Get rid of the first half of QQmlGuard usage
authorLars Knoll <lars.knoll@digia.com>
Fri, 5 Jul 2013 11:29:57 +0000 (13:29 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 5 Jul 2013 13:02:58 +0000 (15:02 +0200)
QQmlGuard was being used as a more performant replacement
for QPointer. QPointer got now fixed in Qt 5.0, making this
class obsolete.

Change-Id: I77eef066c4823af4b074ef32d4d78dbd67c36cd0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
43 files changed:
src/qml/qml/qqmlcomponent.cpp
src/qml/qml/qqmlcontextwrapper_p.h
src/qml/qml/qqmlengine.cpp
src/qml/qml/qqmlengine_p.h
src/qml/qml/qqmlexpression_p.h
src/qml/qml/qqmlincubator_p.h
src/qml/qml/qqmllist_p.h
src/qml/qml/qqmllistwrapper_p.h
src/qml/qml/qqmlmetatype.cpp
src/qml/qml/qqmlnotifier_p.h
src/qml/qml/qqmlproperty_p.h
src/qml/qml/qqmltypewrapper_p.h
src/qml/qml/qqmlvaluetypewrapper.cpp
src/qml/qml/qqmlvme.cpp
src/qml/qml/qqmlvme_p.h
src/qml/qml/qqmlxmlhttprequest.cpp
src/qml/qml/v4/qv4include_p.h
src/qml/qml/v4/qv4qobjectwrapper.cpp
src/qml/qml/v4/qv4qobjectwrapper_p.h
src/qml/qml/v4/qv4sequenceobject.cpp
src/qml/types/qqmlbind.cpp
src/qml/types/qqmldelegatemodel_p_p.h
src/qml/types/qqmllistmodel.cpp
src/qml/types/qqmllistmodel_p_p.h
src/qml/util/qqmladaptormodel.cpp
src/quick/items/qquickdrag.cpp
src/quick/items/qquickdrag_p.h
src/quick/items/qquickdroparea.cpp
src/quick/items/qquickflipable.cpp
src/quick/items/qquickgridview_p.h
src/quick/items/qquickitemview_p_p.h
src/quick/items/qquicklistview_p.h
src/quick/items/qquickpathview_p_p.h
src/quick/items/qquickrepeater_p_p.h
src/quick/items/qquickstateoperations.cpp
src/quick/items/qquicktextinput_p_p.h
src/quick/items/qquickwindow.cpp
src/quick/items/qquickwindow_p.h
src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
src/quick/util/qquickbehavior.cpp
src/quick/util/qquickpropertychanges.cpp
src/quick/util/qquickstatechangescript.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

index 382b856..cd5d1e9 100644 (file)
@@ -1102,7 +1102,7 @@ public:
     static void markObjects(Managed *that);
 
     QV8Engine *v8;
-    QQmlGuard<QObject> parent;
+    QPointer<QObject> parent;
     QV4::Value valuemap;
     QV4::Value qmlGlobal;
     QV4::Value m_statusChanged;
index 646135b..0f44952 100644 (file)
@@ -93,7 +93,7 @@ struct Q_QML_EXPORT QmlContextWrapper : Object
     bool isNullWrapper;
 
     QQmlGuardedContextData context;
-    QQmlGuard<QObject> scopeObject;
+    QPointer<QObject> scopeObject;
 };
 
 }
