summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-04-22 04:58:56 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-04-22 23:46:03 (GMT)
commit64d384e4ec8d9cac98dba3feaab96658b1e27e87 (patch)
tree4aa703b8d94c69d58b7cc5f1edac1c07274432a7 /src/declarative/qml
parent02a7574f213901d98766f717d0135685da139d38 (diff)
downloadQt-64d384e4ec8d9cac98dba3feaab96658b1e27e87.zip
Qt-64d384e4ec8d9cac98dba3feaab96658b1e27e87.tar.gz
Qt-64d384e4ec8d9cac98dba3feaab96658b1e27e87.tar.bz2
Rename QDeclarativeExpression::value() to evaluate().
QDeclarativeExpression can be used to evaluate any sort of expression, not just those returning a value.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp16
-rw-r--r--src/declarative/qml/qdeclarativeexpression.h2
-rw-r--r--src/declarative/qml/qdeclarativewatcher.cpp2
5 files changed, 11 insertions, 15 deletions
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);