diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlbasicscript.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlbinding.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qmlbinding.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcomponent.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlenginedebug.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 11 | ||||
-rw-r--r-- | src/declarative/qml/qmlexpression.h | 4 |
10 files changed, 24 insertions, 12 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp index 5b80ee0..70e3a43 100644 --- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp @@ -965,9 +965,9 @@ QVariant QmlGraphicsVisualDataModel::evaluate(int index, const QString &expressi return value; } -int QmlGraphicsVisualDataModel::indexOf(QmlGraphicsItem *item, QObject *objectContext) const +int QmlGraphicsVisualDataModel::indexOf(QmlGraphicsItem *item, QObject *) const { - QVariant val = QmlEngine::contextForObject(item)->contextProperty("index"); + QVariant val = QmlEngine::contextForObject(item)->contextProperty(QLatin1String("index")); return val.toInt(); return -1; } diff --git a/src/declarative/qml/qmlbasicscript.cpp b/src/declarative/qml/qmlbasicscript.cpp index ebdd348..3d566c7 100644 --- a/src/declarative/qml/qmlbasicscript.cpp +++ b/src/declarative/qml/qmlbasicscript.cpp @@ -494,7 +494,7 @@ const QMetaObject * QmlBasicScriptCompiler::fetch(int type, const QMetaObject *mo, int idx) { ScriptInstruction instr; - (int &)instr.type = type; + *((int*)&instr.type) = type; instr.constant.idx = idx; QMetaProperty prop = mo->property(idx); if (prop.isConstant()) 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/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 7d93c46..4ee59b3 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -2367,7 +2367,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) sig.append(','); funcScript.append(QLatin1Char(',')); } - funcScript.append(s.parameterNames.at(jj)); + funcScript.append(QLatin1String(s.parameterNames.at(jj))); sig.append("QVariant"); } sig.append(')'); diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 2d53b0b..a1292f5 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -676,7 +676,7 @@ QObject * QmlComponentPrivate::begin(QmlContext *ctxt, QmlEnginePrivate *engineP return rv; } -void QmlComponentPrivate::beginDeferred(QmlContext *ctxt, QmlEnginePrivate *enginePriv, +void QmlComponentPrivate::beginDeferred(QmlContext *, QmlEnginePrivate *enginePriv, QObject *object, ConstructionState *state) { bool isRoot = !enginePriv->inBeginCreate; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 2d86e09..aca3f76 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -694,7 +694,7 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi if(ctxt->argumentCount() > 2) url = QUrl(ctxt->argument(2).toString()); else - url = QUrl("inline"); + url = QUrl(QLatin1String("inline")); if (url.isValid() && url.isRelative()) url = context->resolvedUrl(url); diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 46490fb..2abd6e6 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -115,7 +115,7 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) QVariant value = prop.read(obj); rv.value = valueContents(value); - if (prop.userType() < QVariant::UserType) { + if (QVariant::Type(prop.userType()) < QVariant::UserType) { rv.type = QmlObjectProperty::Basic; } else if (QmlMetaType::isObject(prop.userType())) { rv.type = QmlObjectProperty::Object; @@ -130,7 +130,7 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) QVariant QmlEngineDebugServer::valueContents(const QVariant &value) const { int userType = value.userType(); - if (userType < QVariant::UserType) + if (QVariant::Type(userType) < QVariant::UserType) return value; 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 &, |