index be1c28c..2b186db 100644 (file)
@@ -986,7 +986,7 @@ QQmlNetworkAccessManagerFactory *QQmlEngine::networkAccessManagerFactory() const
 void QQmlEnginePrivate::registerFinalizeCallback(QObject *obj, int index)
 {
     if (activeVME) {
-        activeVME->finalizeCallbacks.append(qMakePair(QQmlGuard<QObject>(obj), index));
+        activeVME->finalizeCallbacks.append(qMakePair(QPointer<QObject>(obj), index));
     } else {
         void *args[] = { 0 };
         QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, args);
index b300dcc..c57c70f 100644 (file)
@@ -162,7 +162,7 @@ public:
 
     QUrl baseUrl;
 
-    typedef QPair<QQmlGuard<QObject>,int> FinalizeCallback;
+    typedef QPair<QPointer<QObject>,int> FinalizeCallback;
     void registerFinalizeCallback(QObject *obj, int index);
 
     QQmlVME *activeVME;
index b7f5624..9cc5a32 100644 (file)
@@ -55,7 +55,6 @@
 
 #include "qqmlexpression.h"
 
-#include <private/qqmlguard_p.h>
 #include <private/qqmlengine_p.h>
 #include <private/qfieldlist_p.h>
 #include <private/qflagpointer_p.h>
index 54be20d..229919f 100644 (file)
@@ -85,7 +85,7 @@ public:
     enum Progress { Execute, Completing, Completed };
     Progress progress;
 
-    QQmlGuard<QObject> result;
+    QPointer<QObject> result;
     QQmlGuardedContextData rootContext;
     QQmlCompiledData *compiledData;
     QQmlVME vme;
index a397300..4873222 100644 (file)
@@ -54,7 +54,6 @@
 //
 
 #include "qqmllist.h"
-#include "qqmlguard_p.h"
 #include "qqmlpropertycache_p.h"
 
 QT_BEGIN_NAMESPACE
@@ -66,7 +65,7 @@ public:
 
     static QQmlListReference init(const QQmlListProperty<QObject> &, int, QQmlEngine *);
 
-    QQmlGuard<QObject> object;
+    QPointer<QObject> object;
     QQmlMetaObject elementType;
     QQmlListProperty<QObject> property;
     int propertyType;
index 83624d1..c87b9b2 100644 (file)
@@ -54,8 +54,9 @@
 //
 
 #include <QtCore/qglobal.h>
+#include <QtCore/qpointer.h>
+
 #include <QtQml/qqmllist.h>
-#include <private/qqmlguard_p.h>
 
 #include <private/qv4value_p.h>
 #include <private/qv4object_p.h>
@@ -88,7 +89,7 @@ public:
 
 private:
     QV8Engine *v8;
-    QQmlGuard<QObject> object;
+    QPointer<QObject> object;
     QQmlListProperty<QObject> property;
     int propertyType;
 
index 188fa7d..f3b4d6b 100644 (file)
@@ -44,7 +44,6 @@
 
 #include <private/qqmlproxymetaobject_p.h>
 #include <private/qqmlcustomparser_p.h>
-#include <private/qqmlguard_p.h>
 #include <private/qhashedstring_p.h>
 #include <private/qqmlimport_p.h>
 
index ea4a3e7..93f2cd6 100644 (file)
@@ -43,7 +43,6 @@
 #define QQMLNOTIFIER_P_H
 
 #include "qqmldata_p.h"
-#include "qqmlguard_p.h"
 #include <QtCore/qmetaobject.h>
 #include <private/qmetaobject_p.h>
 
index 6482432..9af091a 100644 (file)
@@ -59,7 +59,6 @@
 #include <private/qobject_p.h>
 #include <private/qtqmlglobal_p.h>
 #include <private/qqmlpropertycache_p.h>
-#include <private/qqmlguard_p.h>
 #include <private/qqmlboundsignalexpressionpointer_p.h>
 
 QT_BEGIN_NAMESPACE
@@ -78,8 +77,8 @@ public:
     Q_DECLARE_FLAGS(WriteFlags, WriteFlag)
 
     QQmlContextData *context;
-    QQmlGuard<QQmlEngine> engine;
-    QQmlGuard<QObject> object;
+    QPointer<QQmlEngine> engine;
+    QPointer<QObject> object;
 
     QQmlPropertyData core;
 
index 9ad364e..ae70367 100644 (file)
@@ -54,8 +54,8 @@
 //
 
 #include <QtCore/qglobal.h>
+#include <QtCore/qpointer.h>
 
-#include <private/qqmlguard_p.h>
 #include <private/qv4value_p.h>
 #include <private/qv4object_p.h>
 
@@ -89,7 +89,7 @@ public:
 private:
     QV8Engine *v8;
     TypeNameMode mode;
-    QQmlGuard<QObject> object;
+    QPointer<QObject> object;
 
     QQmlType *type;
     QQmlTypeNameCache *typeNamespace;
index 7355e0d..05412e9 100644 (file)
@@ -63,7 +63,7 @@ class QmlValueTypeReference : public QmlValueTypeWrapper
 public:
     QmlValueTypeReference(QV8Engine *engine);
 
-    QQmlGuard<QObject> object;
+    QPointer<QObject> object;
     int property;
 };
 
