summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-25 02:45:38 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-25 02:46:48 (GMT)
commita645ab52a7ba10018419b552b8f50ce4b7ad9cd8 (patch)
tree38b3267a4258331ffe22508949869b07f0887c33 /src/declarative/util
parent35f6b95744164e635fb8a03e34b2dd6177a50ccf (diff)
downloadQt-a645ab52a7ba10018419b552b8f50ce4b7ad9cd8.zip
Qt-a645ab52a7ba10018419b552b8f50ce4b7ad9cd8.tar.gz
Qt-a645ab52a7ba10018419b552b8f50ce4b7ad9cd8.tar.bz2
Move private QDeclarativeMetaProperty functions into the private class
We don't want to allow manipulation of bindings and signal properties through the public API. Equivalents of the public functions now exist in QDeclarativeMetaPropertyPrivate for internal use.
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp11
-rw-r--r--src/declarative/util/qdeclarativestate.cpp7
-rw-r--r--src/declarative/util/qdeclarativestate_p_p.h3
-rw-r--r--src/declarative/util/qdeclarativestategroup.cpp4
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager.cpp10
5 files changed, 20 insertions, 15 deletions
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 5907ddb..ad39574 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -50,6 +50,7 @@
#include <qdeclarativebinding_p.h>
#include <qdeclarativecontext.h>
#include <qdeclarativeguard_p.h>
+#include <qdeclarativemetaproperty_p.h>
#include <QtCore/qdebug.h>
@@ -132,12 +133,12 @@ public:
QDeclarativeGuard<QDeclarativeExpression> ownedExpression;
virtual void execute() {
- ownedExpression = property.setSignalExpression(expression);
+ ownedExpression = QDeclarativeMetaPropertyPrivate::setSignalExpression(property, expression);
}
virtual bool isReversable() { return true; }
virtual void reverse() {
- ownedExpression = property.setSignalExpression(reverseExpression);
+ ownedExpression = QDeclarativeMetaPropertyPrivate::setSignalExpression(property, reverseExpression);
}
virtual void saveOriginals() {
@@ -146,9 +147,11 @@ public:
}
virtual void rewind() {
- ownedExpression = property.setSignalExpression(rewindExpression);
+ ownedExpression = QDeclarativeMetaPropertyPrivate::setSignalExpression(property, rewindExpression);
+ }
+ virtual void saveCurrentValues() {
+ rewindExpression = QDeclarativeMetaPropertyPrivate::signalExpression(property);
}
- virtual void saveCurrentValues() { rewindExpression = property.signalExpression(); }
virtual bool override(QDeclarativeActionEvent*other) {
if (other == this)
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 5c3b909..d1dd318 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -334,7 +334,7 @@ void QDeclarativeState::cancel()
void QDeclarativeAction::deleteFromBinding()
{
if (fromBinding) {
- property.setBinding(0);
+ QDeclarativeMetaPropertyPrivate::setBinding(property, 0);
fromBinding->destroy();
fromBinding = 0;
}
@@ -388,7 +388,7 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit
else if (action.event->isRewindable())
action.event->saveCurrentValues();
} else {
- action.fromBinding = action.property.binding();
+ action.fromBinding = QDeclarativeMetaPropertyPrivate::binding(action.property);
for (jj = 0; jj < d->revertList.count(); ++jj) {
if (d->revertList.at(jj).property == action.property) {
@@ -436,7 +436,8 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit
}
if (!found) {
QVariant cur = d->revertList.at(ii).property.read();
- QDeclarativeAbstractBinding *delBinding = d->revertList.at(ii).property.setBinding(0);
+ QDeclarativeAbstractBinding *delBinding =
+ QDeclarativeMetaPropertyPrivate::setBinding(d->revertList.at(ii).property, 0);
if (delBinding)
delBinding->destroy();
diff --git a/src/declarative/util/qdeclarativestate_p_p.h b/src/declarative/util/qdeclarativestate_p_p.h
index dd925f2..6b32f04 100644
--- a/src/declarative/util/qdeclarativestate_p_p.h
+++ b/src/declarative/util/qdeclarativestate_p_p.h
@@ -58,6 +58,7 @@
#include "qdeclarativeanimation_p_p.h"
#include "qdeclarativetransitionmanager_p_p.h"
+#include <qdeclarativemetaproperty_p.h>
#include <qdeclarativeguard_p.h>
#include <private/qobject_p.h>
@@ -76,7 +77,7 @@ public:
event = a.event;
if (state == StartState) {
value = a.fromValue;
- binding = property.binding();
+ binding = QDeclarativeMetaPropertyPrivate::binding(property);
reverseEvent = true;
} else {
value = a.toValue;
diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp
index 0b81a53..1a7c256 100644
--- a/src/declarative/util/qdeclarativestategroup.cpp
+++ b/src/declarative/util/qdeclarativestategroup.cpp
@@ -59,7 +59,7 @@ class QDeclarativeStateGroupPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeStateGroup)
public:
- QDeclarativeStateGroupPrivate(QDeclarativeStateGroup *p)
+ QDeclarativeStateGroupPrivate()
: nullState(0), componentComplete(true),
ignoreTrans(false), applyingState(false) {}
@@ -111,7 +111,7 @@ public:
*/
QDeclarativeStateGroup::QDeclarativeStateGroup(QObject *parent)
- : QObject(*(new QDeclarativeStateGroupPrivate(this)), parent)
+ : QObject(*(new QDeclarativeStateGroupPrivate), parent)
{
}
diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp
index b5841dc..9fa1488 100644
--- a/src/declarative/util/qdeclarativetransitionmanager.cpp
+++ b/src/declarative/util/qdeclarativetransitionmanager.cpp
@@ -98,7 +98,7 @@ void QDeclarativeTransitionManagerPrivate::applyBindings()
{
foreach(const QDeclarativeAction &action, bindingsList) {
if (action.toBinding) {
- action.property.setBinding(action.toBinding);
+ QDeclarativeMetaPropertyPrivate::setBinding(action.property, action.toBinding);
} else if (action.event) {
if (action.reverseEvent)
action.event->reverse();
@@ -122,7 +122,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
if (action.toBinding)
d->bindingsList << action;
if (action.fromBinding)
- action.property.setBinding(0); // Disable current binding
+ QDeclarativeMetaPropertyPrivate::setBinding(action.property, 0); // Disable current binding
if (action.event && action.event->changesBindings()) { //### assume isReversable()?
d->bindingsList << action;
if (action.reverseEvent)
@@ -149,7 +149,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
for (int ii = 0; ii < applyList.size(); ++ii) {
const QDeclarativeAction &action = applyList.at(ii);
if (action.toBinding) {
- action.property.setBinding(action.toBinding, QDeclarativeMetaProperty::BypassInterceptor | QDeclarativeMetaProperty::DontRemoveBinding);
+ QDeclarativeMetaPropertyPrivate::setBinding(action.property, action.toBinding, QDeclarativeMetaProperty::BypassInterceptor | QDeclarativeMetaProperty::DontRemoveBinding);
} else if (!action.event) {
action.property.write(action.toValue, QDeclarativeMetaProperty::BypassInterceptor | QDeclarativeMetaProperty::DontRemoveBinding);
} else if (action.event->isReversable()) {
@@ -190,7 +190,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
}
if (action.toBinding)
- action.property.setBinding(0); // Make sure this is disabled during the transition
+ QDeclarativeMetaPropertyPrivate::setBinding(action.property, 0); // Make sure this is disabled during the transition
action.property.write(action.fromValue, QDeclarativeMetaProperty::BypassInterceptor | QDeclarativeMetaProperty::DontRemoveBinding);
}
@@ -266,7 +266,7 @@ void QDeclarativeTransitionManager::cancel()
for(int i = 0; i < d->bindingsList.count(); ++i) {
QDeclarativeAction action = d->bindingsList[i];
if (action.toBinding && action.deletableToBinding) {
- action.property.setBinding(0);
+ QDeclarativeMetaPropertyPrivate::setBinding(action.property, 0);
action.toBinding->destroy();
action.toBinding = 0;
action.deletableToBinding = false;