diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/QmlChanges.txt | 31 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeboundsignal.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeenginedebug.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeexpression.cpp | 16 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeexpression.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativewatcher.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativepropertychanges.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativestategroup.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativestateoperations.cpp | 2 |
11 files changed, 36 insertions, 35 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 55f7b21..9c46467 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -3,6 +3,11 @@ The changes below are pre Qt 4.7.0 RC Flickable: overShoot is replaced by boundsBehavior enumeration. +C++ API +------- +QDeclarativeExpression::value() has been renamed to +QDeclarativeExpression::evaluate() + ============================================================================= The changes below are pre Qt 4.7.0 beta @@ -62,22 +67,22 @@ automatically 'followed' anymore. If you want to follow an hypothetical rect1, you should do now: - Rectangle { - color: "green" - width: 60; height: 60; - x: rect1.x - 5; y: rect1.y - 5; - Behavior on x { SmoothedAnimation { velocity: 200 } } - Behavior on y { SmoothedAnimation { velocity: 200 } } - } + Rectangle { + color: "green" + width: 60; height: 60; + x: rect1.x - 5; y: rect1.y - 5; + Behavior on x { SmoothedAnimation { velocity: 200 } } + Behavior on y { SmoothedAnimation { velocity: 200 } } + } instead of the old automatic source changed tracking: - Rectangle { - color: "green" - width: 60; height: 60; - EaseFollow on x { source: rect1.x - 5; velocity: 200 } - EaseFollow on y { source: rect1.y - 5; velocity: 200 } - } + Rectangle { + color: "green" + width: 60; height: 60; + EaseFollow on x { source: rect1.x - 5; velocity: 200 } + EaseFollow on y { source: rect1.y - 5; velocity: 200 } + } This is a syntax and behavior change. diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 7fa8cc4..e2d8bc7 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -198,7 +198,7 @@ QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &express QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext); ctxt->setContextObject(d->children.at(index)); QDeclarativeExpression e(ctxt, expression, objectContext); - QVariant value = e.value(); + QVariant value = e.evaluate(); delete ctxt; return value; } @@ -1138,7 +1138,7 @@ QVariant QDeclarativeVisualDataModel::evaluate(int index, const QString &express QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(nobj); if (item) { QDeclarativeExpression e(qmlContext(item), expression, objectContext); - value = e.value(); + value = e.evaluate(); } } else { QDeclarativeContext *ccontext = d->m_context; @@ -1147,7 +1147,7 @@ QVariant QDeclarativeVisualDataModel::evaluate(int index, const QString &express QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this); ctxt->setContextObject(data); QDeclarativeExpression e(ctxt, expression, objectContext); - value = e.value(); + value = e.evaluate(); delete data; delete ctxt; } diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 00a93cc..a10e013 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -97,8 +97,6 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMeth QObject *parent) : m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0) { - // A cached evaluation of the QDeclarativeExpression::value() slot index. - // // This is thread safe. Although it may be updated by two threads, they // will both set it to the same value - so the worst thing that can happen // is that they both do the work to figure it out. Boo hoo. @@ -113,8 +111,6 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, cons QObject *parent) : m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0) { - // A cached evaluation of the QDeclarativeExpression::value() slot index. - // // This is thread safe. Although it may be updated by two threads, they // will both set it to the same value - so the worst thing that can happen // is that they both do the work to figure it out. Boo hoo. diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 264fd8d..69e42f8 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -416,7 +416,7 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) if (object && context) { QDeclarativeExpression exprObj(context, expr, object); bool undefined = false; - QVariant value = exprObj.value(&undefined); + QVariant value = exprObj.evaluate(&undefined); if (undefined) result = QLatin1String("<undefined>"); else diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index 8b5a62f..238beb8 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -479,18 +479,18 @@ QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isU } /*! - Returns the value of the expression, or an invalid QVariant if the - expression is invalid or has an error. + Evaulates the expression, returning the result of the evaluation, + or an invalid QVariant if the expression is invalid or has an error. - \a isUndefined is set to true if the expression resulted in an + \a valueIsUndefined is set to true if the expression resulted in an undefined value. \sa hasError(), error() */ -QVariant QDeclarativeExpression::value(bool *isUndefined) +QVariant QDeclarativeExpression::evaluate(bool *valueIsUndefined) { Q_D(QDeclarativeExpression); - return d->value(0, isUndefined); + return d->value(0, valueIsUndefined); } /*! @@ -569,7 +569,7 @@ QObject *QDeclarativeExpression::scopeObject() const } /*! - Returns true if the last call to value() resulted in an error, + Returns true if the last call to evaluate() resulted in an error, otherwise false. \sa error(), clearError() @@ -593,7 +593,7 @@ void QDeclarativeExpression::clearError() } /*! - Return any error from the last call to value(). If there was no error, + Return any error from the last call to evaluate(). If there was no error, this returns an invalid QDeclarativeError instance. \sa hasError(), clearError() @@ -711,7 +711,7 @@ void QDeclarativeExpressionPrivate::updateGuards(const QPODVector<QDeclarativeEn Emitted each time the expression value changes from the last time it was evaluated. The expression must have been evaluated at least once (by - calling QDeclarativeExpression::value()) before this signal will be emitted. + calling QDeclarativeExpression::evaluate()) before this signal will be emitted. */ void QDeclarativeExpressionPrivate::emitValueChanged() diff --git a/src/declarative/qml/qdeclarativeexpression.h b/src/declarative/qml/qdeclarativeexpression.h index 35d6949..c283dd9 100644 --- a/src/declarative/qml/qdeclarativeexpression.h +++ b/src/declarative/qml/qdeclarativeexpression.h @@ -86,7 +86,7 @@ public: void clearError(); QDeclarativeError error() const; - QVariant value(bool *isUndefined = 0); + QVariant evaluate(bool *valueIsUndefined = 0); Q_SIGNALS: void valueChanged(); diff --git a/src/declarative/qml/qdeclarativewatcher.cpp b/src/declarative/qml/qdeclarativewatcher.cpp index 9ea84b8..842b3c4 100644 --- a/src/declarative/qml/qdeclarativewatcher.cpp +++ b/src/declarative/qml/qdeclarativewatcher.cpp @@ -110,7 +110,7 @@ void QDeclarativeWatchProxy::notifyValueChanged() { QVariant v; if (m_expr) - v = m_expr->value(); + v = m_expr->evaluate(); else v = m_property.read(m_object); diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 4f7719b..3b0d264 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -780,7 +780,7 @@ void QDeclarativeScriptActionPrivate::execute() QDeclarativeData *ddata = QDeclarativeData::get(q); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); - expr.value(); + expr.evaluate(); if (expr.hasError()) qmlInfo(q) << expr.error(); } diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 8a6937d..2641dcf 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -434,7 +434,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() a.specifiedProperty = QString::fromUtf8(property); if (d->isExplicit) { - a.toValue = d->expressions.at(ii).second->value(); + a.toValue = d->expressions.at(ii).second->evaluate(); } else { QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->expressions.at(ii).second->expression(), object(), qmlContext(this)); diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index 81f4230..2349ce1 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -288,7 +288,7 @@ bool QDeclarativeStateGroupPrivate::updateAutoState() QDeclarativeState *state = states.at(ii); if (state->isWhenKnown()) { if (!state->name().isEmpty()) { - if (state->when() && state->when()->value().toBool()) { + if (state->when() && state->when()->evaluate().toBool()) { if (stateChangeDebug()) qWarning() << "Setting auto state due to:" << state->when()->expression(); diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 0aad498..9049b83 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -579,7 +579,7 @@ void QDeclarativeStateChangeScript::execute(Reason) QDeclarativeData *ddata = QDeclarativeData::get(this); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); - expr.value(); + expr.evaluate(); if (expr.hasError()) qmlInfo(this, expr.error()); } |