index e4a996f..e32193e 100644 (file)
@@ -1367,7 +1367,7 @@ void QQmlVMEGuard::guard(QQmlVME *vme)
     clear();
     
     m_objectCount = vme->objects.count();
-    m_objects = new QQmlGuard<QObject>[m_objectCount];
+    m_objects = new QPointer<QObject>[m_objectCount];
     for (int ii = 0; ii < m_objectCount; ++ii)
         m_objects[ii] = vme->objects[ii];
 
index 750076f..09e3237 100644 (file)
@@ -202,7 +202,7 @@ public:
 
 private:
     int m_objectCount;
-    QQmlGuard<QObject> *m_objects;
+    QPointer<QObject> *m_objects;
     int m_contextCount;
     QQmlGuardedContextData *m_contexts;
 };
index 162f3db..1158149 100644 (file)
@@ -1047,7 +1047,7 @@ private:
     QString m_statusText;
     QNetworkRequest m_request;
     QStringList m_addedHeaders;
-    QQmlGuard<QNetworkReply> m_network;
+    QPointer<QNetworkReply> m_network;
     void destroyNetwork();
 
     QNetworkAccessManager *m_nam;
index 76f5ec3..d6bbcd1 100644 (file)
@@ -57,7 +57,6 @@
 #include <QtCore/qurl.h>
 
 #include <private/qqmlcontext_p.h>
-#include <private/qqmlguard_p.h>
 
 #include <private/qv4value_p.h>
 #include <private/qv4context_p.h>
@@ -96,7 +95,7 @@ private:
 
     QV4::ExecutionEngine *v4;
     QNetworkAccessManager *m_network;
-    QQmlGuard<QNetworkReply> m_reply;
+    QPointer<QNetworkReply> m_reply;
 
     QUrl m_url;
     int m_redirectCount;
index dc7b50e..f796758 100644 (file)
@@ -41,7 +41,6 @@
 
 #include "qv4qobjectwrapper_p.h"
 
-#include <private/qqmlguard_p.h>
 #include <private/qqmlpropertycache_p.h>
 #include <private/qqmlengine_p.h>
 #include <private/qqmlvmemetaobject_p.h>
