From 5d6f8b18fe77d2fc17a3c1d77d1c4baeff0e9704 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 5 Jul 2013 13:29:57 +0200 Subject: [PATCH] Get rid of the first half of QQmlGuard usage 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 --- src/qml/qml/qqmlcomponent.cpp | 2 +- src/qml/qml/qqmlcontextwrapper_p.h | 2 +- src/qml/qml/qqmlengine.cpp | 2 +- src/qml/qml/qqmlengine_p.h | 2 +- src/qml/qml/qqmlexpression_p.h | 1 - src/qml/qml/qqmlincubator_p.h | 2 +- src/qml/qml/qqmllist_p.h | 3 +-- src/qml/qml/qqmllistwrapper_p.h | 5 ++-- src/qml/qml/qqmlmetatype.cpp | 1 - src/qml/qml/qqmlnotifier_p.h | 1 - src/qml/qml/qqmlproperty_p.h | 5 ++-- src/qml/qml/qqmltypewrapper_p.h | 4 ++-- src/qml/qml/qqmlvaluetypewrapper.cpp | 2 +- src/qml/qml/qqmlvme.cpp | 2 +- src/qml/qml/qqmlvme_p.h | 2 +- src/qml/qml/qqmlxmlhttprequest.cpp | 2 +- src/qml/qml/v4/qv4include_p.h | 3 +-- src/qml/qml/v4/qv4qobjectwrapper.cpp | 5 ++-- src/qml/qml/v4/qv4qobjectwrapper_p.h | 6 ++--- src/qml/qml/v4/qv4sequenceobject.cpp | 2 +- src/qml/types/qqmlbind.cpp | 3 +-- src/qml/types/qqmldelegatemodel_p_p.h | 4 ++-- src/qml/types/qqmllistmodel.cpp | 28 +++++++++++----------- src/qml/types/qqmllistmodel_p_p.h | 2 +- src/qml/util/qqmladaptormodel.cpp | 2 +- src/quick/items/qquickdrag.cpp | 6 ++--- src/quick/items/qquickdrag_p.h | 1 + src/quick/items/qquickdroparea.cpp | 4 ++-- src/quick/items/qquickflipable.cpp | 7 +++--- src/quick/items/qquickgridview_p.h | 5 ++-- src/quick/items/qquickitemview_p_p.h | 2 +- src/quick/items/qquicklistview_p.h | 5 ++-- src/quick/items/qquickpathview_p_p.h | 5 ++-- src/quick/items/qquickrepeater_p_p.h | 2 +- src/quick/items/qquickstateoperations.cpp | 6 ++--- src/quick/items/qquicktextinput_p_p.h | 4 ++-- src/quick/items/qquickwindow.cpp | 2 +- src/quick/items/qquickwindow_p.h | 1 - .../qsgshareddistancefieldglyphcache_p.h | 3 +-- src/quick/util/qquickbehavior.cpp | 3 +-- src/quick/util/qquickpropertychanges.cpp | 3 +-- src/quick/util/qquickstatechangescript.cpp | 1 - .../auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 13 +++++----- 43 files changed, 76 insertions(+), 90 deletions(-) diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 382b856..cd5d1e9 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1102,7 +1102,7 @@ public: static void markObjects(Managed *that); QV8Engine *v8; - QQmlGuard parent; + QPointer parent; QV4::Value valuemap; QV4::Value qmlGlobal; QV4::Value m_statusChanged; diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/qml/qqmlcontextwrapper_p.h index 646135b..0f44952 100644 --- a/src/qml/qml/qqmlcontextwrapper_p.h +++ b/src/qml/qml/qqmlcontextwrapper_p.h @@ -93,7 +93,7 @@ struct Q_QML_EXPORT QmlContextWrapper : Object bool isNullWrapper; QQmlGuardedContextData context; - QQmlGuard scopeObject; + QPointer scopeObject; }; } diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index be1c28c..2b186db 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -986,7 +986,7 @@ QQmlNetworkAccessManagerFactory *QQmlEngine::networkAccessManagerFactory() const void QQmlEnginePrivate::registerFinalizeCallback(QObject *obj, int index) { if (activeVME) { - activeVME->finalizeCallbacks.append(qMakePair(QQmlGuard(obj), index)); + activeVME->finalizeCallbacks.append(qMakePair(QPointer(obj), index)); } else { void *args[] = { 0 }; QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, args); diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h index b300dcc..c57c70f 100644 --- a/src/qml/qml/qqmlengine_p.h +++ b/src/qml/qml/qqmlengine_p.h @@ -162,7 +162,7 @@ public: QUrl baseUrl; - typedef QPair,int> FinalizeCallback; + typedef QPair,int> FinalizeCallback; void registerFinalizeCallback(QObject *obj, int index); QQmlVME *activeVME; diff --git a/src/qml/qml/qqmlexpression_p.h b/src/qml/qml/qqmlexpression_p.h index b7f5624..9cc5a32 100644 --- a/src/qml/qml/qqmlexpression_p.h +++ b/src/qml/qml/qqmlexpression_p.h @@ -55,7 +55,6 @@ #include "qqmlexpression.h" -#include #include #include #include diff --git a/src/qml/qml/qqmlincubator_p.h b/src/qml/qml/qqmlincubator_p.h index 54be20d..229919f 100644 --- a/src/qml/qml/qqmlincubator_p.h +++ b/src/qml/qml/qqmlincubator_p.h @@ -85,7 +85,7 @@ public: enum Progress { Execute, Completing, Completed }; Progress progress; - QQmlGuard result; + QPointer result; QQmlGuardedContextData rootContext; QQmlCompiledData *compiledData; QQmlVME vme; diff --git a/src/qml/qml/qqmllist_p.h b/src/qml/qml/qqmllist_p.h index a397300..4873222 100644 --- a/src/qml/qml/qqmllist_p.h +++ b/src/qml/qml/qqmllist_p.h @@ -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 &, int, QQmlEngine *); - QQmlGuard object; + QPointer object; QQmlMetaObject elementType; QQmlListProperty property; int propertyType; diff --git a/src/qml/qml/qqmllistwrapper_p.h b/src/qml/qml/qqmllistwrapper_p.h index 83624d1..c87b9b2 100644 --- a/src/qml/qml/qqmllistwrapper_p.h +++ b/src/qml/qml/qqmllistwrapper_p.h @@ -54,8 +54,9 @@ // #include +#include + #include -#include #include #include @@ -88,7 +89,7 @@ public: private: QV8Engine *v8; - QQmlGuard object; + QPointer object; QQmlListProperty property; int propertyType; diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 188fa7d..f3b4d6b 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -44,7 +44,6 @@ #include #include -#include #include #include diff --git a/src/qml/qml/qqmlnotifier_p.h b/src/qml/qml/qqmlnotifier_p.h index ea4a3e7..93f2cd6 100644 --- a/src/qml/qml/qqmlnotifier_p.h +++ b/src/qml/qml/qqmlnotifier_p.h @@ -43,7 +43,6 @@ #define QQMLNOTIFIER_P_H #include "qqmldata_p.h" -#include "qqmlguard_p.h" #include #include diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h index 6482432..9af091a 100644 --- a/src/qml/qml/qqmlproperty_p.h +++ b/src/qml/qml/qqmlproperty_p.h @@ -59,7 +59,6 @@ #include #include #include -#include #include QT_BEGIN_NAMESPACE @@ -78,8 +77,8 @@ public: Q_DECLARE_FLAGS(WriteFlags, WriteFlag) QQmlContextData *context; - QQmlGuard engine; - QQmlGuard object; + QPointer engine; + QPointer object; QQmlPropertyData core; diff --git a/src/qml/qml/qqmltypewrapper_p.h b/src/qml/qml/qqmltypewrapper_p.h index 9ad364e..ae70367 100644 --- a/src/qml/qml/qqmltypewrapper_p.h +++ b/src/qml/qml/qqmltypewrapper_p.h @@ -54,8 +54,8 @@ // #include +#include -#include #include #include @@ -89,7 +89,7 @@ public: private: QV8Engine *v8; TypeNameMode mode; - QQmlGuard object; + QPointer object; QQmlType *type; QQmlTypeNameCache *typeNamespace; diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index 7355e0d..05412e9 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -63,7 +63,7 @@ class QmlValueTypeReference : public QmlValueTypeWrapper public: QmlValueTypeReference(QV8Engine *engine); - QQmlGuard object; + QPointer object; int property; }; diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index e4a996f..e32193e 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -1367,7 +1367,7 @@ void QQmlVMEGuard::guard(QQmlVME *vme) clear(); m_objectCount = vme->objects.count(); - m_objects = new QQmlGuard[m_objectCount]; + m_objects = new QPointer[m_objectCount]; for (int ii = 0; ii < m_objectCount; ++ii) m_objects[ii] = vme->objects[ii]; diff --git a/src/qml/qml/qqmlvme_p.h b/src/qml/qml/qqmlvme_p.h index 750076f..09e3237 100644 --- a/src/qml/qml/qqmlvme_p.h +++ b/src/qml/qml/qqmlvme_p.h @@ -202,7 +202,7 @@ public: private: int m_objectCount; - QQmlGuard *m_objects; + QPointer *m_objects; int m_contextCount; QQmlGuardedContextData *m_contexts; }; diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 162f3db..1158149 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1047,7 +1047,7 @@ private: QString m_statusText; QNetworkRequest m_request; QStringList m_addedHeaders; - QQmlGuard m_network; + QPointer m_network; void destroyNetwork(); QNetworkAccessManager *m_nam; diff --git a/src/qml/qml/v4/qv4include_p.h b/src/qml/qml/v4/qv4include_p.h index 76f5ec3..d6bbcd1 100644 --- a/src/qml/qml/v4/qv4include_p.h +++ b/src/qml/qml/v4/qv4include_p.h @@ -57,7 +57,6 @@ #include #include -#include #include #include @@ -96,7 +95,7 @@ private: QV4::ExecutionEngine *v4; QNetworkAccessManager *m_network; - QQmlGuard m_reply; + QPointer m_reply; QUrl m_url; int m_redirectCount; diff --git a/src/qml/qml/v4/qv4qobjectwrapper.cpp b/src/qml/qml/v4/qv4qobjectwrapper.cpp index dc7b50e..f796758 100644 --- a/src/qml/qml/v4/qv4qobjectwrapper.cpp +++ b/src/qml/qml/v4/qv4qobjectwrapper.cpp @@ -41,7 +41,6 @@ #include "qv4qobjectwrapper_p.h" -#include #include #include #include @@ -924,7 +923,7 @@ namespace { void QObjectWrapper::collectDeletables(Managed *m, GCDeletable **deletable) { QObjectWrapper *This = static_cast(m); - QQmlGuard &object = This->m_object; + QPointer &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(", \""); diff --git a/src/qml/qml/v4/qv4qobjectwrapper_p.h b/src/qml/qml/v4/qv4qobjectwrapper_p.h index 73f19ac..6580d19 100644 --- a/src/qml/qml/v4/qv4qobjectwrapper_p.h +++ b/src/qml/qml/v4/qv4qobjectwrapper_p.h @@ -101,7 +101,7 @@ private: QQmlPropertyData *findProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, String *name, RevisionMode revisionMode, QQmlPropertyData *local) const; - QQmlGuard m_object; + QPointer 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 m_object; + QPointer 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 m_object; + QPointer m_object; int m_signalIndex; static void destroy(Managed *that) diff --git a/src/qml/qml/v4/qv4sequenceobject.cpp b/src/qml/qml/v4/qv4sequenceobject.cpp index 454b327..be431e3 100644 --- a/src/qml/qml/v4/qv4sequenceobject.cpp +++ b/src/qml/qml/v4/qv4sequenceobject.cpp @@ -480,7 +480,7 @@ private: } mutable Container m_container; - QQmlGuard m_object; + QPointer m_object; int m_propertyIndex; bool m_isReference; diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp index 4c4e541..129a81e 100644 --- a/src/qml/types/qqmlbind.cpp +++ b/src/qml/types/qqmlbind.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -66,7 +65,7 @@ public: QQmlNullableValue when; bool componentComplete; - QQmlGuard obj; + QPointer obj; QString propName; QQmlNullableValue value; QQmlProperty prop; diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h index 4e1adf1..7931c4e 100644 --- a/src/qml/types/qqmldelegatemodel_p_p.h +++ b/src/qml/types/qqmldelegatemodel_p_p.h @@ -80,7 +80,7 @@ public: int parseGroups(const QStringList &groupNames) const; int parseGroups(const QV4::Value &groupNames) const; - QQmlGuard model; + QPointer 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 model; + QPointer model; QQmlDelegateModelGroupEmitterList emitters; QQmlChangeSet changeSet; QString name; diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index f371429..4c0b382 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -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), sizeof(QVariantMap), sizeof(QDateTime) }; + const int dataSizes[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QPointer), 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 *o = reinterpret_cast *>(mem); + QPointer *o = reinterpret_cast *>(mem); return o->data(); } @@ -662,22 +662,22 @@ QDateTime *ListElement::getDateTimeProperty(const ListLayout::Role &role) return dt; } -QQmlGuard *ListElement::getGuardProperty(const ListLayout::Role &role) +QPointer *ListElement::getGuardProperty(const ListLayout::Role &role) { char *mem = getPropertyMemory(role); bool existingGuard = false; - for (size_t i=0 ; i < sizeof(QQmlGuard) ; ++i) { + for (size_t i=0 ; i < sizeof(QPointer) ; ++i) { if (mem[i] != 0) { existingGuard = true; break; } } - QQmlGuard *o = 0; + QPointer *o = 0; if (existingGuard) - o = reinterpret_cast *>(mem); + o = reinterpret_cast *>(mem); return o; } @@ -733,7 +733,7 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListMo break; case ListLayout::Role::QObject: { - QQmlGuard *guard = reinterpret_cast *>(mem); + QPointer *guard = reinterpret_cast *>(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 *g = reinterpret_cast *>(mem); + QPointer *g = reinterpret_cast *>(mem); bool existingGuard = false; - for (size_t i=0 ; i < sizeof(QQmlGuard) ; ++i) { + for (size_t i=0 ; i < sizeof(QPointer) ; ++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(o); + new (mem) QPointer(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(o); + new (mem) QPointer(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 *guard = getGuardProperty(r); + QPointer *guard = getGuardProperty(r); if (guard) - guard->~QQmlGuard(); + guard->~QPointer(); } break; case ListLayout::Role::VariantMap: diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h index de083a9..c4d1e5e 100644 --- a/src/qml/types/qqmllistmodel_p_p.h +++ b/src/qml/types/qqmllistmodel_p_p.h @@ -278,7 +278,7 @@ private: ListModel *getListProperty(const ListLayout::Role &role); QString *getStringProperty(const ListLayout::Role &role); QObject *getQObjectProperty(const ListLayout::Role &role); - QQmlGuard *getGuardProperty(const ListLayout::Role &role); + QPointer *getGuardProperty(const ListLayout::Role &role); QVariantMap *getVariantMapProperty(const ListLayout::Role &role); QDateTime *getDateTimeProperty(const ListLayout::Role &role); diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index 96a780f..4e81275 100644 --- a/src/qml/util/qqmladaptormodel.cpp +++ b/src/qml/util/qqmladaptormodel.cpp @@ -686,7 +686,7 @@ public: QObject *modelData() const { return object; } QObject *proxiedObject() { return object; } - QQmlGuard object; + QPointer object; }; class VDMObjectDelegateDataType : public QQmlRefCount, public QQmlAdaptorModel::Accessors diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index e828899..f145ce2 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -89,9 +89,9 @@ public: QQuickDragGrabber dragGrabber; - QQmlGuard source; - QQmlGuard target; - QQmlGuard window; + QPointer source; + QPointer target; + QPointer window; QQuickItem *attachedItem; QQuickDragMimeData *mimeData; Qt::DropAction proposedAction; diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h index b7fa60b..3680fd5 100644 --- a/src/quick/items/qquickdrag_p.h +++ b/src/quick/items/qquickdrag_p.h @@ -45,6 +45,7 @@ #include #include +#include #include #include diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp index 659e606..f453c42 100644 --- a/src/quick/items/qquickdroparea.cpp +++ b/src/quick/items/qquickdroparea.cpp @@ -76,8 +76,8 @@ public: QRegExp keyRegExp; QPointF dragPosition; QQuickDropAreaDrag *drag; - QQmlGuard source; - QQmlGuard mimeData; + QPointer source; + QPointer mimeData; }; QQuickDropAreaPrivate::QQuickDropAreaPrivate() diff --git a/src/quick/items/qquickflipable.cpp b/src/quick/items/qquickflipable.cpp index 1ede6b0..3428c66 100644 --- a/src/quick/items/qquickflipable.cpp +++ b/src/quick/items/qquickflipable.cpp @@ -42,7 +42,6 @@ #include "qquickflipable_p.h" #include "qquickitem_p.h" -#include #include @@ -78,9 +77,9 @@ public: void setBackTransform(); QQuickFlipable::Side current; - QQmlGuard backTransform; - QQmlGuard front; - QQmlGuard back; + QPointer backTransform; + QPointer front; + QPointer back; bool sideDirty; bool wantBackXFlipped; diff --git a/src/quick/items/qquickgridview_p.h b/src/quick/items/qquickgridview_p.h index d98de10..09e11ad 100644 --- a/src/quick/items/qquickgridview_p.h +++ b/src/quick/items/qquickgridview_p.h @@ -42,9 +42,10 @@ #ifndef QQUICKGRIDVIEW_P_H #define QQUICKGRIDVIEW_P_H +#include + #include "qquickitemview_p.h" -#include QT_BEGIN_NAMESPACE @@ -133,7 +134,7 @@ Q_SIGNALS: void viewChanged(); public: - QQmlGuard m_view; + QPointer m_view; }; diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index 1fa933e..6b734ea 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -249,7 +249,7 @@ public: q->polish(); } - QQmlGuard model; + QPointer model; QVariant modelVariant; int itemCount; int buffer; diff --git a/src/quick/items/qquicklistview_p.h b/src/quick/items/qquicklistview_p.h index 3e766f8..f612e7e 100644 --- a/src/quick/items/qquicklistview_p.h +++ b/src/quick/items/qquicklistview_p.h @@ -43,8 +43,7 @@ #define QQUICKLISTVIEW_P_H #include "qquickitemview_p.h" - -#include +#include QT_BEGIN_NAMESPACE @@ -192,7 +191,7 @@ Q_SIGNALS: void viewChanged(); public: - QQmlGuard m_view; + QPointer m_view; QQuickItem *m_sectionItem; }; diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h index 2653305..aa539e7 100644 --- a/src/quick/items/qquickpathview_p_p.h +++ b/src/quick/items/qquickpathview_p_p.h @@ -61,7 +61,6 @@ #include #include -#include #include #include @@ -132,7 +131,7 @@ public: QQuickPath *path; int currentIndex; - QQmlGuard currentItem; + QPointer currentItem; qreal currentItemOffset; qreal startPc; QPointF startPoint; @@ -169,7 +168,7 @@ public: qreal requestedZ; QList items; QList itemCache; - QQmlGuard model; + QPointer model; QVariant modelVariant; enum MovementReason { Other, SetIndex, Mouse }; MovementReason moveReason; diff --git a/src/quick/items/qquickrepeater_p_p.h b/src/quick/items/qquickrepeater_p_p.h index a642f64..6430b3b 100644 --- a/src/quick/items/qquickrepeater_p_p.h +++ b/src/quick/items/qquickrepeater_p_p.h @@ -75,7 +75,7 @@ private: QPointer model; QVariant dataSource; - QQmlGuard dataSourceAsObject; + QPointer dataSourceAsObject; bool ownModel : 1; bool inRequest : 1; bool dataSourceIsObject : 1; diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index 24476b1..b1c548f 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -57,9 +57,9 @@ public: rewindParent(0), rewindStackBefore(0) {} QQuickItem *target; - QQmlGuard parent; - QQmlGuard origParent; - QQmlGuard origStackBefore; + QPointer parent; + QPointer origParent; + QPointer origStackBefore; QQuickItem *rewindParent; QQuickItem *rewindStackBefore; diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h index 11096cf..7b3f61b 100644 --- a/src/quick/items/qquicktextinput_p_p.h +++ b/src/quick/items/qquicktextinput_p_p.h @@ -189,9 +189,9 @@ public: QPointF pressPos; QPointF tripleClickStartPoint; - QQmlGuard cursorComponent; + QPointer cursorComponent; #ifndef QT_NO_VALIDATOR - QQmlGuard m_validator; + QPointer m_validator; #endif qreal hscroll; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 619c72a..cf2526e 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -783,7 +783,7 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, void QQuickWindowPrivate::notifyFocusChangesRecur(QQuickItem **items, int remaining) { - QQmlGuard item(*items); + QPointer item(*items); if (remaining) notifyFocusChangesRecur(items + 1, remaining - 1); diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 2dddd9a..aa7d7c5 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -55,7 +55,6 @@ #include "qquickitem.h" #include "qquickwindow.h" -#include #include #include diff --git a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h index ac613c1..3ca5485 100644 --- a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h @@ -44,7 +44,6 @@ #include #include -#include 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 item; + QPointer item; int ref; }; diff --git a/src/quick/util/qquickbehavior.cpp b/src/quick/util/qquickbehavior.cpp index 1e77084..2d765dc 100644 --- a/src/quick/util/qquickbehavior.cpp +++ b/src/quick/util/qquickbehavior.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -65,7 +64,7 @@ public: QQmlProperty property; QVariant targetValue; - QQmlGuard animation; + QPointer animation; QAbstractAnimationJob *animationInstance; bool enabled; bool finalized; diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index b2aa004..e6f89b9 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -199,7 +198,7 @@ public: QQuickPropertyChangesPrivate() : decoded(true), restore(true), isExplicit(false) {} - QQmlGuard object; + QPointer object; QByteArray data; bool decoded : 1; diff --git a/src/quick/util/qquickstatechangescript.cpp b/src/quick/util/qquickstatechangescript.cpp index 3e89934..2ad42f6 100644 --- a/src/quick/util/qquickstatechangescript.cpp +++ b/src/quick/util/qquickstatechangescript.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 03d553c..3ac88dd 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -1575,9 +1574,9 @@ void tst_qqmlecmascript::dynamicDestruction() { { QQmlComponent component(&engine, testFileUrl("dynamicDeletion.qml")); - QQmlGuard object = qobject_cast(component.create()); + QPointer object = qobject_cast(component.create()); QVERIFY(object != 0); - QQmlGuard createdQmlObject = 0; + QPointer createdQmlObject = 0; QMetaObject::invokeMethod(object, "create"); createdQmlObject = object->objectProperty(); @@ -1630,7 +1629,7 @@ void tst_qqmlecmascript::dynamicDestruction() { // QTBUG-23451 - QQmlGuard createdQmlObject = 0; + QPointer 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 object = component.create(context); + QPointer 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 object = component.create(context); + QPointer 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")); -- 2.7.4