diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-02 20:43:09 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-02 22:29:35 +0100 |
commit | b92b339705c9075a4b1b05b1b470827915dfe50d (patch) | |
tree | 439752241f2393456a7afdcb34940f4d0262aa00 /src/qml/qml/qqmlobjectcreator.cpp | |
parent | 06479ddfe3a9319fd371cd50f4d2f2316d51055a (diff) |
[new compiler] Fix warnings in qml list model custom parser
For the warnings to have the correct column/line number information, we
need to set it on the QQmlData before calling the custom parser.
Change-Id: I6e1c729491df6af846e41ee88e785b32e4715751
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 5d6cbba910..e14d30effb 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -953,6 +953,7 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent) bool isComponent = false; QObject *instance = 0; + QQmlData *ddata = 0; QQmlCustomParser *customParser = 0; QQmlParserStatus *parserStatus = 0; bool installPropertyCache = true; @@ -962,6 +963,7 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent) QQmlComponent *component = new QQmlComponent(engine, compiledData, index, parent); QQmlComponentPrivate::get(component)->creationContext = context; instance = component; + ddata = QQmlData::get(instance, /*create*/true); } else { const QV4::CompiledData::Object *obj = qmlUnit->objectAt(index); @@ -1004,9 +1006,12 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent) // ### use no-event variant if (parent) instance->setParent(parent); + + ddata = QQmlData::get(instance, /*create*/true); + ddata->lineNumber = obj->location.line; + ddata->columnNumber = obj->location.column; } - QQmlData *ddata = QQmlData::get(instance, /*create*/true); ddata->setImplicitDestructible(); if (static_cast<quint32>(index) == qmlUnit->indexOfRootObject || ddata->rootObjectInCreation) { if (ddata->context) { @@ -1175,9 +1180,6 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QQmlRefPo _ddata->propertyCache->addref(); } - _ddata->lineNumber = _compiledObject->location.line; - _ddata->columnNumber = _compiledObject->location.column; - qSwap(_vmeMetaObject, vmeMetaObject); QVector<QQmlAbstractBinding*> createdBindings(_compiledObject->nBindings, 0); |