@@ -924,7 +923,7 @@ namespace {
 void QObjectWrapper::collectDeletables(Managed *m, GCDeletable **deletable)
 {
     QObjectWrapper *This = static_cast<QObjectWrapper*>(m);
-    QQmlGuard<QObject> &object = This->m_object;
+    QPointer<QObject> &object = This->m_object;
     if (!object)
         return;
 
@@ -1652,7 +1651,7 @@ QV4::Value QObjectMethod::method_toString(QV4::ExecutionContext *ctx)
 
         result += QString::fromUtf8(m_object->metaObject()->className());
         result += QLatin1String("(0x");
-        result += QString::number((quintptr)m_object.object(),16);
+        result += QString::number((quintptr)m_object.data(),16);
 
         if (!objectName.isEmpty()) {
             result += QLatin1String(", \"");
index 73f19ac..6580d19 100644 (file)
@@ -101,7 +101,7 @@ private:
 
     QQmlPropertyData *findProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, String *name, RevisionMode revisionMode, QQmlPropertyData *local) const;
 
-    QQmlGuard<QObject> m_object;
+    QPointer<QObject> m_object;
     String *m_destroy;
     String *m_toString;
 
@@ -137,7 +137,7 @@ private:
     QV4::Value method_toString(QV4::ExecutionContext *ctx);
     QV4::Value method_destroy(QV4::ExecutionContext *ctx, Value *args, int argc);
 
-    QQmlGuard<QObject> m_object;
+    QPointer<QObject> m_object;
     int m_index;
     QV4::PersistentValue m_qmlGlobal;
 
@@ -161,7 +161,7 @@ struct QmlSignalHandler : public QV4::Object
     QObject *object() const { return m_object.data(); }
 
 private:
-    QQmlGuard<QObject> m_object;
+    QPointer<QObject> m_object;
     int m_signalIndex;
 
     static void destroy(Managed *that)
index 454b327..be431e3 100644 (file)
@@ -480,7 +480,7 @@ private:
     }
 
     mutable Container m_container;
-    QQmlGuard<QObject> m_object;
+    QPointer<QObject> m_object;
     int m_propertyIndex;
     bool m_isReference;
 
index 4c4e541..129a81e 100644 (file)
@@ -44,7 +44,6 @@
 #include <private/qqmlnullablevalue_p_p.h>
 #include <private/qqmlproperty_p.h>
 #include <private/qqmlbinding_p.h>
-#include <private/qqmlguard_p.h>
 
 #include <qqmlengine.h>
 #include <qqmlcontext.h>
@@ -66,7 +65,7 @@ public:
 
     QQmlNullableValue<bool> when;
     bool componentComplete;
-    QQmlGuard<QObject> obj;
+    QPointer<QObject> obj;
     QString propName;
     QQmlNullableValue<QVariant> value;
     QQmlProperty prop;
index 4e1adf1..7931c4e 100644 (file)
@@ -80,7 +80,7 @@ public:
     int parseGroups(const QStringList &groupNames) const;
     int parseGroups(const QV4::Value &groupNames) const;
 
-    QQmlGuard<QQmlDelegateModel> model;
+    QPointer<QQmlDelegateModel> model;
     const int groupCount;
     QV8Engine * const v8Engine;
     QQmlDelegateModelAttachedMetaObject *metaObject;
@@ -231,7 +231,7 @@ public:
             QQmlV4Function *args, Compositor::Group *group, int *index, int *count, int *groups) const;
 
     Compositor::Group group;
-    QQmlGuard<QQmlDelegateModel> model;
+    QPointer<QQmlDelegateModel> model;
     QQmlDelegateModelGroupEmitterList emitters;
     QQmlChangeSet changeSet;
     QString name;
index f371429..4c0b382 100644 (file)
@@ -121,7 +121,7 @@ const ListLayout::Role &ListLayout::getRoleOrCreate(const QV4::String *key, Role
 
 const ListLayout::Role &ListLayout::createRole(const QString &key, ListLayout::Role::DataType type)
 {
-    const int dataSizes[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QQmlGuard<QObject>), sizeof(QVariantMap), sizeof(QDateTime) };
+    const int dataSizes[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QPointer<QObject>), sizeof(QVariantMap), sizeof(QDateTime) };
     const int dataAlignments[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QObject *), sizeof(QVariantMap), sizeof(QDateTime) };
 
     Role *r = new Role;
@@ -636,7 +636,7 @@ QString *ListElement::getStringProperty(const ListLayout::Role &role)
 QObject *ListElement::getQObjectProperty(const ListLayout::Role &role)
 {
     char *mem = getPropertyMemory(role);
-    QQmlGuard<QObject> *o = reinterpret_cast<QQmlGuard<QObject> *>(mem);
+    QPointer<QObject> *o = reinterpret_cast<QPointer<QObject> *>(mem);
     return o->data();
 }
 
@@ -662,22 +662,22 @@ QDateTime *ListElement::getDateTimeProperty(const ListLayout::Role &role)
     return dt;
 }
 
