diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-01-11 06:32:53 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-01-11 06:35:18 (GMT) |
commit | 26021de11bf8cfd3f2067466b8be97d42316b8b4 (patch) | |
tree | 3a16f21c268f343a32d6a57a374339a167890f17 /src/declarative | |
parent | aa6ec25bdf0e69873b537e05d4511543b21f3e8a (diff) | |
download | Qt-26021de11bf8cfd3f2067466b8be97d42316b8b4.zip Qt-26021de11bf8cfd3f2067466b8be97d42316b8b4.tar.gz Qt-26021de11bf8cfd3f2067466b8be97d42316b8b4.tar.bz2 |
Don't use a virtual signal - moc complains.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlbinding.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qmlbinding.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 11 | ||||
-rw-r--r-- | src/declarative/qml/qmlexpression.h | 4 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp index d1a8fe8..4ec7191 100644 --- a/src/declarative/qml/qmlbinding.cpp +++ b/src/declarative/qml/qmlbinding.cpp @@ -225,9 +225,10 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags) data->release(); } -void QmlBinding::valueChanged() +void QmlBinding::emitValueChanged() { update(); + // don't bother calling valueChanged() } void QmlBinding::setEnabled(bool e, QmlMetaProperty::WriteFlags flags) diff --git a/src/declarative/qml/qmlbinding.h b/src/declarative/qml/qmlbinding.h index 242742a..cefb4fe 100644 --- a/src/declarative/qml/qmlbinding.h +++ b/src/declarative/qml/qmlbinding.h @@ -114,7 +114,7 @@ public Q_SLOTS: void update() { update(QmlMetaProperty::DontRemoveBinding); } protected: - virtual void valueChanged(); + void emitValueChanged(); private: Q_DECLARE_PRIVATE(QmlBinding) diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index 1587d61..22a9c36f 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -627,7 +627,7 @@ QmlError QmlExpression::error() const /*! \internal */ void QmlExpression::__q_notify() { - valueChanged(); + emitValueChanged(); } void QmlExpressionPrivate::clearGuards() @@ -753,6 +753,15 @@ void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::Captu calling QmlExpression::value()) before this signal will be emitted. */ +/*! + Subclasses can capture the emission of the valueChanged() signal by overriding + this function. They can choose whether to then call valueChanged(). +*/ +void QmlExpression::emitValueChanged() +{ + emit valueChanged(); +} + QmlAbstractExpression::QmlAbstractExpression() : m_context(0), m_prevExpression(0), m_nextExpression(0) { diff --git a/src/declarative/qml/qmlexpression.h b/src/declarative/qml/qmlexpression.h index c019f21..cc02d56 100644 --- a/src/declarative/qml/qmlexpression.h +++ b/src/declarative/qml/qmlexpression.h @@ -92,9 +92,11 @@ public Q_SLOTS: QVariant value(bool *isUndefined = 0); Q_SIGNALS: - virtual void valueChanged(); + void valueChanged(); protected: + virtual void emitValueChanged(); + QmlExpression(QmlContext *, const QString &, QObject *, QmlExpressionPrivate &dd); QmlExpression(QmlContext *, void *, QmlRefCount *rc, QObject *me, const QString &, |