summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-06-12 17:16:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-13 20:07:12 +0200
commit1433fc02dd7afce7b9948b3fd29ea229db0e2bbf (patch)
tree83f798058ac86c3943fd8644a4e5ef29b0e9b0c1 /src
parent19bba2faca1e1a1e6ddbb7a899a6894fc64c1723 (diff)
QtQuick1: Fix warnings about QWeakPointer usage.
- Use getPointer to get a weak pointer for the binding. - Change QWeakPointer<QObject> to a QPointer. Change-Id: I6c362a51c398f73817b5f4545d21f4845d625e13 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/debugger/qdeclarativeenginedebugservice.cpp3
-rw-r--r--src/declarative/debugger/qdeclarativeenginedebugservice_p.h4
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp4
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp12
4 files changed, 12 insertions, 11 deletions
diff --git a/src/declarative/debugger/qdeclarativeenginedebugservice.cpp b/src/declarative/debugger/qdeclarativeenginedebugservice.cpp
index 13be5a8e..a6dbbd1d 100644
--- a/src/declarative/debugger/qdeclarativeenginedebugservice.cpp
+++ b/src/declarative/debugger/qdeclarativeenginedebugservice.cpp
@@ -558,10 +558,11 @@ void QDeclarativeEngineDebugService::setBinding(int objectId,
if (object && context) {
QDeclarativeProperty property(object, propertyName, context);
if (property.isValid()) {
+ typedef QPointer<QDeclarativeState> DeclarativeStatePointer;
bool inBaseState = true;
- foreach(QWeakPointer<QDeclarativeState> statePointer, m_allStates) {
+ foreach (const DeclarativeStatePointer &statePointer, m_allStates) {
if (QDeclarativeState *state = statePointer.data()) {
// here we assume that the revert list on itself defines the base state
if (state->isStateActive() && state->containsPropertyInRevertList(object, propertyName)) {
diff --git a/src/declarative/debugger/qdeclarativeenginedebugservice_p.h b/src/declarative/debugger/qdeclarativeenginedebugservice_p.h
index e0dfdea8..cd268c7d 100644
--- a/src/declarative/debugger/qdeclarativeenginedebugservice_p.h
+++ b/src/declarative/debugger/qdeclarativeenginedebugservice_p.h
@@ -57,7 +57,7 @@
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
-#include <QWeakPointer>
+#include <QtCore/qpointer.h>
QT_BEGIN_NAMESPACE
@@ -121,7 +121,7 @@ private:
QList<QDeclarativeEngine *> m_engines;
QDeclarativeWatcher *m_watch;
- QList<QWeakPointer<QDeclarativeState> > m_allStates;
+ QList<QPointer<QDeclarativeState> > m_allStates;
};
Q_QUICK1_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectData &);
Q_QUICK1_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectData &);
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 723c1d35..bcc5a56d 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -485,7 +485,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions()
newBinding->setSourceLocation(e->sourceFile(), e->lineNumber());
}
newBinding->setTarget(prop);
- a.toBinding = newBinding;
+ a.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
a.deletableToBinding = true;
}
@@ -684,7 +684,7 @@ void QDeclarativePropertyChanges::changeExpression(const QString &name, const QS
} else {
QDeclarativeBinding *newBinding = new QDeclarativeBinding(newExpression->expression(), object(), qmlContext(this));
newBinding->setTarget(d->property(name));
- action.toBinding = newBinding;
+ action.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
action.deletableToBinding = true;
state()->addEntryToRevertList(action);
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 58a40cbe..1fc92ac5 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -401,7 +401,7 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions()
newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("x"), ctxt));
QDeclarativeAction xa;
xa.property = newBinding->property();
- xa.toBinding = newBinding;
+ xa.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
xa.fromValue = xa.property.read();
xa.deletableToBinding = true;
actions << xa;
@@ -417,7 +417,7 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions()
newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("y"), ctxt));
QDeclarativeAction ya;
ya.property = newBinding->property();
- ya.toBinding = newBinding;
+ ya.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
ya.fromValue = ya.property.read();
ya.deletableToBinding = true;
actions << ya;
@@ -433,7 +433,7 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions()
newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("scale"), ctxt));
QDeclarativeAction sa;
sa.property = newBinding->property();
- sa.toBinding = newBinding;
+ sa.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
sa.fromValue = sa.property.read();
sa.deletableToBinding = true;
actions << sa;
@@ -449,7 +449,7 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions()
newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("rotation"), ctxt));
QDeclarativeAction ra;
ra.property = newBinding->property();
- ra.toBinding = newBinding;
+ ra.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
ra.fromValue = ra.property.read();
ra.deletableToBinding = true;
actions << ra;
@@ -465,7 +465,7 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions()
newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("width"), ctxt));
QDeclarativeAction wa;
wa.property = newBinding->property();
- wa.toBinding = newBinding;
+ wa.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
wa.fromValue = wa.property.read();
wa.deletableToBinding = true;
actions << wa;
@@ -481,7 +481,7 @@ QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions()
newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("height"), ctxt));
QDeclarativeAction ha;
ha.property = newBinding->property();
- ha.toBinding = newBinding;
+ ha.toBinding = QDeclarativeAbstractBinding::getPointer(newBinding);
ha.fromValue = ha.property.read();
ha.deletableToBinding = true;
actions << ha;