-QQmlGuard<QObject> *ListElement::getGuardProperty(const ListLayout::Role &role)
+QPointer<QObject> *ListElement::getGuardProperty(const ListLayout::Role &role)
 {
     char *mem = getPropertyMemory(role);
 
     bool existingGuard = false;
-    for (size_t i=0 ; i < sizeof(QQmlGuard<QObject>) ; ++i) {
+    for (size_t i=0 ; i < sizeof(QPointer<QObject>) ; ++i) {
         if (mem[i] != 0) {
             existingGuard = true;
             break;
         }
     }
 
-    QQmlGuard<QObject> *o = 0;
+    QPointer<QObject> *o = 0;
 
     if (existingGuard)
-        o = reinterpret_cast<QQmlGuard<QObject> *>(mem);
+        o = reinterpret_cast<QPointer<QObject> *>(mem);
 
     return o;
 }
@@ -733,7 +733,7 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListMo
             break;
         case ListLayout::Role::QObject:
             {
-                QQmlGuard<QObject> *guard = reinterpret_cast<QQmlGuard<QObject> *>(mem);
+                QPointer<QObject> *guard = reinterpret_cast<QPointer<QObject> *>(mem);
                 QObject *object = guard->data();
                 if (object)
                     data = QVariant::fromValue(object);
@@ -840,9 +840,9 @@ int ListElement::setQObjectProperty(const ListLayout::Role &role, QObject *o)
 
     if (role.type == ListLayout::Role::QObject) {
         char *mem = getPropertyMemory(role);
-        QQmlGuard<QObject> *g = reinterpret_cast<QQmlGuard<QObject> *>(mem);
+        QPointer<QObject> *g = reinterpret_cast<QPointer<QObject> *>(mem);
         bool existingGuard = false;
-        for (size_t i=0 ; i < sizeof(QQmlGuard<QObject>) ; ++i) {
+        for (size_t i=0 ; i < sizeof(QPointer<QObject>) ; ++i) {
             if (mem[i] != 0) {
                 existingGuard = true;
                 break;
@@ -851,11 +851,11 @@ int ListElement::setQObjectProperty(const ListLayout::Role &role, QObject *o)
         bool changed;
         if (existingGuard) {
             changed = g->data() != o;
-            g->~QQmlGuard();
+            g->~QPointer();
         } else {
             changed = true;
         }
-        new (mem) QQmlGuard<QObject>(o);
+        new (mem) QPointer<QObject>(o);
         if (changed)
             roleIndex = role.index;
     }
@@ -940,7 +940,7 @@ void ListElement::setBoolPropertyFast(const ListLayout::Role &role, bool b)
 void ListElement::setQObjectPropertyFast(const ListLayout::Role &role, QObject *o)
 {
     char *mem = getPropertyMemory(role);
-    new (mem) QQmlGuard<QObject>(o);
+    new (mem) QPointer<QObject>(o);
 }
 
 void ListElement::setListPropertyFast(const ListLayout::Role &role, ListModel *m)
@@ -1086,9 +1086,9 @@ void ListElement::destroy(ListLayout *layout)
                     break;
                 case ListLayout::Role::QObject:
                     {
-                        QQmlGuard<QObject> *guard = getGuardProperty(r);
+                        QPointer<QObject> *guard = getGuardProperty(r);
                         if (guard)
-                            guard->~QQmlGuard();
+                            guard->~QPointer();
                     }
                     break;
                 case ListLayout::Role::VariantMap:
index de083a9..c4d1e5e 100644 (file)
@@ -278,7 +278,7 @@ private:
     ListModel *getListProperty(const ListLayout::Role &role);
     QString *getStringProperty(const ListLayout::Role &role);
     QObject *getQObjectProperty(const ListLayout::Role &role);
-    QQmlGuard<QObject> *getGuardProperty(const ListLayout::Role &role);
+    QPointer<QObject> *getGuardProperty(const ListLayout::Role &role);
     QVariantMap *getVariantMapProperty(const ListLayout::Role &role);
     QDateTime *getDateTimeProperty(const ListLayout::Role &role);
 
index 96a780f..4e81275 100644 (file)
@@ -686,7 +686,7 @@ public:
     QObject *modelData() const { return object; }
     QObject *proxiedObject() { return object; }
 
-    QQmlGuard<QObject> object;
+    QPointer<QObject> object;
 };
 
 class VDMObjectDelegateDataType : public QQmlRefCount, public QQmlAdaptorModel::Accessors
index e828899..f145ce2 100644 (file)
@@ -89,9 +89,9 @@ public:
 
     QQuickDragGrabber dragGrabber;
 
-    QQmlGuard<QObject> source;
-    QQmlGuard<QObject> target;
-    QQmlGuard<QQuickWindow> window;
+    QPointer<QObject> source;
+    QPointer<QObject> target;
+    QPointer<QQuickWindow> window;
     QQuickItem *attachedItem;
     QQuickDragMimeData *mimeData;
     Qt::DropAction proposedAction;
index b7fa60b..3680fd5 100644 (file)
@@ -45,6 +45,7 @@
 #include <QtQuick/qquickitem.h>
 
 #include <private/qv8engine_p.h>
+#include <private/qqmlguard_p.h>
 
 #include <QtCore/qmimedata.h>
 #include <QtCore/qstringlist.h>
index 659e606..f453c42 100644 (file)
@@ -76,8 +76,8 @@ public:
     QRegExp keyRegExp;
     QPointF dragPosition;
     QQuickDropAreaDrag *drag;
-    QQmlGuard<QObject> source;
-    QQmlGuard<QMimeData> mimeData;
+    QPointer<QObject> source;
+    QPointer<QMimeData> mimeData;
 };
 
 QQuickDropAreaPrivate::QQuickDropAreaPrivate()
index 1ede6b0..3428c66 100644 (file)
@@ -42,7 +42,6 @@
 #include "qquickflipable_p.h"
 #include "qquickitem_p.h"
 
-#include <private/qqmlguard_p.h>
 
 #include <QtQml/qqmlinfo.h>
 
@@ -78,9 +77,9 @@ public:
     void setBackTransform();
 
     QQuickFlipable::Side current;
-    QQmlGuard<QQuickLocalTransform> backTransform;
-    QQmlGuard<QQuickItem> front;
-    QQmlGuard<QQuickItem> back;
+    QPointer<QQuickLocalTransform> backTransform;
+    QPointer<QQuickItem> front;
+    QPointer<QQuickItem> back;
 
     bool sideDirty;
     bool wantBackXFlipped;
index d98de10..09e11ad 100644 (file)
 #ifndef QQUICKGRIDVIEW_P_H
 #define QQUICKGRIDVIEW_P_H
 
+#include <QtCore/qpointer.h>
+
 #include "qquickitemview_p.h"
 
-#include <private/qqmlguard_p.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -133,7 +134,7 @@ Q_SIGNALS:
     void viewChanged();
 
 public:
-    QQmlGuard<QQuickGridView> m_view;
+    QPointer<QQuickGridView> m_view;
 };
 
 
index 1fa933e..6b734ea 100644 (file)
@@ -249,7 +249,7 @@ public:
         q->polish();
     }
 
-    QQmlGuard<QQmlInstanceModel> model;
+    QPointer<QQmlInstanceModel> model;
     QVariant modelVariant;
     int itemCount;
     int buffer;
index 3e766f8..f612e7e 100644 (file)
@@ -43,8 +43,7 @@
 #define QQUICKLISTVIEW_P_H
 
 #include "qquickitemview_p.h"
-
-#include <private/qqmlguard_p.h>
+#include <qpointer.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -192,7 +191,7 @@ Q_SIGNALS:
     void viewChanged();
 
 public:
-    QQmlGuard<QQuickListView> m_view;
+    QPointer<QQuickListView> m_view;
     QQuickItem *m_sectionItem;
 };
 
index 2653305..aa539e7 100644 (file)
@@ -61,7 +61,6 @@
 #include <QtCore/qcoreapplication.h>
 
 #include <private/qquickanimation_p_p.h>
-#include <private/qqmlguard_p.h>
 #include <private/qqmldelegatemodel_p.h>
 #include <private/qquicktimeline_p_p.h>
 
@@ -132,7 +131,7 @@ public:
 
     QQuickPath *path;
     int currentIndex;
-    QQmlGuard<QQuickItem> currentItem;
+    QPointer<QQuickItem> currentItem;
     qreal currentItemOffset;
     qreal startPc;
     QPointF startPoint;
@@ -169,7 +168,7 @@ public:
     qreal requestedZ;
     QList<QQuickItem *> items;
     QList<QQuickItem *> itemCache;
-    QQmlGuard<QQmlInstanceModel> model;
+    QPointer<QQmlInstanceModel> model;
     QVariant modelVariant;
     enum MovementReason { Other, SetIndex, Mouse };
     MovementReason moveReason;
index a642f64..6430b3b 100644 (file)
@@ -75,7 +75,7 @@ private:
 
     QPointer<QQmlInstanceModel> model;
     QVariant dataSource;
-    QQmlGuard<QObject> dataSourceAsObject;
+    QPointer<QObject> dataSourceAsObject;
     bool ownModel : 1;
     bool inRequest : 1;
     bool dataSourceIsObject : 1;
index 24476b1..b1c548f 100644 (file)
@@ -57,9 +57,9 @@ public:
         rewindParent(0), rewindStackBefore(0) {}
 
     QQuickItem *target;
-    QQmlGuard<QQuickItem> parent;
-    QQmlGuard<QQuickItem> origParent;
-    QQmlGuard<QQuickItem> origStackBefore;
+    QPointer<QQuickItem> parent;
+    QPointer<QQuickItem> origParent;
+    QPointer<QQuickItem> origStackBefore;
     QQuickItem *rewindParent;
     QQuickItem *rewindStackBefore;
 
index 11096cf..7b3f61b 100644 (file)
@@ -189,9 +189,9 @@ public:
     QPointF pressPos;
     QPointF tripleClickStartPoint;
 
-    QQmlGuard<QQmlComponent> cursorComponent;
+    QPointer<QQmlComponent> cursorComponent;
 #ifndef QT_NO_VALIDATOR
-    QQmlGuard<QValidator> m_validator;
+    QPointer<QValidator> m_validator;
 #endif
 
     qreal hscroll;
index 619c72a..cf2526e 100644 (file)
@@ -783,7 +783,7 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
 
 void QQuickWindowPrivate::notifyFocusChangesRecur(QQuickItem **items, int remaining)
 {
-    QQmlGuard<QQuickItem> item(*items);
+    QPointer<QQuickItem> item(*items);
 
     if (remaining)
         notifyFocusChangesRecur(items + 1, remaining - 1);
index 2dddd9a..aa7d7c5 100644 (file)
@@ -55,7 +55,6 @@
 
 #include "qquickitem.h"
 #include "qquickwindow.h"
-#include <private/qqmlguard_p.h>
 
 #include <QtQuick/private/qsgcontext_p.h>
 #include <private/qquickdrag_p.h>
index ac613c1..3ca5485 100644 (file)
@@ -44,7 +44,6 @@
 
 #include <QtCore/qwaitcondition.h>
 #include <private/qsgadaptationlayer_p.h>
-#include <private/qqmlguard_p.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -116,7 +115,7 @@ private:
         Owner(const Owner &o) : item(o.item), ref(o.ref) {}
         Owner &operator =(const Owner &o) { item = o.item; ref = o.ref; return *this; }
 
-        QQmlGuard<QQuickItem> item;
+        QPointer<QQuickItem> item;
         int ref;
     };
 
index 1e77084..2d765dc 100644 (file)
@@ -45,7 +45,6 @@
 #include <qqmlcontext.h>
 #include <qqmlinfo.h>
 #include <private/qqmlproperty_p.h>
-#include <private/qqmlguard_p.h>
 #include <private/qqmlengine_p.h>
 #include <private/qabstractanimationjob_p.h>
 #include <private/qquicktransition_p.h>
@@ -65,7 +64,7 @@ public:
 
     QQmlProperty property;
     QVariant targetValue;
-    QQmlGuard<QQuickAbstractAnimation> animation;
+    QPointer<QQuickAbstractAnimation> animation;
     QAbstractAnimationJob *animationInstance;
     bool enabled;
     bool finalized;
index b2aa004..e6f89b9 100644 (file)
@@ -50,7 +50,6 @@
 #include <qqmlexpression.h>
 #include <private/qqmlbinding_p.h>
 #include <qqmlcontext.h>
-#include <private/qqmlguard_p.h>
 #include <private/qqmlproperty_p.h>
 #include <private/qqmlcontext_p.h>
 #include <private/qquickstate_p_p.h>
@@ -199,7 +198,7 @@ public:
     QQuickPropertyChangesPrivate() : decoded(true), restore(true),
                                 isExplicit(false) {}
 
-    QQmlGuard<QObject> object;
+    QPointer<QObject> object;
     QByteArray data;
 
     bool decoded : 1;
index 3e89934..2ad42f6 100644 (file)
@@ -45,7 +45,6 @@
 #include <qqmlcontext.h>
 #include <qqmlexpression.h>
 #include <qqmlinfo.h>
-#include <private/qqmlguard_p.h>
 #include <private/qqmlcontext_p.h>
 #include <private/qqmlproperty_p.h>
 #include <private/qqmlbinding_p.h>
index 03d553c..3ac88dd 100644 (file)
@@ -45,7 +45,6 @@
 #include <QtQml/qqmlcontext.h>
 #include <QtCore/qfileinfo.h>
 #include <QtCore/qdebug.h>
-#include <QtQml/private/qqmlguard_p.h>
 #include <QtCore/qdir.h>
 #include <QtCore/qnumeric.h>
 #include <private/qqmlengine_p.h>
@@ -1575,9 +1574,9 @@ void tst_qqmlecmascript::dynamicDestruction()
 {
     {
     QQmlComponent component(&engine, testFileUrl("dynamicDeletion.qml"));
-    QQmlGuard<MyQmlObject> object = qobject_cast<MyQmlObject*>(component.create());
+    QPointer<MyQmlObject> object = qobject_cast<MyQmlObject*>(component.create());
     QVERIFY(object != 0);
-    QQmlGuard<QObject> createdQmlObject = 0;
+    QPointer<QObject> createdQmlObject = 0;
 
     QMetaObject::invokeMethod(object, "create");
     createdQmlObject = object->objectProperty();
@@ -1630,7 +1629,7 @@ void tst_qqmlecmascript::dynamicDestruction()
 
     {
     // QTBUG-23451
-    QQmlGuard<QObject> createdQmlObject = 0;
+    QPointer<QObject> createdQmlObject = 0;
     QQmlComponent component(&engine, testFileUrl("dynamicDeletion.3.qml"));
     QObject *o = component.create();
     QVERIFY(o != 0);
@@ -3274,7 +3273,7 @@ void tst_qqmlecmascript::ownershipRootObject()
     context->setContextObject(&own);
 
     QQmlComponent component(&engine, testFileUrl("ownershipRootObject.qml"));
-    QQmlGuard<QObject> object = component.create(context);
+    QPointer<QObject> object = component.create(context);
     QVERIFY(object);
 
     engine.collectGarbage();
@@ -3304,7 +3303,7 @@ void tst_qqmlecmascript::ownershipConsistency()
     QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
 
     QQmlComponent component(&engine, testFileUrl("ownershipConsistency.qml"));
-    QQmlGuard<QObject> object = component.create(context);
+    QPointer<QObject> object = component.create(context);
     QVERIFY(object);
 
     engine.collectGarbage();
@@ -5613,7 +5612,7 @@ void tst_qqmlecmascript::qtbug_9792()
     delete object;
 }
 
-// Verifies that QQmlGuard<>s used in the vmemetaobject are cleaned correctly
+// Verifies that QPointer<>s used in the vmemetaobject are cleaned correctly
 void tst_qqmlecmascript::qtcreatorbug_1289()
 {
     QQmlComponent component(&engine, testFileUrl("qtcreatorbug_1289.qml"));