From 1206562c6be4098de8a9fdda5c7ff5c8fdd6bc01 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 11:25:23 +1000 Subject: Use a bitmask to track bound properties --- src/declarative/qml/qmlbinding.cpp | 29 ++++++++++++++------- src/declarative/qml/qmlbinding.h | 1 + src/declarative/qml/qmldeclarativedata_p.h | 6 +++++ src/declarative/qml/qmlengine.cpp | 41 +++++++++++++++++++++++++++++- src/declarative/qml/qmlmetaproperty.cpp | 37 +++++++++++++++++---------- src/declarative/qml/qmlmetaproperty.h | 2 ++ src/declarative/qml/qmlmetaproperty_p.h | 2 +- src/declarative/qml/qmlvme.cpp | 3 +-- 8 files changed, 95 insertions(+), 26 deletions(-) diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp index f9c9561..454369b 100644 --- a/src/declarative/qml/qmlbinding.cpp +++ b/src/declarative/qml/qmlbinding.cpp @@ -131,7 +131,7 @@ void QmlBinding::update() value = qVariantFromValue(QmlStringConverters::vector3DFromString(value.toString())); } - d->property.write(value); + d->property.write(value, QmlMetaProperty::Binding); } d->updating = false; @@ -180,7 +180,7 @@ QString QmlBinding::expression() const } QmlAbstractBinding::QmlAbstractBinding() -: m_mePtr(0), m_prevBinding(0), m_nextBinding(0) +: m_object(0), m_mePtr(0), m_prevBinding(0), m_nextBinding(0) { } @@ -193,24 +193,35 @@ QmlAbstractBinding::~QmlAbstractBinding() void QmlAbstractBinding::addToObject(QObject *object) { + Q_ASSERT(object); + removeFromObject(); - if (object) { - QmlDeclarativeData *data = QmlDeclarativeData::get(object, true); - m_nextBinding = data->bindings; - if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding; - m_prevBinding = &data->bindings; - data->bindings = this; - } + Q_ASSERT(!m_prevBinding); + + QmlDeclarativeData *data = QmlDeclarativeData::get(object, true); + m_nextBinding = data->bindings; + if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding; + m_prevBinding = &data->bindings; + data->bindings = this; + m_object = object; + + data->setBindingBit(m_object, propertyIndex()); } void QmlAbstractBinding::removeFromObject() { if (m_prevBinding) { + Q_ASSERT(m_object); + *m_prevBinding = m_nextBinding; if (m_nextBinding) m_nextBinding->m_prevBinding = m_prevBinding; m_prevBinding = 0; m_nextBinding = 0; + + QmlDeclarativeData *data = QmlDeclarativeData::get(m_object, false); + if (data) data->clearBindingBit(propertyIndex()); + m_object = 0; } } diff --git a/src/declarative/qml/qmlbinding.h b/src/declarative/qml/qmlbinding.h index 63b8a15..675917d 100644 --- a/src/declarative/qml/qmlbinding.h +++ b/src/declarative/qml/qmlbinding.h @@ -75,6 +75,7 @@ private: friend class QmlMetaProperty; friend class QmlVME; + QObject *m_object; QmlAbstractBinding **m_mePtr; QmlAbstractBinding **m_prevBinding; QmlAbstractBinding *m_nextBinding; diff --git a/src/declarative/qml/qmldeclarativedata_p.h b/src/declarative/qml/qmldeclarativedata_p.h index a316c0c..ade961f 100644 --- a/src/declarative/qml/qmldeclarativedata_p.h +++ b/src/declarative/qml/qmldeclarativedata_p.h @@ -70,6 +70,12 @@ public: QmlContext *context; QmlAbstractBinding *bindings; + int bindingBitsSize; + quint32 *bindingBits; + bool hasBindingBit(int) const; + void clearBindingBit(int); + void setBindingBit(QObject *obj, int); + QmlContext *outerContext; // Can't this be found from context? ushort lineNumber; ushort columnNumber; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 4be5230..2ea1bee 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -700,7 +700,8 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre } QmlDeclarativeData::QmlDeclarativeData(QmlContext *ctxt) -: context(ctxt), bindings(0), outerContext(0), lineNumber(0), columnNumber(0), deferredComponent(0), +: context(ctxt), bindings(0), bindingBitsSize(0), bindingBits(0), + outerContext(0), lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0), attachedProperties(0) { } @@ -723,9 +724,47 @@ void QmlDeclarativeData::destroyed(QObject *object) binding = next; } + if (bindingBits) + free(bindingBits); + delete this; } +bool QmlDeclarativeData::hasBindingBit(int bit) const +{ + if (bindingBitsSize >= bit) + return bindingBits[bit / 32] & (1 << (bit % 32)); + else + return false; +} + +void QmlDeclarativeData::clearBindingBit(int bit) +{ + if (bindingBitsSize >= bit) + bindingBits[bit / 32] &= ~(1 << (bit % 32)); +} + +void QmlDeclarativeData::setBindingBit(QObject *obj, int bit) +{ + if (bindingBitsSize < bit) { + int props = obj->metaObject()->propertyCount(); + Q_ASSERT(bit < props); + + int arraySize = (props + 31) / 32; + int oldArraySize = bindingBitsSize / 32; + + bindingBits = (quint32 *)realloc(bindingBits, + arraySize * sizeof(quint32)); + memset(bindingBits + oldArraySize, + sizeof(quint32) * (arraySize - oldArraySize), + 0x00); + + bindingBitsSize = arraySize * 32; + } + + bindingBits[bit / 32] |= (1 << (bit % 32)); +} + /*! Creates a QScriptValue allowing you to use \a object in QML script. \a engine is the QmlEngine it is to be created in. diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 8f76240..91769d3 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -531,6 +531,9 @@ QmlAbstractBinding *QmlMetaProperty::binding() const if (!data) return 0; + if (!data->hasBindingBit(d->coreIdx)) + return 0; + QmlAbstractBinding *binding = data->bindings; while (binding) { // ### This wont work for value types @@ -559,20 +562,22 @@ QmlMetaProperty::setBinding(QmlAbstractBinding *newBinding) const QmlDeclarativeData *data = QmlDeclarativeData::get(d->object, true); - QmlAbstractBinding *binding = data->bindings; - while (binding) { - // ### This wont work for value types - if (binding->propertyIndex() == d->coreIdx) { - binding->setEnabled(false); + if (data->hasBindingBit(d->coreIdx)) { + QmlAbstractBinding *binding = data->bindings; + while (binding) { + // ### This wont work for value types + if (binding->propertyIndex() == d->coreIdx) { + binding->setEnabled(false); - if (newBinding) - newBinding->setEnabled(true); + if (newBinding) + newBinding->setEnabled(true); - return binding; // ### QmlAbstractBinding; - } + return binding; // ### QmlAbstractBinding; + } - binding = binding->m_nextBinding; - } + binding = binding->m_nextBinding; + } + } if (newBinding) newBinding->setEnabled(true); @@ -727,7 +732,8 @@ void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) } } -void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) +void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value, + QmlMetaProperty::WriteSource source) { QObject *object = this->object; int coreIdx = this->coreIdx; @@ -987,6 +993,11 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) */ void QmlMetaProperty::write(const QVariant &value) const { + write(value, Other); +} + +void QmlMetaProperty::write(const QVariant &value, WriteSource source) const +{ if (!d->object) return; @@ -996,7 +1007,7 @@ void QmlMetaProperty::write(const QVariant &value) const } else if (d->coreIdx != -1) { - d->writeValueProperty(value); + d->writeValueProperty(value, source); } } diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qmlmetaproperty.h index 62e93c4..8c34ece 100644 --- a/src/declarative/qml/qmlmetaproperty.h +++ b/src/declarative/qml/qmlmetaproperty.h @@ -88,6 +88,8 @@ public: QVariant read() const; void write(const QVariant &) const; + enum WriteSource { Animation, Binding, Other }; + void write(const QVariant &, WriteSource) const; bool hasChangedNotifier() const; bool needsChangedNotifier() const; diff --git a/src/declarative/qml/qmlmetaproperty_p.h b/src/declarative/qml/qmlmetaproperty_p.h index 8e8966e..f2d0039 100644 --- a/src/declarative/qml/qmlmetaproperty_p.h +++ b/src/declarative/qml/qmlmetaproperty_p.h @@ -118,7 +118,7 @@ public: QmlMetaProperty::PropertyCategory propertyCategory() const; void writeSignalProperty(const QVariant &); - void writeValueProperty(const QVariant &); + void writeValueProperty(const QVariant &, QmlMetaProperty::WriteSource); static quint32 saveValueType(int, int); static quint32 saveProperty(int); diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index d377cc3..606a732 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -565,9 +565,8 @@ QObject *QmlVME::run(QStack &stack, QmlContext *ctxt, QmlCompiledData QmlBinding *bind = new QmlBinding((void *)datas.at(instr.assignBinding.value).constData(), comp, context, ctxt, 0); bindValues.append(bind); bind->m_mePtr = &bindValues.values[bindValues.count - 1]; - bind->addToObject(target); - bind->setTarget(mp); + bind->addToObject(target); } break; -- cgit v0.12 From 4d89a76ee9d4756eb1d1171dc620a202234a9fc9 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 11:32:45 +1000 Subject: Move test data into data subdir --- tests/auto/declarative/qmlparser/Alias.qml | 8 ----- tests/auto/declarative/qmlparser/MyComponent.qml | 6 ---- .../declarative/qmlparser/MyContainerComponent.qml | 5 --- tests/auto/declarative/qmlparser/alias.1.qml | 8 ----- tests/auto/declarative/qmlparser/alias.2.qml | 8 ----- tests/auto/declarative/qmlparser/alias.3.qml | 10 ------ .../declarative/qmlparser/assignBasicTypes.qml | 26 --------------- .../qmlparser/assignLiteralSignalProperty.qml | 4 --- .../declarative/qmlparser/assignObjectToSignal.qml | 4 --- .../qmlparser/assignObjectToVariant.qml | 6 ---- .../declarative/qmlparser/assignQmlComponent.qml | 4 --- tests/auto/declarative/qmlparser/assignSignal.qml | 5 --- .../declarative/qmlparser/assignTypeExtremes.qml | 5 --- .../declarative/qmlparser/attachedProperties.qml | 5 --- .../qmlparser/autoComponentCreation.qml | 4 --- tests/auto/declarative/qmlparser/cppnamespace.qml | 4 --- .../qmlparser/customParserIdNotAllowed.errors.txt | 1 - .../qmlparser/customParserIdNotAllowed.qml | 5 --- .../declarative/qmlparser/customParserTypes.qml | 5 --- .../declarative/qmlparser/customVariantTypes.qml | 4 --- tests/auto/declarative/qmlparser/data/Alias.qml | 8 +++++ .../declarative/qmlparser/data/MyComponent.qml | 6 ++++ .../qmlparser/data/MyContainerComponent.qml | 5 +++ tests/auto/declarative/qmlparser/data/alias.1.qml | 8 +++++ tests/auto/declarative/qmlparser/data/alias.2.qml | 8 +++++ tests/auto/declarative/qmlparser/data/alias.3.qml | 10 ++++++ .../qmlparser/data/assignBasicTypes.qml | 26 +++++++++++++++ .../qmlparser/data/assignLiteralSignalProperty.qml | 4 +++ .../qmlparser/data/assignObjectToSignal.qml | 4 +++ .../qmlparser/data/assignObjectToVariant.qml | 6 ++++ .../qmlparser/data/assignQmlComponent.qml | 4 +++ .../declarative/qmlparser/data/assignSignal.qml | 5 +++ .../qmlparser/data/assignTypeExtremes.qml | 5 +++ .../qmlparser/data/attachedProperties.qml | 5 +++ .../qmlparser/data/autoComponentCreation.qml | 4 +++ .../declarative/qmlparser/data/cppnamespace.qml | 4 +++ .../data/customParserIdNotAllowed.errors.txt | 1 + .../qmlparser/data/customParserIdNotAllowed.qml | 5 +++ .../qmlparser/data/customParserTypes.qml | 5 +++ .../qmlparser/data/customVariantTypes.qml | 4 +++ .../qmlparser/data/duplicateIDs.errors.txt | 1 + .../declarative/qmlparser/data/duplicateIDs.qml | 6 ++++ .../declarative/qmlparser/data/dynamicObject.1.qml | 8 +++++ .../qmlparser/data/dynamicProperties.qml | 13 ++++++++ .../qmlparser/data/dynamicSignalsAndSlots.qml | 7 ++++ .../declarative/qmlparser/data/empty.errors.txt | 2 ++ tests/auto/declarative/qmlparser/data/empty.qml | 0 .../qmlparser/data/failingComponent.errors.txt | 1 + .../qmlparser/data/failingComponentTest.qml | 4 +++ .../qmlparser/data/fakeDotProperty.errors.txt | 1 + .../declarative/qmlparser/data/fakeDotProperty.qml | 4 +++ .../qmlparser/data/finalOverride.errors.txt | 1 + .../declarative/qmlparser/data/finalOverride.qml | 4 +++ .../auto/declarative/qmlparser/data/idProperty.qml | 8 +++++ .../data/importNamespaceConflict.errors.txt | 1 + .../qmlparser/data/importNamespaceConflict.qml | 4 +++ .../data/importVersionMissingBuiltIn.errors.txt | 1 + .../qmlparser/data/importVersionMissingBuiltIn.qml | 7 ++++ .../data/importVersionMissingInstalled.errors.txt | 1 + .../data/importVersionMissingInstalled.qml | 3 ++ .../qmlparser/data/inlineQmlComponents.qml | 10 ++++++ .../qmlparser/data/interfaceProperty.qml | 5 +++ .../declarative/qmlparser/data/interfaceQList.qml | 7 ++++ .../qmlparser/data/interfaceQmlList.qml | 7 ++++ .../qmlparser/data/invalidID.2.errors.txt | 2 ++ .../declarative/qmlparser/data/invalidID.2.qml | 5 +++ .../qmlparser/data/invalidID.3.errors.txt | 1 + .../declarative/qmlparser/data/invalidID.3.qml | 5 +++ .../qmlparser/data/invalidID.4.errors.txt | 1 + .../declarative/qmlparser/data/invalidID.4.qml | 6 ++++ .../qmlparser/data/invalidID.5.errors.txt | 1 + .../declarative/qmlparser/data/invalidID.5.qml | 6 ++++ .../qmlparser/data/invalidID.6.errors.txt | 1 + .../declarative/qmlparser/data/invalidID.6.qml | 5 +++ .../qmlparser/data/invalidID.errors.txt | 1 + .../auto/declarative/qmlparser/data/invalidID.qml | 4 +++ .../lib/com/nokia/installedtest/InstalledTest.qml | 2 ++ .../lib/com/nokia/installedtest/InstalledTest2.qml | 2 ++ .../data/lib/com/nokia/installedtest/qmldir | 3 ++ .../qmlparser/data/listAssignment.1.errors.txt | 1 + .../qmlparser/data/listAssignment.1.qml | 4 +++ .../qmlparser/data/listAssignment.2.errors.txt | 2 ++ .../qmlparser/data/listAssignment.2.qml | 4 +++ .../qmlparser/data/listAssignment.3.errors.txt | 1 + .../qmlparser/data/listAssignment.3.qml | 6 ++++ .../qmlparser/data/listItemDeleteSelf.qml | 38 ++++++++++++++++++++++ .../qmlparser/data/missingObject.errors.txt | 1 + .../declarative/qmlparser/data/missingObject.qml | 1 + .../qmlparser/data/missingSignal.errors.txt | 1 + .../declarative/qmlparser/data/missingSignal.qml | 5 +++ .../data/nonexistantProperty.1.errors.txt | 1 + .../qmlparser/data/nonexistantProperty.1.qml | 2 ++ .../data/nonexistantProperty.2.errors.txt | 1 + .../qmlparser/data/nonexistantProperty.2.qml | 4 +++ .../data/nonexistantProperty.3.errors.txt | 1 + .../qmlparser/data/nonexistantProperty.3.qml | 4 +++ .../data/nonexistantProperty.4.errors.txt | 1 + .../qmlparser/data/nonexistantProperty.4.qml | 4 +++ .../data/nonexistantProperty.5.errors.txt | 1 + .../qmlparser/data/nonexistantProperty.5.qml | 4 +++ .../data/nonexistantProperty.6.errors.txt | 1 + .../qmlparser/data/nonexistantProperty.6.qml | 4 +++ .../qmlparser/data/nullDotProperty.errors.txt | 1 + .../declarative/qmlparser/data/nullDotProperty.qml | 4 +++ .../qmlparser/data/propertyValueSource.qml | 4 +++ .../qmlparser/data/readOnly.1.errors.txt | 1 + .../auto/declarative/qmlparser/data/readOnly.1.qml | 4 +++ .../qmlparser/data/readOnly.2.errors.txt | 1 + .../auto/declarative/qmlparser/data/readOnly.2.qml | 4 +++ .../qmlparser/data/rootAsQmlComponent.qml | 6 ++++ .../declarative/qmlparser/data/simpleBindings.qml | 18 ++++++++++ .../declarative/qmlparser/data/simpleContainer.qml | 5 +++ .../declarative/qmlparser/data/simpleObject.qml | 2 ++ .../declarative/qmlparser/data/subdir/Test.qml | 2 ++ .../qmlparser/data/unregisteredObject.errors.txt | 1 + .../qmlparser/data/unregisteredObject.qml | 2 ++ .../qmlparser/data/unsupportedProperty.errors.txt | 1 + .../qmlparser/data/unsupportedProperty.qml | 4 +++ .../auto/declarative/qmlparser/data/valueTypes.qml | 13 ++++++++ .../qmlparser/data/wrongType.1.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.1.qml | 4 +++ .../qmlparser/data/wrongType.10.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.10.qml | 5 +++ .../qmlparser/data/wrongType.11.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.11.qml | 5 +++ .../qmlparser/data/wrongType.12.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.12.qml | 5 +++ .../qmlparser/data/wrongType.13.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.13.qml | 4 +++ .../qmlparser/data/wrongType.14.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.14.qml | 5 +++ .../qmlparser/data/wrongType.2.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.2.qml | 4 +++ .../qmlparser/data/wrongType.3.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.3.qml | 4 +++ .../qmlparser/data/wrongType.4.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.4.qml | 4 +++ .../qmlparser/data/wrongType.5.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.5.qml | 5 +++ .../qmlparser/data/wrongType.6.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.6.qml | 5 +++ .../qmlparser/data/wrongType.7.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.7.qml | 5 +++ .../qmlparser/data/wrongType.8.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.8.qml | 5 +++ .../qmlparser/data/wrongType.9.errors.txt | 1 + .../declarative/qmlparser/data/wrongType.9.qml | 5 +++ .../declarative/qmlparser/duplicateIDs.errors.txt | 1 - tests/auto/declarative/qmlparser/duplicateIDs.qml | 6 ---- .../auto/declarative/qmlparser/dynamicObject.1.qml | 8 ----- .../declarative/qmlparser/dynamicProperties.qml | 13 -------- .../qmlparser/dynamicSignalsAndSlots.qml | 7 ---- tests/auto/declarative/qmlparser/empty.errors.txt | 2 -- tests/auto/declarative/qmlparser/empty.qml | 0 .../qmlparser/failingComponent.errors.txt | 1 - .../declarative/qmlparser/failingComponentTest.qml | 4 --- .../qmlparser/fakeDotProperty.errors.txt | 1 - .../auto/declarative/qmlparser/fakeDotProperty.qml | 4 --- .../declarative/qmlparser/finalOverride.errors.txt | 1 - tests/auto/declarative/qmlparser/finalOverride.qml | 4 --- tests/auto/declarative/qmlparser/idProperty.qml | 8 ----- .../qmlparser/importNamespaceConflict.errors.txt | 1 - .../qmlparser/importNamespaceConflict.qml | 4 --- .../importVersionMissingBuiltIn.errors.txt | 1 - .../qmlparser/importVersionMissingBuiltIn.qml | 7 ---- .../importVersionMissingInstalled.errors.txt | 1 - .../qmlparser/importVersionMissingInstalled.qml | 3 -- .../declarative/qmlparser/inlineQmlComponents.qml | 10 ------ .../declarative/qmlparser/interfaceProperty.qml | 5 --- .../auto/declarative/qmlparser/interfaceQList.qml | 7 ---- .../declarative/qmlparser/interfaceQmlList.qml | 7 ---- .../declarative/qmlparser/invalidID.2.errors.txt | 2 -- tests/auto/declarative/qmlparser/invalidID.2.qml | 5 --- .../declarative/qmlparser/invalidID.3.errors.txt | 1 - tests/auto/declarative/qmlparser/invalidID.3.qml | 5 --- .../declarative/qmlparser/invalidID.4.errors.txt | 1 - tests/auto/declarative/qmlparser/invalidID.4.qml | 6 ---- .../declarative/qmlparser/invalidID.5.errors.txt | 1 - tests/auto/declarative/qmlparser/invalidID.5.qml | 6 ---- .../declarative/qmlparser/invalidID.6.errors.txt | 1 - tests/auto/declarative/qmlparser/invalidID.6.qml | 5 --- .../declarative/qmlparser/invalidID.errors.txt | 1 - tests/auto/declarative/qmlparser/invalidID.qml | 4 --- .../lib/com/nokia/installedtest/InstalledTest.qml | 2 -- .../lib/com/nokia/installedtest/InstalledTest2.qml | 2 -- .../qmlparser/lib/com/nokia/installedtest/qmldir | 3 -- .../qmlparser/listAssignment.1.errors.txt | 1 - .../declarative/qmlparser/listAssignment.1.qml | 4 --- .../qmlparser/listAssignment.2.errors.txt | 2 -- .../declarative/qmlparser/listAssignment.2.qml | 4 --- .../qmlparser/listAssignment.3.errors.txt | 1 - .../declarative/qmlparser/listAssignment.3.qml | 6 ---- .../declarative/qmlparser/listItemDeleteSelf.qml | 38 ---------------------- .../declarative/qmlparser/missingObject.errors.txt | 1 - tests/auto/declarative/qmlparser/missingObject.qml | 1 - .../declarative/qmlparser/missingSignal.errors.txt | 1 - tests/auto/declarative/qmlparser/missingSignal.qml | 5 --- .../qmlparser/nonexistantProperty.1.errors.txt | 1 - .../qmlparser/nonexistantProperty.1.qml | 2 -- .../qmlparser/nonexistantProperty.2.errors.txt | 1 - .../qmlparser/nonexistantProperty.2.qml | 4 --- .../qmlparser/nonexistantProperty.3.errors.txt | 1 - .../qmlparser/nonexistantProperty.3.qml | 4 --- .../qmlparser/nonexistantProperty.4.errors.txt | 1 - .../qmlparser/nonexistantProperty.4.qml | 4 --- .../qmlparser/nonexistantProperty.5.errors.txt | 1 - .../qmlparser/nonexistantProperty.5.qml | 4 --- .../qmlparser/nonexistantProperty.6.errors.txt | 1 - .../qmlparser/nonexistantProperty.6.qml | 4 --- .../qmlparser/nullDotProperty.errors.txt | 1 - .../auto/declarative/qmlparser/nullDotProperty.qml | 4 --- .../declarative/qmlparser/propertyValueSource.qml | 4 --- .../declarative/qmlparser/readOnly.1.errors.txt | 1 - tests/auto/declarative/qmlparser/readOnly.1.qml | 4 --- .../declarative/qmlparser/readOnly.2.errors.txt | 1 - tests/auto/declarative/qmlparser/readOnly.2.qml | 4 --- .../declarative/qmlparser/rootAsQmlComponent.qml | 6 ---- .../auto/declarative/qmlparser/simpleBindings.qml | 18 ---------- .../auto/declarative/qmlparser/simpleContainer.qml | 5 --- tests/auto/declarative/qmlparser/simpleObject.qml | 2 -- tests/auto/declarative/qmlparser/subdir/Test.qml | 2 -- tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 6 ++-- .../qmlparser/unregisteredObject.errors.txt | 1 - .../declarative/qmlparser/unregisteredObject.qml | 2 -- .../qmlparser/unsupportedProperty.errors.txt | 1 - .../declarative/qmlparser/unsupportedProperty.qml | 4 --- tests/auto/declarative/qmlparser/valueTypes.qml | 13 -------- .../declarative/qmlparser/wrongType.1.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.1.qml | 4 --- .../declarative/qmlparser/wrongType.10.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.10.qml | 5 --- .../declarative/qmlparser/wrongType.11.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.11.qml | 5 --- .../declarative/qmlparser/wrongType.12.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.12.qml | 5 --- .../declarative/qmlparser/wrongType.13.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.13.qml | 4 --- .../declarative/qmlparser/wrongType.14.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.14.qml | 5 --- .../declarative/qmlparser/wrongType.2.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.2.qml | 4 --- .../declarative/qmlparser/wrongType.3.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.3.qml | 4 --- .../declarative/qmlparser/wrongType.4.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.4.qml | 4 --- .../declarative/qmlparser/wrongType.5.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.5.qml | 5 --- .../declarative/qmlparser/wrongType.6.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.6.qml | 5 --- .../declarative/qmlparser/wrongType.7.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.7.qml | 5 --- .../declarative/qmlparser/wrongType.8.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.8.qml | 5 --- .../declarative/qmlparser/wrongType.9.errors.txt | 1 - tests/auto/declarative/qmlparser/wrongType.9.qml | 5 --- 255 files changed, 525 insertions(+), 525 deletions(-) delete mode 100644 tests/auto/declarative/qmlparser/Alias.qml delete mode 100644 tests/auto/declarative/qmlparser/MyComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/MyContainerComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/alias.1.qml delete mode 100644 tests/auto/declarative/qmlparser/alias.2.qml delete mode 100644 tests/auto/declarative/qmlparser/alias.3.qml delete mode 100644 tests/auto/declarative/qmlparser/assignBasicTypes.qml delete mode 100644 tests/auto/declarative/qmlparser/assignLiteralSignalProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/assignObjectToSignal.qml delete mode 100644 tests/auto/declarative/qmlparser/assignObjectToVariant.qml delete mode 100644 tests/auto/declarative/qmlparser/assignQmlComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/assignSignal.qml delete mode 100644 tests/auto/declarative/qmlparser/assignTypeExtremes.qml delete mode 100644 tests/auto/declarative/qmlparser/attachedProperties.qml delete mode 100644 tests/auto/declarative/qmlparser/autoComponentCreation.qml delete mode 100644 tests/auto/declarative/qmlparser/cppnamespace.qml delete mode 100644 tests/auto/declarative/qmlparser/customParserIdNotAllowed.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/customParserIdNotAllowed.qml delete mode 100644 tests/auto/declarative/qmlparser/customParserTypes.qml delete mode 100644 tests/auto/declarative/qmlparser/customVariantTypes.qml create mode 100644 tests/auto/declarative/qmlparser/data/Alias.qml create mode 100644 tests/auto/declarative/qmlparser/data/MyComponent.qml create mode 100644 tests/auto/declarative/qmlparser/data/MyContainerComponent.qml create mode 100644 tests/auto/declarative/qmlparser/data/alias.1.qml create mode 100644 tests/auto/declarative/qmlparser/data/alias.2.qml create mode 100644 tests/auto/declarative/qmlparser/data/alias.3.qml create mode 100644 tests/auto/declarative/qmlparser/data/assignBasicTypes.qml create mode 100644 tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml create mode 100644 tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml create mode 100644 tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml create mode 100644 tests/auto/declarative/qmlparser/data/assignQmlComponent.qml create mode 100644 tests/auto/declarative/qmlparser/data/assignSignal.qml create mode 100644 tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml create mode 100644 tests/auto/declarative/qmlparser/data/attachedProperties.qml create mode 100644 tests/auto/declarative/qmlparser/data/autoComponentCreation.qml create mode 100644 tests/auto/declarative/qmlparser/data/cppnamespace.qml create mode 100644 tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml create mode 100644 tests/auto/declarative/qmlparser/data/customParserTypes.qml create mode 100644 tests/auto/declarative/qmlparser/data/customVariantTypes.qml create mode 100644 tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/duplicateIDs.qml create mode 100644 tests/auto/declarative/qmlparser/data/dynamicObject.1.qml create mode 100644 tests/auto/declarative/qmlparser/data/dynamicProperties.qml create mode 100644 tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml create mode 100644 tests/auto/declarative/qmlparser/data/empty.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/empty.qml create mode 100644 tests/auto/declarative/qmlparser/data/failingComponent.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/failingComponentTest.qml create mode 100644 tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/fakeDotProperty.qml create mode 100644 tests/auto/declarative/qmlparser/data/finalOverride.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/finalOverride.qml create mode 100644 tests/auto/declarative/qmlparser/data/idProperty.qml create mode 100644 tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml create mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml create mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml create mode 100644 tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml create mode 100644 tests/auto/declarative/qmlparser/data/interfaceProperty.qml create mode 100644 tests/auto/declarative/qmlparser/data/interfaceQList.qml create mode 100644 tests/auto/declarative/qmlparser/data/interfaceQmlList.qml create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.2.qml create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.3.qml create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.4.qml create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.5.qml create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.6.qml create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/invalidID.qml create mode 100644 tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml create mode 100644 tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml create mode 100644 tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir create mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.1.qml create mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.2.qml create mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.3.qml create mode 100644 tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml create mode 100644 tests/auto/declarative/qmlparser/data/missingObject.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/missingObject.qml create mode 100644 tests/auto/declarative/qmlparser/data/missingSignal.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/missingSignal.qml create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml create mode 100644 tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/nullDotProperty.qml create mode 100644 tests/auto/declarative/qmlparser/data/propertyValueSource.qml create mode 100644 tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/readOnly.1.qml create mode 100644 tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/readOnly.2.qml create mode 100644 tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml create mode 100644 tests/auto/declarative/qmlparser/data/simpleBindings.qml create mode 100644 tests/auto/declarative/qmlparser/data/simpleContainer.qml create mode 100644 tests/auto/declarative/qmlparser/data/simpleObject.qml create mode 100644 tests/auto/declarative/qmlparser/data/subdir/Test.qml create mode 100644 tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/unregisteredObject.qml create mode 100644 tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/unsupportedProperty.qml create mode 100644 tests/auto/declarative/qmlparser/data/valueTypes.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.1.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.10.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.11.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.12.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.13.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.14.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.2.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.3.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.4.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.5.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.6.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.7.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.8.qml create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt create mode 100644 tests/auto/declarative/qmlparser/data/wrongType.9.qml delete mode 100644 tests/auto/declarative/qmlparser/duplicateIDs.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/duplicateIDs.qml delete mode 100644 tests/auto/declarative/qmlparser/dynamicObject.1.qml delete mode 100644 tests/auto/declarative/qmlparser/dynamicProperties.qml delete mode 100644 tests/auto/declarative/qmlparser/dynamicSignalsAndSlots.qml delete mode 100644 tests/auto/declarative/qmlparser/empty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/empty.qml delete mode 100644 tests/auto/declarative/qmlparser/failingComponent.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/failingComponentTest.qml delete mode 100644 tests/auto/declarative/qmlparser/fakeDotProperty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/fakeDotProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/finalOverride.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/finalOverride.qml delete mode 100644 tests/auto/declarative/qmlparser/idProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/importNamespaceConflict.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/importNamespaceConflict.qml delete mode 100644 tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml delete mode 100644 tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml delete mode 100644 tests/auto/declarative/qmlparser/inlineQmlComponents.qml delete mode 100644 tests/auto/declarative/qmlparser/interfaceProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/interfaceQList.qml delete mode 100644 tests/auto/declarative/qmlparser/interfaceQmlList.qml delete mode 100644 tests/auto/declarative/qmlparser/invalidID.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/invalidID.2.qml delete mode 100644 tests/auto/declarative/qmlparser/invalidID.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/invalidID.3.qml delete mode 100644 tests/auto/declarative/qmlparser/invalidID.4.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/invalidID.4.qml delete mode 100644 tests/auto/declarative/qmlparser/invalidID.5.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/invalidID.5.qml delete mode 100644 tests/auto/declarative/qmlparser/invalidID.6.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/invalidID.6.qml delete mode 100644 tests/auto/declarative/qmlparser/invalidID.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/invalidID.qml delete mode 100644 tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml delete mode 100644 tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml delete mode 100644 tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir delete mode 100644 tests/auto/declarative/qmlparser/listAssignment.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/listAssignment.1.qml delete mode 100644 tests/auto/declarative/qmlparser/listAssignment.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/listAssignment.2.qml delete mode 100644 tests/auto/declarative/qmlparser/listAssignment.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/listAssignment.3.qml delete mode 100644 tests/auto/declarative/qmlparser/listItemDeleteSelf.qml delete mode 100644 tests/auto/declarative/qmlparser/missingObject.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/missingObject.qml delete mode 100644 tests/auto/declarative/qmlparser/missingSignal.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/missingSignal.qml delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.1.qml delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.2.qml delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.3.qml delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.4.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.4.qml delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.5.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.5.qml delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.6.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/nonexistantProperty.6.qml delete mode 100644 tests/auto/declarative/qmlparser/nullDotProperty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/nullDotProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/propertyValueSource.qml delete mode 100644 tests/auto/declarative/qmlparser/readOnly.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/readOnly.1.qml delete mode 100644 tests/auto/declarative/qmlparser/readOnly.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/readOnly.2.qml delete mode 100644 tests/auto/declarative/qmlparser/rootAsQmlComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/simpleBindings.qml delete mode 100644 tests/auto/declarative/qmlparser/simpleContainer.qml delete mode 100644 tests/auto/declarative/qmlparser/simpleObject.qml delete mode 100644 tests/auto/declarative/qmlparser/subdir/Test.qml delete mode 100644 tests/auto/declarative/qmlparser/unregisteredObject.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/unregisteredObject.qml delete mode 100644 tests/auto/declarative/qmlparser/unsupportedProperty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/unsupportedProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/valueTypes.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.1.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.10.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.10.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.11.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.11.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.12.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.12.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.13.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.13.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.14.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.14.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.2.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.3.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.4.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.4.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.5.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.5.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.6.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.6.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.7.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.7.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.8.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.8.qml delete mode 100644 tests/auto/declarative/qmlparser/wrongType.9.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/wrongType.9.qml diff --git a/tests/auto/declarative/qmlparser/Alias.qml b/tests/auto/declarative/qmlparser/Alias.qml deleted file mode 100644 index 8264e0d..0000000 --- a/tests/auto/declarative/qmlparser/Alias.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Qt 4.6 - -Object { - id: Root - property int value: 1892 - property alias aliasValue: Root.value -} - diff --git a/tests/auto/declarative/qmlparser/MyComponent.qml b/tests/auto/declarative/qmlparser/MyComponent.qml deleted file mode 100644 index 1a23277..0000000 --- a/tests/auto/declarative/qmlparser/MyComponent.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 - -MyQmlObject { - property real x; - property real y; -} diff --git a/tests/auto/declarative/qmlparser/MyContainerComponent.qml b/tests/auto/declarative/qmlparser/MyContainerComponent.qml deleted file mode 100644 index 61f54c5..0000000 --- a/tests/auto/declarative/qmlparser/MyContainerComponent.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 - -MyContainer { - property int x -} diff --git a/tests/auto/declarative/qmlparser/alias.1.qml b/tests/auto/declarative/qmlparser/alias.1.qml deleted file mode 100644 index 492d99a..0000000 --- a/tests/auto/declarative/qmlparser/alias.1.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 -import Qt 4.6 - -Object { - id: Root - property int value: 10 - property alias valueAlias: Root.value -} diff --git a/tests/auto/declarative/qmlparser/alias.2.qml b/tests/auto/declarative/qmlparser/alias.2.qml deleted file mode 100644 index aa4d103..0000000 --- a/tests/auto/declarative/qmlparser/alias.2.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 - -MyQmlObject { - id: Root - property alias aliasObject: Root.qmlobjectProperty - - qmlobjectProperty: MyQmlObject { value : 10 } -} diff --git a/tests/auto/declarative/qmlparser/alias.3.qml b/tests/auto/declarative/qmlparser/alias.3.qml deleted file mode 100644 index e25fbae..0000000 --- a/tests/auto/declarative/qmlparser/alias.3.qml +++ /dev/null @@ -1,10 +0,0 @@ -import Qt 4.6 - -Object { - property var other - other: Alias { id: MyAliasObject } - - property alias value: MyAliasObject.aliasValue - property alias value2: MyAliasObject.value -} - diff --git a/tests/auto/declarative/qmlparser/assignBasicTypes.qml b/tests/auto/declarative/qmlparser/assignBasicTypes.qml deleted file mode 100644 index cef9f8d..0000000 --- a/tests/auto/declarative/qmlparser/assignBasicTypes.qml +++ /dev/null @@ -1,26 +0,0 @@ -import Test 1.0 -MyTypeObject { - flagProperty: "FlagVal1 | FlagVal3" - enumProperty: "EnumVal2" - stringProperty: "Hello World!" - uintProperty: 10 - intProperty: -19 - realProperty: 23.2 - doubleProperty: -19.7 - colorProperty: "red" - dateProperty: "1982-11-25" - timeProperty: "11:11:31" - timeProperty: "11:11:32" - timeProperty: "11:11:32" - dateTimeProperty: "2009-05-12T13:22:01" - pointProperty: "99,13" - pointFProperty: "-10.1,12.3" - sizeProperty: "99x13" - sizeFProperty: "0.1x0.2" - rectProperty: "9,7,100x200" - rectFProperty: "1000.1,-10.9,400x90.99" - boolProperty: true - variantProperty: "Hello World!" - - objectProperty: MyTypeObject { intProperty: 8 } -} diff --git a/tests/auto/declarative/qmlparser/assignLiteralSignalProperty.qml b/tests/auto/declarative/qmlparser/assignLiteralSignalProperty.qml deleted file mode 100644 index 399fcea..0000000 --- a/tests/auto/declarative/qmlparser/assignLiteralSignalProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - onLiteralSignal: 10 -} diff --git a/tests/auto/declarative/qmlparser/assignObjectToSignal.qml b/tests/auto/declarative/qmlparser/assignObjectToSignal.qml deleted file mode 100644 index 789cc66..0000000 --- a/tests/auto/declarative/qmlparser/assignObjectToSignal.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - onBasicSignal: MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/assignObjectToVariant.qml b/tests/auto/declarative/qmlparser/assignObjectToVariant.qml deleted file mode 100644 index 28c68c4..0000000 --- a/tests/auto/declarative/qmlparser/assignObjectToVariant.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - property var a; - a: MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/assignQmlComponent.qml b/tests/auto/declarative/qmlparser/assignQmlComponent.qml deleted file mode 100644 index 20bdc55..0000000 --- a/tests/auto/declarative/qmlparser/assignQmlComponent.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - MyComponent { x: 10; y: 11; } -} diff --git a/tests/auto/declarative/qmlparser/assignSignal.qml b/tests/auto/declarative/qmlparser/assignSignal.qml deleted file mode 100644 index 3abc04d..0000000 --- a/tests/auto/declarative/qmlparser/assignSignal.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - onBasicSignal: basicSlot() - onBasicParameterizedSignal: basicSlot(parameter) -} diff --git a/tests/auto/declarative/qmlparser/assignTypeExtremes.qml b/tests/auto/declarative/qmlparser/assignTypeExtremes.qml deleted file mode 100644 index 60ede52..0000000 --- a/tests/auto/declarative/qmlparser/assignTypeExtremes.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - uintProperty: 4000000000 - intProperty: -2000000000 -} diff --git a/tests/auto/declarative/qmlparser/attachedProperties.qml b/tests/auto/declarative/qmlparser/attachedProperties.qml deleted file mode 100644 index 8343754..0000000 --- a/tests/auto/declarative/qmlparser/attachedProperties.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - MyQmlObject.value: 10 -} diff --git a/tests/auto/declarative/qmlparser/autoComponentCreation.qml b/tests/auto/declarative/qmlparser/autoComponentCreation.qml deleted file mode 100644 index 5d00144..0000000 --- a/tests/auto/declarative/qmlparser/autoComponentCreation.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyTypeObject { - componentProperty : MyTypeObject { realProperty: 9 } -} diff --git a/tests/auto/declarative/qmlparser/cppnamespace.qml b/tests/auto/declarative/qmlparser/cppnamespace.qml deleted file mode 100644 index e1daf3b..0000000 --- a/tests/auto/declarative/qmlparser/cppnamespace.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 - -MyNamespacedType { -} diff --git a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.errors.txt b/tests/auto/declarative/qmlparser/customParserIdNotAllowed.errors.txt deleted file mode 100644 index d28c0bd..0000000 --- a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:19:Cannot use reserved "id" property in ListModel diff --git a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.qml b/tests/auto/declarative/qmlparser/customParserIdNotAllowed.qml deleted file mode 100644 index e607768..0000000 --- a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt 4.6 -ListModel { - ListElement { a: 10 } - ListElement { id: Foo; a: 12 } -} diff --git a/tests/auto/declarative/qmlparser/customParserTypes.qml b/tests/auto/declarative/qmlparser/customParserTypes.qml deleted file mode 100644 index cf2f272..0000000 --- a/tests/auto/declarative/qmlparser/customParserTypes.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt 4.6 -ListModel { - ListElement { a: 10 } - ListElement { a: 12 } -} diff --git a/tests/auto/declarative/qmlparser/customVariantTypes.qml b/tests/auto/declarative/qmlparser/customVariantTypes.qml deleted file mode 100644 index 0263ed2..0000000 --- a/tests/auto/declarative/qmlparser/customVariantTypes.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - customType: "10" -} diff --git a/tests/auto/declarative/qmlparser/data/Alias.qml b/tests/auto/declarative/qmlparser/data/Alias.qml new file mode 100644 index 0000000..8264e0d --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/Alias.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Object { + id: Root + property int value: 1892 + property alias aliasValue: Root.value +} + diff --git a/tests/auto/declarative/qmlparser/data/MyComponent.qml b/tests/auto/declarative/qmlparser/data/MyComponent.qml new file mode 100644 index 0000000..1a23277 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/MyComponent.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyQmlObject { + property real x; + property real y; +} diff --git a/tests/auto/declarative/qmlparser/data/MyContainerComponent.qml b/tests/auto/declarative/qmlparser/data/MyContainerComponent.qml new file mode 100644 index 0000000..61f54c5 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/MyContainerComponent.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyContainer { + property int x +} diff --git a/tests/auto/declarative/qmlparser/data/alias.1.qml b/tests/auto/declarative/qmlparser/data/alias.1.qml new file mode 100644 index 0000000..492d99a --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/alias.1.qml @@ -0,0 +1,8 @@ +import Test 1.0 +import Qt 4.6 + +Object { + id: Root + property int value: 10 + property alias valueAlias: Root.value +} diff --git a/tests/auto/declarative/qmlparser/data/alias.2.qml b/tests/auto/declarative/qmlparser/data/alias.2.qml new file mode 100644 index 0000000..aa4d103 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/alias.2.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyQmlObject { + id: Root + property alias aliasObject: Root.qmlobjectProperty + + qmlobjectProperty: MyQmlObject { value : 10 } +} diff --git a/tests/auto/declarative/qmlparser/data/alias.3.qml b/tests/auto/declarative/qmlparser/data/alias.3.qml new file mode 100644 index 0000000..e25fbae --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/alias.3.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +Object { + property var other + other: Alias { id: MyAliasObject } + + property alias value: MyAliasObject.aliasValue + property alias value2: MyAliasObject.value +} + diff --git a/tests/auto/declarative/qmlparser/data/assignBasicTypes.qml b/tests/auto/declarative/qmlparser/data/assignBasicTypes.qml new file mode 100644 index 0000000..cef9f8d --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/assignBasicTypes.qml @@ -0,0 +1,26 @@ +import Test 1.0 +MyTypeObject { + flagProperty: "FlagVal1 | FlagVal3" + enumProperty: "EnumVal2" + stringProperty: "Hello World!" + uintProperty: 10 + intProperty: -19 + realProperty: 23.2 + doubleProperty: -19.7 + colorProperty: "red" + dateProperty: "1982-11-25" + timeProperty: "11:11:31" + timeProperty: "11:11:32" + timeProperty: "11:11:32" + dateTimeProperty: "2009-05-12T13:22:01" + pointProperty: "99,13" + pointFProperty: "-10.1,12.3" + sizeProperty: "99x13" + sizeFProperty: "0.1x0.2" + rectProperty: "9,7,100x200" + rectFProperty: "1000.1,-10.9,400x90.99" + boolProperty: true + variantProperty: "Hello World!" + + objectProperty: MyTypeObject { intProperty: 8 } +} diff --git a/tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml b/tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml new file mode 100644 index 0000000..399fcea --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + onLiteralSignal: 10 +} diff --git a/tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml b/tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml new file mode 100644 index 0000000..789cc66 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + onBasicSignal: MyQmlObject {} +} diff --git a/tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml b/tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml new file mode 100644 index 0000000..28c68c4 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml @@ -0,0 +1,6 @@ +import Test 1.0 +import Qt 4.6 +Object { + property var a; + a: MyQmlObject {} +} diff --git a/tests/auto/declarative/qmlparser/data/assignQmlComponent.qml b/tests/auto/declarative/qmlparser/data/assignQmlComponent.qml new file mode 100644 index 0000000..20bdc55 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/assignQmlComponent.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + MyComponent { x: 10; y: 11; } +} diff --git a/tests/auto/declarative/qmlparser/data/assignSignal.qml b/tests/auto/declarative/qmlparser/data/assignSignal.qml new file mode 100644 index 0000000..3abc04d --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/assignSignal.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + onBasicSignal: basicSlot() + onBasicParameterizedSignal: basicSlot(parameter) +} diff --git a/tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml b/tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml new file mode 100644 index 0000000..60ede52 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + uintProperty: 4000000000 + intProperty: -2000000000 +} diff --git a/tests/auto/declarative/qmlparser/data/attachedProperties.qml b/tests/auto/declarative/qmlparser/data/attachedProperties.qml new file mode 100644 index 0000000..8343754 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/attachedProperties.qml @@ -0,0 +1,5 @@ +import Test 1.0 +import Qt 4.6 +Object { + MyQmlObject.value: 10 +} diff --git a/tests/auto/declarative/qmlparser/data/autoComponentCreation.qml b/tests/auto/declarative/qmlparser/data/autoComponentCreation.qml new file mode 100644 index 0000000..5d00144 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/autoComponentCreation.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + componentProperty : MyTypeObject { realProperty: 9 } +} diff --git a/tests/auto/declarative/qmlparser/data/cppnamespace.qml b/tests/auto/declarative/qmlparser/data/cppnamespace.qml new file mode 100644 index 0000000..e1daf3b --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/cppnamespace.qml @@ -0,0 +1,4 @@ +import Test 1.0 + +MyNamespacedType { +} diff --git a/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt b/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt new file mode 100644 index 0000000..d28c0bd --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt @@ -0,0 +1 @@ +4:19:Cannot use reserved "id" property in ListModel diff --git a/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml b/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml new file mode 100644 index 0000000..e607768 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml @@ -0,0 +1,5 @@ +import Qt 4.6 +ListModel { + ListElement { a: 10 } + ListElement { id: Foo; a: 12 } +} diff --git a/tests/auto/declarative/qmlparser/data/customParserTypes.qml b/tests/auto/declarative/qmlparser/data/customParserTypes.qml new file mode 100644 index 0000000..cf2f272 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/customParserTypes.qml @@ -0,0 +1,5 @@ +import Qt 4.6 +ListModel { + ListElement { a: 10 } + ListElement { a: 12 } +} diff --git a/tests/auto/declarative/qmlparser/data/customVariantTypes.qml b/tests/auto/declarative/qmlparser/data/customVariantTypes.qml new file mode 100644 index 0000000..0263ed2 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/customVariantTypes.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + customType: "10" +} diff --git a/tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt b/tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt new file mode 100644 index 0000000..66241cf --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt @@ -0,0 +1 @@ +4:19:id is not unique diff --git a/tests/auto/declarative/qmlparser/data/duplicateIDs.qml b/tests/auto/declarative/qmlparser/data/duplicateIDs.qml new file mode 100644 index 0000000..9605b5b --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/duplicateIDs.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyContainer { + MyQmlObject { id: MyID } + MyQmlObject { id: MyID } +} + diff --git a/tests/auto/declarative/qmlparser/data/dynamicObject.1.qml b/tests/auto/declarative/qmlparser/data/dynamicObject.1.qml new file mode 100644 index 0000000..85d1052 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/dynamicObject.1.qml @@ -0,0 +1,8 @@ +import Test 1.0 +import Qt 4.6 +PropertyChanges { + propa: a + 10 + propb: Math.min(a, 10) + propc: MyPropertyValueSource {} + onPropA: a +} diff --git a/tests/auto/declarative/qmlparser/data/dynamicProperties.qml b/tests/auto/declarative/qmlparser/data/dynamicProperties.qml new file mode 100644 index 0000000..f93e446 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/dynamicProperties.qml @@ -0,0 +1,13 @@ +import Test 1.0 +import Qt 4.6 +Object { + default property int intProperty : 10 + property bool boolProperty: false + property double doubleProperty: -10.1 + property real realProperty: -19.9 + property string stringProperty: "Hello World!" + property color colorProperty: "red" + property date dateProperty: "1945-09-02" + property var varProperty: "Hello World!" + property variant variantProperty: 12 +} diff --git a/tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml new file mode 100644 index 0000000..b0ca970 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml @@ -0,0 +1,7 @@ +import Qt 4.6 +Object { + signal signal1 + function slot1() {} + signal signal2 + function slot2() {} +} diff --git a/tests/auto/declarative/qmlparser/data/empty.errors.txt b/tests/auto/declarative/qmlparser/data/empty.errors.txt new file mode 100644 index 0000000..d416e76 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/empty.errors.txt @@ -0,0 +1,2 @@ +0:0:Expected token `numeric literal' +0:0:Expected a qualified name id diff --git a/tests/auto/declarative/qmlparser/data/empty.qml b/tests/auto/declarative/qmlparser/data/empty.qml new file mode 100644 index 0000000..e69de29 diff --git a/tests/auto/declarative/qmlparser/data/failingComponent.errors.txt b/tests/auto/declarative/qmlparser/data/failingComponent.errors.txt new file mode 100644 index 0000000..0cf0ef3 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/failingComponent.errors.txt @@ -0,0 +1 @@ +3:5:Type FailingComponent unavailable diff --git a/tests/auto/declarative/qmlparser/data/failingComponentTest.qml b/tests/auto/declarative/qmlparser/data/failingComponentTest.qml new file mode 100644 index 0000000..74a6acf --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/failingComponentTest.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + FailingComponent {} +} diff --git a/tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt b/tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt new file mode 100644 index 0000000..e56ad3a --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt @@ -0,0 +1 @@ +3:5:Invalid property access diff --git a/tests/auto/declarative/qmlparser/data/fakeDotProperty.qml b/tests/auto/declarative/qmlparser/data/fakeDotProperty.qml new file mode 100644 index 0000000..d971eee --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/fakeDotProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + value.something: "hello" +} diff --git a/tests/auto/declarative/qmlparser/data/finalOverride.errors.txt b/tests/auto/declarative/qmlparser/data/finalOverride.errors.txt new file mode 100644 index 0000000..49e06cb --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/finalOverride.errors.txt @@ -0,0 +1 @@ +3:5:Cannot override FINAL property diff --git a/tests/auto/declarative/qmlparser/data/finalOverride.qml b/tests/auto/declarative/qmlparser/data/finalOverride.qml new file mode 100644 index 0000000..a84393a --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/finalOverride.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + property int value: 10 +} diff --git a/tests/auto/declarative/qmlparser/data/idProperty.qml b/tests/auto/declarative/qmlparser/data/idProperty.qml new file mode 100644 index 0000000..a413c0b --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/idProperty.qml @@ -0,0 +1,8 @@ +import Test 1.0 +MyContainer { + property var object : MyObjectId + + MyTypeObject { + id: "MyObjectId" + } +} diff --git a/tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt b/tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt new file mode 100644 index 0000000..231998d --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt @@ -0,0 +1 @@ +4:1:Namespace Rectangle cannot be used as a type diff --git a/tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml b/tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml new file mode 100644 index 0000000..cd112af --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml @@ -0,0 +1,4 @@ +import Test 1.0 as Rectangle +import Qt 4.6 + +Rectangle { } diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt new file mode 100644 index 0000000..2235cbc --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt @@ -0,0 +1 @@ +SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml b/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml new file mode 100644 index 0000000..23ed566 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml @@ -0,0 +1,7 @@ +import Test as S + +S.MyQmlObject { + property real x; + property real y; +} + diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt new file mode 100644 index 0000000..2235cbc --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt @@ -0,0 +1 @@ +SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml b/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml new file mode 100644 index 0000000..97ec222 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml @@ -0,0 +1,3 @@ +import com.nokia.installedtest as T + +T.InstalledTest {} diff --git a/tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml b/tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml new file mode 100644 index 0000000..79ceda6 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml @@ -0,0 +1,10 @@ +import Test 1.0 +import Qt 4.6 +MyContainer { + Component { + id: MyComponent + MyQmlObject { + value: 11 + } + } +} diff --git a/tests/auto/declarative/qmlparser/data/interfaceProperty.qml b/tests/auto/declarative/qmlparser/data/interfaceProperty.qml new file mode 100644 index 0000000..70879ff --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/interfaceProperty.qml @@ -0,0 +1,5 @@ +import Test 1.0 +import Qt 4.6 +MyQmlObject { + interfaceProperty: MyQmlObject {} +} diff --git a/tests/auto/declarative/qmlparser/data/interfaceQList.qml b/tests/auto/declarative/qmlparser/data/interfaceQList.qml new file mode 100644 index 0000000..c87dfae --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/interfaceQList.qml @@ -0,0 +1,7 @@ +import Test 1.0 +MyContainer { + qlistInterfaces: [ + MyQmlObject {}, + MyQmlObject {} + ] +} diff --git a/tests/auto/declarative/qmlparser/data/interfaceQmlList.qml b/tests/auto/declarative/qmlparser/data/interfaceQmlList.qml new file mode 100644 index 0000000..8392bea --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/interfaceQmlList.qml @@ -0,0 +1,7 @@ +import Test 1.0 +MyContainer { + qmllistInterfaces: [ + MyQmlObject {}, + MyQmlObject {} + ] +} diff --git a/tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt new file mode 100644 index 0000000..56e3eeb --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt @@ -0,0 +1,2 @@ +3:5:"" is not a valid object id + diff --git a/tests/auto/declarative/qmlparser/data/invalidID.2.qml b/tests/auto/declarative/qmlparser/data/invalidID.2.qml new file mode 100644 index 0000000..4fb3b29 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.2.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + id: "" +} + diff --git a/tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt new file mode 100644 index 0000000..bb811cf --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt @@ -0,0 +1 @@ +3:5:Invalid use of id property diff --git a/tests/auto/declarative/qmlparser/data/invalidID.3.qml b/tests/auto/declarative/qmlparser/data/invalidID.3.qml new file mode 100644 index 0000000..6684172 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.3.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + id.other: 10 +} + diff --git a/tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt new file mode 100644 index 0000000..cfe8756 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt @@ -0,0 +1 @@ +4:5:Invalid use of id property diff --git a/tests/auto/declarative/qmlparser/data/invalidID.4.qml b/tests/auto/declarative/qmlparser/data/invalidID.4.qml new file mode 100644 index 0000000..1f15fce --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.4.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyQmlObject { + id: Hello + id: World +} + diff --git a/tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt new file mode 100644 index 0000000..b0a63a0 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt @@ -0,0 +1 @@ +4:9:id conflicts with namespace prefix diff --git a/tests/auto/declarative/qmlparser/data/invalidID.5.qml b/tests/auto/declarative/qmlparser/data/invalidID.5.qml new file mode 100644 index 0000000..0545b0d --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.5.qml @@ -0,0 +1,6 @@ +import Test 1.0 +import Test 1.0 as Hello +MyQmlObject { + id: Hello +} + diff --git a/tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt new file mode 100644 index 0000000..861e3d7 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt @@ -0,0 +1 @@ +3:9:id conflicts with type name diff --git a/tests/auto/declarative/qmlparser/data/invalidID.6.qml b/tests/auto/declarative/qmlparser/data/invalidID.6.qml new file mode 100644 index 0000000..ea34007 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.6.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + id: MyQmlObject +} + diff --git a/tests/auto/declarative/qmlparser/data/invalidID.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.errors.txt new file mode 100644 index 0000000..1ca678c --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.errors.txt @@ -0,0 +1 @@ +3:5:"1" is not a valid object id diff --git a/tests/auto/declarative/qmlparser/data/invalidID.qml b/tests/auto/declarative/qmlparser/data/invalidID.qml new file mode 100644 index 0000000..04db3eb --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/invalidID.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + id: 1 +} diff --git a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml new file mode 100644 index 0000000..d8a22a8 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Rectangle {} diff --git a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml new file mode 100644 index 0000000..a0706ad --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Text {} diff --git a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir new file mode 100644 index 0000000..ba0b42a --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir @@ -0,0 +1,3 @@ +InstalledTest 1.0-3 InstalledTest.qml +InstalledTest 1.4 InstalledTest2.qml +Rectangle 1.5 InstalledTest2.qml diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt b/tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt new file mode 100644 index 0000000..d68d487 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt @@ -0,0 +1 @@ +3:24:Cannot assign primitives to lists diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.1.qml b/tests/auto/declarative/qmlparser/data/listAssignment.1.qml new file mode 100644 index 0000000..4240425 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/listAssignment.1.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + qmllistInterfaces: 1 +} diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt b/tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt new file mode 100644 index 0000000..8b40aa3 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt @@ -0,0 +1,2 @@ +3:15:Cannot assign primitives to lists + diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.2.qml b/tests/auto/declarative/qmlparser/data/listAssignment.2.qml new file mode 100644 index 0000000..e3baadb --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/listAssignment.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + children: 2 +} diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt b/tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt new file mode 100644 index 0000000..8c7b7e9 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt @@ -0,0 +1 @@ +4:15:Can only assign one binding to lists diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.3.qml b/tests/auto/declarative/qmlparser/data/listAssignment.3.qml new file mode 100644 index 0000000..00c4c6b --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/listAssignment.3.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyContainer { + children: childBinding.expression + children: childBinding2.expression +} + diff --git a/tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml b/tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml new file mode 100644 index 0000000..fa2e831 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml @@ -0,0 +1,38 @@ +import Qt 4.6 + +Item { + ListModel { + id: FruitModel + ListElement { + name: "Apple" + cost: 2.45 + } + ListElement { + name: "Orange" + cost: 3.25 + } + ListElement { + name: "Banana" + cost: 1.95 + } + } + + Component { + id: FruitDelegate + Item { + width: 200; height: 50 + Text { text: name } + Text { text: '$'+cost; anchors.right: parent.right } + MouseRegion { + anchors.fill: parent + onClicked: FruitModel.remove(index) + } + } + } + + ListView { + model: FruitModel + delegate: FruitDelegate + anchors.fill: parent + } +} diff --git a/tests/auto/declarative/qmlparser/data/missingObject.errors.txt b/tests/auto/declarative/qmlparser/data/missingObject.errors.txt new file mode 100644 index 0000000..b31b562 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/missingObject.errors.txt @@ -0,0 +1 @@ +1:10:Expected token `{' diff --git a/tests/auto/declarative/qmlparser/data/missingObject.qml b/tests/auto/declarative/qmlparser/data/missingObject.qml new file mode 100644 index 0000000..2f17045 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/missingObject.qml @@ -0,0 +1 @@ +something: 24 diff --git a/tests/auto/declarative/qmlparser/data/missingSignal.errors.txt b/tests/auto/declarative/qmlparser/data/missingSignal.errors.txt new file mode 100644 index 0000000..e243ae5 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/missingSignal.errors.txt @@ -0,0 +1 @@ +4:5:Cannot assign to non-existant property "onClicked" diff --git a/tests/auto/declarative/qmlparser/data/missingSignal.qml b/tests/auto/declarative/qmlparser/data/missingSignal.qml new file mode 100644 index 0000000..fd489ca --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/missingSignal.qml @@ -0,0 +1,5 @@ +import Test 1.0 +import Qt 4.6 +Object { + onClicked: print("Hello world!") +} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt new file mode 100644 index 0000000..cfc6fc8 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt @@ -0,0 +1 @@ +2:15:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml new file mode 100644 index 0000000..df7406c --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml @@ -0,0 +1,2 @@ +import Test 1.0 +MyQmlObject { something: 24 } diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt new file mode 100644 index 0000000..8b13585 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml new file mode 100644 index 0000000..06ccd37 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + something: 24 +} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt new file mode 100644 index 0000000..8b13585 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml new file mode 100644 index 0000000..5b08608 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + something: 1 + 1 +} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt new file mode 100644 index 0000000..8b13585 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml new file mode 100644 index 0000000..6579191 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + something: ; +} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt new file mode 100644 index 0000000..c07f2b9 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt @@ -0,0 +1 @@ +3:5:Expected a qualified name id diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml new file mode 100644 index 0000000..37af057 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + 24 +} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt new file mode 100644 index 0000000..c02d7bd --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant default property diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml new file mode 100644 index 0000000..5cd55d0 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + MyQmlObject {} +} diff --git a/tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt b/tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt new file mode 100644 index 0000000..07a4094 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt @@ -0,0 +1 @@ +3:-1:Cannot set properties on obj as it is null diff --git a/tests/auto/declarative/qmlparser/data/nullDotProperty.qml b/tests/auto/declarative/qmlparser/data/nullDotProperty.qml new file mode 100644 index 0000000..4e36779 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/nullDotProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyDotPropertyObject { + obj.value: 1 +} diff --git a/tests/auto/declarative/qmlparser/data/propertyValueSource.qml b/tests/auto/declarative/qmlparser/data/propertyValueSource.qml new file mode 100644 index 0000000..ad71fcf --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/propertyValueSource.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + intProperty : MyPropertyValueSource {} +} diff --git a/tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt b/tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt new file mode 100644 index 0000000..b8c3404 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt @@ -0,0 +1 @@ +3:21:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmlparser/data/readOnly.1.qml b/tests/auto/declarative/qmlparser/data/readOnly.1.qml new file mode 100644 index 0000000..60757bd --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/readOnly.1.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + readOnlyString: "Hello World" +} diff --git a/tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt b/tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt new file mode 100644 index 0000000..d857a04 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt @@ -0,0 +1 @@ +3:5:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmlparser/data/readOnly.2.qml b/tests/auto/declarative/qmlparser/data/readOnly.2.qml new file mode 100644 index 0000000..8f1633c --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/readOnly.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + readOnlyString: "Hello" + "World" +} diff --git a/tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml b/tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml new file mode 100644 index 0000000..8d72cd3 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyContainerComponent { + x: 11 + MyQmlObject {} + MyQmlObject {} +} diff --git a/tests/auto/declarative/qmlparser/data/simpleBindings.qml b/tests/auto/declarative/qmlparser/data/simpleBindings.qml new file mode 100644 index 0000000..74867b3 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/simpleBindings.qml @@ -0,0 +1,18 @@ +import Test 1.0 +MyTypeObject { + id: Me + property int v1: 10 + property int v2: 11 + + property int value1 + property int value2 + property int value3 + property int value4 + + value1: v1 + value2: Me.v1 + value3: v1 + v2 + value4: Math.min(v1, v2) + + objectProperty: Me +} diff --git a/tests/auto/declarative/qmlparser/data/simpleContainer.qml b/tests/auto/declarative/qmlparser/data/simpleContainer.qml new file mode 100644 index 0000000..c3a795f --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/simpleContainer.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyContainer { + MyQmlObject {} + MyQmlObject {} +} diff --git a/tests/auto/declarative/qmlparser/data/simpleObject.qml b/tests/auto/declarative/qmlparser/data/simpleObject.qml new file mode 100644 index 0000000..30c7823 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/simpleObject.qml @@ -0,0 +1,2 @@ +import Test 1.0 +MyQmlObject {} diff --git a/tests/auto/declarative/qmlparser/data/subdir/Test.qml b/tests/auto/declarative/qmlparser/data/subdir/Test.qml new file mode 100644 index 0000000..c4d5905 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/subdir/Test.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Rectangle { } diff --git a/tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt b/tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt new file mode 100644 index 0000000..bc4f7f4 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt @@ -0,0 +1 @@ +2:1:Type UnregisteredObject unavailable diff --git a/tests/auto/declarative/qmlparser/data/unregisteredObject.qml b/tests/auto/declarative/qmlparser/data/unregisteredObject.qml new file mode 100644 index 0000000..9498e31 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/unregisteredObject.qml @@ -0,0 +1,2 @@ +import Test 1.0 +UnregisteredObject {} diff --git a/tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt b/tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt new file mode 100644 index 0000000..3a90a7d --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt @@ -0,0 +1 @@ +3:13:Invalid property assignment: unknown type QVariant::QMatrix diff --git a/tests/auto/declarative/qmlparser/data/unsupportedProperty.qml b/tests/auto/declarative/qmlparser/data/unsupportedProperty.qml new file mode 100644 index 0000000..9f19680 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/unsupportedProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + matrix: "1,0,0,0,1,0,0,0,1" +} diff --git a/tests/auto/declarative/qmlparser/data/valueTypes.qml b/tests/auto/declarative/qmlparser/data/valueTypes.qml new file mode 100644 index 0000000..bf325a7 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/valueTypes.qml @@ -0,0 +1,13 @@ +import Test 1.0 +MyTypeObject { + rectProperty.x: 10 + rectProperty.y: 11 + rectProperty.width: rectProperty.x + 2 + rectProperty.height: 13 + + intProperty: rectProperty.x + + onAction: { var a = rectProperty; a.x = 12; } + + rectProperty2: rectProperty +} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt new file mode 100644 index 0000000..ba7a076 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt @@ -0,0 +1 @@ +3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.1.qml b/tests/auto/declarative/qmlparser/data/wrongType.1.qml new file mode 100644 index 0000000..289d37f --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.1.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + value: "hello" +} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt new file mode 100644 index 0000000..ae75b52 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt @@ -0,0 +1 @@ +3:23:Invalid property assignment: datetime expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.10.qml b/tests/auto/declarative/qmlparser/data/wrongType.10.qml new file mode 100644 index 0000000..2cf0e50 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.10.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + dateTimeProperty: 12 +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt new file mode 100644 index 0000000..23a4cda --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt @@ -0,0 +1 @@ +3:20:Invalid property assignment: point expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.11.qml b/tests/auto/declarative/qmlparser/data/wrongType.11.qml new file mode 100644 index 0000000..ae77ba1 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.11.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + pointProperty: "apples" +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt new file mode 100644 index 0000000..3092100 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: size expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.12.qml b/tests/auto/declarative/qmlparser/data/wrongType.12.qml new file mode 100644 index 0000000..b7a366f --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.12.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + sizeProperty: "red" +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt new file mode 100644 index 0000000..ba7a076 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt @@ -0,0 +1 @@ +3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.13.qml b/tests/auto/declarative/qmlparser/data/wrongType.13.qml new file mode 100644 index 0000000..477aff1 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.13.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + value: "12" +} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt new file mode 100644 index 0000000..d621fdd --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt @@ -0,0 +1 @@ +3:21:Invalid property assignment: string expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.14.qml b/tests/auto/declarative/qmlparser/data/wrongType.14.qml new file mode 100644 index 0000000..672d693 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.14.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + stringProperty: 10 +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt new file mode 100644 index 0000000..9ff9f25 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt @@ -0,0 +1 @@ +3:14:Invalid property assignment: boolean expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.2.qml b/tests/auto/declarative/qmlparser/data/wrongType.2.qml new file mode 100644 index 0000000..34b74f7 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + enabled: 5 +} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt new file mode 100644 index 0000000..6d971c6 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt @@ -0,0 +1 @@ +3:11:Invalid property assignment: rect expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.3.qml b/tests/auto/declarative/qmlparser/data/wrongType.3.qml new file mode 100644 index 0000000..384181a --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.3.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + rect: "5,5x10" +} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt new file mode 100644 index 0000000..ef34d0e --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: unknown enumeration diff --git a/tests/auto/declarative/qmlparser/data/wrongType.4.qml b/tests/auto/declarative/qmlparser/data/wrongType.4.qml new file mode 100644 index 0000000..0787bf5 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.4.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + enumProperty: "InvalidEnumName" +} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt new file mode 100644 index 0000000..cab10bd --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: unsigned int expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.5.qml b/tests/auto/declarative/qmlparser/data/wrongType.5.qml new file mode 100644 index 0000000..c50ae9a --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.5.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + uintProperty: -13 +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt new file mode 100644 index 0000000..d0a0b00 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: double expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.6.qml b/tests/auto/declarative/qmlparser/data/wrongType.6.qml new file mode 100644 index 0000000..da10b78 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.6.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + realProperty: "Hello" +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt new file mode 100644 index 0000000..614346b --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt @@ -0,0 +1 @@ +3:20:Invalid property assignment: color expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.7.qml b/tests/auto/declarative/qmlparser/data/wrongType.7.qml new file mode 100644 index 0000000..ddc3835 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.7.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + colorProperty: 12 +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt new file mode 100644 index 0000000..1773c00 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: date expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.8.qml b/tests/auto/declarative/qmlparser/data/wrongType.8.qml new file mode 100644 index 0000000..a5f6756 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.8.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + dateProperty: 12 +} + diff --git a/tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt new file mode 100644 index 0000000..8630975 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: time expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.9.qml b/tests/auto/declarative/qmlparser/data/wrongType.9.qml new file mode 100644 index 0000000..a3db732 --- /dev/null +++ b/tests/auto/declarative/qmlparser/data/wrongType.9.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + timeProperty: 12 +} + diff --git a/tests/auto/declarative/qmlparser/duplicateIDs.errors.txt b/tests/auto/declarative/qmlparser/duplicateIDs.errors.txt deleted file mode 100644 index 66241cf..0000000 --- a/tests/auto/declarative/qmlparser/duplicateIDs.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:19:id is not unique diff --git a/tests/auto/declarative/qmlparser/duplicateIDs.qml b/tests/auto/declarative/qmlparser/duplicateIDs.qml deleted file mode 100644 index 9605b5b..0000000 --- a/tests/auto/declarative/qmlparser/duplicateIDs.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyContainer { - MyQmlObject { id: MyID } - MyQmlObject { id: MyID } -} - diff --git a/tests/auto/declarative/qmlparser/dynamicObject.1.qml b/tests/auto/declarative/qmlparser/dynamicObject.1.qml deleted file mode 100644 index 85d1052..0000000 --- a/tests/auto/declarative/qmlparser/dynamicObject.1.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 -import Qt 4.6 -PropertyChanges { - propa: a + 10 - propb: Math.min(a, 10) - propc: MyPropertyValueSource {} - onPropA: a -} diff --git a/tests/auto/declarative/qmlparser/dynamicProperties.qml b/tests/auto/declarative/qmlparser/dynamicProperties.qml deleted file mode 100644 index f93e446..0000000 --- a/tests/auto/declarative/qmlparser/dynamicProperties.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - default property int intProperty : 10 - property bool boolProperty: false - property double doubleProperty: -10.1 - property real realProperty: -19.9 - property string stringProperty: "Hello World!" - property color colorProperty: "red" - property date dateProperty: "1945-09-02" - property var varProperty: "Hello World!" - property variant variantProperty: 12 -} diff --git a/tests/auto/declarative/qmlparser/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qmlparser/dynamicSignalsAndSlots.qml deleted file mode 100644 index b0ca970..0000000 --- a/tests/auto/declarative/qmlparser/dynamicSignalsAndSlots.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Qt 4.6 -Object { - signal signal1 - function slot1() {} - signal signal2 - function slot2() {} -} diff --git a/tests/auto/declarative/qmlparser/empty.errors.txt b/tests/auto/declarative/qmlparser/empty.errors.txt deleted file mode 100644 index d416e76..0000000 --- a/tests/auto/declarative/qmlparser/empty.errors.txt +++ /dev/null @@ -1,2 +0,0 @@ -0:0:Expected token `numeric literal' -0:0:Expected a qualified name id diff --git a/tests/auto/declarative/qmlparser/empty.qml b/tests/auto/declarative/qmlparser/empty.qml deleted file mode 100644 index e69de29..0000000 diff --git a/tests/auto/declarative/qmlparser/failingComponent.errors.txt b/tests/auto/declarative/qmlparser/failingComponent.errors.txt deleted file mode 100644 index 0cf0ef3..0000000 --- a/tests/auto/declarative/qmlparser/failingComponent.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Type FailingComponent unavailable diff --git a/tests/auto/declarative/qmlparser/failingComponentTest.qml b/tests/auto/declarative/qmlparser/failingComponentTest.qml deleted file mode 100644 index 74a6acf..0000000 --- a/tests/auto/declarative/qmlparser/failingComponentTest.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - FailingComponent {} -} diff --git a/tests/auto/declarative/qmlparser/fakeDotProperty.errors.txt b/tests/auto/declarative/qmlparser/fakeDotProperty.errors.txt deleted file mode 100644 index e56ad3a..0000000 --- a/tests/auto/declarative/qmlparser/fakeDotProperty.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Invalid property access diff --git a/tests/auto/declarative/qmlparser/fakeDotProperty.qml b/tests/auto/declarative/qmlparser/fakeDotProperty.qml deleted file mode 100644 index d971eee..0000000 --- a/tests/auto/declarative/qmlparser/fakeDotProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - value.something: "hello" -} diff --git a/tests/auto/declarative/qmlparser/finalOverride.errors.txt b/tests/auto/declarative/qmlparser/finalOverride.errors.txt deleted file mode 100644 index 49e06cb..0000000 --- a/tests/auto/declarative/qmlparser/finalOverride.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot override FINAL property diff --git a/tests/auto/declarative/qmlparser/finalOverride.qml b/tests/auto/declarative/qmlparser/finalOverride.qml deleted file mode 100644 index a84393a..0000000 --- a/tests/auto/declarative/qmlparser/finalOverride.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - property int value: 10 -} diff --git a/tests/auto/declarative/qmlparser/idProperty.qml b/tests/auto/declarative/qmlparser/idProperty.qml deleted file mode 100644 index a413c0b..0000000 --- a/tests/auto/declarative/qmlparser/idProperty.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 -MyContainer { - property var object : MyObjectId - - MyTypeObject { - id: "MyObjectId" - } -} diff --git a/tests/auto/declarative/qmlparser/importNamespaceConflict.errors.txt b/tests/auto/declarative/qmlparser/importNamespaceConflict.errors.txt deleted file mode 100644 index 231998d..0000000 --- a/tests/auto/declarative/qmlparser/importNamespaceConflict.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:1:Namespace Rectangle cannot be used as a type diff --git a/tests/auto/declarative/qmlparser/importNamespaceConflict.qml b/tests/auto/declarative/qmlparser/importNamespaceConflict.qml deleted file mode 100644 index cd112af..0000000 --- a/tests/auto/declarative/qmlparser/importNamespaceConflict.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 as Rectangle -import Qt 4.6 - -Rectangle { } diff --git a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt deleted file mode 100644 index 2235cbc..0000000 --- a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt +++ /dev/null @@ -1 +0,0 @@ -SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml b/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml deleted file mode 100644 index 23ed566..0000000 --- a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Test as S - -S.MyQmlObject { - property real x; - property real y; -} - diff --git a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt deleted file mode 100644 index 2235cbc..0000000 --- a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt +++ /dev/null @@ -1 +0,0 @@ -SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml b/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml deleted file mode 100644 index 97ec222..0000000 --- a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml +++ /dev/null @@ -1,3 +0,0 @@ -import com.nokia.installedtest as T - -T.InstalledTest {} diff --git a/tests/auto/declarative/qmlparser/inlineQmlComponents.qml b/tests/auto/declarative/qmlparser/inlineQmlComponents.qml deleted file mode 100644 index 79ceda6..0000000 --- a/tests/auto/declarative/qmlparser/inlineQmlComponents.qml +++ /dev/null @@ -1,10 +0,0 @@ -import Test 1.0 -import Qt 4.6 -MyContainer { - Component { - id: MyComponent - MyQmlObject { - value: 11 - } - } -} diff --git a/tests/auto/declarative/qmlparser/interfaceProperty.qml b/tests/auto/declarative/qmlparser/interfaceProperty.qml deleted file mode 100644 index 70879ff..0000000 --- a/tests/auto/declarative/qmlparser/interfaceProperty.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -import Qt 4.6 -MyQmlObject { - interfaceProperty: MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/interfaceQList.qml b/tests/auto/declarative/qmlparser/interfaceQList.qml deleted file mode 100644 index c87dfae..0000000 --- a/tests/auto/declarative/qmlparser/interfaceQList.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Test 1.0 -MyContainer { - qlistInterfaces: [ - MyQmlObject {}, - MyQmlObject {} - ] -} diff --git a/tests/auto/declarative/qmlparser/interfaceQmlList.qml b/tests/auto/declarative/qmlparser/interfaceQmlList.qml deleted file mode 100644 index 8392bea..0000000 --- a/tests/auto/declarative/qmlparser/interfaceQmlList.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Test 1.0 -MyContainer { - qmllistInterfaces: [ - MyQmlObject {}, - MyQmlObject {} - ] -} diff --git a/tests/auto/declarative/qmlparser/invalidID.2.errors.txt b/tests/auto/declarative/qmlparser/invalidID.2.errors.txt deleted file mode 100644 index 56e3eeb..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.2.errors.txt +++ /dev/null @@ -1,2 +0,0 @@ -3:5:"" is not a valid object id - diff --git a/tests/auto/declarative/qmlparser/invalidID.2.qml b/tests/auto/declarative/qmlparser/invalidID.2.qml deleted file mode 100644 index 4fb3b29..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.2.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: "" -} - diff --git a/tests/auto/declarative/qmlparser/invalidID.3.errors.txt b/tests/auto/declarative/qmlparser/invalidID.3.errors.txt deleted file mode 100644 index bb811cf..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Invalid use of id property diff --git a/tests/auto/declarative/qmlparser/invalidID.3.qml b/tests/auto/declarative/qmlparser/invalidID.3.qml deleted file mode 100644 index 6684172..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.3.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - id.other: 10 -} - diff --git a/tests/auto/declarative/qmlparser/invalidID.4.errors.txt b/tests/auto/declarative/qmlparser/invalidID.4.errors.txt deleted file mode 100644 index cfe8756..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.4.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:5:Invalid use of id property diff --git a/tests/auto/declarative/qmlparser/invalidID.4.qml b/tests/auto/declarative/qmlparser/invalidID.4.qml deleted file mode 100644 index 1f15fce..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.4.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: Hello - id: World -} - diff --git a/tests/auto/declarative/qmlparser/invalidID.5.errors.txt b/tests/auto/declarative/qmlparser/invalidID.5.errors.txt deleted file mode 100644 index b0a63a0..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.5.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:9:id conflicts with namespace prefix diff --git a/tests/auto/declarative/qmlparser/invalidID.5.qml b/tests/auto/declarative/qmlparser/invalidID.5.qml deleted file mode 100644 index 0545b0d..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.5.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -import Test 1.0 as Hello -MyQmlObject { - id: Hello -} - diff --git a/tests/auto/declarative/qmlparser/invalidID.6.errors.txt b/tests/auto/declarative/qmlparser/invalidID.6.errors.txt deleted file mode 100644 index 861e3d7..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.6.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:9:id conflicts with type name diff --git a/tests/auto/declarative/qmlparser/invalidID.6.qml b/tests/auto/declarative/qmlparser/invalidID.6.qml deleted file mode 100644 index ea34007..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.6.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: MyQmlObject -} - diff --git a/tests/auto/declarative/qmlparser/invalidID.errors.txt b/tests/auto/declarative/qmlparser/invalidID.errors.txt deleted file mode 100644 index 1ca678c..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:"1" is not a valid object id diff --git a/tests/auto/declarative/qmlparser/invalidID.qml b/tests/auto/declarative/qmlparser/invalidID.qml deleted file mode 100644 index 04db3eb..0000000 --- a/tests/auto/declarative/qmlparser/invalidID.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: 1 -} diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml deleted file mode 100644 index d8a22a8..0000000 --- a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Qt 4.6 -Rectangle {} diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml deleted file mode 100644 index a0706ad..0000000 --- a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Qt 4.6 -Text {} diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir deleted file mode 100644 index ba0b42a..0000000 --- a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -InstalledTest 1.0-3 InstalledTest.qml -InstalledTest 1.4 InstalledTest2.qml -Rectangle 1.5 InstalledTest2.qml diff --git a/tests/auto/declarative/qmlparser/listAssignment.1.errors.txt b/tests/auto/declarative/qmlparser/listAssignment.1.errors.txt deleted file mode 100644 index d68d487..0000000 --- a/tests/auto/declarative/qmlparser/listAssignment.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:24:Cannot assign primitives to lists diff --git a/tests/auto/declarative/qmlparser/listAssignment.1.qml b/tests/auto/declarative/qmlparser/listAssignment.1.qml deleted file mode 100644 index 4240425..0000000 --- a/tests/auto/declarative/qmlparser/listAssignment.1.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - qmllistInterfaces: 1 -} diff --git a/tests/auto/declarative/qmlparser/listAssignment.2.errors.txt b/tests/auto/declarative/qmlparser/listAssignment.2.errors.txt deleted file mode 100644 index 8b40aa3..0000000 --- a/tests/auto/declarative/qmlparser/listAssignment.2.errors.txt +++ /dev/null @@ -1,2 +0,0 @@ -3:15:Cannot assign primitives to lists - diff --git a/tests/auto/declarative/qmlparser/listAssignment.2.qml b/tests/auto/declarative/qmlparser/listAssignment.2.qml deleted file mode 100644 index e3baadb..0000000 --- a/tests/auto/declarative/qmlparser/listAssignment.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - children: 2 -} diff --git a/tests/auto/declarative/qmlparser/listAssignment.3.errors.txt b/tests/auto/declarative/qmlparser/listAssignment.3.errors.txt deleted file mode 100644 index 8c7b7e9..0000000 --- a/tests/auto/declarative/qmlparser/listAssignment.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:15:Can only assign one binding to lists diff --git a/tests/auto/declarative/qmlparser/listAssignment.3.qml b/tests/auto/declarative/qmlparser/listAssignment.3.qml deleted file mode 100644 index 00c4c6b..0000000 --- a/tests/auto/declarative/qmlparser/listAssignment.3.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyContainer { - children: childBinding.expression - children: childBinding2.expression -} - diff --git a/tests/auto/declarative/qmlparser/listItemDeleteSelf.qml b/tests/auto/declarative/qmlparser/listItemDeleteSelf.qml deleted file mode 100644 index fa2e831..0000000 --- a/tests/auto/declarative/qmlparser/listItemDeleteSelf.qml +++ /dev/null @@ -1,38 +0,0 @@ -import Qt 4.6 - -Item { - ListModel { - id: FruitModel - ListElement { - name: "Apple" - cost: 2.45 - } - ListElement { - name: "Orange" - cost: 3.25 - } - ListElement { - name: "Banana" - cost: 1.95 - } - } - - Component { - id: FruitDelegate - Item { - width: 200; height: 50 - Text { text: name } - Text { text: '$'+cost; anchors.right: parent.right } - MouseRegion { - anchors.fill: parent - onClicked: FruitModel.remove(index) - } - } - } - - ListView { - model: FruitModel - delegate: FruitDelegate - anchors.fill: parent - } -} diff --git a/tests/auto/declarative/qmlparser/missingObject.errors.txt b/tests/auto/declarative/qmlparser/missingObject.errors.txt deleted file mode 100644 index b31b562..0000000 --- a/tests/auto/declarative/qmlparser/missingObject.errors.txt +++ /dev/null @@ -1 +0,0 @@ -1:10:Expected token `{' diff --git a/tests/auto/declarative/qmlparser/missingObject.qml b/tests/auto/declarative/qmlparser/missingObject.qml deleted file mode 100644 index 2f17045..0000000 --- a/tests/auto/declarative/qmlparser/missingObject.qml +++ /dev/null @@ -1 +0,0 @@ -something: 24 diff --git a/tests/auto/declarative/qmlparser/missingSignal.errors.txt b/tests/auto/declarative/qmlparser/missingSignal.errors.txt deleted file mode 100644 index e243ae5..0000000 --- a/tests/auto/declarative/qmlparser/missingSignal.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:5:Cannot assign to non-existant property "onClicked" diff --git a/tests/auto/declarative/qmlparser/missingSignal.qml b/tests/auto/declarative/qmlparser/missingSignal.qml deleted file mode 100644 index fd489ca..0000000 --- a/tests/auto/declarative/qmlparser/missingSignal.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - onClicked: print("Hello world!") -} diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.1.errors.txt b/tests/auto/declarative/qmlparser/nonexistantProperty.1.errors.txt deleted file mode 100644 index cfc6fc8..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -2:15:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.1.qml b/tests/auto/declarative/qmlparser/nonexistantProperty.1.qml deleted file mode 100644 index df7406c..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.1.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Test 1.0 -MyQmlObject { something: 24 } diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.2.errors.txt b/tests/auto/declarative/qmlparser/nonexistantProperty.2.errors.txt deleted file mode 100644 index 8b13585..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.2.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.2.qml b/tests/auto/declarative/qmlparser/nonexistantProperty.2.qml deleted file mode 100644 index 06ccd37..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - something: 24 -} diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.3.errors.txt b/tests/auto/declarative/qmlparser/nonexistantProperty.3.errors.txt deleted file mode 100644 index 8b13585..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.3.qml b/tests/auto/declarative/qmlparser/nonexistantProperty.3.qml deleted file mode 100644 index 5b08608..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.3.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - something: 1 + 1 -} diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.4.errors.txt b/tests/auto/declarative/qmlparser/nonexistantProperty.4.errors.txt deleted file mode 100644 index 8b13585..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.4.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.4.qml b/tests/auto/declarative/qmlparser/nonexistantProperty.4.qml deleted file mode 100644 index 6579191..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.4.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - something: ; -} diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.5.errors.txt b/tests/auto/declarative/qmlparser/nonexistantProperty.5.errors.txt deleted file mode 100644 index c07f2b9..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.5.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Expected a qualified name id diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.5.qml b/tests/auto/declarative/qmlparser/nonexistantProperty.5.qml deleted file mode 100644 index 37af057..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.5.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - 24 -} diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.6.errors.txt b/tests/auto/declarative/qmlparser/nonexistantProperty.6.errors.txt deleted file mode 100644 index c02d7bd..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.6.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant default property diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.6.qml b/tests/auto/declarative/qmlparser/nonexistantProperty.6.qml deleted file mode 100644 index 5cd55d0..0000000 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.6.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/nullDotProperty.errors.txt b/tests/auto/declarative/qmlparser/nullDotProperty.errors.txt deleted file mode 100644 index 07a4094..0000000 --- a/tests/auto/declarative/qmlparser/nullDotProperty.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:-1:Cannot set properties on obj as it is null diff --git a/tests/auto/declarative/qmlparser/nullDotProperty.qml b/tests/auto/declarative/qmlparser/nullDotProperty.qml deleted file mode 100644 index 4e36779..0000000 --- a/tests/auto/declarative/qmlparser/nullDotProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyDotPropertyObject { - obj.value: 1 -} diff --git a/tests/auto/declarative/qmlparser/propertyValueSource.qml b/tests/auto/declarative/qmlparser/propertyValueSource.qml deleted file mode 100644 index ad71fcf..0000000 --- a/tests/auto/declarative/qmlparser/propertyValueSource.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyTypeObject { - intProperty : MyPropertyValueSource {} -} diff --git a/tests/auto/declarative/qmlparser/readOnly.1.errors.txt b/tests/auto/declarative/qmlparser/readOnly.1.errors.txt deleted file mode 100644 index b8c3404..0000000 --- a/tests/auto/declarative/qmlparser/readOnly.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:21:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmlparser/readOnly.1.qml b/tests/auto/declarative/qmlparser/readOnly.1.qml deleted file mode 100644 index 60757bd..0000000 --- a/tests/auto/declarative/qmlparser/readOnly.1.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - readOnlyString: "Hello World" -} diff --git a/tests/auto/declarative/qmlparser/readOnly.2.errors.txt b/tests/auto/declarative/qmlparser/readOnly.2.errors.txt deleted file mode 100644 index d857a04..0000000 --- a/tests/auto/declarative/qmlparser/readOnly.2.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmlparser/readOnly.2.qml b/tests/auto/declarative/qmlparser/readOnly.2.qml deleted file mode 100644 index 8f1633c..0000000 --- a/tests/auto/declarative/qmlparser/readOnly.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - readOnlyString: "Hello" + "World" -} diff --git a/tests/auto/declarative/qmlparser/rootAsQmlComponent.qml b/tests/auto/declarative/qmlparser/rootAsQmlComponent.qml deleted file mode 100644 index 8d72cd3..0000000 --- a/tests/auto/declarative/qmlparser/rootAsQmlComponent.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyContainerComponent { - x: 11 - MyQmlObject {} - MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/simpleBindings.qml b/tests/auto/declarative/qmlparser/simpleBindings.qml deleted file mode 100644 index 74867b3..0000000 --- a/tests/auto/declarative/qmlparser/simpleBindings.qml +++ /dev/null @@ -1,18 +0,0 @@ -import Test 1.0 -MyTypeObject { - id: Me - property int v1: 10 - property int v2: 11 - - property int value1 - property int value2 - property int value3 - property int value4 - - value1: v1 - value2: Me.v1 - value3: v1 + v2 - value4: Math.min(v1, v2) - - objectProperty: Me -} diff --git a/tests/auto/declarative/qmlparser/simpleContainer.qml b/tests/auto/declarative/qmlparser/simpleContainer.qml deleted file mode 100644 index c3a795f..0000000 --- a/tests/auto/declarative/qmlparser/simpleContainer.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyContainer { - MyQmlObject {} - MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/simpleObject.qml b/tests/auto/declarative/qmlparser/simpleObject.qml deleted file mode 100644 index 30c7823..0000000 --- a/tests/auto/declarative/qmlparser/simpleObject.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Test 1.0 -MyQmlObject {} diff --git a/tests/auto/declarative/qmlparser/subdir/Test.qml b/tests/auto/declarative/qmlparser/subdir/Test.qml deleted file mode 100644 index c4d5905..0000000 --- a/tests/auto/declarative/qmlparser/subdir/Test.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Qt 4.6 -Rectangle { } diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index c2f1e1a..7f51639 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -14,7 +14,7 @@ public: tst_qmlparser() { QmlMetaType::registerCustomStringConverter(qMetaTypeId(), myCustomVariantTypeConverter); QFileInfo fileInfo(__FILE__); - engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("lib"))); + engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("data/lib"))); } private slots: @@ -74,7 +74,7 @@ private: QVERIFY(!component.isError()); \ QVERIFY(component.errors().isEmpty()); \ } else { \ - QFile file(errorfile); \ + QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \ QVERIFY(file.open(QIODevice::ReadOnly)); \ QByteArray data = file.readAll(); \ QList expected = data.split('\n'); \ @@ -96,7 +96,7 @@ private: inline QUrl TEST_FILE(const QString &filename) { QFileInfo fileInfo(__FILE__); - return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(filename)); + return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(QLatin1String("data/") + filename)); } inline QUrl TEST_FILE(const char *filename) diff --git a/tests/auto/declarative/qmlparser/unregisteredObject.errors.txt b/tests/auto/declarative/qmlparser/unregisteredObject.errors.txt deleted file mode 100644 index bc4f7f4..0000000 --- a/tests/auto/declarative/qmlparser/unregisteredObject.errors.txt +++ /dev/null @@ -1 +0,0 @@ -2:1:Type UnregisteredObject unavailable diff --git a/tests/auto/declarative/qmlparser/unregisteredObject.qml b/tests/auto/declarative/qmlparser/unregisteredObject.qml deleted file mode 100644 index 9498e31..0000000 --- a/tests/auto/declarative/qmlparser/unregisteredObject.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Test 1.0 -UnregisteredObject {} diff --git a/tests/auto/declarative/qmlparser/unsupportedProperty.errors.txt b/tests/auto/declarative/qmlparser/unsupportedProperty.errors.txt deleted file mode 100644 index 3a90a7d..0000000 --- a/tests/auto/declarative/qmlparser/unsupportedProperty.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:13:Invalid property assignment: unknown type QVariant::QMatrix diff --git a/tests/auto/declarative/qmlparser/unsupportedProperty.qml b/tests/auto/declarative/qmlparser/unsupportedProperty.qml deleted file mode 100644 index 9f19680..0000000 --- a/tests/auto/declarative/qmlparser/unsupportedProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - matrix: "1,0,0,0,1,0,0,0,1" -} diff --git a/tests/auto/declarative/qmlparser/valueTypes.qml b/tests/auto/declarative/qmlparser/valueTypes.qml deleted file mode 100644 index bf325a7..0000000 --- a/tests/auto/declarative/qmlparser/valueTypes.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Test 1.0 -MyTypeObject { - rectProperty.x: 10 - rectProperty.y: 11 - rectProperty.width: rectProperty.x + 2 - rectProperty.height: 13 - - intProperty: rectProperty.x - - onAction: { var a = rectProperty; a.x = 12; } - - rectProperty2: rectProperty -} diff --git a/tests/auto/declarative/qmlparser/wrongType.1.errors.txt b/tests/auto/declarative/qmlparser/wrongType.1.errors.txt deleted file mode 100644 index ba7a076..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmlparser/wrongType.1.qml b/tests/auto/declarative/qmlparser/wrongType.1.qml deleted file mode 100644 index 289d37f..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.1.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - value: "hello" -} diff --git a/tests/auto/declarative/qmlparser/wrongType.10.errors.txt b/tests/auto/declarative/qmlparser/wrongType.10.errors.txt deleted file mode 100644 index ae75b52..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.10.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:23:Invalid property assignment: datetime expected diff --git a/tests/auto/declarative/qmlparser/wrongType.10.qml b/tests/auto/declarative/qmlparser/wrongType.10.qml deleted file mode 100644 index 2cf0e50..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.10.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - dateTimeProperty: 12 -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.11.errors.txt b/tests/auto/declarative/qmlparser/wrongType.11.errors.txt deleted file mode 100644 index 23a4cda..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.11.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:20:Invalid property assignment: point expected diff --git a/tests/auto/declarative/qmlparser/wrongType.11.qml b/tests/auto/declarative/qmlparser/wrongType.11.qml deleted file mode 100644 index ae77ba1..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.11.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - pointProperty: "apples" -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.12.errors.txt b/tests/auto/declarative/qmlparser/wrongType.12.errors.txt deleted file mode 100644 index 3092100..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.12.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: size expected diff --git a/tests/auto/declarative/qmlparser/wrongType.12.qml b/tests/auto/declarative/qmlparser/wrongType.12.qml deleted file mode 100644 index b7a366f..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.12.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - sizeProperty: "red" -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.13.errors.txt b/tests/auto/declarative/qmlparser/wrongType.13.errors.txt deleted file mode 100644 index ba7a076..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.13.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmlparser/wrongType.13.qml b/tests/auto/declarative/qmlparser/wrongType.13.qml deleted file mode 100644 index 477aff1..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.13.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - value: "12" -} diff --git a/tests/auto/declarative/qmlparser/wrongType.14.errors.txt b/tests/auto/declarative/qmlparser/wrongType.14.errors.txt deleted file mode 100644 index d621fdd..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.14.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:21:Invalid property assignment: string expected diff --git a/tests/auto/declarative/qmlparser/wrongType.14.qml b/tests/auto/declarative/qmlparser/wrongType.14.qml deleted file mode 100644 index 672d693..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.14.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - stringProperty: 10 -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.2.errors.txt b/tests/auto/declarative/qmlparser/wrongType.2.errors.txt deleted file mode 100644 index 9ff9f25..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.2.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:14:Invalid property assignment: boolean expected diff --git a/tests/auto/declarative/qmlparser/wrongType.2.qml b/tests/auto/declarative/qmlparser/wrongType.2.qml deleted file mode 100644 index 34b74f7..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - enabled: 5 -} diff --git a/tests/auto/declarative/qmlparser/wrongType.3.errors.txt b/tests/auto/declarative/qmlparser/wrongType.3.errors.txt deleted file mode 100644 index 6d971c6..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:11:Invalid property assignment: rect expected diff --git a/tests/auto/declarative/qmlparser/wrongType.3.qml b/tests/auto/declarative/qmlparser/wrongType.3.qml deleted file mode 100644 index 384181a..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.3.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - rect: "5,5x10" -} diff --git a/tests/auto/declarative/qmlparser/wrongType.4.errors.txt b/tests/auto/declarative/qmlparser/wrongType.4.errors.txt deleted file mode 100644 index ef34d0e..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.4.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: unknown enumeration diff --git a/tests/auto/declarative/qmlparser/wrongType.4.qml b/tests/auto/declarative/qmlparser/wrongType.4.qml deleted file mode 100644 index 0787bf5..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.4.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyTypeObject { - enumProperty: "InvalidEnumName" -} diff --git a/tests/auto/declarative/qmlparser/wrongType.5.errors.txt b/tests/auto/declarative/qmlparser/wrongType.5.errors.txt deleted file mode 100644 index cab10bd..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.5.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: unsigned int expected diff --git a/tests/auto/declarative/qmlparser/wrongType.5.qml b/tests/auto/declarative/qmlparser/wrongType.5.qml deleted file mode 100644 index c50ae9a..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.5.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - uintProperty: -13 -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.6.errors.txt b/tests/auto/declarative/qmlparser/wrongType.6.errors.txt deleted file mode 100644 index d0a0b00..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.6.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: double expected diff --git a/tests/auto/declarative/qmlparser/wrongType.6.qml b/tests/auto/declarative/qmlparser/wrongType.6.qml deleted file mode 100644 index da10b78..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.6.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - realProperty: "Hello" -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.7.errors.txt b/tests/auto/declarative/qmlparser/wrongType.7.errors.txt deleted file mode 100644 index 614346b..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.7.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:20:Invalid property assignment: color expected diff --git a/tests/auto/declarative/qmlparser/wrongType.7.qml b/tests/auto/declarative/qmlparser/wrongType.7.qml deleted file mode 100644 index ddc3835..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.7.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - colorProperty: 12 -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.8.errors.txt b/tests/auto/declarative/qmlparser/wrongType.8.errors.txt deleted file mode 100644 index 1773c00..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.8.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: date expected diff --git a/tests/auto/declarative/qmlparser/wrongType.8.qml b/tests/auto/declarative/qmlparser/wrongType.8.qml deleted file mode 100644 index a5f6756..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.8.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - dateProperty: 12 -} - diff --git a/tests/auto/declarative/qmlparser/wrongType.9.errors.txt b/tests/auto/declarative/qmlparser/wrongType.9.errors.txt deleted file mode 100644 index 8630975..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.9.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: time expected diff --git a/tests/auto/declarative/qmlparser/wrongType.9.qml b/tests/auto/declarative/qmlparser/wrongType.9.qml deleted file mode 100644 index a3db732..0000000 --- a/tests/auto/declarative/qmlparser/wrongType.9.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - timeProperty: 12 -} - -- cgit v0.12 From c60dfe1f2732670eb48d98c9772815d37a16ec3c Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 23 Sep 2009 11:37:50 +1000 Subject: Add some of the functionality from the old debugger (e.g. dynamic updating of property values, watch table, colouring of tree widget items). --- src/declarative/debugger/qmldebug.cpp | 205 +++++++++++++-- src/declarative/debugger/qmldebug.h | 59 ++++- src/declarative/debugger/qmldebugservice.h | 2 +- src/declarative/qml/qml.pri | 6 +- src/declarative/qml/qmlenginedebug.cpp | 82 +++++- src/declarative/qml/qmlenginedebug_p.h | 8 + src/declarative/qml/qmlwatcher.cpp | 183 +++++++++++++ src/declarative/qml/qmlwatcher_p.h | 93 +++++++ tools/qmldebugger/engine.cpp | 407 ++++++++++++++++++++++++++++- tools/qmldebugger/engine.h | 25 +- 10 files changed, 1033 insertions(+), 37 deletions(-) create mode 100644 src/declarative/qml/qmlwatcher.cpp create mode 100644 src/declarative/qml/qmlwatcher_p.h diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index 57e5858..7483fe2 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -36,6 +36,8 @@ public: QHash enginesQuery; QHash rootContextQuery; QHash objectQuery; + + QHash watched; }; QmlEngineDebugClient::QmlEngineDebugClient(QmlDebugConnection *client, @@ -91,6 +93,7 @@ void QmlEngineDebugPrivate::decode(QDataStream &ds, QmlDebugObjectReference &o, o.m_source.m_url = data.url; o.m_source.m_lineNumber = data.lineNumber; o.m_source.m_columnNumber = data.columnNumber; + o.m_contextDebugId = data.contextId; if (simple) return; @@ -104,6 +107,7 @@ void QmlEngineDebugPrivate::decode(QDataStream &ds, QmlDebugObjectReference &o, QmlDebugPropertyReference prop; prop.m_name = data.name; prop.m_binding = data.binding; + prop.m_objectDebugId = o.m_debugId; if (data.type == QmlEngineDebugServer::QmlObjectProperty::Basic) prop.m_value = data.value; else if (data.type == QmlEngineDebugServer::QmlObjectProperty::Object) { @@ -144,6 +148,7 @@ void QmlEngineDebugPrivate::decode(QDataStream &ds, QmlDebugContextReference &c) QmlDebugObjectReference obj; decode(ds, obj, true); + obj.m_contextDebugId = c.m_debugId; c.m_objects << obj; } } @@ -155,6 +160,8 @@ void QmlEngineDebugPrivate::message(const QByteArray &data) QByteArray type; ds >> type; + //qDebug() << "QmlEngineDebugPrivate::message()" << type; + if (type == "LIST_ENGINES_R") { int queryId; ds >> queryId; @@ -204,6 +211,47 @@ void QmlEngineDebugPrivate::message(const QByteArray &data) query->m_client = 0; query->setState(QmlDebugQuery::Completed); + } else if (type == "WATCH_PROPERTY_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QmlDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QmlDebugWatch::Active : QmlDebugWatch::Inactive); + } else if (type == "WATCH_OBJECT_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QmlDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QmlDebugWatch::Active : QmlDebugWatch::Inactive); + } else if (type == "WATCH_EXPR_OBJECT_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QmlDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QmlDebugWatch::Active : QmlDebugWatch::Inactive); + } else if (type == "UPDATE_WATCH") { + int queryId; + int debugId; + QByteArray name; + QVariant value; + ds >> queryId >> debugId >> name >> value; + + QmlDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + emit watch->valueChanged(name, value); } } @@ -212,10 +260,27 @@ QmlEngineDebug::QmlEngineDebug(QmlDebugConnection *client, QObject *parent) { } -QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugPropertyReference &, QObject *) +QmlDebugPropertyWatch *QmlEngineDebug::addWatch(const QmlDebugPropertyReference &property, QObject *parent) { - qWarning("QmlEngineDebug::addWatch(): Not implemented"); - return 0; + Q_D(QmlEngineDebug); + + QmlDebugPropertyWatch *watch = new QmlDebugPropertyWatch(parent); + if (d->client->isConnected()) { + //query->m_client = this; + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_objectDebugId = property.objectDebugId(); + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toLatin1(); + d->client->sendMessage(message); + } else { + watch->m_state = QmlDebugWatch::Dead; + } + + return watch; } QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugContextReference &, const QString &, QObject *) @@ -224,16 +289,46 @@ QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugContextReference &, const return 0; } -QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugObjectReference &, const QString &, QObject *) +QmlDebugObjectExpressionWatch *QmlEngineDebug::addWatch(const QmlDebugObjectReference &object, const QString &expr, QObject *parent) { - qWarning("QmlEngineDebug::addWatch(): Not implemented"); - return 0; + Q_D(QmlEngineDebug); + QmlDebugObjectExpressionWatch *watch = new QmlDebugObjectExpressionWatch(parent); + if (d->client->isConnected()) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_objectDebugId = object.debugId(); + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr; + d->client->sendMessage(message); + } else { + watch->m_state = QmlDebugWatch::Dead; + } + return watch; } -QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugObjectReference &, QObject *) +QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugObjectReference &object, QObject *parent) { - qWarning("QmlEngineDebug::addWatch(): Not implemented"); - return 0; + Q_D(QmlEngineDebug); + + QmlDebugWatch *watch = new QmlDebugWatch(parent); + if (d->client->isConnected()) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_objectDebugId = object.debugId(); + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId(); + d->client->sendMessage(message); + } else { + watch->m_state = QmlDebugWatch::Dead; + } + + return watch; } QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugFileReference &, QObject *) @@ -242,6 +337,20 @@ QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugFileReference &, QObject * return 0; } +void QmlEngineDebug::removeWatch(QmlDebugWatch *watch) +{ + Q_D(QmlEngineDebug); + + d->watched.remove(watch->queryId()); + + if (d->client->isConnected()) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("NO_WATCH") << watch->queryId(); + d->client->sendMessage(message); + } +} + QmlDebugEnginesQuery *QmlEngineDebug::queryAvailableEngines(QObject *parent) { Q_D(QmlEngineDebug); @@ -332,6 +441,56 @@ QmlDebugObjectQuery *QmlEngineDebug::queryObjectRecursive(const QmlDebugObjectRe return query; } +QmlDebugWatch::QmlDebugWatch(QObject *parent) +: QObject(parent), m_state(Waiting), m_queryId(-1), m_objectDebugId(-1) +{ +} + +int QmlDebugWatch::queryId() const +{ + return m_queryId; +} + +int QmlDebugWatch::objectDebugId() const +{ + return m_objectDebugId; +} + +QmlDebugWatch::State QmlDebugWatch::state() const +{ + return m_state; +} + +void QmlDebugWatch::setState(State s) +{ + if (m_state == s) + return; + m_state = s; + emit stateChanged(m_state); +} + +QmlDebugPropertyWatch::QmlDebugPropertyWatch(QObject *parent) + : QmlDebugWatch(parent) +{ +} + +QString QmlDebugPropertyWatch::name() const +{ + return m_name; +} + + +QmlDebugObjectExpressionWatch::QmlDebugObjectExpressionWatch(QObject *parent) + : QmlDebugWatch(parent) +{ +} + +QString QmlDebugObjectExpressionWatch::expression() const +{ + return m_expr; +} + + QmlDebugQuery::QmlDebugQuery(QObject *parent) : QObject(parent), m_state(Waiting) { @@ -436,18 +595,19 @@ QString QmlDebugEngineReference::name() const } QmlDebugObjectReference::QmlDebugObjectReference() -: m_debugId(-1) +: m_debugId(-1), m_contextDebugId(-1) { } QmlDebugObjectReference::QmlDebugObjectReference(int debugId) -: m_debugId(debugId) +: m_debugId(debugId), m_contextDebugId(-1) { } QmlDebugObjectReference::QmlDebugObjectReference(const QmlDebugObjectReference &o) -: m_debugId(o.m_debugId), m_class(o.m_class), m_name(o.m_name), - m_source(o.m_source), m_properties(o.m_properties), m_children(o.m_children) +: m_debugId(o.m_debugId), m_class(o.m_class), m_name(o.m_name), + m_source(o.m_source), m_contextDebugId(o.m_contextDebugId), + m_properties(o.m_properties), m_children(o.m_children) { } @@ -455,8 +615,8 @@ QmlDebugObjectReference & QmlDebugObjectReference::operator=(const QmlDebugObjectReference &o) { m_debugId = o.m_debugId; m_class = o.m_class; m_name = o.m_name; - m_source = o.m_source; m_properties = o.m_properties; - m_children = o.m_children; + m_source = o.m_source; m_contextDebugId = o.m_contextDebugId; + m_properties = o.m_properties; m_children = o.m_children; return *this; } @@ -480,6 +640,11 @@ QmlDebugFileReference QmlDebugObjectReference::source() const return m_source; } +int QmlDebugObjectReference::contextDebugId() const +{ + return m_contextDebugId; +} + QList QmlDebugObjectReference::properties() const { return m_properties; @@ -574,20 +739,26 @@ void QmlDebugFileReference::setColumnNumber(int c) } QmlDebugPropertyReference::QmlDebugPropertyReference() +: m_objectDebugId(-1) { } QmlDebugPropertyReference::QmlDebugPropertyReference(const QmlDebugPropertyReference &o) -: m_name(o.m_name), m_value(o.m_value), m_binding(o.m_binding) +: m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value), m_binding(o.m_binding) { } QmlDebugPropertyReference &QmlDebugPropertyReference::operator=(const QmlDebugPropertyReference &o) { - m_name = o.m_name; m_value = o.m_value; m_binding = o.m_binding; + m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value; m_binding = o.m_binding; return *this; } +int QmlDebugPropertyReference::objectDebugId() const +{ + return m_objectDebugId; +} + QString QmlDebugPropertyReference::name() const { return m_name; diff --git a/src/declarative/debugger/qmldebug.h b/src/declarative/debugger/qmldebug.h index 11e6b3e..be28a7e 100644 --- a/src/declarative/debugger/qmldebug.h +++ b/src/declarative/debugger/qmldebug.h @@ -7,6 +7,8 @@ class QmlDebugConnection; class QmlDebugWatch; +class QmlDebugPropertyWatch; +class QmlDebugObjectExpressionWatch; class QmlDebugEnginesQuery; class QmlDebugRootContextQuery; class QmlDebugObjectQuery; @@ -22,17 +24,19 @@ Q_OBJECT public: QmlEngineDebug(QmlDebugConnection *, QObject * = 0); - QmlDebugWatch *addWatch(const QmlDebugPropertyReference &, + QmlDebugPropertyWatch *addWatch(const QmlDebugPropertyReference &, QObject *parent = 0); QmlDebugWatch *addWatch(const QmlDebugContextReference &, const QString &, QObject *parent = 0); - QmlDebugWatch *addWatch(const QmlDebugObjectReference &, const QString &, + QmlDebugObjectExpressionWatch *addWatch(const QmlDebugObjectReference &, const QString &, QObject *parent = 0); QmlDebugWatch *addWatch(const QmlDebugObjectReference &, QObject *parent = 0); QmlDebugWatch *addWatch(const QmlDebugFileReference &, QObject *parent = 0); + void removeWatch(QmlDebugWatch *watch); + QmlDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0); QmlDebugRootContextQuery *queryRootContexts(const QmlDebugEngineReference &, QObject *parent = 0); @@ -51,14 +55,57 @@ Q_OBJECT public: enum State { Waiting, Active, Inactive, Dead }; + QmlDebugWatch(QObject *); + + int queryId() const; + int objectDebugId() const; State state() const; signals: void stateChanged(State); - void objectChanged(int, const QmlDebugObjectReference &); - void valueChanged(int, const QVariant &); + //void objectChanged(int, const QmlDebugObjectReference &); + //void valueChanged(int, const QVariant &); + + // Server sends value as string if it is a user-type variant + void valueChanged(const QByteArray &name, const QVariant &value); + +private: + friend class QmlEngineDebug; + friend class QmlEngineDebugPrivate; + void setState(State); + State m_state; + int m_queryId; + int m_objectDebugId; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugPropertyWatch : public QmlDebugWatch +{ + Q_OBJECT +public: + QmlDebugPropertyWatch(QObject *parent); + + QString name() const; + +private: + friend class QmlEngineDebug; + QString m_name; }; +class Q_DECLARATIVE_EXPORT QmlDebugObjectExpressionWatch : public QmlDebugWatch +{ + Q_OBJECT +public: + QmlDebugObjectExpressionWatch(QObject *parent); + + QString expression() const; + +private: + friend class QmlEngineDebug; + QString m_expr; + int m_debugId; +}; + + class Q_DECLARATIVE_EXPORT QmlDebugQuery : public QObject { Q_OBJECT @@ -134,6 +181,7 @@ public: QString name() const; QmlDebugFileReference source() const; + int contextDebugId() const; QList properties() const; QList children() const; @@ -144,6 +192,7 @@ private: QString m_class; QString m_name; QmlDebugFileReference m_source; + int m_contextDebugId; QList m_properties; QList m_children; }; @@ -176,12 +225,14 @@ public: QmlDebugPropertyReference(const QmlDebugPropertyReference &); QmlDebugPropertyReference &operator=(const QmlDebugPropertyReference &); + int objectDebugId() const; QString name() const; QVariant value() const; QString binding() const; private: friend class QmlEngineDebugPrivate; + int m_objectDebugId; QString m_name; QVariant m_value; QString m_binding; diff --git a/src/declarative/debugger/qmldebugservice.h b/src/declarative/debugger/qmldebugservice.h index c3c3b01..5d20ba0 100644 --- a/src/declarative/debugger/qmldebugservice.h +++ b/src/declarative/debugger/qmldebugservice.h @@ -49,7 +49,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QmlDebugServicePrivate; -class QmlDebugService : public QObject +class Q_DECLARATIVE_EXPORT QmlDebugService : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QmlDebugService) diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 29d97ba..5df6532 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -32,7 +32,8 @@ SOURCES += qml/qmlparser.cpp \ qml/qmlvaluetype.cpp \ qml/qmlbindingoptimizations.cpp \ qml/qmlxmlhttprequest.cpp \ - qml/qmetaobjectbuilder.cpp + qml/qmetaobjectbuilder.cpp \ + qml/qmlwatcher.cpp HEADERS += qml/qmlparser_p.h \ qml/qmlinstruction_p.h \ @@ -81,7 +82,8 @@ HEADERS += qml/qmlparser_p.h \ qml/qmlvaluetype_p.h \ qml/qmlbindingoptimizations_p.h \ qml/qmlxmlhttprequest_p.h \ - qml/qmetaobjectbuilder_p.h + qml/qmetaobjectbuilder_p.h \ + qml/qmlwatcher_p.h # for qtscript debugger contains(QT_CONFIG, scripttools):QT += scripttools diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 7f9e530..f5c1297 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -48,20 +48,24 @@ #include #include #include "qmlcontext_p.h" +#include "qmlwatcher_p.h" QT_BEGIN_NAMESPACE QList QmlEngineDebugServer::m_engines; QmlEngineDebugServer::QmlEngineDebugServer(QObject *parent) -: QmlDebugService(QLatin1String("QmlEngine"), parent) +: QmlDebugService(QLatin1String("QmlEngine"), parent), + m_watch(new QmlWatcher(this)) { + QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QByteArray,QVariant)), + this, SLOT(propertyChanged(int,int,QByteArray,QVariant))); } QDataStream &operator<<(QDataStream &ds, const QmlEngineDebugServer::QmlObjectData &data) { ds << data.url << data.lineNumber << data.columnNumber << data.objectName - << data.objectType << data.objectId; + << data.objectType << data.objectId << data.contextId; return ds; } @@ -69,7 +73,7 @@ QDataStream &operator>>(QDataStream &ds, QmlEngineDebugServer::QmlObjectData &data) { ds >> data.url >> data.lineNumber >> data.columnNumber >> data.objectName - >> data.objectType >> data.objectId; + >> data.objectType >> data.objectId >> data.contextId; return ds; } @@ -200,6 +204,7 @@ QmlEngineDebugServer::objectData(QObject *object) rv.objectName = object->objectName(); rv.objectType = object->metaObject()->className(); rv.objectId = QmlDebugService::idForObject(object); + rv.contextId = QmlDebugService::idForObject(qmlContext(object)); return rv; } @@ -211,6 +216,8 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) QByteArray type; ds >> type; + //qDebug() << "QmlEngineDebugServer::messageReceived()" << type; + if (type == "LIST_ENGINES") { int queryId; ds >> queryId; @@ -263,9 +270,78 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) buildObjectDump(rs, object, recurse); sendMessage(reply); + } else if (type == "WATCH_OBJECT") { + int queryId; + int objectId; + + ds >> queryId >> objectId; + bool ok = m_watch->addWatch(queryId, objectId); + + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + rs << QByteArray("WATCH_OBJECT_R") << queryId << objectId << ok; + + sendMessage(reply); + } else if (type == "WATCH_PROPERTY") { + int queryId; + int objectId; + QByteArray property; + + ds >> queryId >> objectId >> property; + bool ok = m_watch->addWatch(queryId, objectId, property); + + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + rs << QByteArray("WATCH_PROPERTY_R") << queryId << ok; + + sendMessage(reply); + } else if (type == "WATCH_EXPR_OBJECT") { + int queryId; + int debugId; + QString expr; + + ds >> queryId >> debugId >> expr; + bool ok = m_watch->addWatch(queryId, debugId, expr); + + QByteArray reply; + QDataStream rs(&reply, QIODevice::WriteOnly); + rs << QByteArray("WATCH_EXPR_OBJECT_R") << queryId << ok; + + sendMessage(reply); + } else if (type == "NO_WATCH") { + int queryId; + + ds >> queryId; + m_watch->removeWatch(queryId); } } +void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value) +{ + QByteArray reply; + QVariant v; + QDataStream rs(&reply, QIODevice::WriteOnly); + + if (value.type() == QVariant::UserType) { + QObject *o = QmlMetaType::toQObject(value); + if (o) { + QString objectName = o->objectName(); + if (objectName.isEmpty()) + objectName = QLatin1String(""); + v = QLatin1String(o->metaObject()->className()) + + QLatin1String(": ") + objectName; + } + if (v.isNull()) + v = value.toString(); + } else { + v = value; + } + + rs << QByteArray("UPDATE_WATCH") << id << objectId << property << v; + + sendMessage(reply); +} + void QmlEngineDebugServer::addEngine(QmlEngine *engine) { Q_ASSERT(engine); diff --git a/src/declarative/qml/qmlenginedebug_p.h b/src/declarative/qml/qmlenginedebug_p.h index 87b2ffd..f935c04 100644 --- a/src/declarative/qml/qmlenginedebug_p.h +++ b/src/declarative/qml/qmlenginedebug_p.h @@ -61,9 +61,12 @@ QT_BEGIN_NAMESPACE class QmlEngine; class QmlContext; +class QmlWatcher; class QDataStream; + class QmlEngineDebugServer : public QmlDebugService { + Q_OBJECT public: QmlEngineDebugServer(QObject * = 0); @@ -74,6 +77,7 @@ public: QString objectName; QString objectType; int objectId; + int contextId; }; struct QmlObjectProperty { @@ -90,6 +94,9 @@ public: protected: virtual void messageReceived(const QByteArray &); +private Q_SLOTS: + void propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value); + private: void buildObjectList(QDataStream &, QmlContext *); void buildObjectDump(QDataStream &, QObject *, bool); @@ -97,6 +104,7 @@ private: QmlObjectProperty propertyData(QObject *, int); static QList m_engines; + QmlWatcher *m_watch; }; Q_DECLARATIVE_EXPORT QDataStream &operator<<(QDataStream &, const QmlEngineDebugServer::QmlObjectData &); Q_DECLARATIVE_EXPORT QDataStream &operator>>(QDataStream &, QmlEngineDebugServer::QmlObjectData &); diff --git a/src/declarative/qml/qmlwatcher.cpp b/src/declarative/qml/qmlwatcher.cpp new file mode 100644 index 0000000..eb00dfe --- /dev/null +++ b/src/declarative/qml/qmlwatcher.cpp @@ -0,0 +1,183 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "qmlwatcher_p.h" + +QT_BEGIN_NAMESPACE + + +class QmlWatchProxy : public QObject +{ + Q_OBJECT +public: + QmlWatchProxy(int id, + QObject *object, + int debugId, + const QMetaProperty &prop, + QmlWatcher *parent = 0); + + QmlWatchProxy(int id, + QmlExpression *exp, + int debugId, + QmlWatcher *parent = 0); + +public slots: + void notifyValueChanged(); + +private: + friend class QmlWatcher; + int m_id; + QmlWatcher *m_watch; + QObject *m_object; + int m_debugId; + QMetaProperty m_property; + + QmlExpression *m_expr; +}; + +QmlWatchProxy::QmlWatchProxy(int id, + QmlExpression *exp, + int debugId, + QmlWatcher *parent) +: QObject(parent), m_id(id), m_watch(parent), m_object(0), m_debugId(debugId), m_expr(exp) +{ + QObject::connect(m_expr, SIGNAL(valueChanged()), this, SLOT(notifyValueChanged())); +} + +QmlWatchProxy::QmlWatchProxy(int id, + QObject *object, + int debugId, + const QMetaProperty &prop, + QmlWatcher *parent) +: QObject(parent), m_id(id), m_watch(parent), m_object(object), m_debugId(debugId), m_property(prop), m_expr(0) +{ + static int refreshIdx = -1; + if(refreshIdx == -1) + refreshIdx = QmlWatchProxy::staticMetaObject.indexOfMethod("notifyValueChanged()"); + + if (prop.hasNotifySignal()) + QMetaObject::connect(m_object, prop.notifySignalIndex(), this, refreshIdx); +} + +void QmlWatchProxy::notifyValueChanged() +{ + QVariant v; + if (m_expr) + v = m_expr->value(); + else + v = m_property.read(m_object); + + emit m_watch->propertyChanged(m_id, m_debugId, QByteArray(m_property.name()), v); +} + + +QmlWatcher::QmlWatcher(QObject *parent) + : QObject(parent) +{ +} + +bool QmlWatcher::addWatch(int id, quint32 debugId) +{ + QObject *object = QmlDebugService::objectForId(debugId); + if (object) { + int propCount = object->metaObject()->propertyCount(); + for (int ii=0; iimetaObject()->property(ii)); + return true; + } + return false; +} + +bool QmlWatcher::addWatch(int id, quint32 debugId, const QByteArray &property) +{ + QObject *object = QmlDebugService::objectForId(debugId); + if (object) { + int index = object->metaObject()->indexOfProperty(property.constData()); + if (index >= 0) { + addPropertyWatch(id, object, debugId, object->metaObject()->property(index)); + return true; + } + } + return false; +} + +bool QmlWatcher::addWatch(int id, quint32 objectId, const QString &expr) +{ + QObject *object = QmlDebugService::objectForId(objectId); + QmlContext *context = qmlContext(object); + if (context) { + QmlExpression *exprObj = new QmlExpression(context, expr, object); + QmlWatchProxy *proxy = new QmlWatchProxy(id, exprObj, objectId, this); + exprObj->setParent(proxy); + m_proxies[id].append(proxy); + proxy->notifyValueChanged(); + return true; + } + return false; +} + +void QmlWatcher::removeWatch(int id) +{ + if (!m_proxies.contains(id)) + return; + + QList > proxies = m_proxies.take(id); + qDeleteAll(proxies); +} + +void QmlWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, const QMetaProperty &property) +{ + QmlWatchProxy *proxy = new QmlWatchProxy(id, object, debugId, property, this); + m_proxies[id].append(proxy); + + proxy->notifyValueChanged(); +} + +QT_END_NAMESPACE + +#include "qmlwatch.moc" diff --git a/src/declarative/qml/qmlwatcher_p.h b/src/declarative/qml/qmlwatcher_p.h new file mode 100644 index 0000000..99cae88 --- /dev/null +++ b/src/declarative/qml/qmlwatcher_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLWATCHER_P_H +#define QMLWATCHER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QmlWatchProxy; +class QmlExpression; +class QmlContext; + +class QmlWatcher : public QObject +{ + Q_OBJECT +public: + QmlWatcher(QObject * = 0); + + bool addWatch(int id, quint32 objectId); + bool addWatch(int id, quint32 objectId, const QByteArray &property); + bool addWatch(int id, quint32 objectId, const QString &expr); + + void removeWatch(int id); + +Q_SIGNALS: + void propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value); + +private: + friend class QmlWatchProxy; + void addPropertyWatch(int id, QObject *object, quint32 objectId, const QMetaProperty &property); + + QHash > > m_proxies; +}; + +QT_END_NAMESPACE + +#endif // QMLWATCHER_P_H diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp index 1f4bcc2..f5f9d93 100644 --- a/tools/qmldebugger/engine.cpp +++ b/tools/qmldebugger/engine.cpp @@ -6,13 +6,278 @@ #include #include #include +#include +#include +#include +#include +#include #include +#include #include #include #include +#include QT_BEGIN_NAMESPACE +class QmlObjectTree : public QTreeWidget +{ + Q_OBJECT +public: + enum AdditionalRoles { + ContextIdRole = Qt::UserRole + 1 + }; + + QmlObjectTree(QWidget *parent = 0); + + QTreeWidgetItem *findItemByObjectId(int debugId) const; + +signals: + void addExpressionWatch(int debugId, const QString &); + +protected: + virtual void mousePressEvent(QMouseEvent *); + +private: + QTreeWidgetItem *findItem(QTreeWidgetItem *item, int debugId) const; +}; + +QmlObjectTree::QmlObjectTree(QWidget *parent) +: QTreeWidget(parent) +{ +} + +QTreeWidgetItem *QmlObjectTree::findItemByObjectId(int debugId) const +{ + for (int i=0; idata(0, Qt::UserRole).toInt() == debugId) + return item; + + QTreeWidgetItem *child; + for (int i=0; ichildCount(); i++) { + child = findItem(item->child(i), debugId); + if (child) + return child; + } + + return 0; +} + +void QmlObjectTree::mousePressEvent(QMouseEvent *me) +{ + QTreeWidget::mousePressEvent(me); + if (!currentItem()) + return; + if(me->button() == Qt::RightButton && me->type() == QEvent::MouseButtonPress) { + QAction action(tr("Add watch..."), 0); + QList actions; + actions << &action; + int debugId = currentItem()->data(0, Qt::UserRole).toInt(); + if (debugId >= 0 && QMenu::exec(actions, me->globalPos())) { + bool ok = false; + QString watch = QInputDialog::getText(this, tr("Watch expression"), + tr("Expression:"), QLineEdit::Normal, QString(), &ok); + if (ok && !watch.isEmpty()) + emit addExpressionWatch(debugId, watch); + } + } +} + + +class WatchTableModel : public QAbstractTableModel +{ + Q_OBJECT +public: + WatchTableModel(QObject *parent = 0); + + void addWatch(QmlDebugWatch *watch, const QString &title); + QmlDebugWatch *removeWatch(QmlDebugWatch *watch); + + void updateWatch(QmlDebugWatch *watch, const QVariant &value); + + QmlDebugWatch *watchFromIndex(const QModelIndex &index) const; + + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + +private: + int columnForWatch(QmlDebugWatch *watch) const; + void addValue(int column, const QVariant &value); + + struct WatchedEntity + { + QString title; + bool hasFirstValue; + QPointer watch; + }; + + struct Value { + int column; + QVariant variant; + bool first; + }; + + QList m_columns; + QList m_values; +}; + +WatchTableModel::WatchTableModel(QObject *parent) + : QAbstractTableModel(parent) +{ +} + +void WatchTableModel::addWatch(QmlDebugWatch *watch, const QString &title) +{ + int col = columnCount(QModelIndex()); + beginInsertColumns(QModelIndex(), col, col); + + WatchedEntity e; + e.title = title; + e.hasFirstValue = false; + e.watch = watch; + m_columns.append(e); + + endInsertColumns(); +} + +QmlDebugWatch *WatchTableModel::removeWatch(QmlDebugWatch *watch) +{ + int column = columnForWatch(watch); + if (column == -1) + return 0; + + WatchedEntity entity = m_columns.takeAt(column); + + for (QList::Iterator iter = m_values.begin(); iter != m_values.end();) { + if (iter->column == column) { + iter = m_values.erase(iter); + } else { + if(iter->column > column) + --iter->column; + ++iter; + } + } + + reset(); + + return entity.watch; +} + +void WatchTableModel::updateWatch(QmlDebugWatch *watch, const QVariant &value) +{ + int column = columnForWatch(watch); + if (column == -1) + return; + + addValue(column, value); + + if (!m_columns[column].hasFirstValue) { + m_columns[column].hasFirstValue = true; + m_values[m_values.count() - 1].first = true; + } +} + +QmlDebugWatch *WatchTableModel::watchFromIndex(const QModelIndex &index) const +{ + if (index.isValid() && index.column() < m_columns.count()) + return m_columns.at(index.column()).watch; + return 0; +} + +int WatchTableModel::rowCount(const QModelIndex &) const +{ + return m_values.count(); +} + +int WatchTableModel::columnCount(const QModelIndex &) const +{ + return m_columns.count(); +} + +QVariant WatchTableModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (orientation == Qt::Horizontal) { + if (section < m_columns.count() && role == Qt::DisplayRole) + return m_columns.at(section).title; + } else { + if (role == Qt::DisplayRole) + return section + 1; + } + return QVariant(); +} + +QVariant WatchTableModel::data(const QModelIndex &idx, int role) const +{ + if (m_values.at(idx.row()).column == idx.column()) { + if (role == Qt::DisplayRole) { + const QVariant &value = m_values.at(idx.row()).variant; + QString str = value.toString(); + + if (str.isEmpty() && QmlMetaType::isObject(value.userType())) { + QObject *o = QmlMetaType::toQObject(value); + if(o) { + QString objectName = o->objectName(); + if(objectName.isEmpty()) + objectName = QLatin1String(""); + str = QLatin1String(o->metaObject()->className()) + + QLatin1String(": ") + objectName; + } + } + + if(str.isEmpty()) { + QDebug d(&str); + d << value; + } + return QVariant(str); + } else if(role == Qt::BackgroundRole) { + if(m_values.at(idx.row()).first) + return QColor(Qt::green); + else + return QVariant(); + } else { + return QVariant(); + } + } else { + return QVariant(); + } +} + +int WatchTableModel::columnForWatch(QmlDebugWatch *watch) const +{ + for (int i=0; isetContentsMargins(0, 0, 0, 0); @@ -67,18 +332,31 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent) QHBoxLayout *hbox = new QHBoxLayout; hbox->setContentsMargins(0, 0, 0, 0); - m_objTree = new QTreeWidget(this); + m_objTree = new QmlObjectTree(this); m_objTree->setHeaderHidden(true); connect(m_objTree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(itemClicked(QTreeWidgetItem *))); + connect(m_objTree, SIGNAL(addExpressionWatch(int,QString)), this, SLOT(addExpressionWatch(int,QString))); hbox->addWidget(m_objTree); m_propTable = new QTableWidget(this); + connect(m_propTable, SIGNAL(itemDoubleClicked(QTableWidgetItem *)), this, SLOT(propertyDoubleClicked(QTableWidgetItem *))); m_propTable->setColumnCount(2); m_propTable->setColumnWidth(0, 150); m_propTable->setColumnWidth(1, 400); m_propTable->setHorizontalHeaderLabels(QStringList() << "name" << "value"); - hbox->addWidget(m_propTable); - hbox->setStretchFactor(m_propTable, 2); + + m_watchTableModel = new WatchTableModel(this); + m_watchTable = new QTableView(this); + m_watchTable->setModel(m_watchTableModel); + QObject::connect(m_watchTable, SIGNAL(activated(QModelIndex)), + this, SLOT(watchedItemActivated(QModelIndex))); + + m_tabs = new QTabWidget(this); + m_tabs->addTab(m_propTable, tr("Properties")); + m_tabs->addTab(m_watchTable, tr("Watching")); + + hbox->addWidget(m_tabs); + hbox->setStretchFactor(m_tabs, 2); layout->addLayout(hbox); } @@ -112,15 +390,113 @@ void EnginePane::showProperties() m_propTable->setRowCount(obj.properties().count()); for (int ii = 0; ii < obj.properties().count(); ++ii) { QTableWidgetItem *name = new QTableWidgetItem(obj.properties().at(ii).name()); + name->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_propTable->setItem(ii, 0, name); QTableWidgetItem *value; if (!obj.properties().at(ii).binding().isEmpty()) value = new QTableWidgetItem(obj.properties().at(ii).binding()); else value = new QTableWidgetItem(obj.properties().at(ii).value().toString()); + value->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_propTable->setItem(ii, 1, value); } - delete m_object; m_object = 0; + + if (m_watchedObject) { + m_client.removeWatch(m_watchedObject); + delete m_watchedObject; + m_watchedObject = 0; + } + + QmlDebugWatch *watch = m_client.addWatch(obj, this); + m_watchedObject = watch; + QObject::connect(watch, SIGNAL(valueChanged(QByteArray,QVariant)), + this, SLOT(valueChanged(QByteArray,QVariant))); + + // don't delete, keep it for when property table cells are clicked + //delete m_object; m_object = 0; +} + +void EnginePane::addExpressionWatch(int debugId, const QString &expr) +{ + QmlDebugWatch *watch = m_client.addWatch(QmlDebugObjectReference(debugId), expr, this); + + QObject::connect(watch, SIGNAL(valueChanged(QByteArray,QVariant)), + this, SLOT(valueChanged(QByteArray,QVariant))); + m_watchTableModel->addWatch(watch, expr); + m_watchTable->resizeColumnsToContents(); +} + +void EnginePane::valueChanged(const QByteArray &propertyName, const QVariant &value) +{ + if (!m_object) + return; + + QmlDebugWatch *watch = qobject_cast(sender()); + + m_watchTableModel->updateWatch(watch, value); + + if (!propertyName.isEmpty()) { + QmlDebugObjectReference obj = m_object->object(); + if (obj.debugId() == watch->objectDebugId()) { + for (int ii=0; iirowCount(); ii++) { + if (m_propTable->item(ii, 0)->text() == propertyName) { + m_propTable->item(ii, 1)->setText(value.toString()); + break; + } + } + } + } +} + +void EnginePane::propertyDoubleClicked(QTableWidgetItem *item) +{ + if (!m_object || item->column() > 0) + return; + QList props = m_object->object().properties(); + if (item->row() < props.count()) { + bool watching = togglePropertyWatch(m_object->object(), props.at(item->row())); + if (watching) + item->setForeground(Qt::red); + else + item->setForeground(QBrush()); + } +} + +bool EnginePane::togglePropertyWatch(const QmlDebugObjectReference &object, const QmlDebugPropertyReference &property) +{ + QPair objProperty(object.debugId(), property.name()); + + if (m_watchedProps.contains(objProperty)) { + QmlDebugWatch *watch = m_watchedProps.take(objProperty); + m_watchTableModel->removeWatch(watch); + delete watch; + return false; + } else { + QmlDebugWatch *watch = m_client.addWatch(property, this); + m_watchedProps.insert(objProperty, watch); + QObject::connect(watch, SIGNAL(valueChanged(QByteArray,QVariant)), + this, SLOT(valueChanged(QByteArray,QVariant))); + QString desc = property.name() + + QLatin1String(" on\n") + + object.className() + + QLatin1String(": ") + + (object.name().isEmpty() ? QLatin1String("") : object.name()); + m_watchTableModel->addWatch(watch, desc); + m_watchTable->resizeColumnsToContents(); + return true; + } +} + +void EnginePane::watchedItemActivated(const QModelIndex &index) +{ + QmlDebugWatch *watch = m_watchTableModel->watchFromIndex(index); + if (!watch) + return; + QTreeWidgetItem *item = m_objTree->findItemByObjectId(watch->objectDebugId()); + if (item) { + m_objTree->setCurrentItem(item); + item->setExpanded(true); + } } void EnginePane::queryContext(int id) @@ -143,6 +519,7 @@ void EnginePane::contextChanged() dump(m_context->rootContext(), 0); foreach (const QmlDebugObjectReference &object, m_context->rootContext().objects()) fetchObject(object.debugId()); + delete m_context; m_context = 0; } @@ -175,17 +552,29 @@ void EnginePane::buildTree(const QmlDebugObjectReference &obj, QTreeWidgetItem * { if (!parent) m_objTree->clear(); - m_objTree->expandAll(); QTreeWidgetItem *item = parent ? new QTreeWidgetItem(parent) : new QTreeWidgetItem(m_objTree); item->setText(0, obj.className()); item->setData(0, Qt::UserRole, obj.debugId()); + item->setData(0, QmlObjectTree::ContextIdRole, obj.contextDebugId()); + + if (parent && obj.contextDebugId() >= 0 + && obj.contextDebugId() != parent->data(0, QmlObjectTree::ContextIdRole).toInt()) { + QmlDebugFileReference source = obj.source(); + if (!source.url().isEmpty()) { + QString toolTipString = QLatin1String("URL: ") + source.url().toString(); + item->setToolTip(0, toolTipString); + } + item->setForeground(0, QColor("orange")); + } else { + item->setExpanded(true); + } + + if (obj.contextDebugId() < 0) + item->setForeground(0, Qt::lightGray); for (int ii = 0; ii < obj.children().count(); ++ii) buildTree(obj.children().at(ii), item); - - if (!parent) - m_objTree->expandAll(); } void EnginePane::queryEngines() diff --git a/tools/qmldebugger/engine.h b/tools/qmldebugger/engine.h index 52f0608..b171df2 100644 --- a/tools/qmldebugger/engine.h +++ b/tools/qmldebugger/engine.h @@ -2,6 +2,7 @@ #define ENGINE_H #include +#include #include #include #include @@ -10,11 +11,20 @@ QT_BEGIN_NAMESPACE class QmlDebugConnection; +class QmlDebugPropertyReference; +class QmlDebugWatch; +class QmlObjectTree; class EngineClientPlugin; +class WatchTableModel; class QLineEdit; +class QModelIndex; class QTreeWidget; class QTreeWidgetItem; +class QTabWidget; class QTableWidget; +class QTableView; +class QTableWidgetItem; + class EnginePane : public QWidget { Q_OBJECT @@ -36,11 +46,18 @@ private slots: void itemClicked(QTreeWidgetItem *); void showProperties(); + void addExpressionWatch(int debugId, const QString &expr); + + void valueChanged(const QByteArray &property, const QVariant &value); + + void propertyDoubleClicked(QTableWidgetItem *); + void watchedItemActivated(const QModelIndex &index); private: void dump(const QmlDebugContextReference &, int); void dump(const QmlDebugObjectReference &, int); void buildTree(const QmlDebugObjectReference &, QTreeWidgetItem *parent); + bool togglePropertyWatch(const QmlDebugObjectReference &object, const QmlDebugPropertyReference &property); QmlEngineDebug m_client; QmlDebugEnginesQuery *m_engines; @@ -48,11 +65,17 @@ private: QmlDebugObjectQuery *m_object; QLineEdit *m_text; - QTreeWidget *m_objTree; + QmlObjectTree *m_objTree; + QTabWidget *m_tabs; QTableWidget *m_propTable; + QTableView *m_watchTable; QFxView *m_engineView; QList m_engineItems; + + QmlDebugWatch *m_watchedObject; + WatchTableModel *m_watchTableModel; + QHash< QPair, QPointer > m_watchedProps; }; QT_END_NAMESPACE -- cgit v0.12 From 1dfabbbb1b740060444a11cd894561aed3a884ad Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 11:38:12 +1000 Subject: vector -> Qt.vector3d --- src/declarative/qml/qmlengine.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 2ea1bee..0efb5c8 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -250,8 +250,6 @@ void QmlEnginePrivate::init() scriptEngine.newFunction(QmlEnginePrivate::createQmlObject, 1)); scriptEngine.globalObject().setProperty(QLatin1String("createComponent"), scriptEngine.newFunction(QmlEnginePrivate::createComponent, 1)); - scriptEngine.globalObject().setProperty(QLatin1String("vector"), - scriptEngine.newFunction(QmlEnginePrivate::vector, 3)); if (QCoreApplication::instance()->thread() == q->thread() && QmlEngineDebugServer::isDebuggingEnabled()) { -- cgit v0.12 From a24183cc1df3f13b7ec7b4005a36bb58bcfeedb7 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 12:41:27 +1000 Subject: Move test data into data/ subdir --- tests/auto/declarative/qmlbindengine/bindingLoop.txt | 14 -------------- .../qmlbindengine/boolPropertiesEvaluateAsBool.1.txt | 5 ----- .../qmlbindengine/boolPropertiesEvaluateAsBool.2.txt | 5 ----- .../declarative/qmlbindengine/data/bindingLoop.txt | 14 ++++++++++++++ .../data/boolPropertiesEvaluateAsBool.1.txt | 5 +++++ .../data/boolPropertiesEvaluateAsBool.2.txt | 5 +++++ .../qmlbindengine/data/deferredProperties.txt | 7 +++++++ .../auto/declarative/qmlbindengine/data/enums.1.qml | 20 ++++++++++++++++++++ .../qmlbindengine/data/extensionObjects.txt | 10 ++++++++++ .../qmlbindengine/data/idShortcutInvalidates.1.txt | 13 +++++++++++++ .../qmlbindengine/data/idShortcutInvalidates.txt | 12 ++++++++++++ .../declarative/qmlbindengine/data/methods.1.txt | 6 ++++++ .../declarative/qmlbindengine/data/methods.2.txt | 6 ++++++ .../qmlbindengine/data/signalAssignment.1.txt | 5 +++++ .../qmlbindengine/data/signalAssignment.2.txt | 5 +++++ .../declarative/qmlbindengine/deferredProperties.txt | 7 ------- tests/auto/declarative/qmlbindengine/enums.1.qml | 20 -------------------- .../declarative/qmlbindengine/extensionObjects.txt | 10 ---------- .../qmlbindengine/idShortcutInvalidates.1.txt | 13 ------------- .../qmlbindengine/idShortcutInvalidates.txt | 12 ------------ tests/auto/declarative/qmlbindengine/methods.1.txt | 6 ------ tests/auto/declarative/qmlbindengine/methods.2.txt | 6 ------ .../declarative/qmlbindengine/signalAssignment.1.txt | 5 ----- .../declarative/qmlbindengine/signalAssignment.2.txt | 5 ----- .../declarative/qmlbindengine/tst_qmlbindengine.cpp | 2 +- 25 files changed, 109 insertions(+), 109 deletions(-) delete mode 100644 tests/auto/declarative/qmlbindengine/bindingLoop.txt delete mode 100644 tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.1.txt delete mode 100644 tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.2.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/bindingLoop.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/deferredProperties.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/enums.1.qml create mode 100644 tests/auto/declarative/qmlbindengine/data/extensionObjects.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/methods.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/methods.2.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt delete mode 100644 tests/auto/declarative/qmlbindengine/deferredProperties.txt delete mode 100644 tests/auto/declarative/qmlbindengine/enums.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/extensionObjects.txt delete mode 100644 tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt delete mode 100644 tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt delete mode 100644 tests/auto/declarative/qmlbindengine/methods.1.txt delete mode 100644 tests/auto/declarative/qmlbindengine/methods.2.txt delete mode 100644 tests/auto/declarative/qmlbindengine/signalAssignment.1.txt delete mode 100644 tests/auto/declarative/qmlbindengine/signalAssignment.2.txt diff --git a/tests/auto/declarative/qmlbindengine/bindingLoop.txt b/tests/auto/declarative/qmlbindengine/bindingLoop.txt deleted file mode 100644 index 8b22dd1..0000000 --- a/tests/auto/declarative/qmlbindengine/bindingLoop.txt +++ /dev/null @@ -1,14 +0,0 @@ -import Qt.test 1.0 - -MyQmlContainer { - children : [ - MyQmlObject { - id: Object1 - stringProperty: "hello" + Object2.stringProperty - }, - MyQmlObject { - id: Object2 - stringProperty: "hello" + Object1.stringProperty - } - ] -} diff --git a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.1.txt b/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.1.txt deleted file mode 100644 index 3147f63..0000000 --- a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.1.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - stringProperty: trueProperty?'pass':'fail' -} diff --git a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.2.txt b/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.2.txt deleted file mode 100644 index c89bb49..0000000 --- a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.2.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - stringProperty: falseProperty?'fail':'pass' -} diff --git a/tests/auto/declarative/qmlbindengine/data/bindingLoop.txt b/tests/auto/declarative/qmlbindengine/data/bindingLoop.txt new file mode 100644 index 0000000..8b22dd1 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/bindingLoop.txt @@ -0,0 +1,14 @@ +import Qt.test 1.0 + +MyQmlContainer { + children : [ + MyQmlObject { + id: Object1 + stringProperty: "hello" + Object2.stringProperty + }, + MyQmlObject { + id: Object2 + stringProperty: "hello" + Object1.stringProperty + } + ] +} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt new file mode 100644 index 0000000..3147f63 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + stringProperty: trueProperty?'pass':'fail' +} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt new file mode 100644 index 0000000..c89bb49 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + stringProperty: falseProperty?'fail':'pass' +} diff --git a/tests/auto/declarative/qmlbindengine/data/deferredProperties.txt b/tests/auto/declarative/qmlbindengine/data/deferredProperties.txt new file mode 100644 index 0000000..9dabafe --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/deferredProperties.txt @@ -0,0 +1,7 @@ +import Qt.test 1.0 + +MyDeferredObject { + value: 10 + objectProperty: MyQmlObject {} + objectProperty2: MyQmlObject { id: blah } +} diff --git a/tests/auto/declarative/qmlbindengine/data/enums.1.qml b/tests/auto/declarative/qmlbindengine/data/enums.1.qml new file mode 100644 index 0000000..6351823 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/enums.1.qml @@ -0,0 +1,20 @@ +import Qt.test 1.0 +import Qt.test 1.0 as Namespace + +MyQmlObject { + // Enums from non-namespaced type + property int a: MyQmlObject.EnumValue1 + property int b: MyQmlObject.EnumValue2 + property int c: MyQmlObject.EnumValue3 + property int d: MyQmlObject.EnumValue4 + + // Enums from namespaced type + property int e: Namespace.MyQmlObject.EnumValue1 + property int f: Namespace.MyQmlObject.EnumValue2 + property int g: Namespace.MyQmlObject.EnumValue3 + property int h: Namespace.MyQmlObject.EnumValue4 + + // Test that enums don't mask attached properties + property int i: MyQmlObject.value + property int j: Namespace.MyQmlObject.value +} diff --git a/tests/auto/declarative/qmlbindengine/data/extensionObjects.txt b/tests/auto/declarative/qmlbindengine/data/extensionObjects.txt new file mode 100644 index 0000000..a902312 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/extensionObjects.txt @@ -0,0 +1,10 @@ +import Qt.test 1.0 + +MyExtendedObject +{ + baseProperty: baseExtendedProperty + baseExtendedProperty: 13 + + coreProperty: extendedProperty + extendedProperty: 9 +} diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt new file mode 100644 index 0000000..ccb3a22 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt @@ -0,0 +1,13 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyQmlObject { + objectProperty: if(1) OtherObject + + property var obj + + obj: Object { + id: OtherObject + } +} + diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt new file mode 100644 index 0000000..6c1fca6 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt @@ -0,0 +1,12 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyQmlObject { + objectProperty: OtherObject + + property var obj + + obj: Object { + id: OtherObject + } +} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.1.txt b/tests/auto/declarative/qmlbindengine/data/methods.1.txt new file mode 100644 index 0000000..8ba300f --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/methods.1.txt @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyQmlObject { + id: MyObject + onBasicSignal: MyObject.method() +} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.2.txt b/tests/auto/declarative/qmlbindengine/data/methods.2.txt new file mode 100644 index 0000000..70911f7 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/methods.2.txt @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyQmlObject { + id: MyObject + onBasicSignal: MyObject.method(163) +} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt b/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt new file mode 100644 index 0000000..fbd0914 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + onBasicSignal: setString('pass') +} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt b/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt new file mode 100644 index 0000000..8addcb9 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) +} diff --git a/tests/auto/declarative/qmlbindengine/deferredProperties.txt b/tests/auto/declarative/qmlbindengine/deferredProperties.txt deleted file mode 100644 index 9dabafe..0000000 --- a/tests/auto/declarative/qmlbindengine/deferredProperties.txt +++ /dev/null @@ -1,7 +0,0 @@ -import Qt.test 1.0 - -MyDeferredObject { - value: 10 - objectProperty: MyQmlObject {} - objectProperty2: MyQmlObject { id: blah } -} diff --git a/tests/auto/declarative/qmlbindengine/enums.1.qml b/tests/auto/declarative/qmlbindengine/enums.1.qml deleted file mode 100644 index 6351823..0000000 --- a/tests/auto/declarative/qmlbindengine/enums.1.qml +++ /dev/null @@ -1,20 +0,0 @@ -import Qt.test 1.0 -import Qt.test 1.0 as Namespace - -MyQmlObject { - // Enums from non-namespaced type - property int a: MyQmlObject.EnumValue1 - property int b: MyQmlObject.EnumValue2 - property int c: MyQmlObject.EnumValue3 - property int d: MyQmlObject.EnumValue4 - - // Enums from namespaced type - property int e: Namespace.MyQmlObject.EnumValue1 - property int f: Namespace.MyQmlObject.EnumValue2 - property int g: Namespace.MyQmlObject.EnumValue3 - property int h: Namespace.MyQmlObject.EnumValue4 - - // Test that enums don't mask attached properties - property int i: MyQmlObject.value - property int j: Namespace.MyQmlObject.value -} diff --git a/tests/auto/declarative/qmlbindengine/extensionObjects.txt b/tests/auto/declarative/qmlbindengine/extensionObjects.txt deleted file mode 100644 index a902312..0000000 --- a/tests/auto/declarative/qmlbindengine/extensionObjects.txt +++ /dev/null @@ -1,10 +0,0 @@ -import Qt.test 1.0 - -MyExtendedObject -{ - baseProperty: baseExtendedProperty - baseExtendedProperty: 13 - - coreProperty: extendedProperty - extendedProperty: 9 -} diff --git a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt b/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt deleted file mode 100644 index ccb3a22..0000000 --- a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt +++ /dev/null @@ -1,13 +0,0 @@ -import Qt.test 1.0 -import Qt 4.6 - -MyQmlObject { - objectProperty: if(1) OtherObject - - property var obj - - obj: Object { - id: OtherObject - } -} - diff --git a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt b/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt deleted file mode 100644 index 6c1fca6..0000000 --- a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt +++ /dev/null @@ -1,12 +0,0 @@ -import Qt.test 1.0 -import Qt 4.6 - -MyQmlObject { - objectProperty: OtherObject - - property var obj - - obj: Object { - id: OtherObject - } -} diff --git a/tests/auto/declarative/qmlbindengine/methods.1.txt b/tests/auto/declarative/qmlbindengine/methods.1.txt deleted file mode 100644 index 8ba300f..0000000 --- a/tests/auto/declarative/qmlbindengine/methods.1.txt +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - id: MyObject - onBasicSignal: MyObject.method() -} diff --git a/tests/auto/declarative/qmlbindengine/methods.2.txt b/tests/auto/declarative/qmlbindengine/methods.2.txt deleted file mode 100644 index 70911f7..0000000 --- a/tests/auto/declarative/qmlbindengine/methods.2.txt +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - id: MyObject - onBasicSignal: MyObject.method(163) -} diff --git a/tests/auto/declarative/qmlbindengine/signalAssignment.1.txt b/tests/auto/declarative/qmlbindengine/signalAssignment.1.txt deleted file mode 100644 index fbd0914..0000000 --- a/tests/auto/declarative/qmlbindengine/signalAssignment.1.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - onBasicSignal: setString('pass') -} diff --git a/tests/auto/declarative/qmlbindengine/signalAssignment.2.txt b/tests/auto/declarative/qmlbindengine/signalAssignment.2.txt deleted file mode 100644 index 8addcb9..0000000 --- a/tests/auto/declarative/qmlbindengine/signalAssignment.2.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) -} diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp index 80373fe..2f2bb43 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp @@ -11,7 +11,7 @@ inline QUrl TEST_FILE(const QString &filename) { QFileInfo fileInfo(__FILE__); - return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(filename)); + return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename)); } inline QUrl TEST_FILE(const char *filename) -- cgit v0.12 From 11faf8ea7dbff1d81b6e5fbe7c907e5b06be1aa1 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 12:51:48 +1000 Subject: Use .qml file extension in test --- .../declarative/qmlbindengine/data/bindingLoop.qml | 14 ++++++++++++++ .../declarative/qmlbindengine/data/bindingLoop.txt | 14 -------------- .../data/boolPropertiesEvaluateAsBool.1.qml | 5 +++++ .../data/boolPropertiesEvaluateAsBool.1.txt | 5 ----- .../data/boolPropertiesEvaluateAsBool.2.qml | 5 +++++ .../data/boolPropertiesEvaluateAsBool.2.txt | 5 ----- .../qmlbindengine/data/deferredProperties.qml | 7 +++++++ .../qmlbindengine/data/deferredProperties.txt | 7 ------- .../qmlbindengine/data/extensionObjects.qml | 10 ++++++++++ .../qmlbindengine/data/extensionObjects.txt | 10 ---------- .../qmlbindengine/data/idShortcutInvalidates.1.qml | 13 +++++++++++++ .../qmlbindengine/data/idShortcutInvalidates.1.txt | 13 ------------- .../qmlbindengine/data/idShortcutInvalidates.qml | 12 ++++++++++++ .../qmlbindengine/data/idShortcutInvalidates.txt | 12 ------------ .../declarative/qmlbindengine/data/methods.1.qml | 6 ++++++ .../declarative/qmlbindengine/data/methods.1.txt | 6 ------ .../declarative/qmlbindengine/data/methods.2.qml | 6 ++++++ .../declarative/qmlbindengine/data/methods.2.txt | 6 ------ .../qmlbindengine/data/signalAssignment.1.qml | 5 +++++ .../qmlbindengine/data/signalAssignment.1.txt | 5 ----- .../qmlbindengine/data/signalAssignment.2.qml | 5 +++++ .../qmlbindengine/data/signalAssignment.2.txt | 5 ----- .../qmlbindengine/tst_qmlbindengine.cpp | 22 +++++++++++----------- 23 files changed, 99 insertions(+), 99 deletions(-) create mode 100644 tests/auto/declarative/qmlbindengine/data/bindingLoop.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/bindingLoop.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/deferredProperties.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/deferredProperties.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/extensionObjects.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/extensionObjects.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/methods.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/methods.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/methods.2.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/methods.2.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt create mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt diff --git a/tests/auto/declarative/qmlbindengine/data/bindingLoop.qml b/tests/auto/declarative/qmlbindengine/data/bindingLoop.qml new file mode 100644 index 0000000..8b22dd1 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/bindingLoop.qml @@ -0,0 +1,14 @@ +import Qt.test 1.0 + +MyQmlContainer { + children : [ + MyQmlObject { + id: Object1 + stringProperty: "hello" + Object2.stringProperty + }, + MyQmlObject { + id: Object2 + stringProperty: "hello" + Object1.stringProperty + } + ] +} diff --git a/tests/auto/declarative/qmlbindengine/data/bindingLoop.txt b/tests/auto/declarative/qmlbindengine/data/bindingLoop.txt deleted file mode 100644 index 8b22dd1..0000000 --- a/tests/auto/declarative/qmlbindengine/data/bindingLoop.txt +++ /dev/null @@ -1,14 +0,0 @@ -import Qt.test 1.0 - -MyQmlContainer { - children : [ - MyQmlObject { - id: Object1 - stringProperty: "hello" + Object2.stringProperty - }, - MyQmlObject { - id: Object2 - stringProperty: "hello" + Object1.stringProperty - } - ] -} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml new file mode 100644 index 0000000..3147f63 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + stringProperty: trueProperty?'pass':'fail' +} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt deleted file mode 100644 index 3147f63..0000000 --- a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - stringProperty: trueProperty?'pass':'fail' -} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml new file mode 100644 index 0000000..c89bb49 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + stringProperty: falseProperty?'fail':'pass' +} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt deleted file mode 100644 index c89bb49..0000000 --- a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - stringProperty: falseProperty?'fail':'pass' -} diff --git a/tests/auto/declarative/qmlbindengine/data/deferredProperties.qml b/tests/auto/declarative/qmlbindengine/data/deferredProperties.qml new file mode 100644 index 0000000..9dabafe --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/deferredProperties.qml @@ -0,0 +1,7 @@ +import Qt.test 1.0 + +MyDeferredObject { + value: 10 + objectProperty: MyQmlObject {} + objectProperty2: MyQmlObject { id: blah } +} diff --git a/tests/auto/declarative/qmlbindengine/data/deferredProperties.txt b/tests/auto/declarative/qmlbindengine/data/deferredProperties.txt deleted file mode 100644 index 9dabafe..0000000 --- a/tests/auto/declarative/qmlbindengine/data/deferredProperties.txt +++ /dev/null @@ -1,7 +0,0 @@ -import Qt.test 1.0 - -MyDeferredObject { - value: 10 - objectProperty: MyQmlObject {} - objectProperty2: MyQmlObject { id: blah } -} diff --git a/tests/auto/declarative/qmlbindengine/data/extensionObjects.qml b/tests/auto/declarative/qmlbindengine/data/extensionObjects.qml new file mode 100644 index 0000000..a902312 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/extensionObjects.qml @@ -0,0 +1,10 @@ +import Qt.test 1.0 + +MyExtendedObject +{ + baseProperty: baseExtendedProperty + baseExtendedProperty: 13 + + coreProperty: extendedProperty + extendedProperty: 9 +} diff --git a/tests/auto/declarative/qmlbindengine/data/extensionObjects.txt b/tests/auto/declarative/qmlbindengine/data/extensionObjects.txt deleted file mode 100644 index a902312..0000000 --- a/tests/auto/declarative/qmlbindengine/data/extensionObjects.txt +++ /dev/null @@ -1,10 +0,0 @@ -import Qt.test 1.0 - -MyExtendedObject -{ - baseProperty: baseExtendedProperty - baseExtendedProperty: 13 - - coreProperty: extendedProperty - extendedProperty: 9 -} diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml new file mode 100644 index 0000000..ccb3a22 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml @@ -0,0 +1,13 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyQmlObject { + objectProperty: if(1) OtherObject + + property var obj + + obj: Object { + id: OtherObject + } +} + diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt deleted file mode 100644 index ccb3a22..0000000 --- a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.txt +++ /dev/null @@ -1,13 +0,0 @@ -import Qt.test 1.0 -import Qt 4.6 - -MyQmlObject { - objectProperty: if(1) OtherObject - - property var obj - - obj: Object { - id: OtherObject - } -} - diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml new file mode 100644 index 0000000..6c1fca6 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml @@ -0,0 +1,12 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyQmlObject { + objectProperty: OtherObject + + property var obj + + obj: Object { + id: OtherObject + } +} diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt deleted file mode 100644 index 6c1fca6..0000000 --- a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.txt +++ /dev/null @@ -1,12 +0,0 @@ -import Qt.test 1.0 -import Qt 4.6 - -MyQmlObject { - objectProperty: OtherObject - - property var obj - - obj: Object { - id: OtherObject - } -} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.1.qml b/tests/auto/declarative/qmlbindengine/data/methods.1.qml new file mode 100644 index 0000000..8ba300f --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/methods.1.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyQmlObject { + id: MyObject + onBasicSignal: MyObject.method() +} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.1.txt b/tests/auto/declarative/qmlbindengine/data/methods.1.txt deleted file mode 100644 index 8ba300f..0000000 --- a/tests/auto/declarative/qmlbindengine/data/methods.1.txt +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - id: MyObject - onBasicSignal: MyObject.method() -} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.2.qml b/tests/auto/declarative/qmlbindengine/data/methods.2.qml new file mode 100644 index 0000000..70911f7 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/methods.2.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyQmlObject { + id: MyObject + onBasicSignal: MyObject.method(163) +} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.2.txt b/tests/auto/declarative/qmlbindengine/data/methods.2.txt deleted file mode 100644 index 70911f7..0000000 --- a/tests/auto/declarative/qmlbindengine/data/methods.2.txt +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - id: MyObject - onBasicSignal: MyObject.method(163) -} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml b/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml new file mode 100644 index 0000000..fbd0914 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + onBasicSignal: setString('pass') +} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt b/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt deleted file mode 100644 index fbd0914..0000000 --- a/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - onBasicSignal: setString('pass') -} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml b/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml new file mode 100644 index 0000000..8addcb9 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) +} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt b/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt deleted file mode 100644 index 8addcb9..0000000 --- a/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.txt +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) -} diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp index 2f2bb43..c7d6a87 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp @@ -47,7 +47,7 @@ private: void tst_qmlbindengine::idShortcutInvalidates() { { - QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.txt")); + QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QVERIFY(object->objectProperty() != 0); @@ -56,7 +56,7 @@ void tst_qmlbindengine::idShortcutInvalidates() } { - QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.1.txt")); + QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.1.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QVERIFY(object->objectProperty() != 0); @@ -68,13 +68,13 @@ void tst_qmlbindengine::idShortcutInvalidates() void tst_qmlbindengine::boolPropertiesEvaluateAsBool() { { - QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.1.txt")); + QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.1.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->stringProperty(), QLatin1String("pass")); } { - QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.2.txt")); + QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.2.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->stringProperty(), QLatin1String("pass")); @@ -84,7 +84,7 @@ void tst_qmlbindengine::boolPropertiesEvaluateAsBool() void tst_qmlbindengine::signalAssignment() { { - QmlComponent component(&engine, TEST_FILE("signalAssignment.1.txt")); + QmlComponent component(&engine, TEST_FILE("signalAssignment.1.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->string(), QString()); @@ -93,7 +93,7 @@ void tst_qmlbindengine::signalAssignment() } { - QmlComponent component(&engine, TEST_FILE("signalAssignment.2.txt")); + QmlComponent component(&engine, TEST_FILE("signalAssignment.2.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->string(), QString()); @@ -105,7 +105,7 @@ void tst_qmlbindengine::signalAssignment() void tst_qmlbindengine::methods() { { - QmlComponent component(&engine, TEST_FILE("methods.1.txt")); + QmlComponent component(&engine, TEST_FILE("methods.1.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->methodCalled(), false); @@ -116,7 +116,7 @@ void tst_qmlbindengine::methods() } { - QmlComponent component(&engine, TEST_FILE("methods.2.txt")); + QmlComponent component(&engine, TEST_FILE("methods.2.qml")); MyQmlObject *object = qobject_cast(component.create()); QVERIFY(object != 0); QCOMPARE(object->methodCalled(), false); @@ -129,7 +129,7 @@ void tst_qmlbindengine::methods() void tst_qmlbindengine::bindingLoop() { - QmlComponent component(&engine, TEST_FILE("bindingLoop.txt")); + QmlComponent component(&engine, TEST_FILE("bindingLoop.qml")); QTest::ignoreMessage(QtWarningMsg, "QML MyQmlObject (unknown location): Binding loop detected for property \"stringProperty\" "); QObject *object = component.create(); QVERIFY(object != 0); @@ -337,7 +337,7 @@ void tst_qmlbindengine::objectPropertiesTriggerReeval() void tst_qmlbindengine::deferredProperties() { - QmlComponent component(&engine, TEST_FILE("deferredProperties.txt")); + QmlComponent component(&engine, TEST_FILE("deferredProperties.qml")); MyDeferredObject *object = qobject_cast(component.create()); QVERIFY(object != 0); @@ -354,7 +354,7 @@ void tst_qmlbindengine::deferredProperties() void tst_qmlbindengine::extensionObjects() { - QmlComponent component(&engine, TEST_FILE("extensionObjects.txt")); + QmlComponent component(&engine, TEST_FILE("extensionObjects.qml")); MyExtendedObject *object = qobject_cast(component.create()); QVERIFY(object != 0); -- cgit v0.12 From 267ab0cd6a1d7070a7139eda24eb372590603c01 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 12:56:58 +1000 Subject: Compile --- src/declarative/qml/qmlwatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlwatcher.cpp b/src/declarative/qml/qmlwatcher.cpp index eb00dfe..ca99472 100644 --- a/src/declarative/qml/qmlwatcher.cpp +++ b/src/declarative/qml/qmlwatcher.cpp @@ -180,4 +180,4 @@ void QmlWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, cons QT_END_NAMESPACE -#include "qmlwatch.moc" +#include "qmlwatcher.moc" -- cgit v0.12 From ecfe2b1cb35a8779bea5d23c0bb2c1b31939c01d Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 13:02:57 +1000 Subject: Merge qmlengine and qmlbindengine tests --- .../qmlbindengine/data/valueTypeFunctions.qml | 6 ++ tests/auto/declarative/qmlbindengine/testtypes.cpp | 1 + tests/auto/declarative/qmlbindengine/testtypes.h | 67 +++++++++++++++ .../qmlbindengine/tst_qmlbindengine.cpp | 11 +++ tests/auto/declarative/qmlengine/functions.qml | 6 -- tests/auto/declarative/qmlengine/qmlengine.pro | 5 -- tests/auto/declarative/qmlengine/tst_qmlengine.cpp | 98 ---------------------- 7 files changed, 85 insertions(+), 109 deletions(-) create mode 100644 tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml delete mode 100644 tests/auto/declarative/qmlengine/functions.qml delete mode 100644 tests/auto/declarative/qmlengine/qmlengine.pro delete mode 100644 tests/auto/declarative/qmlengine/tst_qmlengine.cpp diff --git a/tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml b/tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml new file mode 100644 index 0000000..33b4a68 --- /dev/null +++ b/tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyTypeObject { + rectProperty: Qt.rect(0,0,100,100) + rectFProperty: Qt.rect(0,0.5,100,99.5) +} diff --git a/tests/auto/declarative/qmlbindengine/testtypes.cpp b/tests/auto/declarative/qmlbindengine/testtypes.cpp index 3ff05d7..22e3071 100644 --- a/tests/auto/declarative/qmlbindengine/testtypes.cpp +++ b/tests/auto/declarative/qmlbindengine/testtypes.cpp @@ -37,5 +37,6 @@ QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyDeferredObject,MyDeferredObject); QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyQmlContainer,MyQmlContainer); QML_DEFINE_EXTENDED_TYPE(Qt.test, 1, 0, 0, MyBaseExtendedObject,MyBaseExtendedObject,BaseExtensionObject); QML_DEFINE_EXTENDED_TYPE(Qt.test, 1, 0, 0, MyExtendedObject,MyExtendedObject,ExtensionObject); +QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyTypeObject, MyTypeObject); #include "testtypes.moc" diff --git a/tests/auto/declarative/qmlbindengine/testtypes.h b/tests/auto/declarative/qmlbindengine/testtypes.h index f27c0b0..f0302aa 100644 --- a/tests/auto/declarative/qmlbindengine/testtypes.h +++ b/tests/auto/declarative/qmlbindengine/testtypes.h @@ -4,6 +4,9 @@ #include #include #include +#include +#include +#include class MyQmlAttachedObject : public QObject { @@ -197,5 +200,69 @@ private: }; QML_DECLARE_TYPE(MyExtendedObject); +class MyTypeObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); + Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); + Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); + Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); + Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); + Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); + +public: + MyTypeObject() {} + + QPoint pointPropertyValue; + QPoint pointProperty() const { + return pointPropertyValue; + } + void setPointProperty(const QPoint &v) { + pointPropertyValue = v; + } + + QPointF pointFPropertyValue; + QPointF pointFProperty() const { + return pointFPropertyValue; + } + void setPointFProperty(const QPointF &v) { + pointFPropertyValue = v; + } + + QSize sizePropertyValue; + QSize sizeProperty() const { + return sizePropertyValue; + } + void setSizeProperty(const QSize &v) { + sizePropertyValue = v; + } + + QSizeF sizeFPropertyValue; + QSizeF sizeFProperty() const { + return sizeFPropertyValue; + } + void setSizeFProperty(const QSizeF &v) { + sizeFPropertyValue = v; + } + + QRect rectPropertyValue; + QRect rectProperty() const { + return rectPropertyValue; + } + void setRectProperty(const QRect &v) { + rectPropertyValue = v; + } + + QRectF rectFPropertyValue; + QRectF rectFProperty() const { + return rectFPropertyValue; + } + void setRectFProperty(const QRectF &v) { + rectFPropertyValue = v; + } + +}; +QML_DECLARE_TYPE(MyTypeObject); + #endif // TESTTYPES_H diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp index c7d6a87..612220a 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp @@ -39,6 +39,7 @@ private slots: void deferredProperties(); void extensionObjects(); void enums(); + void valueTypeFunctions(); private: QmlEngine engine; @@ -385,6 +386,16 @@ void tst_qmlbindengine::enums() QCOMPARE(object->property("j").toInt(), 19); } +void tst_qmlbindengine::valueTypeFunctions() +{ + QmlComponent component(&engine, TEST_FILE("valueTypeFunctions.qml")); + MyTypeObject *obj = qobject_cast(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->rectProperty(), QRect(0,0,100,100)); + QCOMPARE(obj->rectFProperty(), QRectF(0,0.5,100,99.5)); +} + + QTEST_MAIN(tst_qmlbindengine) #include "tst_qmlbindengine.moc" diff --git a/tests/auto/declarative/qmlengine/functions.qml b/tests/auto/declarative/qmlengine/functions.qml deleted file mode 100644 index 28e8ed4..0000000 --- a/tests/auto/declarative/qmlengine/functions.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 - -MyTypeObject { - rectProperty: Qt.rect(0,0,100,100) - rectFProperty: Qt.rect(0,0.5,100,99.5) -} diff --git a/tests/auto/declarative/qmlengine/qmlengine.pro b/tests/auto/declarative/qmlengine/qmlengine.pro deleted file mode 100644 index 4ac81e9..0000000 --- a/tests/auto/declarative/qmlengine/qmlengine.pro +++ /dev/null @@ -1,5 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_qmlengine.cpp - -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlengine/tst_qmlengine.cpp b/tests/auto/declarative/qmlengine/tst_qmlengine.cpp deleted file mode 100644 index 8c050cb..0000000 --- a/tests/auto/declarative/qmlengine/tst_qmlengine.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include - -class tst_qmlengine : public QObject -{ - Q_OBJECT -public: - tst_qmlengine() {} - -private slots: - void valueTypeFunctions(); - -private: - QmlEngine engine; -}; - -class MyTypeObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); - Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); - Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); - Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); - Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); - Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); - -public: - MyTypeObject() {} - - QPoint pointPropertyValue; - QPoint pointProperty() const { - return pointPropertyValue; - } - void setPointProperty(const QPoint &v) { - pointPropertyValue = v; - } - - QPointF pointFPropertyValue; - QPointF pointFProperty() const { - return pointFPropertyValue; - } - void setPointFProperty(const QPointF &v) { - pointFPropertyValue = v; - } - - QSize sizePropertyValue; - QSize sizeProperty() const { - return sizePropertyValue; - } - void setSizeProperty(const QSize &v) { - sizePropertyValue = v; - } - - QSizeF sizeFPropertyValue; - QSizeF sizeFProperty() const { - return sizeFPropertyValue; - } - void setSizeFProperty(const QSizeF &v) { - sizeFPropertyValue = v; - } - - QRect rectPropertyValue; - QRect rectProperty() const { - return rectPropertyValue; - } - void setRectProperty(const QRect &v) { - rectPropertyValue = v; - } - - QRectF rectFPropertyValue; - QRectF rectFProperty() const { - return rectFPropertyValue; - } - void setRectFProperty(const QRectF &v) { - rectFPropertyValue = v; - } - -}; -QML_DECLARE_TYPE(MyTypeObject); -QML_DEFINE_TYPE(Test, 1, 0, 0, MyTypeObject, MyTypeObject); - -void tst_qmlengine::valueTypeFunctions() -{ - QmlComponent component(&engine, SRCDIR "/functions.qml"); - MyTypeObject *obj = qobject_cast(component.create()); - QCOMPARE(obj->rectProperty(), QRect(0,0,100,100)); - QCOMPARE(obj->rectFProperty(), QRectF(0,0.5,100,99.5)); -} - -QTEST_MAIN(tst_qmlengine) - -#include "tst_qmlengine.moc" -- cgit v0.12 From babddd243002ecd6db23aca6322fd27797bd2385 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 13:18:00 +1000 Subject: Rename testcases --- tests/auto/declarative/declarative.pro | 7 +- .../declarative/qmlbindengine/data/bindingLoop.qml | 14 - .../data/boolPropertiesEvaluateAsBool.1.qml | 5 - .../data/boolPropertiesEvaluateAsBool.2.qml | 5 - .../qmlbindengine/data/deferredProperties.qml | 7 - .../declarative/qmlbindengine/data/enums.1.qml | 20 - .../qmlbindengine/data/extensionObjects.qml | 10 - .../qmlbindengine/data/idShortcutInvalidates.1.qml | 13 - .../qmlbindengine/data/idShortcutInvalidates.qml | 12 - .../declarative/qmlbindengine/data/methods.1.qml | 6 - .../declarative/qmlbindengine/data/methods.2.qml | 6 - .../qmlbindengine/data/signalAssignment.1.qml | 5 - .../qmlbindengine/data/signalAssignment.2.qml | 5 - .../qmlbindengine/data/valueTypeFunctions.qml | 6 - .../declarative/qmlbindengine/qmlbindengine.pro | 9 - tests/auto/declarative/qmlbindengine/testtypes.cpp | 42 - tests/auto/declarative/qmlbindengine/testtypes.h | 268 ------- .../qmlbindengine/tst_qmlbindengine.cpp | 401 ---------- .../declarative/qmlecmascript/data/bindingLoop.qml | 14 + .../data/boolPropertiesEvaluateAsBool.1.qml | 5 + .../data/boolPropertiesEvaluateAsBool.2.qml | 5 + .../qmlecmascript/data/deferredProperties.qml | 7 + .../declarative/qmlecmascript/data/enums.1.qml | 20 + .../qmlecmascript/data/extensionObjects.qml | 10 + .../qmlecmascript/data/idShortcutInvalidates.1.qml | 13 + .../qmlecmascript/data/idShortcutInvalidates.qml | 12 + .../declarative/qmlecmascript/data/methods.1.qml | 6 + .../declarative/qmlecmascript/data/methods.2.qml | 6 + .../qmlecmascript/data/signalAssignment.1.qml | 5 + .../qmlecmascript/data/signalAssignment.2.qml | 5 + .../qmlecmascript/data/valueTypeFunctions.qml | 6 + .../declarative/qmlecmascript/qmlecmascript.pro | 9 + tests/auto/declarative/qmlecmascript/testtypes.cpp | 42 + tests/auto/declarative/qmlecmascript/testtypes.h | 268 +++++++ .../qmlecmascript/tst_qmlecmascript.cpp | 407 ++++++++++ tests/auto/declarative/qmllanguage/data/Alias.qml | 8 + .../declarative/qmllanguage/data/MyComponent.qml | 6 + .../qmllanguage/data/MyContainerComponent.qml | 5 + .../auto/declarative/qmllanguage/data/alias.1.qml | 8 + .../auto/declarative/qmllanguage/data/alias.2.qml | 8 + .../auto/declarative/qmllanguage/data/alias.3.qml | 10 + .../qmllanguage/data/assignBasicTypes.qml | 26 + .../data/assignLiteralSignalProperty.qml | 4 + .../qmllanguage/data/assignObjectToSignal.qml | 4 + .../qmllanguage/data/assignObjectToVariant.qml | 6 + .../qmllanguage/data/assignQmlComponent.qml | 4 + .../declarative/qmllanguage/data/assignSignal.qml | 5 + .../qmllanguage/data/assignTypeExtremes.qml | 5 + .../qmllanguage/data/attachedProperties.qml | 5 + .../qmllanguage/data/autoComponentCreation.qml | 4 + .../declarative/qmllanguage/data/cppnamespace.qml | 4 + .../data/customParserIdNotAllowed.errors.txt | 1 + .../qmllanguage/data/customParserIdNotAllowed.qml | 5 + .../qmllanguage/data/customParserTypes.qml | 5 + .../qmllanguage/data/customVariantTypes.qml | 4 + .../qmllanguage/data/duplicateIDs.errors.txt | 1 + .../declarative/qmllanguage/data/duplicateIDs.qml | 6 + .../qmllanguage/data/dynamicObject.1.qml | 8 + .../qmllanguage/data/dynamicProperties.qml | 13 + .../qmllanguage/data/dynamicSignalsAndSlots.qml | 7 + .../declarative/qmllanguage/data/empty.errors.txt | 2 + tests/auto/declarative/qmllanguage/data/empty.qml | 0 .../qmllanguage/data/failingComponent.errors.txt | 1 + .../qmllanguage/data/failingComponentTest.qml | 4 + .../qmllanguage/data/fakeDotProperty.errors.txt | 1 + .../qmllanguage/data/fakeDotProperty.qml | 4 + .../qmllanguage/data/finalOverride.errors.txt | 1 + .../declarative/qmllanguage/data/finalOverride.qml | 4 + .../declarative/qmllanguage/data/idProperty.qml | 8 + .../data/importNamespaceConflict.errors.txt | 1 + .../qmllanguage/data/importNamespaceConflict.qml | 4 + .../data/importVersionMissingBuiltIn.errors.txt | 1 + .../data/importVersionMissingBuiltIn.qml | 7 + .../data/importVersionMissingInstalled.errors.txt | 1 + .../data/importVersionMissingInstalled.qml | 3 + .../qmllanguage/data/inlineQmlComponents.qml | 10 + .../qmllanguage/data/interfaceProperty.qml | 5 + .../qmllanguage/data/interfaceQList.qml | 7 + .../qmllanguage/data/interfaceQmlList.qml | 7 + .../qmllanguage/data/invalidID.2.errors.txt | 2 + .../declarative/qmllanguage/data/invalidID.2.qml | 5 + .../qmllanguage/data/invalidID.3.errors.txt | 1 + .../declarative/qmllanguage/data/invalidID.3.qml | 5 + .../qmllanguage/data/invalidID.4.errors.txt | 1 + .../declarative/qmllanguage/data/invalidID.4.qml | 6 + .../qmllanguage/data/invalidID.5.errors.txt | 1 + .../declarative/qmllanguage/data/invalidID.5.qml | 6 + .../qmllanguage/data/invalidID.6.errors.txt | 1 + .../declarative/qmllanguage/data/invalidID.6.qml | 5 + .../qmllanguage/data/invalidID.errors.txt | 1 + .../declarative/qmllanguage/data/invalidID.qml | 4 + .../lib/com/nokia/installedtest/InstalledTest.qml | 2 + .../lib/com/nokia/installedtest/InstalledTest2.qml | 2 + .../data/lib/com/nokia/installedtest/qmldir | 3 + .../qmllanguage/data/listAssignment.1.errors.txt | 1 + .../qmllanguage/data/listAssignment.1.qml | 4 + .../qmllanguage/data/listAssignment.2.errors.txt | 2 + .../qmllanguage/data/listAssignment.2.qml | 4 + .../qmllanguage/data/listAssignment.3.errors.txt | 1 + .../qmllanguage/data/listAssignment.3.qml | 6 + .../qmllanguage/data/listItemDeleteSelf.qml | 38 + .../qmllanguage/data/missingObject.errors.txt | 1 + .../declarative/qmllanguage/data/missingObject.qml | 1 + .../qmllanguage/data/missingSignal.errors.txt | 1 + .../declarative/qmllanguage/data/missingSignal.qml | 5 + .../data/nonexistantProperty.1.errors.txt | 1 + .../qmllanguage/data/nonexistantProperty.1.qml | 2 + .../data/nonexistantProperty.2.errors.txt | 1 + .../qmllanguage/data/nonexistantProperty.2.qml | 4 + .../data/nonexistantProperty.3.errors.txt | 1 + .../qmllanguage/data/nonexistantProperty.3.qml | 4 + .../data/nonexistantProperty.4.errors.txt | 1 + .../qmllanguage/data/nonexistantProperty.4.qml | 4 + .../data/nonexistantProperty.5.errors.txt | 1 + .../qmllanguage/data/nonexistantProperty.5.qml | 4 + .../data/nonexistantProperty.6.errors.txt | 1 + .../qmllanguage/data/nonexistantProperty.6.qml | 4 + .../qmllanguage/data/nullDotProperty.errors.txt | 1 + .../qmllanguage/data/nullDotProperty.qml | 4 + .../qmllanguage/data/propertyValueSource.qml | 4 + .../qmllanguage/data/readOnly.1.errors.txt | 1 + .../declarative/qmllanguage/data/readOnly.1.qml | 4 + .../qmllanguage/data/readOnly.2.errors.txt | 1 + .../declarative/qmllanguage/data/readOnly.2.qml | 4 + .../qmllanguage/data/rootAsQmlComponent.qml | 6 + .../qmllanguage/data/simpleBindings.qml | 18 + .../qmllanguage/data/simpleContainer.qml | 5 + .../declarative/qmllanguage/data/simpleObject.qml | 2 + .../declarative/qmllanguage/data/subdir/Test.qml | 2 + .../qmllanguage/data/unregisteredObject.errors.txt | 1 + .../qmllanguage/data/unregisteredObject.qml | 2 + .../data/unsupportedProperty.errors.txt | 1 + .../qmllanguage/data/unsupportedProperty.qml | 4 + .../declarative/qmllanguage/data/valueTypes.qml | 13 + .../qmllanguage/data/wrongType.1.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.1.qml | 4 + .../qmllanguage/data/wrongType.10.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.10.qml | 5 + .../qmllanguage/data/wrongType.11.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.11.qml | 5 + .../qmllanguage/data/wrongType.12.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.12.qml | 5 + .../qmllanguage/data/wrongType.13.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.13.qml | 4 + .../qmllanguage/data/wrongType.14.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.14.qml | 5 + .../qmllanguage/data/wrongType.2.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.2.qml | 4 + .../qmllanguage/data/wrongType.3.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.3.qml | 4 + .../qmllanguage/data/wrongType.4.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.4.qml | 4 + .../qmllanguage/data/wrongType.5.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.5.qml | 5 + .../qmllanguage/data/wrongType.6.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.6.qml | 5 + .../qmllanguage/data/wrongType.7.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.7.qml | 5 + .../qmllanguage/data/wrongType.8.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.8.qml | 5 + .../qmllanguage/data/wrongType.9.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.9.qml | 5 + tests/auto/declarative/qmllanguage/qmllanguage.pro | 9 + tests/auto/declarative/qmllanguage/testtypes.cpp | 10 + tests/auto/declarative/qmllanguage/testtypes.h | 433 +++++++++++ .../declarative/qmllanguage/tst_qmllanguage.cpp | 863 +++++++++++++++++++++ tests/auto/declarative/qmlparser/data/Alias.qml | 8 - .../declarative/qmlparser/data/MyComponent.qml | 6 - .../qmlparser/data/MyContainerComponent.qml | 5 - tests/auto/declarative/qmlparser/data/alias.1.qml | 8 - tests/auto/declarative/qmlparser/data/alias.2.qml | 8 - tests/auto/declarative/qmlparser/data/alias.3.qml | 10 - .../qmlparser/data/assignBasicTypes.qml | 26 - .../qmlparser/data/assignLiteralSignalProperty.qml | 4 - .../qmlparser/data/assignObjectToSignal.qml | 4 - .../qmlparser/data/assignObjectToVariant.qml | 6 - .../qmlparser/data/assignQmlComponent.qml | 4 - .../declarative/qmlparser/data/assignSignal.qml | 5 - .../qmlparser/data/assignTypeExtremes.qml | 5 - .../qmlparser/data/attachedProperties.qml | 5 - .../qmlparser/data/autoComponentCreation.qml | 4 - .../declarative/qmlparser/data/cppnamespace.qml | 4 - .../data/customParserIdNotAllowed.errors.txt | 1 - .../qmlparser/data/customParserIdNotAllowed.qml | 5 - .../qmlparser/data/customParserTypes.qml | 5 - .../qmlparser/data/customVariantTypes.qml | 4 - .../qmlparser/data/duplicateIDs.errors.txt | 1 - .../declarative/qmlparser/data/duplicateIDs.qml | 6 - .../declarative/qmlparser/data/dynamicObject.1.qml | 8 - .../qmlparser/data/dynamicProperties.qml | 13 - .../qmlparser/data/dynamicSignalsAndSlots.qml | 7 - .../declarative/qmlparser/data/empty.errors.txt | 2 - tests/auto/declarative/qmlparser/data/empty.qml | 0 .../qmlparser/data/failingComponent.errors.txt | 1 - .../qmlparser/data/failingComponentTest.qml | 4 - .../qmlparser/data/fakeDotProperty.errors.txt | 1 - .../declarative/qmlparser/data/fakeDotProperty.qml | 4 - .../qmlparser/data/finalOverride.errors.txt | 1 - .../declarative/qmlparser/data/finalOverride.qml | 4 - .../auto/declarative/qmlparser/data/idProperty.qml | 8 - .../data/importNamespaceConflict.errors.txt | 1 - .../qmlparser/data/importNamespaceConflict.qml | 4 - .../data/importVersionMissingBuiltIn.errors.txt | 1 - .../qmlparser/data/importVersionMissingBuiltIn.qml | 7 - .../data/importVersionMissingInstalled.errors.txt | 1 - .../data/importVersionMissingInstalled.qml | 3 - .../qmlparser/data/inlineQmlComponents.qml | 10 - .../qmlparser/data/interfaceProperty.qml | 5 - .../declarative/qmlparser/data/interfaceQList.qml | 7 - .../qmlparser/data/interfaceQmlList.qml | 7 - .../qmlparser/data/invalidID.2.errors.txt | 2 - .../declarative/qmlparser/data/invalidID.2.qml | 5 - .../qmlparser/data/invalidID.3.errors.txt | 1 - .../declarative/qmlparser/data/invalidID.3.qml | 5 - .../qmlparser/data/invalidID.4.errors.txt | 1 - .../declarative/qmlparser/data/invalidID.4.qml | 6 - .../qmlparser/data/invalidID.5.errors.txt | 1 - .../declarative/qmlparser/data/invalidID.5.qml | 6 - .../qmlparser/data/invalidID.6.errors.txt | 1 - .../declarative/qmlparser/data/invalidID.6.qml | 5 - .../qmlparser/data/invalidID.errors.txt | 1 - .../auto/declarative/qmlparser/data/invalidID.qml | 4 - .../lib/com/nokia/installedtest/InstalledTest.qml | 2 - .../lib/com/nokia/installedtest/InstalledTest2.qml | 2 - .../data/lib/com/nokia/installedtest/qmldir | 3 - .../qmlparser/data/listAssignment.1.errors.txt | 1 - .../qmlparser/data/listAssignment.1.qml | 4 - .../qmlparser/data/listAssignment.2.errors.txt | 2 - .../qmlparser/data/listAssignment.2.qml | 4 - .../qmlparser/data/listAssignment.3.errors.txt | 1 - .../qmlparser/data/listAssignment.3.qml | 6 - .../qmlparser/data/listItemDeleteSelf.qml | 38 - .../qmlparser/data/missingObject.errors.txt | 1 - .../declarative/qmlparser/data/missingObject.qml | 1 - .../qmlparser/data/missingSignal.errors.txt | 1 - .../declarative/qmlparser/data/missingSignal.qml | 5 - .../data/nonexistantProperty.1.errors.txt | 1 - .../qmlparser/data/nonexistantProperty.1.qml | 2 - .../data/nonexistantProperty.2.errors.txt | 1 - .../qmlparser/data/nonexistantProperty.2.qml | 4 - .../data/nonexistantProperty.3.errors.txt | 1 - .../qmlparser/data/nonexistantProperty.3.qml | 4 - .../data/nonexistantProperty.4.errors.txt | 1 - .../qmlparser/data/nonexistantProperty.4.qml | 4 - .../data/nonexistantProperty.5.errors.txt | 1 - .../qmlparser/data/nonexistantProperty.5.qml | 4 - .../data/nonexistantProperty.6.errors.txt | 1 - .../qmlparser/data/nonexistantProperty.6.qml | 4 - .../qmlparser/data/nullDotProperty.errors.txt | 1 - .../declarative/qmlparser/data/nullDotProperty.qml | 4 - .../qmlparser/data/propertyValueSource.qml | 4 - .../qmlparser/data/readOnly.1.errors.txt | 1 - .../auto/declarative/qmlparser/data/readOnly.1.qml | 4 - .../qmlparser/data/readOnly.2.errors.txt | 1 - .../auto/declarative/qmlparser/data/readOnly.2.qml | 4 - .../qmlparser/data/rootAsQmlComponent.qml | 6 - .../declarative/qmlparser/data/simpleBindings.qml | 18 - .../declarative/qmlparser/data/simpleContainer.qml | 5 - .../declarative/qmlparser/data/simpleObject.qml | 2 - .../declarative/qmlparser/data/subdir/Test.qml | 2 - .../qmlparser/data/unregisteredObject.errors.txt | 1 - .../qmlparser/data/unregisteredObject.qml | 2 - .../qmlparser/data/unsupportedProperty.errors.txt | 1 - .../qmlparser/data/unsupportedProperty.qml | 4 - .../auto/declarative/qmlparser/data/valueTypes.qml | 13 - .../qmlparser/data/wrongType.1.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.1.qml | 4 - .../qmlparser/data/wrongType.10.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.10.qml | 5 - .../qmlparser/data/wrongType.11.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.11.qml | 5 - .../qmlparser/data/wrongType.12.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.12.qml | 5 - .../qmlparser/data/wrongType.13.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.13.qml | 4 - .../qmlparser/data/wrongType.14.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.14.qml | 5 - .../qmlparser/data/wrongType.2.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.2.qml | 4 - .../qmlparser/data/wrongType.3.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.3.qml | 4 - .../qmlparser/data/wrongType.4.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.4.qml | 4 - .../qmlparser/data/wrongType.5.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.5.qml | 5 - .../qmlparser/data/wrongType.6.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.6.qml | 5 - .../qmlparser/data/wrongType.7.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.7.qml | 5 - .../qmlparser/data/wrongType.8.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.8.qml | 5 - .../qmlparser/data/wrongType.9.errors.txt | 1 - .../declarative/qmlparser/data/wrongType.9.qml | 5 - tests/auto/declarative/qmlparser/qmlparser.pro | 9 - tests/auto/declarative/qmlparser/testtypes.cpp | 10 - tests/auto/declarative/qmlparser/testtypes.h | 433 ----------- tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 857 -------------------- 297 files changed, 2680 insertions(+), 2669 deletions(-) delete mode 100644 tests/auto/declarative/qmlbindengine/data/bindingLoop.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/deferredProperties.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/enums.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/extensionObjects.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/methods.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/methods.2.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml delete mode 100644 tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml delete mode 100644 tests/auto/declarative/qmlbindengine/qmlbindengine.pro delete mode 100644 tests/auto/declarative/qmlbindengine/testtypes.cpp delete mode 100644 tests/auto/declarative/qmlbindengine/testtypes.h delete mode 100644 tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp create mode 100644 tests/auto/declarative/qmlecmascript/data/bindingLoop.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.1.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.2.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/deferredProperties.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/enums.1.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/extensionObjects.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/methods.1.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/methods.2.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/signalAssignment.1.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/signalAssignment.2.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/valueTypeFunctions.qml create mode 100644 tests/auto/declarative/qmlecmascript/qmlecmascript.pro create mode 100644 tests/auto/declarative/qmlecmascript/testtypes.cpp create mode 100644 tests/auto/declarative/qmlecmascript/testtypes.h create mode 100644 tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp create mode 100644 tests/auto/declarative/qmllanguage/data/Alias.qml create mode 100644 tests/auto/declarative/qmllanguage/data/MyComponent.qml create mode 100644 tests/auto/declarative/qmllanguage/data/MyContainerComponent.qml create mode 100644 tests/auto/declarative/qmllanguage/data/alias.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/alias.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/alias.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml create mode 100644 tests/auto/declarative/qmllanguage/data/assignLiteralSignalProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/assignObjectToSignal.qml create mode 100644 tests/auto/declarative/qmllanguage/data/assignObjectToVariant.qml create mode 100644 tests/auto/declarative/qmllanguage/data/assignQmlComponent.qml create mode 100644 tests/auto/declarative/qmllanguage/data/assignSignal.qml create mode 100644 tests/auto/declarative/qmllanguage/data/assignTypeExtremes.qml create mode 100644 tests/auto/declarative/qmllanguage/data/attachedProperties.qml create mode 100644 tests/auto/declarative/qmllanguage/data/autoComponentCreation.qml create mode 100644 tests/auto/declarative/qmllanguage/data/cppnamespace.qml create mode 100644 tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml create mode 100644 tests/auto/declarative/qmllanguage/data/customParserTypes.qml create mode 100644 tests/auto/declarative/qmllanguage/data/customVariantTypes.qml create mode 100644 tests/auto/declarative/qmllanguage/data/duplicateIDs.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/duplicateIDs.qml create mode 100644 tests/auto/declarative/qmllanguage/data/dynamicObject.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/dynamicProperties.qml create mode 100644 tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml create mode 100644 tests/auto/declarative/qmllanguage/data/empty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/empty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/failingComponent.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/failingComponentTest.qml create mode 100644 tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/fakeDotProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/finalOverride.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/finalOverride.qml create mode 100644 tests/auto/declarative/qmllanguage/data/idProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/importNamespaceConflict.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/importNamespaceConflict.qml create mode 100644 tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.qml create mode 100644 tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.qml create mode 100644 tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml create mode 100644 tests/auto/declarative/qmllanguage/data/interfaceProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/interfaceQList.qml create mode 100644 tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.6.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidID.qml create mode 100644 tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest.qml create mode 100644 tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir create mode 100644 tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/listAssignment.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/listAssignment.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/listAssignment.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/listAssignment.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/listAssignment.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml create mode 100644 tests/auto/declarative/qmllanguage/data/missingObject.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/missingObject.qml create mode 100644 tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/missingSignal.qml create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.qml create mode 100644 tests/auto/declarative/qmllanguage/data/nullDotProperty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/nullDotProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/propertyValueSource.qml create mode 100644 tests/auto/declarative/qmllanguage/data/readOnly.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/readOnly.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/readOnly.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/readOnly.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/rootAsQmlComponent.qml create mode 100644 tests/auto/declarative/qmllanguage/data/simpleBindings.qml create mode 100644 tests/auto/declarative/qmllanguage/data/simpleContainer.qml create mode 100644 tests/auto/declarative/qmllanguage/data/simpleObject.qml create mode 100644 tests/auto/declarative/qmllanguage/data/subdir/Test.qml create mode 100644 tests/auto/declarative/qmllanguage/data/unregisteredObject.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/unregisteredObject.qml create mode 100644 tests/auto/declarative/qmllanguage/data/unsupportedProperty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/unsupportedProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/valueTypes.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.10.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.10.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.11.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.11.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.12.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.12.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.13.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.13.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.14.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.14.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.6.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.6.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.7.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.7.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.8.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.8.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.9.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.9.qml create mode 100644 tests/auto/declarative/qmllanguage/qmllanguage.pro create mode 100644 tests/auto/declarative/qmllanguage/testtypes.cpp create mode 100644 tests/auto/declarative/qmllanguage/testtypes.h create mode 100644 tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp delete mode 100644 tests/auto/declarative/qmlparser/data/Alias.qml delete mode 100644 tests/auto/declarative/qmlparser/data/MyComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/data/MyContainerComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/data/alias.1.qml delete mode 100644 tests/auto/declarative/qmlparser/data/alias.2.qml delete mode 100644 tests/auto/declarative/qmlparser/data/alias.3.qml delete mode 100644 tests/auto/declarative/qmlparser/data/assignBasicTypes.qml delete mode 100644 tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml delete mode 100644 tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml delete mode 100644 tests/auto/declarative/qmlparser/data/assignQmlComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/data/assignSignal.qml delete mode 100644 tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml delete mode 100644 tests/auto/declarative/qmlparser/data/attachedProperties.qml delete mode 100644 tests/auto/declarative/qmlparser/data/autoComponentCreation.qml delete mode 100644 tests/auto/declarative/qmlparser/data/cppnamespace.qml delete mode 100644 tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml delete mode 100644 tests/auto/declarative/qmlparser/data/customParserTypes.qml delete mode 100644 tests/auto/declarative/qmlparser/data/customVariantTypes.qml delete mode 100644 tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/duplicateIDs.qml delete mode 100644 tests/auto/declarative/qmlparser/data/dynamicObject.1.qml delete mode 100644 tests/auto/declarative/qmlparser/data/dynamicProperties.qml delete mode 100644 tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml delete mode 100644 tests/auto/declarative/qmlparser/data/empty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/empty.qml delete mode 100644 tests/auto/declarative/qmlparser/data/failingComponent.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/failingComponentTest.qml delete mode 100644 tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/fakeDotProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/data/finalOverride.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/finalOverride.qml delete mode 100644 tests/auto/declarative/qmlparser/data/idProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml delete mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml delete mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml delete mode 100644 tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml delete mode 100644 tests/auto/declarative/qmlparser/data/interfaceProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/data/interfaceQList.qml delete mode 100644 tests/auto/declarative/qmlparser/data/interfaceQmlList.qml delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.2.qml delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.3.qml delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.4.qml delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.5.qml delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.6.qml delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/invalidID.qml delete mode 100644 tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml delete mode 100644 tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml delete mode 100644 tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir delete mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.1.qml delete mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.2.qml delete mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/listAssignment.3.qml delete mode 100644 tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml delete mode 100644 tests/auto/declarative/qmlparser/data/missingObject.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/missingObject.qml delete mode 100644 tests/auto/declarative/qmlparser/data/missingSignal.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/missingSignal.qml delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml delete mode 100644 tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/nullDotProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/data/propertyValueSource.qml delete mode 100644 tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/readOnly.1.qml delete mode 100644 tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/readOnly.2.qml delete mode 100644 tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml delete mode 100644 tests/auto/declarative/qmlparser/data/simpleBindings.qml delete mode 100644 tests/auto/declarative/qmlparser/data/simpleContainer.qml delete mode 100644 tests/auto/declarative/qmlparser/data/simpleObject.qml delete mode 100644 tests/auto/declarative/qmlparser/data/subdir/Test.qml delete mode 100644 tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/unregisteredObject.qml delete mode 100644 tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/unsupportedProperty.qml delete mode 100644 tests/auto/declarative/qmlparser/data/valueTypes.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.1.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.10.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.11.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.12.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.13.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.14.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.2.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.3.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.4.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.5.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.6.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.7.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.8.qml delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt delete mode 100644 tests/auto/declarative/qmlparser/data/wrongType.9.qml delete mode 100644 tests/auto/declarative/qmlparser/qmlparser.pro delete mode 100644 tests/auto/declarative/qmlparser/testtypes.cpp delete mode 100644 tests/auto/declarative/qmlparser/testtypes.h delete mode 100644 tests/auto/declarative/qmlparser/tst_qmlparser.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 14d8c24..4724278 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -9,13 +9,12 @@ SUBDIRS += datetimeformatter \ qfxtextedit \ simplecanvasitem \ repeater \ - qmlparser \ - qmlbindengine \ + qmllanguage \ + qmlecmascript \ qmlmetaproperty \ qmllist \ qmllistaccessor \ - visual\ - qmlengine + visual # Tests which should run in Pulse PULSE_TESTS = $$SUBDIRS diff --git a/tests/auto/declarative/qmlbindengine/data/bindingLoop.qml b/tests/auto/declarative/qmlbindengine/data/bindingLoop.qml deleted file mode 100644 index 8b22dd1..0000000 --- a/tests/auto/declarative/qmlbindengine/data/bindingLoop.qml +++ /dev/null @@ -1,14 +0,0 @@ -import Qt.test 1.0 - -MyQmlContainer { - children : [ - MyQmlObject { - id: Object1 - stringProperty: "hello" + Object2.stringProperty - }, - MyQmlObject { - id: Object2 - stringProperty: "hello" + Object1.stringProperty - } - ] -} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml deleted file mode 100644 index 3147f63..0000000 --- a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.1.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - stringProperty: trueProperty?'pass':'fail' -} diff --git a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml b/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml deleted file mode 100644 index c89bb49..0000000 --- a/tests/auto/declarative/qmlbindengine/data/boolPropertiesEvaluateAsBool.2.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - stringProperty: falseProperty?'fail':'pass' -} diff --git a/tests/auto/declarative/qmlbindengine/data/deferredProperties.qml b/tests/auto/declarative/qmlbindengine/data/deferredProperties.qml deleted file mode 100644 index 9dabafe..0000000 --- a/tests/auto/declarative/qmlbindengine/data/deferredProperties.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Qt.test 1.0 - -MyDeferredObject { - value: 10 - objectProperty: MyQmlObject {} - objectProperty2: MyQmlObject { id: blah } -} diff --git a/tests/auto/declarative/qmlbindengine/data/enums.1.qml b/tests/auto/declarative/qmlbindengine/data/enums.1.qml deleted file mode 100644 index 6351823..0000000 --- a/tests/auto/declarative/qmlbindengine/data/enums.1.qml +++ /dev/null @@ -1,20 +0,0 @@ -import Qt.test 1.0 -import Qt.test 1.0 as Namespace - -MyQmlObject { - // Enums from non-namespaced type - property int a: MyQmlObject.EnumValue1 - property int b: MyQmlObject.EnumValue2 - property int c: MyQmlObject.EnumValue3 - property int d: MyQmlObject.EnumValue4 - - // Enums from namespaced type - property int e: Namespace.MyQmlObject.EnumValue1 - property int f: Namespace.MyQmlObject.EnumValue2 - property int g: Namespace.MyQmlObject.EnumValue3 - property int h: Namespace.MyQmlObject.EnumValue4 - - // Test that enums don't mask attached properties - property int i: MyQmlObject.value - property int j: Namespace.MyQmlObject.value -} diff --git a/tests/auto/declarative/qmlbindengine/data/extensionObjects.qml b/tests/auto/declarative/qmlbindengine/data/extensionObjects.qml deleted file mode 100644 index a902312..0000000 --- a/tests/auto/declarative/qmlbindengine/data/extensionObjects.qml +++ /dev/null @@ -1,10 +0,0 @@ -import Qt.test 1.0 - -MyExtendedObject -{ - baseProperty: baseExtendedProperty - baseExtendedProperty: 13 - - coreProperty: extendedProperty - extendedProperty: 9 -} diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml deleted file mode 100644 index ccb3a22..0000000 --- a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.1.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Qt.test 1.0 -import Qt 4.6 - -MyQmlObject { - objectProperty: if(1) OtherObject - - property var obj - - obj: Object { - id: OtherObject - } -} - diff --git a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml b/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml deleted file mode 100644 index 6c1fca6..0000000 --- a/tests/auto/declarative/qmlbindengine/data/idShortcutInvalidates.qml +++ /dev/null @@ -1,12 +0,0 @@ -import Qt.test 1.0 -import Qt 4.6 - -MyQmlObject { - objectProperty: OtherObject - - property var obj - - obj: Object { - id: OtherObject - } -} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.1.qml b/tests/auto/declarative/qmlbindengine/data/methods.1.qml deleted file mode 100644 index 8ba300f..0000000 --- a/tests/auto/declarative/qmlbindengine/data/methods.1.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - id: MyObject - onBasicSignal: MyObject.method() -} diff --git a/tests/auto/declarative/qmlbindengine/data/methods.2.qml b/tests/auto/declarative/qmlbindengine/data/methods.2.qml deleted file mode 100644 index 70911f7..0000000 --- a/tests/auto/declarative/qmlbindengine/data/methods.2.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - id: MyObject - onBasicSignal: MyObject.method(163) -} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml b/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml deleted file mode 100644 index fbd0914..0000000 --- a/tests/auto/declarative/qmlbindengine/data/signalAssignment.1.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - onBasicSignal: setString('pass') -} diff --git a/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml b/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml deleted file mode 100644 index 8addcb9..0000000 --- a/tests/auto/declarative/qmlbindengine/data/signalAssignment.2.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) -} diff --git a/tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml b/tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml deleted file mode 100644 index 33b4a68..0000000 --- a/tests/auto/declarative/qmlbindengine/data/valueTypeFunctions.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.test 1.0 - -MyTypeObject { - rectProperty: Qt.rect(0,0,100,100) - rectFProperty: Qt.rect(0,0.5,100,99.5) -} diff --git a/tests/auto/declarative/qmlbindengine/qmlbindengine.pro b/tests/auto/declarative/qmlbindengine/qmlbindengine.pro deleted file mode 100644 index 4a38ac9..0000000 --- a/tests/auto/declarative/qmlbindengine/qmlbindengine.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -macx:CONFIG -= app_bundle -SOURCES += tst_qmlbindengine.cpp \ - testtypes.cpp -HEADERS += testtypes.h - -# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -# LIBS += -lgcov diff --git a/tests/auto/declarative/qmlbindengine/testtypes.cpp b/tests/auto/declarative/qmlbindengine/testtypes.cpp deleted file mode 100644 index 22e3071..0000000 --- a/tests/auto/declarative/qmlbindengine/testtypes.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "testtypes.h" - -class BaseExtensionObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int baseExtendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged); -public: - BaseExtensionObject(QObject *parent) : QObject(parent), m_value(0) {} - - int extendedProperty() const { return m_value; } - void setExtendedProperty(int v) { m_value = v; emit extendedPropertyChanged(); } - -signals: - void extendedPropertyChanged(); -private: - int m_value; -}; - -class ExtensionObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int extendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged); -public: - ExtensionObject(QObject *parent) : QObject(parent), m_value(0) {} - - int extendedProperty() const { return m_value; } - void setExtendedProperty(int v) { m_value = v; emit extendedPropertyChanged(); } - -signals: - void extendedPropertyChanged(); -private: - int m_value; -}; - -QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyQmlObject,MyQmlObject); -QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyDeferredObject,MyDeferredObject); -QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyQmlContainer,MyQmlContainer); -QML_DEFINE_EXTENDED_TYPE(Qt.test, 1, 0, 0, MyBaseExtendedObject,MyBaseExtendedObject,BaseExtensionObject); -QML_DEFINE_EXTENDED_TYPE(Qt.test, 1, 0, 0, MyExtendedObject,MyExtendedObject,ExtensionObject); -QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyTypeObject, MyTypeObject); - -#include "testtypes.moc" diff --git a/tests/auto/declarative/qmlbindengine/testtypes.h b/tests/auto/declarative/qmlbindengine/testtypes.h deleted file mode 100644 index f0302aa..0000000 --- a/tests/auto/declarative/qmlbindengine/testtypes.h +++ /dev/null @@ -1,268 +0,0 @@ -#ifndef TESTTYPES_H -#define TESTTYPES_H - -#include -#include -#include -#include -#include -#include - -class MyQmlAttachedObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int value READ value CONSTANT) -public: - MyQmlAttachedObject(QObject *parent) : QObject(parent) {} - - int value() const { return 19; } -}; - -class MyQmlObject : public QObject -{ - Q_OBJECT - Q_ENUMS(MyEnum) - Q_ENUMS(MyEnum2) - Q_PROPERTY(bool trueProperty READ trueProperty CONSTANT) - Q_PROPERTY(bool falseProperty READ falseProperty CONSTANT) - Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged) - Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged); -public: - MyQmlObject(): m_methodCalled(false), m_methodIntCalled(false), m_object(0) {} - - enum MyEnum { EnumValue1 = 0, EnumValue2 = 1 }; - enum MyEnum2 { EnumValue3 = 2, EnumValue4 = 3 }; - - bool trueProperty() const { return true; } - bool falseProperty() const { return false; } - - QString stringProperty() const { return m_string; } - void setStringProperty(const QString &s) - { - if (s == m_string) - return; - m_string = s; - emit stringChanged(); - } - - QObject *objectProperty() const { return m_object; } - void setObjectProperty(QObject *obj) { - if (obj == m_object) - return; - m_object = obj; - emit objectChanged(); - } - - bool methodCalled() const { return m_methodCalled; } - bool methodIntCalled() const { return m_methodIntCalled; } - - QString string() const { return m_string; } - - static MyQmlAttachedObject *qmlAttachedProperties(QObject *o) { - return new MyQmlAttachedObject(o); - } -signals: - void basicSignal(); - void argumentSignal(int a, QString b, qreal c); - void stringChanged(); - void objectChanged(); - -public slots: - void method() { m_methodCalled = true; } - void method(int a) { if(a == 163) m_methodIntCalled = true; } - void setString(const QString &s) { m_string = s; } - -private: - friend class tst_qmlbindengine; - bool m_methodCalled; - bool m_methodIntCalled; - - QObject *m_object; - QString m_string; -}; - -QML_DECLARE_TYPE(MyQmlObject); - -class MyQmlContainer : public QObject -{ - Q_OBJECT - Q_PROPERTY(QList* children READ children) -public: - MyQmlContainer() {} - - QList *children() { return &m_children; } - -private: - QList m_children; -}; - -QML_DECLARE_TYPE(MyQmlContainer); - -class MyExpression : public QmlExpression -{ -public: - MyExpression(QmlContext *ctxt, const QString &expr) - : QmlExpression(ctxt, expr, 0), changed(false) - { - } - - virtual void valueChanged() { - changed = true; - } - bool changed; -}; - - -class MyDefaultObject1 : public QObject -{ - Q_OBJECT - Q_PROPERTY(int horseLegs READ horseLegs CONSTANT); - Q_PROPERTY(int antLegs READ antLegs CONSTANT); -public: - int horseLegs() const { return 4; } - int antLegs() const { return 6; } -}; - -class MyDefaultObject2 : public QObject -{ - Q_OBJECT - Q_PROPERTY(int antLegs READ antLegs CONSTANT); - Q_PROPERTY(int emuLegs READ emuLegs CONSTANT); -public: - int antLegs() const { return 5; } // Had an accident - int emuLegs() const { return 2; } -}; - -class MyDefaultObject3 : public QObject -{ - Q_OBJECT - Q_PROPERTY(int antLegs READ antLegs CONSTANT); - Q_PROPERTY(int humanLegs READ humanLegs CONSTANT); -public: - int antLegs() const { return 7; } // Mutant - int humanLegs() const { return 2; } - int millipedeLegs() const { return 1000; } -}; - -class MyDeferredObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int value READ value WRITE setValue) - Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty); - Q_PROPERTY(QObject *objectProperty2 READ objectProperty2 WRITE setObjectProperty2); - Q_CLASSINFO("DeferredPropertyNames", "value,objectProperty,objectProperty2"); - -public: - MyDeferredObject() : m_value(0), m_object(0), m_object2(0) {} - - int value() const { return m_value; } - void setValue(int v) { m_value = v; } - - QObject *objectProperty() const { return m_object; } - void setObjectProperty(QObject *obj) { m_object = obj; } - - QObject *objectProperty2() const { return m_object2; } - void setObjectProperty2(QObject *obj) { m_object2 = obj; } -private: - int m_value; - QObject *m_object; - QObject *m_object2; -}; -QML_DECLARE_TYPE(MyDeferredObject); - -class MyBaseExtendedObject : public QObject -{ -Q_OBJECT -Q_PROPERTY(int baseProperty READ baseProperty WRITE setBaseProperty); -public: - MyBaseExtendedObject() : m_value(0) {} - - int baseProperty() const { return m_value; } - void setBaseProperty(int v) { m_value = v; } - -private: - int m_value; -}; -QML_DECLARE_TYPE(MyBaseExtendedObject); - -class MyExtendedObject : public MyBaseExtendedObject -{ -Q_OBJECT -Q_PROPERTY(int coreProperty READ coreProperty WRITE setCoreProperty); -public: - MyExtendedObject() : m_value(0) {} - - int coreProperty() const { return m_value; } - void setCoreProperty(int v) { m_value = v; } - -private: - int m_value; -}; -QML_DECLARE_TYPE(MyExtendedObject); - -class MyTypeObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); - Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); - Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); - Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); - Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); - Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); - -public: - MyTypeObject() {} - - QPoint pointPropertyValue; - QPoint pointProperty() const { - return pointPropertyValue; - } - void setPointProperty(const QPoint &v) { - pointPropertyValue = v; - } - - QPointF pointFPropertyValue; - QPointF pointFProperty() const { - return pointFPropertyValue; - } - void setPointFProperty(const QPointF &v) { - pointFPropertyValue = v; - } - - QSize sizePropertyValue; - QSize sizeProperty() const { - return sizePropertyValue; - } - void setSizeProperty(const QSize &v) { - sizePropertyValue = v; - } - - QSizeF sizeFPropertyValue; - QSizeF sizeFProperty() const { - return sizeFPropertyValue; - } - void setSizeFProperty(const QSizeF &v) { - sizeFPropertyValue = v; - } - - QRect rectPropertyValue; - QRect rectProperty() const { - return rectPropertyValue; - } - void setRectProperty(const QRect &v) { - rectPropertyValue = v; - } - - QRectF rectFPropertyValue; - QRectF rectFProperty() const { - return rectFPropertyValue; - } - void setRectFProperty(const QRectF &v) { - rectFPropertyValue = v; - } - -}; -QML_DECLARE_TYPE(MyTypeObject); - -#endif // TESTTYPES_H - diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp deleted file mode 100644 index 612220a..0000000 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ /dev/null @@ -1,401 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include "testtypes.h" - -inline QUrl TEST_FILE(const QString &filename) -{ - QFileInfo fileInfo(__FILE__); - return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename)); -} - -inline QUrl TEST_FILE(const char *filename) -{ - return TEST_FILE(QLatin1String(filename)); -} - -class tst_qmlbindengine : public QObject -{ - Q_OBJECT -public: - tst_qmlbindengine() {} - -private slots: - void idShortcutInvalidates(); - void boolPropertiesEvaluateAsBool(); - void methods(); - void signalAssignment(); - void bindingLoop(); - void basicExpressions(); - void basicExpressions_data(); - void arrayExpressions(); - void contextPropertiesTriggerReeval(); - void objectPropertiesTriggerReeval(); - void deferredProperties(); - void extensionObjects(); - void enums(); - void valueTypeFunctions(); - -private: - QmlEngine engine; -}; - -void tst_qmlbindengine::idShortcutInvalidates() -{ - { - QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QVERIFY(object->objectProperty() != 0); - delete object->objectProperty(); - QVERIFY(object->objectProperty() == 0); - } - - { - QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.1.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QVERIFY(object->objectProperty() != 0); - delete object->objectProperty(); - QVERIFY(object->objectProperty() == 0); - } -} - -void tst_qmlbindengine::boolPropertiesEvaluateAsBool() -{ - { - QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.1.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->stringProperty(), QLatin1String("pass")); - } - { - QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.2.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->stringProperty(), QLatin1String("pass")); - } -} - -void tst_qmlbindengine::signalAssignment() -{ - { - QmlComponent component(&engine, TEST_FILE("signalAssignment.1.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->string(), QString()); - emit object->basicSignal(); - QCOMPARE(object->string(), QString("pass")); - } - - { - QmlComponent component(&engine, TEST_FILE("signalAssignment.2.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->string(), QString()); - emit object->argumentSignal(19, "Hello world!", 10.3); - QCOMPARE(object->string(), QString("pass 19 Hello world! 10.3")); - } -} - -void tst_qmlbindengine::methods() -{ - { - QmlComponent component(&engine, TEST_FILE("methods.1.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->methodCalled(), false); - QCOMPARE(object->methodIntCalled(), false); - emit object->basicSignal(); - QCOMPARE(object->methodCalled(), true); - QCOMPARE(object->methodIntCalled(), false); - } - - { - QmlComponent component(&engine, TEST_FILE("methods.2.qml")); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->methodCalled(), false); - QCOMPARE(object->methodIntCalled(), false); - emit object->basicSignal(); - QCOMPARE(object->methodCalled(), false); - QCOMPARE(object->methodIntCalled(), true); - } -} - -void tst_qmlbindengine::bindingLoop() -{ - QmlComponent component(&engine, TEST_FILE("bindingLoop.qml")); - QTest::ignoreMessage(QtWarningMsg, "QML MyQmlObject (unknown location): Binding loop detected for property \"stringProperty\" "); - QObject *object = component.create(); - QVERIFY(object != 0); -} - -void tst_qmlbindengine::basicExpressions_data() -{ - QTest::addColumn("expression"); - QTest::addColumn("result"); - QTest::addColumn("nest"); - - QTest::newRow("Context property") << "a" << QVariant(1944) << false; - QTest::newRow("Context property") << "a" << QVariant(1944) << true; - QTest::newRow("Context property expression") << "a * 2" << QVariant(3888) << false; - QTest::newRow("Context property expression") << "a * 2" << QVariant(3888) << true; - QTest::newRow("Overridden context property") << "b" << QVariant("Milk") << false; - QTest::newRow("Overridden context property") << "b" << QVariant("Cow") << true; - QTest::newRow("Object property") << "object.stringProperty" << QVariant("Object1") << false; - QTest::newRow("Object property") << "object.stringProperty" << QVariant("Object1") << true; - QTest::newRow("Overridden object property") << "objectOverride.stringProperty" << QVariant("Object2") << false; - QTest::newRow("Overridden object property") << "objectOverride.stringProperty" << QVariant("Object3") << true; - QTest::newRow("Default object property") << "horseLegs" << QVariant(4) << false; - QTest::newRow("Default object property") << "antLegs" << QVariant(6) << false; - QTest::newRow("Default object property") << "emuLegs" << QVariant(2) << false; - QTest::newRow("Nested default object property") << "horseLegs" << QVariant(4) << true; - QTest::newRow("Nested default object property") << "antLegs" << QVariant(7) << true; - QTest::newRow("Nested default object property") << "emuLegs" << QVariant(2) << true; - QTest::newRow("Nested default object property") << "humanLegs" << QVariant(2) << true; - QTest::newRow("Context property override default object property") << "millipedeLegs" << QVariant(100) << true; -} - -void tst_qmlbindengine::basicExpressions() -{ - QFETCH(QString, expression); - QFETCH(QVariant, result); - QFETCH(bool, nest); - - MyQmlObject object1; - MyQmlObject object2; - MyQmlObject object3; - MyDefaultObject1 default1; - MyDefaultObject2 default2; - MyDefaultObject3 default3; - object1.setStringProperty("Object1"); - object2.setStringProperty("Object2"); - object3.setStringProperty("Object3"); - - QmlContext context(engine.rootContext()); - QmlContext nestedContext(&context); - - context.addDefaultObject(&default1); - context.addDefaultObject(&default2); - context.setContextProperty("a", QVariant(1944)); - context.setContextProperty("b", QVariant("Milk")); - context.setContextProperty("object", &object1); - context.setContextProperty("objectOverride", &object2); - nestedContext.addDefaultObject(&default3); - nestedContext.setContextProperty("b", QVariant("Cow")); - nestedContext.setContextProperty("objectOverride", &object3); - nestedContext.setContextProperty("millipedeLegs", QVariant(100)); - - MyExpression expr(nest?&nestedContext:&context, expression); - QCOMPARE(expr.value(), result); -} - -Q_DECLARE_METATYPE(QList); -void tst_qmlbindengine::arrayExpressions() -{ - QObject obj1; - QObject obj2; - QObject obj3; - - QmlContext context(engine.rootContext()); - context.setContextProperty("a", &obj1); - context.setContextProperty("b", &obj2); - context.setContextProperty("c", &obj3); - - MyExpression expr(&context, "[a, b, c, 10]"); - QVariant result = expr.value(); - QCOMPARE(result.userType(), qMetaTypeId >()); - QList list = qvariant_cast >(result); - QCOMPARE(list.count(), 4); - QCOMPARE(list.at(0), &obj1); - QCOMPARE(list.at(1), &obj2); - QCOMPARE(list.at(2), &obj3); - QCOMPARE(list.at(3), (QObject *)0); -} - -// Tests that modifying a context property will reevaluate expressions -void tst_qmlbindengine::contextPropertiesTriggerReeval() -{ - QmlContext context(engine.rootContext()); - MyQmlObject object1; - MyQmlObject object2; - MyQmlObject *object3 = new MyQmlObject; - - object1.setStringProperty("Hello"); - object2.setStringProperty("World"); - - context.setContextProperty("testProp", QVariant(1)); - context.setContextProperty("testObj", &object1); - context.setContextProperty("testObj2", object3); - - { - MyExpression expr(&context, "testProp + 1"); - QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant(2)); - - context.setContextProperty("testProp", QVariant(2)); - QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant(3)); - } - - { - MyExpression expr(&context, "testProp + testProp + testProp"); - QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant(6)); - - context.setContextProperty("testProp", QVariant(4)); - QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant(12)); - } - - { - MyExpression expr(&context, "testObj.stringProperty"); - QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant("Hello")); - - context.setContextProperty("testObj", &object2); - QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant("World")); - } - - { - MyExpression expr(&context, "testObj.stringProperty /**/"); - QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant("World")); - - context.setContextProperty("testObj", &object1); - QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant("Hello")); - } - - { - MyExpression expr(&context, "testObj2"); - QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant::fromValue((QObject *)object3)); - } - -} - -void tst_qmlbindengine::objectPropertiesTriggerReeval() -{ - QmlContext context(engine.rootContext()); - MyQmlObject object1; - MyQmlObject object2; - MyQmlObject object3; - context.setContextProperty("testObj", &object1); - - object1.setStringProperty(QLatin1String("Hello")); - object2.setStringProperty(QLatin1String("Dog")); - object3.setStringProperty(QLatin1String("Cat")); - - { - MyExpression expr(&context, "testObj.stringProperty"); - QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant("Hello")); - - object1.setStringProperty(QLatin1String("World")); - QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant("World")); - } - - { - MyExpression expr(&context, "testObj.objectProperty.stringProperty"); - QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant()); - - object1.setObjectProperty(&object2); - QCOMPARE(expr.changed, true); - expr.changed = false; - QCOMPARE(expr.value(), QVariant("Dog")); - - object1.setObjectProperty(&object3); - QCOMPARE(expr.changed, true); - expr.changed = false; - QCOMPARE(expr.value(), QVariant("Cat")); - - object1.setObjectProperty(0); - QCOMPARE(expr.changed, true); - expr.changed = false; - QCOMPARE(expr.value(), QVariant()); - - object1.setObjectProperty(&object3); - QCOMPARE(expr.changed, true); - expr.changed = false; - QCOMPARE(expr.value(), QVariant("Cat")); - - object3.setStringProperty("Donkey"); - QCOMPARE(expr.changed, true); - expr.changed = false; - QCOMPARE(expr.value(), QVariant("Donkey")); - } -} - -void tst_qmlbindengine::deferredProperties() -{ - QmlComponent component(&engine, TEST_FILE("deferredProperties.qml")); - MyDeferredObject *object = - qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->value(), 0); - QVERIFY(object->objectProperty() == 0); - QVERIFY(object->objectProperty2() != 0); - qmlExecuteDeferred(object); - QCOMPARE(object->value(), 10); - QVERIFY(object->objectProperty() != 0); - MyQmlObject *qmlObject = - qobject_cast(object->objectProperty()); - QVERIFY(qmlObject != 0); -} - -void tst_qmlbindengine::extensionObjects() -{ - QmlComponent component(&engine, TEST_FILE("extensionObjects.qml")); - MyExtendedObject *object = - qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->baseProperty(), 13); - QCOMPARE(object->coreProperty(), 9); - - object->setProperty("extendedProperty", QVariant(11)); - object->setProperty("baseExtendedProperty", QVariant(92)); - QCOMPARE(object->coreProperty(), 11); - QCOMPARE(object->baseProperty(), 92); -} - -void tst_qmlbindengine::enums() -{ - QmlComponent component(&engine, TEST_FILE("enums.1.qml")); - QObject *object = component.create(); - QVERIFY(object != 0); - - QCOMPARE(object->property("a").toInt(), 0); - QCOMPARE(object->property("b").toInt(), 1); - QCOMPARE(object->property("c").toInt(), 2); - QCOMPARE(object->property("d").toInt(), 3); - QCOMPARE(object->property("e").toInt(), 0); - QCOMPARE(object->property("f").toInt(), 1); - QCOMPARE(object->property("g").toInt(), 2); - QCOMPARE(object->property("h").toInt(), 3); - QCOMPARE(object->property("i").toInt(), 19); - QCOMPARE(object->property("j").toInt(), 19); -} - -void tst_qmlbindengine::valueTypeFunctions() -{ - QmlComponent component(&engine, TEST_FILE("valueTypeFunctions.qml")); - MyTypeObject *obj = qobject_cast(component.create()); - QVERIFY(obj != 0); - QCOMPARE(obj->rectProperty(), QRect(0,0,100,100)); - QCOMPARE(obj->rectFProperty(), QRectF(0,0.5,100,99.5)); -} - - -QTEST_MAIN(tst_qmlbindengine) - -#include "tst_qmlbindengine.moc" diff --git a/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml b/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml new file mode 100644 index 0000000..8b22dd1 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml @@ -0,0 +1,14 @@ +import Qt.test 1.0 + +MyQmlContainer { + children : [ + MyQmlObject { + id: Object1 + stringProperty: "hello" + Object2.stringProperty + }, + MyQmlObject { + id: Object2 + stringProperty: "hello" + Object1.stringProperty + } + ] +} diff --git a/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.1.qml b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.1.qml new file mode 100644 index 0000000..3147f63 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.1.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + stringProperty: trueProperty?'pass':'fail' +} diff --git a/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.2.qml b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.2.qml new file mode 100644 index 0000000..c89bb49 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.2.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + stringProperty: falseProperty?'fail':'pass' +} diff --git a/tests/auto/declarative/qmlecmascript/data/deferredProperties.qml b/tests/auto/declarative/qmlecmascript/data/deferredProperties.qml new file mode 100644 index 0000000..9dabafe --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/deferredProperties.qml @@ -0,0 +1,7 @@ +import Qt.test 1.0 + +MyDeferredObject { + value: 10 + objectProperty: MyQmlObject {} + objectProperty2: MyQmlObject { id: blah } +} diff --git a/tests/auto/declarative/qmlecmascript/data/enums.1.qml b/tests/auto/declarative/qmlecmascript/data/enums.1.qml new file mode 100644 index 0000000..6351823 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/enums.1.qml @@ -0,0 +1,20 @@ +import Qt.test 1.0 +import Qt.test 1.0 as Namespace + +MyQmlObject { + // Enums from non-namespaced type + property int a: MyQmlObject.EnumValue1 + property int b: MyQmlObject.EnumValue2 + property int c: MyQmlObject.EnumValue3 + property int d: MyQmlObject.EnumValue4 + + // Enums from namespaced type + property int e: Namespace.MyQmlObject.EnumValue1 + property int f: Namespace.MyQmlObject.EnumValue2 + property int g: Namespace.MyQmlObject.EnumValue3 + property int h: Namespace.MyQmlObject.EnumValue4 + + // Test that enums don't mask attached properties + property int i: MyQmlObject.value + property int j: Namespace.MyQmlObject.value +} diff --git a/tests/auto/declarative/qmlecmascript/data/extensionObjects.qml b/tests/auto/declarative/qmlecmascript/data/extensionObjects.qml new file mode 100644 index 0000000..a902312 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/extensionObjects.qml @@ -0,0 +1,10 @@ +import Qt.test 1.0 + +MyExtendedObject +{ + baseProperty: baseExtendedProperty + baseExtendedProperty: 13 + + coreProperty: extendedProperty + extendedProperty: 9 +} diff --git a/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml new file mode 100644 index 0000000..ccb3a22 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml @@ -0,0 +1,13 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyQmlObject { + objectProperty: if(1) OtherObject + + property var obj + + obj: Object { + id: OtherObject + } +} + diff --git a/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml new file mode 100644 index 0000000..6c1fca6 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml @@ -0,0 +1,12 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyQmlObject { + objectProperty: OtherObject + + property var obj + + obj: Object { + id: OtherObject + } +} diff --git a/tests/auto/declarative/qmlecmascript/data/methods.1.qml b/tests/auto/declarative/qmlecmascript/data/methods.1.qml new file mode 100644 index 0000000..8ba300f --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/methods.1.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyQmlObject { + id: MyObject + onBasicSignal: MyObject.method() +} diff --git a/tests/auto/declarative/qmlecmascript/data/methods.2.qml b/tests/auto/declarative/qmlecmascript/data/methods.2.qml new file mode 100644 index 0000000..70911f7 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/methods.2.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyQmlObject { + id: MyObject + onBasicSignal: MyObject.method(163) +} diff --git a/tests/auto/declarative/qmlecmascript/data/signalAssignment.1.qml b/tests/auto/declarative/qmlecmascript/data/signalAssignment.1.qml new file mode 100644 index 0000000..fbd0914 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/signalAssignment.1.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + onBasicSignal: setString('pass') +} diff --git a/tests/auto/declarative/qmlecmascript/data/signalAssignment.2.qml b/tests/auto/declarative/qmlecmascript/data/signalAssignment.2.qml new file mode 100644 index 0000000..8addcb9 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/signalAssignment.2.qml @@ -0,0 +1,5 @@ +import Qt.test 1.0 + +MyQmlObject { + onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) +} diff --git a/tests/auto/declarative/qmlecmascript/data/valueTypeFunctions.qml b/tests/auto/declarative/qmlecmascript/data/valueTypeFunctions.qml new file mode 100644 index 0000000..33b4a68 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/valueTypeFunctions.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +MyTypeObject { + rectProperty: Qt.rect(0,0,100,100) + rectFProperty: Qt.rect(0,0.5,100,99.5) +} diff --git a/tests/auto/declarative/qmlecmascript/qmlecmascript.pro b/tests/auto/declarative/qmlecmascript/qmlecmascript.pro new file mode 100644 index 0000000..ff4d20f --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/qmlecmascript.pro @@ -0,0 +1,9 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle +SOURCES += tst_qmlecmascript.cpp \ + testtypes.cpp +HEADERS += testtypes.h + +# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage +# LIBS += -lgcov diff --git a/tests/auto/declarative/qmlecmascript/testtypes.cpp b/tests/auto/declarative/qmlecmascript/testtypes.cpp new file mode 100644 index 0000000..22e3071 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/testtypes.cpp @@ -0,0 +1,42 @@ +#include "testtypes.h" + +class BaseExtensionObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int baseExtendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged); +public: + BaseExtensionObject(QObject *parent) : QObject(parent), m_value(0) {} + + int extendedProperty() const { return m_value; } + void setExtendedProperty(int v) { m_value = v; emit extendedPropertyChanged(); } + +signals: + void extendedPropertyChanged(); +private: + int m_value; +}; + +class ExtensionObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int extendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged); +public: + ExtensionObject(QObject *parent) : QObject(parent), m_value(0) {} + + int extendedProperty() const { return m_value; } + void setExtendedProperty(int v) { m_value = v; emit extendedPropertyChanged(); } + +signals: + void extendedPropertyChanged(); +private: + int m_value; +}; + +QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyQmlObject,MyQmlObject); +QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyDeferredObject,MyDeferredObject); +QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyQmlContainer,MyQmlContainer); +QML_DEFINE_EXTENDED_TYPE(Qt.test, 1, 0, 0, MyBaseExtendedObject,MyBaseExtendedObject,BaseExtensionObject); +QML_DEFINE_EXTENDED_TYPE(Qt.test, 1, 0, 0, MyExtendedObject,MyExtendedObject,ExtensionObject); +QML_DEFINE_TYPE(Qt.test, 1, 0, 0, MyTypeObject, MyTypeObject); + +#include "testtypes.moc" diff --git a/tests/auto/declarative/qmlecmascript/testtypes.h b/tests/auto/declarative/qmlecmascript/testtypes.h new file mode 100644 index 0000000..ffc8fec --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/testtypes.h @@ -0,0 +1,268 @@ +#ifndef TESTTYPES_H +#define TESTTYPES_H + +#include +#include +#include +#include +#include +#include + +class MyQmlAttachedObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int value READ value CONSTANT) +public: + MyQmlAttachedObject(QObject *parent) : QObject(parent) {} + + int value() const { return 19; } +}; + +class MyQmlObject : public QObject +{ + Q_OBJECT + Q_ENUMS(MyEnum) + Q_ENUMS(MyEnum2) + Q_PROPERTY(bool trueProperty READ trueProperty CONSTANT) + Q_PROPERTY(bool falseProperty READ falseProperty CONSTANT) + Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged) + Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged); +public: + MyQmlObject(): m_methodCalled(false), m_methodIntCalled(false), m_object(0) {} + + enum MyEnum { EnumValue1 = 0, EnumValue2 = 1 }; + enum MyEnum2 { EnumValue3 = 2, EnumValue4 = 3 }; + + bool trueProperty() const { return true; } + bool falseProperty() const { return false; } + + QString stringProperty() const { return m_string; } + void setStringProperty(const QString &s) + { + if (s == m_string) + return; + m_string = s; + emit stringChanged(); + } + + QObject *objectProperty() const { return m_object; } + void setObjectProperty(QObject *obj) { + if (obj == m_object) + return; + m_object = obj; + emit objectChanged(); + } + + bool methodCalled() const { return m_methodCalled; } + bool methodIntCalled() const { return m_methodIntCalled; } + + QString string() const { return m_string; } + + static MyQmlAttachedObject *qmlAttachedProperties(QObject *o) { + return new MyQmlAttachedObject(o); + } +signals: + void basicSignal(); + void argumentSignal(int a, QString b, qreal c); + void stringChanged(); + void objectChanged(); + +public slots: + void method() { m_methodCalled = true; } + void method(int a) { if(a == 163) m_methodIntCalled = true; } + void setString(const QString &s) { m_string = s; } + +private: + friend class tst_qmlecmascript; + bool m_methodCalled; + bool m_methodIntCalled; + + QObject *m_object; + QString m_string; +}; + +QML_DECLARE_TYPE(MyQmlObject); + +class MyQmlContainer : public QObject +{ + Q_OBJECT + Q_PROPERTY(QList* children READ children) +public: + MyQmlContainer() {} + + QList *children() { return &m_children; } + +private: + QList m_children; +}; + +QML_DECLARE_TYPE(MyQmlContainer); + +class MyExpression : public QmlExpression +{ +public: + MyExpression(QmlContext *ctxt, const QString &expr) + : QmlExpression(ctxt, expr, 0), changed(false) + { + } + + virtual void valueChanged() { + changed = true; + } + bool changed; +}; + + +class MyDefaultObject1 : public QObject +{ + Q_OBJECT + Q_PROPERTY(int horseLegs READ horseLegs CONSTANT); + Q_PROPERTY(int antLegs READ antLegs CONSTANT); +public: + int horseLegs() const { return 4; } + int antLegs() const { return 6; } +}; + +class MyDefaultObject2 : public QObject +{ + Q_OBJECT + Q_PROPERTY(int antLegs READ antLegs CONSTANT); + Q_PROPERTY(int emuLegs READ emuLegs CONSTANT); +public: + int antLegs() const { return 5; } // Had an accident + int emuLegs() const { return 2; } +}; + +class MyDefaultObject3 : public QObject +{ + Q_OBJECT + Q_PROPERTY(int antLegs READ antLegs CONSTANT); + Q_PROPERTY(int humanLegs READ humanLegs CONSTANT); +public: + int antLegs() const { return 7; } // Mutant + int humanLegs() const { return 2; } + int millipedeLegs() const { return 1000; } +}; + +class MyDeferredObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue) + Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty); + Q_PROPERTY(QObject *objectProperty2 READ objectProperty2 WRITE setObjectProperty2); + Q_CLASSINFO("DeferredPropertyNames", "value,objectProperty,objectProperty2"); + +public: + MyDeferredObject() : m_value(0), m_object(0), m_object2(0) {} + + int value() const { return m_value; } + void setValue(int v) { m_value = v; } + + QObject *objectProperty() const { return m_object; } + void setObjectProperty(QObject *obj) { m_object = obj; } + + QObject *objectProperty2() const { return m_object2; } + void setObjectProperty2(QObject *obj) { m_object2 = obj; } +private: + int m_value; + QObject *m_object; + QObject *m_object2; +}; +QML_DECLARE_TYPE(MyDeferredObject); + +class MyBaseExtendedObject : public QObject +{ +Q_OBJECT +Q_PROPERTY(int baseProperty READ baseProperty WRITE setBaseProperty); +public: + MyBaseExtendedObject() : m_value(0) {} + + int baseProperty() const { return m_value; } + void setBaseProperty(int v) { m_value = v; } + +private: + int m_value; +}; +QML_DECLARE_TYPE(MyBaseExtendedObject); + +class MyExtendedObject : public MyBaseExtendedObject +{ +Q_OBJECT +Q_PROPERTY(int coreProperty READ coreProperty WRITE setCoreProperty); +public: + MyExtendedObject() : m_value(0) {} + + int coreProperty() const { return m_value; } + void setCoreProperty(int v) { m_value = v; } + +private: + int m_value; +}; +QML_DECLARE_TYPE(MyExtendedObject); + +class MyTypeObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); + Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); + Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); + Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); + Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); + Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); + +public: + MyTypeObject() {} + + QPoint pointPropertyValue; + QPoint pointProperty() const { + return pointPropertyValue; + } + void setPointProperty(const QPoint &v) { + pointPropertyValue = v; + } + + QPointF pointFPropertyValue; + QPointF pointFProperty() const { + return pointFPropertyValue; + } + void setPointFProperty(const QPointF &v) { + pointFPropertyValue = v; + } + + QSize sizePropertyValue; + QSize sizeProperty() const { + return sizePropertyValue; + } + void setSizeProperty(const QSize &v) { + sizePropertyValue = v; + } + + QSizeF sizeFPropertyValue; + QSizeF sizeFProperty() const { + return sizeFPropertyValue; + } + void setSizeFProperty(const QSizeF &v) { + sizeFPropertyValue = v; + } + + QRect rectPropertyValue; + QRect rectProperty() const { + return rectPropertyValue; + } + void setRectProperty(const QRect &v) { + rectPropertyValue = v; + } + + QRectF rectFPropertyValue; + QRectF rectFProperty() const { + return rectFPropertyValue; + } + void setRectFProperty(const QRectF &v) { + rectFPropertyValue = v; + } + +}; +QML_DECLARE_TYPE(MyTypeObject); + +#endif // TESTTYPES_H + diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp new file mode 100644 index 0000000..40e4fff --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -0,0 +1,407 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "testtypes.h" + +/* +This test covers evaluation of ECMAScript expressions and bindings from within +QML. This does not include static QML language issues. + +Static QML language issues are covered in qmllanguage +*/ +inline QUrl TEST_FILE(const QString &filename) +{ + QFileInfo fileInfo(__FILE__); + return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename)); +} + +inline QUrl TEST_FILE(const char *filename) +{ + return TEST_FILE(QLatin1String(filename)); +} + +class tst_qmlecmascript : public QObject +{ + Q_OBJECT +public: + tst_qmlecmascript() {} + +private slots: + void idShortcutInvalidates(); + void boolPropertiesEvaluateAsBool(); + void methods(); + void signalAssignment(); + void bindingLoop(); + void basicExpressions(); + void basicExpressions_data(); + void arrayExpressions(); + void contextPropertiesTriggerReeval(); + void objectPropertiesTriggerReeval(); + void deferredProperties(); + void extensionObjects(); + void enums(); + void valueTypeFunctions(); + +private: + QmlEngine engine; +}; + +void tst_qmlecmascript::idShortcutInvalidates() +{ + { + QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QVERIFY(object->objectProperty() != 0); + delete object->objectProperty(); + QVERIFY(object->objectProperty() == 0); + } + + { + QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.1.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QVERIFY(object->objectProperty() != 0); + delete object->objectProperty(); + QVERIFY(object->objectProperty() == 0); + } +} + +void tst_qmlecmascript::boolPropertiesEvaluateAsBool() +{ + { + QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.1.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->stringProperty(), QLatin1String("pass")); + } + { + QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.2.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->stringProperty(), QLatin1String("pass")); + } +} + +void tst_qmlecmascript::signalAssignment() +{ + { + QmlComponent component(&engine, TEST_FILE("signalAssignment.1.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->string(), QString()); + emit object->basicSignal(); + QCOMPARE(object->string(), QString("pass")); + } + + { + QmlComponent component(&engine, TEST_FILE("signalAssignment.2.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->string(), QString()); + emit object->argumentSignal(19, "Hello world!", 10.3); + QCOMPARE(object->string(), QString("pass 19 Hello world! 10.3")); + } +} + +void tst_qmlecmascript::methods() +{ + { + QmlComponent component(&engine, TEST_FILE("methods.1.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->methodCalled(), false); + QCOMPARE(object->methodIntCalled(), false); + emit object->basicSignal(); + QCOMPARE(object->methodCalled(), true); + QCOMPARE(object->methodIntCalled(), false); + } + + { + QmlComponent component(&engine, TEST_FILE("methods.2.qml")); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->methodCalled(), false); + QCOMPARE(object->methodIntCalled(), false); + emit object->basicSignal(); + QCOMPARE(object->methodCalled(), false); + QCOMPARE(object->methodIntCalled(), true); + } +} + +void tst_qmlecmascript::bindingLoop() +{ + QmlComponent component(&engine, TEST_FILE("bindingLoop.qml")); + QTest::ignoreMessage(QtWarningMsg, "QML MyQmlObject (unknown location): Binding loop detected for property \"stringProperty\" "); + QObject *object = component.create(); + QVERIFY(object != 0); +} + +void tst_qmlecmascript::basicExpressions_data() +{ + QTest::addColumn("expression"); + QTest::addColumn("result"); + QTest::addColumn("nest"); + + QTest::newRow("Context property") << "a" << QVariant(1944) << false; + QTest::newRow("Context property") << "a" << QVariant(1944) << true; + QTest::newRow("Context property expression") << "a * 2" << QVariant(3888) << false; + QTest::newRow("Context property expression") << "a * 2" << QVariant(3888) << true; + QTest::newRow("Overridden context property") << "b" << QVariant("Milk") << false; + QTest::newRow("Overridden context property") << "b" << QVariant("Cow") << true; + QTest::newRow("Object property") << "object.stringProperty" << QVariant("Object1") << false; + QTest::newRow("Object property") << "object.stringProperty" << QVariant("Object1") << true; + QTest::newRow("Overridden object property") << "objectOverride.stringProperty" << QVariant("Object2") << false; + QTest::newRow("Overridden object property") << "objectOverride.stringProperty" << QVariant("Object3") << true; + QTest::newRow("Default object property") << "horseLegs" << QVariant(4) << false; + QTest::newRow("Default object property") << "antLegs" << QVariant(6) << false; + QTest::newRow("Default object property") << "emuLegs" << QVariant(2) << false; + QTest::newRow("Nested default object property") << "horseLegs" << QVariant(4) << true; + QTest::newRow("Nested default object property") << "antLegs" << QVariant(7) << true; + QTest::newRow("Nested default object property") << "emuLegs" << QVariant(2) << true; + QTest::newRow("Nested default object property") << "humanLegs" << QVariant(2) << true; + QTest::newRow("Context property override default object property") << "millipedeLegs" << QVariant(100) << true; +} + +void tst_qmlecmascript::basicExpressions() +{ + QFETCH(QString, expression); + QFETCH(QVariant, result); + QFETCH(bool, nest); + + MyQmlObject object1; + MyQmlObject object2; + MyQmlObject object3; + MyDefaultObject1 default1; + MyDefaultObject2 default2; + MyDefaultObject3 default3; + object1.setStringProperty("Object1"); + object2.setStringProperty("Object2"); + object3.setStringProperty("Object3"); + + QmlContext context(engine.rootContext()); + QmlContext nestedContext(&context); + + context.addDefaultObject(&default1); + context.addDefaultObject(&default2); + context.setContextProperty("a", QVariant(1944)); + context.setContextProperty("b", QVariant("Milk")); + context.setContextProperty("object", &object1); + context.setContextProperty("objectOverride", &object2); + nestedContext.addDefaultObject(&default3); + nestedContext.setContextProperty("b", QVariant("Cow")); + nestedContext.setContextProperty("objectOverride", &object3); + nestedContext.setContextProperty("millipedeLegs", QVariant(100)); + + MyExpression expr(nest?&nestedContext:&context, expression); + QCOMPARE(expr.value(), result); +} + +Q_DECLARE_METATYPE(QList); +void tst_qmlecmascript::arrayExpressions() +{ + QObject obj1; + QObject obj2; + QObject obj3; + + QmlContext context(engine.rootContext()); + context.setContextProperty("a", &obj1); + context.setContextProperty("b", &obj2); + context.setContextProperty("c", &obj3); + + MyExpression expr(&context, "[a, b, c, 10]"); + QVariant result = expr.value(); + QCOMPARE(result.userType(), qMetaTypeId >()); + QList list = qvariant_cast >(result); + QCOMPARE(list.count(), 4); + QCOMPARE(list.at(0), &obj1); + QCOMPARE(list.at(1), &obj2); + QCOMPARE(list.at(2), &obj3); + QCOMPARE(list.at(3), (QObject *)0); +} + +// Tests that modifying a context property will reevaluate expressions +void tst_qmlecmascript::contextPropertiesTriggerReeval() +{ + QmlContext context(engine.rootContext()); + MyQmlObject object1; + MyQmlObject object2; + MyQmlObject *object3 = new MyQmlObject; + + object1.setStringProperty("Hello"); + object2.setStringProperty("World"); + + context.setContextProperty("testProp", QVariant(1)); + context.setContextProperty("testObj", &object1); + context.setContextProperty("testObj2", object3); + + { + MyExpression expr(&context, "testProp + 1"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant(2)); + + context.setContextProperty("testProp", QVariant(2)); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant(3)); + } + + { + MyExpression expr(&context, "testProp + testProp + testProp"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant(6)); + + context.setContextProperty("testProp", QVariant(4)); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant(12)); + } + + { + MyExpression expr(&context, "testObj.stringProperty"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant("Hello")); + + context.setContextProperty("testObj", &object2); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant("World")); + } + + { + MyExpression expr(&context, "testObj.stringProperty /**/"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant("World")); + + context.setContextProperty("testObj", &object1); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant("Hello")); + } + + { + MyExpression expr(&context, "testObj2"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant::fromValue((QObject *)object3)); + } + +} + +void tst_qmlecmascript::objectPropertiesTriggerReeval() +{ + QmlContext context(engine.rootContext()); + MyQmlObject object1; + MyQmlObject object2; + MyQmlObject object3; + context.setContextProperty("testObj", &object1); + + object1.setStringProperty(QLatin1String("Hello")); + object2.setStringProperty(QLatin1String("Dog")); + object3.setStringProperty(QLatin1String("Cat")); + + { + MyExpression expr(&context, "testObj.stringProperty"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant("Hello")); + + object1.setStringProperty(QLatin1String("World")); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant("World")); + } + + { + MyExpression expr(&context, "testObj.objectProperty.stringProperty"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant()); + + object1.setObjectProperty(&object2); + QCOMPARE(expr.changed, true); + expr.changed = false; + QCOMPARE(expr.value(), QVariant("Dog")); + + object1.setObjectProperty(&object3); + QCOMPARE(expr.changed, true); + expr.changed = false; + QCOMPARE(expr.value(), QVariant("Cat")); + + object1.setObjectProperty(0); + QCOMPARE(expr.changed, true); + expr.changed = false; + QCOMPARE(expr.value(), QVariant()); + + object1.setObjectProperty(&object3); + QCOMPARE(expr.changed, true); + expr.changed = false; + QCOMPARE(expr.value(), QVariant("Cat")); + + object3.setStringProperty("Donkey"); + QCOMPARE(expr.changed, true); + expr.changed = false; + QCOMPARE(expr.value(), QVariant("Donkey")); + } +} + +void tst_qmlecmascript::deferredProperties() +{ + QmlComponent component(&engine, TEST_FILE("deferredProperties.qml")); + MyDeferredObject *object = + qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->value(), 0); + QVERIFY(object->objectProperty() == 0); + QVERIFY(object->objectProperty2() != 0); + qmlExecuteDeferred(object); + QCOMPARE(object->value(), 10); + QVERIFY(object->objectProperty() != 0); + MyQmlObject *qmlObject = + qobject_cast(object->objectProperty()); + QVERIFY(qmlObject != 0); +} + +void tst_qmlecmascript::extensionObjects() +{ + QmlComponent component(&engine, TEST_FILE("extensionObjects.qml")); + MyExtendedObject *object = + qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->baseProperty(), 13); + QCOMPARE(object->coreProperty(), 9); + + object->setProperty("extendedProperty", QVariant(11)); + object->setProperty("baseExtendedProperty", QVariant(92)); + QCOMPARE(object->coreProperty(), 11); + QCOMPARE(object->baseProperty(), 92); +} + +void tst_qmlecmascript::enums() +{ + QmlComponent component(&engine, TEST_FILE("enums.1.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("a").toInt(), 0); + QCOMPARE(object->property("b").toInt(), 1); + QCOMPARE(object->property("c").toInt(), 2); + QCOMPARE(object->property("d").toInt(), 3); + QCOMPARE(object->property("e").toInt(), 0); + QCOMPARE(object->property("f").toInt(), 1); + QCOMPARE(object->property("g").toInt(), 2); + QCOMPARE(object->property("h").toInt(), 3); + QCOMPARE(object->property("i").toInt(), 19); + QCOMPARE(object->property("j").toInt(), 19); +} + +void tst_qmlecmascript::valueTypeFunctions() +{ + QmlComponent component(&engine, TEST_FILE("valueTypeFunctions.qml")); + MyTypeObject *obj = qobject_cast(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->rectProperty(), QRect(0,0,100,100)); + QCOMPARE(obj->rectFProperty(), QRectF(0,0.5,100,99.5)); +} + + +QTEST_MAIN(tst_qmlecmascript) + +#include "tst_qmlecmascript.moc" diff --git a/tests/auto/declarative/qmllanguage/data/Alias.qml b/tests/auto/declarative/qmllanguage/data/Alias.qml new file mode 100644 index 0000000..8264e0d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/Alias.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Object { + id: Root + property int value: 1892 + property alias aliasValue: Root.value +} + diff --git a/tests/auto/declarative/qmllanguage/data/MyComponent.qml b/tests/auto/declarative/qmllanguage/data/MyComponent.qml new file mode 100644 index 0000000..1a23277 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/MyComponent.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyQmlObject { + property real x; + property real y; +} diff --git a/tests/auto/declarative/qmllanguage/data/MyContainerComponent.qml b/tests/auto/declarative/qmllanguage/data/MyContainerComponent.qml new file mode 100644 index 0000000..61f54c5 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/MyContainerComponent.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyContainer { + property int x +} diff --git a/tests/auto/declarative/qmllanguage/data/alias.1.qml b/tests/auto/declarative/qmllanguage/data/alias.1.qml new file mode 100644 index 0000000..492d99a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/alias.1.qml @@ -0,0 +1,8 @@ +import Test 1.0 +import Qt 4.6 + +Object { + id: Root + property int value: 10 + property alias valueAlias: Root.value +} diff --git a/tests/auto/declarative/qmllanguage/data/alias.2.qml b/tests/auto/declarative/qmllanguage/data/alias.2.qml new file mode 100644 index 0000000..aa4d103 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/alias.2.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyQmlObject { + id: Root + property alias aliasObject: Root.qmlobjectProperty + + qmlobjectProperty: MyQmlObject { value : 10 } +} diff --git a/tests/auto/declarative/qmllanguage/data/alias.3.qml b/tests/auto/declarative/qmllanguage/data/alias.3.qml new file mode 100644 index 0000000..e25fbae --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/alias.3.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +Object { + property var other + other: Alias { id: MyAliasObject } + + property alias value: MyAliasObject.aliasValue + property alias value2: MyAliasObject.value +} + diff --git a/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml new file mode 100644 index 0000000..cef9f8d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml @@ -0,0 +1,26 @@ +import Test 1.0 +MyTypeObject { + flagProperty: "FlagVal1 | FlagVal3" + enumProperty: "EnumVal2" + stringProperty: "Hello World!" + uintProperty: 10 + intProperty: -19 + realProperty: 23.2 + doubleProperty: -19.7 + colorProperty: "red" + dateProperty: "1982-11-25" + timeProperty: "11:11:31" + timeProperty: "11:11:32" + timeProperty: "11:11:32" + dateTimeProperty: "2009-05-12T13:22:01" + pointProperty: "99,13" + pointFProperty: "-10.1,12.3" + sizeProperty: "99x13" + sizeFProperty: "0.1x0.2" + rectProperty: "9,7,100x200" + rectFProperty: "1000.1,-10.9,400x90.99" + boolProperty: true + variantProperty: "Hello World!" + + objectProperty: MyTypeObject { intProperty: 8 } +} diff --git a/tests/auto/declarative/qmllanguage/data/assignLiteralSignalProperty.qml b/tests/auto/declarative/qmllanguage/data/assignLiteralSignalProperty.qml new file mode 100644 index 0000000..399fcea --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignLiteralSignalProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + onLiteralSignal: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/assignObjectToSignal.qml b/tests/auto/declarative/qmllanguage/data/assignObjectToSignal.qml new file mode 100644 index 0000000..789cc66 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignObjectToSignal.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + onBasicSignal: MyQmlObject {} +} diff --git a/tests/auto/declarative/qmllanguage/data/assignObjectToVariant.qml b/tests/auto/declarative/qmllanguage/data/assignObjectToVariant.qml new file mode 100644 index 0000000..28c68c4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignObjectToVariant.qml @@ -0,0 +1,6 @@ +import Test 1.0 +import Qt 4.6 +Object { + property var a; + a: MyQmlObject {} +} diff --git a/tests/auto/declarative/qmllanguage/data/assignQmlComponent.qml b/tests/auto/declarative/qmllanguage/data/assignQmlComponent.qml new file mode 100644 index 0000000..20bdc55 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignQmlComponent.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + MyComponent { x: 10; y: 11; } +} diff --git a/tests/auto/declarative/qmllanguage/data/assignSignal.qml b/tests/auto/declarative/qmllanguage/data/assignSignal.qml new file mode 100644 index 0000000..3abc04d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignSignal.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + onBasicSignal: basicSlot() + onBasicParameterizedSignal: basicSlot(parameter) +} diff --git a/tests/auto/declarative/qmllanguage/data/assignTypeExtremes.qml b/tests/auto/declarative/qmllanguage/data/assignTypeExtremes.qml new file mode 100644 index 0000000..60ede52 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignTypeExtremes.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + uintProperty: 4000000000 + intProperty: -2000000000 +} diff --git a/tests/auto/declarative/qmllanguage/data/attachedProperties.qml b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml new file mode 100644 index 0000000..8343754 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml @@ -0,0 +1,5 @@ +import Test 1.0 +import Qt 4.6 +Object { + MyQmlObject.value: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/autoComponentCreation.qml b/tests/auto/declarative/qmllanguage/data/autoComponentCreation.qml new file mode 100644 index 0000000..5d00144 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/autoComponentCreation.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + componentProperty : MyTypeObject { realProperty: 9 } +} diff --git a/tests/auto/declarative/qmllanguage/data/cppnamespace.qml b/tests/auto/declarative/qmllanguage/data/cppnamespace.qml new file mode 100644 index 0000000..e1daf3b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/cppnamespace.qml @@ -0,0 +1,4 @@ +import Test 1.0 + +MyNamespacedType { +} diff --git a/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt new file mode 100644 index 0000000..d28c0bd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt @@ -0,0 +1 @@ +4:19:Cannot use reserved "id" property in ListModel diff --git a/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml new file mode 100644 index 0000000..e607768 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml @@ -0,0 +1,5 @@ +import Qt 4.6 +ListModel { + ListElement { a: 10 } + ListElement { id: Foo; a: 12 } +} diff --git a/tests/auto/declarative/qmllanguage/data/customParserTypes.qml b/tests/auto/declarative/qmllanguage/data/customParserTypes.qml new file mode 100644 index 0000000..cf2f272 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/customParserTypes.qml @@ -0,0 +1,5 @@ +import Qt 4.6 +ListModel { + ListElement { a: 10 } + ListElement { a: 12 } +} diff --git a/tests/auto/declarative/qmllanguage/data/customVariantTypes.qml b/tests/auto/declarative/qmllanguage/data/customVariantTypes.qml new file mode 100644 index 0000000..0263ed2 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/customVariantTypes.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + customType: "10" +} diff --git a/tests/auto/declarative/qmllanguage/data/duplicateIDs.errors.txt b/tests/auto/declarative/qmllanguage/data/duplicateIDs.errors.txt new file mode 100644 index 0000000..66241cf --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/duplicateIDs.errors.txt @@ -0,0 +1 @@ +4:19:id is not unique diff --git a/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml b/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml new file mode 100644 index 0000000..9605b5b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyContainer { + MyQmlObject { id: MyID } + MyQmlObject { id: MyID } +} + diff --git a/tests/auto/declarative/qmllanguage/data/dynamicObject.1.qml b/tests/auto/declarative/qmllanguage/data/dynamicObject.1.qml new file mode 100644 index 0000000..85d1052 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/dynamicObject.1.qml @@ -0,0 +1,8 @@ +import Test 1.0 +import Qt 4.6 +PropertyChanges { + propa: a + 10 + propb: Math.min(a, 10) + propc: MyPropertyValueSource {} + onPropA: a +} diff --git a/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml b/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml new file mode 100644 index 0000000..f93e446 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml @@ -0,0 +1,13 @@ +import Test 1.0 +import Qt 4.6 +Object { + default property int intProperty : 10 + property bool boolProperty: false + property double doubleProperty: -10.1 + property real realProperty: -19.9 + property string stringProperty: "Hello World!" + property color colorProperty: "red" + property date dateProperty: "1945-09-02" + property var varProperty: "Hello World!" + property variant variantProperty: 12 +} diff --git a/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml new file mode 100644 index 0000000..b0ca970 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml @@ -0,0 +1,7 @@ +import Qt 4.6 +Object { + signal signal1 + function slot1() {} + signal signal2 + function slot2() {} +} diff --git a/tests/auto/declarative/qmllanguage/data/empty.errors.txt b/tests/auto/declarative/qmllanguage/data/empty.errors.txt new file mode 100644 index 0000000..d416e76 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/empty.errors.txt @@ -0,0 +1,2 @@ +0:0:Expected token `numeric literal' +0:0:Expected a qualified name id diff --git a/tests/auto/declarative/qmllanguage/data/empty.qml b/tests/auto/declarative/qmllanguage/data/empty.qml new file mode 100644 index 0000000..e69de29 diff --git a/tests/auto/declarative/qmllanguage/data/failingComponent.errors.txt b/tests/auto/declarative/qmllanguage/data/failingComponent.errors.txt new file mode 100644 index 0000000..0cf0ef3 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/failingComponent.errors.txt @@ -0,0 +1 @@ +3:5:Type FailingComponent unavailable diff --git a/tests/auto/declarative/qmllanguage/data/failingComponentTest.qml b/tests/auto/declarative/qmllanguage/data/failingComponentTest.qml new file mode 100644 index 0000000..74a6acf --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/failingComponentTest.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + FailingComponent {} +} diff --git a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt new file mode 100644 index 0000000..e56ad3a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt @@ -0,0 +1 @@ +3:5:Invalid property access diff --git a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.qml b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.qml new file mode 100644 index 0000000..d971eee --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + value.something: "hello" +} diff --git a/tests/auto/declarative/qmllanguage/data/finalOverride.errors.txt b/tests/auto/declarative/qmllanguage/data/finalOverride.errors.txt new file mode 100644 index 0000000..49e06cb --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/finalOverride.errors.txt @@ -0,0 +1 @@ +3:5:Cannot override FINAL property diff --git a/tests/auto/declarative/qmllanguage/data/finalOverride.qml b/tests/auto/declarative/qmllanguage/data/finalOverride.qml new file mode 100644 index 0000000..a84393a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/finalOverride.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + property int value: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/idProperty.qml b/tests/auto/declarative/qmllanguage/data/idProperty.qml new file mode 100644 index 0000000..a413c0b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/idProperty.qml @@ -0,0 +1,8 @@ +import Test 1.0 +MyContainer { + property var object : MyObjectId + + MyTypeObject { + id: "MyObjectId" + } +} diff --git a/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.errors.txt b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.errors.txt new file mode 100644 index 0000000..231998d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.errors.txt @@ -0,0 +1 @@ +4:1:Namespace Rectangle cannot be used as a type diff --git a/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.qml b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.qml new file mode 100644 index 0000000..cd112af --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.qml @@ -0,0 +1,4 @@ +import Test 1.0 as Rectangle +import Qt 4.6 + +Rectangle { } diff --git a/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt new file mode 100644 index 0000000..2235cbc --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt @@ -0,0 +1 @@ +SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.qml b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.qml new file mode 100644 index 0000000..23ed566 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.qml @@ -0,0 +1,7 @@ +import Test as S + +S.MyQmlObject { + property real x; + property real y; +} + diff --git a/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt new file mode 100644 index 0000000..2235cbc --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt @@ -0,0 +1 @@ +SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.qml b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.qml new file mode 100644 index 0000000..97ec222 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.qml @@ -0,0 +1,3 @@ +import com.nokia.installedtest as T + +T.InstalledTest {} diff --git a/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml b/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml new file mode 100644 index 0000000..79ceda6 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml @@ -0,0 +1,10 @@ +import Test 1.0 +import Qt 4.6 +MyContainer { + Component { + id: MyComponent + MyQmlObject { + value: 11 + } + } +} diff --git a/tests/auto/declarative/qmllanguage/data/interfaceProperty.qml b/tests/auto/declarative/qmllanguage/data/interfaceProperty.qml new file mode 100644 index 0000000..70879ff --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/interfaceProperty.qml @@ -0,0 +1,5 @@ +import Test 1.0 +import Qt 4.6 +MyQmlObject { + interfaceProperty: MyQmlObject {} +} diff --git a/tests/auto/declarative/qmllanguage/data/interfaceQList.qml b/tests/auto/declarative/qmllanguage/data/interfaceQList.qml new file mode 100644 index 0000000..c87dfae --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/interfaceQList.qml @@ -0,0 +1,7 @@ +import Test 1.0 +MyContainer { + qlistInterfaces: [ + MyQmlObject {}, + MyQmlObject {} + ] +} diff --git a/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml b/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml new file mode 100644 index 0000000..8392bea --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml @@ -0,0 +1,7 @@ +import Test 1.0 +MyContainer { + qmllistInterfaces: [ + MyQmlObject {}, + MyQmlObject {} + ] +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.2.errors.txt new file mode 100644 index 0000000..56e3eeb --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.2.errors.txt @@ -0,0 +1,2 @@ +3:5:"" is not a valid object id + diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.2.qml b/tests/auto/declarative/qmllanguage/data/invalidID.2.qml new file mode 100644 index 0000000..4fb3b29 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.2.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + id: "" +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.3.errors.txt new file mode 100644 index 0000000..bb811cf --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.3.errors.txt @@ -0,0 +1 @@ +3:5:Invalid use of id property diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.3.qml b/tests/auto/declarative/qmllanguage/data/invalidID.3.qml new file mode 100644 index 0000000..6684172 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.3.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + id.other: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.4.errors.txt new file mode 100644 index 0000000..cfe8756 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.4.errors.txt @@ -0,0 +1 @@ +4:5:Invalid use of id property diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.4.qml b/tests/auto/declarative/qmllanguage/data/invalidID.4.qml new file mode 100644 index 0000000..1f15fce --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.4.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyQmlObject { + id: Hello + id: World +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.5.errors.txt new file mode 100644 index 0000000..b0a63a0 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.5.errors.txt @@ -0,0 +1 @@ +4:9:id conflicts with namespace prefix diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.5.qml b/tests/auto/declarative/qmllanguage/data/invalidID.5.qml new file mode 100644 index 0000000..0545b0d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.5.qml @@ -0,0 +1,6 @@ +import Test 1.0 +import Test 1.0 as Hello +MyQmlObject { + id: Hello +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt new file mode 100644 index 0000000..861e3d7 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt @@ -0,0 +1 @@ +3:9:id conflicts with type name diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.6.qml b/tests/auto/declarative/qmllanguage/data/invalidID.6.qml new file mode 100644 index 0000000..ea34007 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.6.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyQmlObject { + id: MyQmlObject +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.errors.txt new file mode 100644 index 0000000..1ca678c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.errors.txt @@ -0,0 +1 @@ +3:5:"1" is not a valid object id diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.qml b/tests/auto/declarative/qmllanguage/data/invalidID.qml new file mode 100644 index 0000000..04db3eb --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidID.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + id: 1 +} diff --git a/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest.qml new file mode 100644 index 0000000..d8a22a8 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Rectangle {} diff --git a/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml new file mode 100644 index 0000000..a0706ad --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Text {} diff --git a/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir new file mode 100644 index 0000000..ba0b42a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir @@ -0,0 +1,3 @@ +InstalledTest 1.0-3 InstalledTest.qml +InstalledTest 1.4 InstalledTest2.qml +Rectangle 1.5 InstalledTest2.qml diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt new file mode 100644 index 0000000..d68d487 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt @@ -0,0 +1 @@ +3:24:Cannot assign primitives to lists diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml new file mode 100644 index 0000000..4240425 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + qmllistInterfaces: 1 +} diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.2.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.2.errors.txt new file mode 100644 index 0000000..8b40aa3 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.2.errors.txt @@ -0,0 +1,2 @@ +3:15:Cannot assign primitives to lists + diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.2.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.2.qml new file mode 100644 index 0000000..e3baadb --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyContainer { + children: 2 +} diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.3.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.3.errors.txt new file mode 100644 index 0000000..8c7b7e9 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.3.errors.txt @@ -0,0 +1 @@ +4:15:Can only assign one binding to lists diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.3.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.3.qml new file mode 100644 index 0000000..00c4c6b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.3.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyContainer { + children: childBinding.expression + children: childBinding2.expression +} + diff --git a/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml new file mode 100644 index 0000000..fa2e831 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml @@ -0,0 +1,38 @@ +import Qt 4.6 + +Item { + ListModel { + id: FruitModel + ListElement { + name: "Apple" + cost: 2.45 + } + ListElement { + name: "Orange" + cost: 3.25 + } + ListElement { + name: "Banana" + cost: 1.95 + } + } + + Component { + id: FruitDelegate + Item { + width: 200; height: 50 + Text { text: name } + Text { text: '$'+cost; anchors.right: parent.right } + MouseRegion { + anchors.fill: parent + onClicked: FruitModel.remove(index) + } + } + } + + ListView { + model: FruitModel + delegate: FruitDelegate + anchors.fill: parent + } +} diff --git a/tests/auto/declarative/qmllanguage/data/missingObject.errors.txt b/tests/auto/declarative/qmllanguage/data/missingObject.errors.txt new file mode 100644 index 0000000..b31b562 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingObject.errors.txt @@ -0,0 +1 @@ +1:10:Expected token `{' diff --git a/tests/auto/declarative/qmllanguage/data/missingObject.qml b/tests/auto/declarative/qmllanguage/data/missingObject.qml new file mode 100644 index 0000000..2f17045 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingObject.qml @@ -0,0 +1 @@ +something: 24 diff --git a/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt b/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt new file mode 100644 index 0000000..e243ae5 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt @@ -0,0 +1 @@ +4:5:Cannot assign to non-existant property "onClicked" diff --git a/tests/auto/declarative/qmllanguage/data/missingSignal.qml b/tests/auto/declarative/qmllanguage/data/missingSignal.qml new file mode 100644 index 0000000..fd489ca --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingSignal.qml @@ -0,0 +1,5 @@ +import Test 1.0 +import Qt 4.6 +Object { + onClicked: print("Hello world!") +} diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt new file mode 100644 index 0000000..cfc6fc8 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt @@ -0,0 +1 @@ +2:15:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.qml new file mode 100644 index 0000000..df7406c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.qml @@ -0,0 +1,2 @@ +import Test 1.0 +MyQmlObject { something: 24 } diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt new file mode 100644 index 0000000..8b13585 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.qml new file mode 100644 index 0000000..06ccd37 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + something: 24 +} diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt new file mode 100644 index 0000000..8b13585 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.qml new file mode 100644 index 0000000..5b08608 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + something: 1 + 1 +} diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt new file mode 100644 index 0000000..8b13585 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.qml new file mode 100644 index 0000000..6579191 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + something: ; +} diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.errors.txt new file mode 100644 index 0000000..c07f2b9 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.errors.txt @@ -0,0 +1 @@ +3:5:Expected a qualified name id diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.qml new file mode 100644 index 0000000..37af057 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + 24 +} diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt new file mode 100644 index 0000000..c02d7bd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt @@ -0,0 +1 @@ +3:5:Cannot assign to non-existant default property diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.qml new file mode 100644 index 0000000..5cd55d0 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + MyQmlObject {} +} diff --git a/tests/auto/declarative/qmllanguage/data/nullDotProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/nullDotProperty.errors.txt new file mode 100644 index 0000000..07a4094 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nullDotProperty.errors.txt @@ -0,0 +1 @@ +3:-1:Cannot set properties on obj as it is null diff --git a/tests/auto/declarative/qmllanguage/data/nullDotProperty.qml b/tests/auto/declarative/qmllanguage/data/nullDotProperty.qml new file mode 100644 index 0000000..4e36779 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/nullDotProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyDotPropertyObject { + obj.value: 1 +} diff --git a/tests/auto/declarative/qmllanguage/data/propertyValueSource.qml b/tests/auto/declarative/qmllanguage/data/propertyValueSource.qml new file mode 100644 index 0000000..ad71fcf --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/propertyValueSource.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + intProperty : MyPropertyValueSource {} +} diff --git a/tests/auto/declarative/qmllanguage/data/readOnly.1.errors.txt b/tests/auto/declarative/qmllanguage/data/readOnly.1.errors.txt new file mode 100644 index 0000000..b8c3404 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/readOnly.1.errors.txt @@ -0,0 +1 @@ +3:21:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmllanguage/data/readOnly.1.qml b/tests/auto/declarative/qmllanguage/data/readOnly.1.qml new file mode 100644 index 0000000..60757bd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/readOnly.1.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + readOnlyString: "Hello World" +} diff --git a/tests/auto/declarative/qmllanguage/data/readOnly.2.errors.txt b/tests/auto/declarative/qmllanguage/data/readOnly.2.errors.txt new file mode 100644 index 0000000..d857a04 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/readOnly.2.errors.txt @@ -0,0 +1 @@ +3:5:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmllanguage/data/readOnly.2.qml b/tests/auto/declarative/qmllanguage/data/readOnly.2.qml new file mode 100644 index 0000000..8f1633c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/readOnly.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + readOnlyString: "Hello" + "World" +} diff --git a/tests/auto/declarative/qmllanguage/data/rootAsQmlComponent.qml b/tests/auto/declarative/qmllanguage/data/rootAsQmlComponent.qml new file mode 100644 index 0000000..8d72cd3 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/rootAsQmlComponent.qml @@ -0,0 +1,6 @@ +import Test 1.0 +MyContainerComponent { + x: 11 + MyQmlObject {} + MyQmlObject {} +} diff --git a/tests/auto/declarative/qmllanguage/data/simpleBindings.qml b/tests/auto/declarative/qmllanguage/data/simpleBindings.qml new file mode 100644 index 0000000..74867b3 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/simpleBindings.qml @@ -0,0 +1,18 @@ +import Test 1.0 +MyTypeObject { + id: Me + property int v1: 10 + property int v2: 11 + + property int value1 + property int value2 + property int value3 + property int value4 + + value1: v1 + value2: Me.v1 + value3: v1 + v2 + value4: Math.min(v1, v2) + + objectProperty: Me +} diff --git a/tests/auto/declarative/qmllanguage/data/simpleContainer.qml b/tests/auto/declarative/qmllanguage/data/simpleContainer.qml new file mode 100644 index 0000000..c3a795f --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/simpleContainer.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyContainer { + MyQmlObject {} + MyQmlObject {} +} diff --git a/tests/auto/declarative/qmllanguage/data/simpleObject.qml b/tests/auto/declarative/qmllanguage/data/simpleObject.qml new file mode 100644 index 0000000..30c7823 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/simpleObject.qml @@ -0,0 +1,2 @@ +import Test 1.0 +MyQmlObject {} diff --git a/tests/auto/declarative/qmllanguage/data/subdir/Test.qml b/tests/auto/declarative/qmllanguage/data/subdir/Test.qml new file mode 100644 index 0000000..c4d5905 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/subdir/Test.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Rectangle { } diff --git a/tests/auto/declarative/qmllanguage/data/unregisteredObject.errors.txt b/tests/auto/declarative/qmllanguage/data/unregisteredObject.errors.txt new file mode 100644 index 0000000..bc4f7f4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/unregisteredObject.errors.txt @@ -0,0 +1 @@ +2:1:Type UnregisteredObject unavailable diff --git a/tests/auto/declarative/qmllanguage/data/unregisteredObject.qml b/tests/auto/declarative/qmllanguage/data/unregisteredObject.qml new file mode 100644 index 0000000..9498e31 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/unregisteredObject.qml @@ -0,0 +1,2 @@ +import Test 1.0 +UnregisteredObject {} diff --git a/tests/auto/declarative/qmllanguage/data/unsupportedProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.errors.txt new file mode 100644 index 0000000..3a90a7d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.errors.txt @@ -0,0 +1 @@ +3:13:Invalid property assignment: unknown type QVariant::QMatrix diff --git a/tests/auto/declarative/qmllanguage/data/unsupportedProperty.qml b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.qml new file mode 100644 index 0000000..9f19680 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + matrix: "1,0,0,0,1,0,0,0,1" +} diff --git a/tests/auto/declarative/qmllanguage/data/valueTypes.qml b/tests/auto/declarative/qmllanguage/data/valueTypes.qml new file mode 100644 index 0000000..bf325a7 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/valueTypes.qml @@ -0,0 +1,13 @@ +import Test 1.0 +MyTypeObject { + rectProperty.x: 10 + rectProperty.y: 11 + rectProperty.width: rectProperty.x + 2 + rectProperty.height: 13 + + intProperty: rectProperty.x + + onAction: { var a = rectProperty; a.x = 12; } + + rectProperty2: rectProperty +} diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.1.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.1.errors.txt new file mode 100644 index 0000000..ba7a076 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.1.errors.txt @@ -0,0 +1 @@ +3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.1.qml b/tests/auto/declarative/qmllanguage/data/wrongType.1.qml new file mode 100644 index 0000000..289d37f --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.1.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + value: "hello" +} diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.10.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.10.errors.txt new file mode 100644 index 0000000..ae75b52 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.10.errors.txt @@ -0,0 +1 @@ +3:23:Invalid property assignment: datetime expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.10.qml b/tests/auto/declarative/qmllanguage/data/wrongType.10.qml new file mode 100644 index 0000000..2cf0e50 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.10.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + dateTimeProperty: 12 +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.11.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.11.errors.txt new file mode 100644 index 0000000..23a4cda --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.11.errors.txt @@ -0,0 +1 @@ +3:20:Invalid property assignment: point expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.11.qml b/tests/auto/declarative/qmllanguage/data/wrongType.11.qml new file mode 100644 index 0000000..ae77ba1 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.11.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + pointProperty: "apples" +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.12.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.12.errors.txt new file mode 100644 index 0000000..3092100 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.12.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: size expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.12.qml b/tests/auto/declarative/qmllanguage/data/wrongType.12.qml new file mode 100644 index 0000000..b7a366f --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.12.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + sizeProperty: "red" +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.13.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.13.errors.txt new file mode 100644 index 0000000..ba7a076 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.13.errors.txt @@ -0,0 +1 @@ +3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.13.qml b/tests/auto/declarative/qmllanguage/data/wrongType.13.qml new file mode 100644 index 0000000..477aff1 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.13.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + value: "12" +} diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.14.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.14.errors.txt new file mode 100644 index 0000000..d621fdd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.14.errors.txt @@ -0,0 +1 @@ +3:21:Invalid property assignment: string expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.14.qml b/tests/auto/declarative/qmllanguage/data/wrongType.14.qml new file mode 100644 index 0000000..672d693 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.14.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + stringProperty: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.2.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.2.errors.txt new file mode 100644 index 0000000..9ff9f25 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.2.errors.txt @@ -0,0 +1 @@ +3:14:Invalid property assignment: boolean expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.2.qml b/tests/auto/declarative/qmllanguage/data/wrongType.2.qml new file mode 100644 index 0000000..34b74f7 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.2.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + enabled: 5 +} diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.3.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.3.errors.txt new file mode 100644 index 0000000..6d971c6 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.3.errors.txt @@ -0,0 +1 @@ +3:11:Invalid property assignment: rect expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.3.qml b/tests/auto/declarative/qmllanguage/data/wrongType.3.qml new file mode 100644 index 0000000..384181a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.3.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + rect: "5,5x10" +} diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.4.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.4.errors.txt new file mode 100644 index 0000000..ef34d0e --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.4.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: unknown enumeration diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.4.qml b/tests/auto/declarative/qmllanguage/data/wrongType.4.qml new file mode 100644 index 0000000..0787bf5 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.4.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + enumProperty: "InvalidEnumName" +} diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.5.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.5.errors.txt new file mode 100644 index 0000000..cab10bd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.5.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: unsigned int expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.5.qml b/tests/auto/declarative/qmllanguage/data/wrongType.5.qml new file mode 100644 index 0000000..c50ae9a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.5.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + uintProperty: -13 +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.6.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.6.errors.txt new file mode 100644 index 0000000..d0a0b00 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.6.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: double expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.6.qml b/tests/auto/declarative/qmllanguage/data/wrongType.6.qml new file mode 100644 index 0000000..da10b78 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.6.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + realProperty: "Hello" +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.7.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.7.errors.txt new file mode 100644 index 0000000..614346b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.7.errors.txt @@ -0,0 +1 @@ +3:20:Invalid property assignment: color expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.7.qml b/tests/auto/declarative/qmllanguage/data/wrongType.7.qml new file mode 100644 index 0000000..ddc3835 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.7.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + colorProperty: 12 +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.8.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.8.errors.txt new file mode 100644 index 0000000..1773c00 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.8.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: date expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.8.qml b/tests/auto/declarative/qmllanguage/data/wrongType.8.qml new file mode 100644 index 0000000..a5f6756 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.8.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + dateProperty: 12 +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.9.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.9.errors.txt new file mode 100644 index 0000000..8630975 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.9.errors.txt @@ -0,0 +1 @@ +3:19:Invalid property assignment: time expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.9.qml b/tests/auto/declarative/qmllanguage/data/wrongType.9.qml new file mode 100644 index 0000000..a3db732 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.9.qml @@ -0,0 +1,5 @@ +import Test 1.0 +MyTypeObject { + timeProperty: 12 +} + diff --git a/tests/auto/declarative/qmllanguage/qmllanguage.pro b/tests/auto/declarative/qmllanguage/qmllanguage.pro new file mode 100644 index 0000000..4e4be9c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/qmllanguage.pro @@ -0,0 +1,9 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +SOURCES += tst_qmllanguage.cpp \ + testtypes.cpp +HEADERS += testtypes.h +macx:CONFIG -= app_bundle + +# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage +# LIBS += -lgcov diff --git a/tests/auto/declarative/qmllanguage/testtypes.cpp b/tests/auto/declarative/qmllanguage/testtypes.cpp new file mode 100644 index 0000000..c11e195 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/testtypes.cpp @@ -0,0 +1,10 @@ +#include "testtypes.h" + +QML_DEFINE_INTERFACE(MyInterface); +QML_DEFINE_TYPE(Test,1,0,0,MyQmlObject,MyQmlObject); +QML_DEFINE_TYPE(Test,1,0,0,MyTypeObject,MyTypeObject); +QML_DEFINE_TYPE(Test,1,0,0,MyContainer,MyContainer); +QML_DEFINE_TYPE(Test,1,0,0,MyPropertyValueSource,MyPropertyValueSource); +QML_DEFINE_TYPE(Test,1,0,0,MyDotPropertyObject,MyDotPropertyObject); +QML_DEFINE_TYPE(Test,1,0,0,MyNamespacedType,MyNamespace::MyNamespacedType); + diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h new file mode 100644 index 0000000..b1da9fb --- /dev/null +++ b/tests/auto/declarative/qmllanguage/testtypes.h @@ -0,0 +1,433 @@ +#ifndef TESTTYPES_H +#define TESTTYPES_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class MyInterface +{ +public: + MyInterface() : id(913) {} + int id; +}; +Q_DECLARE_INTERFACE(MyInterface, "com.trolltech.Qt.Test.MyInterface"); +QML_DECLARE_INTERFACE(MyInterface); + +struct MyCustomVariantType +{ + MyCustomVariantType() : a(0) {} + int a; +}; +Q_DECLARE_METATYPE(MyCustomVariantType); + +static QVariant myCustomVariantTypeConverter(const QString &data) +{ + MyCustomVariantType rv; + rv.a = data.toInt(); + return QVariant::fromValue(rv); +} + +class MyAttachedObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue) +public: + MyAttachedObject(QObject *parent) : QObject(parent), m_value(0) {} + + int value() const { return m_value; } + void setValue(int v) { m_value = v; } + +private: + int m_value; +}; + +class MyQmlObject : public QObject, public MyInterface, public QmlParserStatus +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue FINAL) + Q_PROPERTY(QString readOnlyString READ readOnlyString) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled) + Q_PROPERTY(QRect rect READ rect WRITE setRect) + Q_PROPERTY(QMatrix matrix READ matrix WRITE setMatrix) //assumed to be unsupported by QML + Q_PROPERTY(MyInterface *interfaceProperty READ interface WRITE setInterface) + Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal); + Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType); + Q_PROPERTY(MyQmlObject *qmlobjectProperty READ qmlobject WRITE setQmlobject) + + Q_INTERFACES(MyInterface QmlParserStatus) +public: + MyQmlObject() : m_value(-1), m_interface(0), m_qmlobject(0) { qRegisterMetaType("MyCustomVariantType"); } + + int value() const { return m_value; } + void setValue(int v) { m_value = v; } + + QString readOnlyString() const { return QLatin1String(""); } + + bool enabled() const { return false; } + void setEnabled(bool) {} + + QRect rect() const { return QRect(); } + void setRect(const QRect&) {} + + QMatrix matrix() const { return QMatrix(); } + void setMatrix(const QMatrix&) {} + + MyInterface *interface() const { return m_interface; } + void setInterface(MyInterface *iface) { m_interface = iface; } + + static MyAttachedObject *qmlAttachedProperties(QObject *other) { + return new MyAttachedObject(other); + } + Q_CLASSINFO("DefaultMethod", "basicSlot()"); + + int onLiteralSignal() const { return m_value; } + void setOnLiteralSignal(int v) { m_value = v; } + + MyQmlObject *qmlobject() const { return m_qmlobject; } + void setQmlobject(MyQmlObject *o) { m_qmlobject = o; } + + MyCustomVariantType customType() const { return m_custom; } + void setCustomType(const MyCustomVariantType &v) { m_custom = v; } +public slots: + void basicSlot() { qWarning("MyQmlObject::basicSlot"); } + void basicSlot(int v) { qWarning("MyQmlObject::basicSlot(%d)", v); } + +signals: + void basicSignal(); + void basicParameterizedSignal(int parameter); + +private: + friend class tst_qmllanguage; + int m_value; + MyInterface *m_interface; + MyQmlObject *m_qmlobject; + MyCustomVariantType m_custom; +}; +QML_DECLARE_TYPE(MyQmlObject); + +class MyTypeObject : public QObject +{ + Q_OBJECT + Q_ENUMS(MyEnum) + Q_FLAGS(MyFlags) + + Q_PROPERTY(QString id READ id WRITE setId); + Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty); + Q_PROPERTY(QmlComponent *componentProperty READ componentProperty WRITE setComponentProperty); + Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty); + Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty); + Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty); + Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty); + Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty); + Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty); + Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty); + Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty); + Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty); + Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty); + Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty); + Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); + Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); + Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); + Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); + Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); + Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2); + Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); + Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty); + Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty); + +public: + MyTypeObject() + : objectPropertyValue(0), componentPropertyValue(0) {} + + QString idValue; + QString id() const { + return idValue; + } + void setId(const QString &v) { + idValue = v; + } + + QObject *objectPropertyValue; + QObject *objectProperty() const { + return objectPropertyValue; + } + void setObjectProperty(QObject *v) { + objectPropertyValue = v; + } + + QmlComponent *componentPropertyValue; + QmlComponent *componentProperty() const { + return componentPropertyValue; + } + void setComponentProperty(QmlComponent *v) { + componentPropertyValue = v; + } + + enum MyFlag { FlagVal1 = 0x01, FlagVal2 = 0x02, FlagVal3 = 0x04 }; + Q_DECLARE_FLAGS(MyFlags, MyFlag) + MyFlags flagPropertyValue; + MyFlags flagProperty() const { + return flagPropertyValue; + } + void setFlagProperty(MyFlags v) { + flagPropertyValue = v; + } + + enum MyEnum { EnumVal1, EnumVal2 }; + MyEnum enumPropertyValue; + MyEnum enumProperty() const { + return enumPropertyValue; + } + void setEnumProperty(MyEnum v) { + enumPropertyValue = v; + } + + QString stringPropertyValue; + QString stringProperty() const { + return stringPropertyValue; + } + void setStringProperty(const QString &v) { + stringPropertyValue = v; + } + + uint uintPropertyValue; + uint uintProperty() const { + return uintPropertyValue; + } + void setUintProperty(const uint &v) { + uintPropertyValue = v; + } + + int intPropertyValue; + int intProperty() const { + return intPropertyValue; + } + void setIntProperty(const int &v) { + intPropertyValue = v; + } + + qreal realPropertyValue; + qreal realProperty() const { + return realPropertyValue; + } + void setRealProperty(const qreal &v) { + realPropertyValue = v; + } + + double doublePropertyValue; + double doubleProperty() const { + return doublePropertyValue; + } + void setDoubleProperty(const double &v) { + doublePropertyValue = v; + } + + QColor colorPropertyValue; + QColor colorProperty() const { + return colorPropertyValue; + } + void setColorProperty(const QColor &v) { + colorPropertyValue = v; + } + + QDate datePropertyValue; + QDate dateProperty() const { + return datePropertyValue; + } + void setDateProperty(const QDate &v) { + datePropertyValue = v; + } + + QTime timePropertyValue; + QTime timeProperty() const { + return timePropertyValue; + } + void setTimeProperty(const QTime &v) { + timePropertyValue = v; + } + + QDateTime dateTimePropertyValue; + QDateTime dateTimeProperty() const { + return dateTimePropertyValue; + } + void setDateTimeProperty(const QDateTime &v) { + dateTimePropertyValue = v; + } + + QPoint pointPropertyValue; + QPoint pointProperty() const { + return pointPropertyValue; + } + void setPointProperty(const QPoint &v) { + pointPropertyValue = v; + } + + QPointF pointFPropertyValue; + QPointF pointFProperty() const { + return pointFPropertyValue; + } + void setPointFProperty(const QPointF &v) { + pointFPropertyValue = v; + } + + QSize sizePropertyValue; + QSize sizeProperty() const { + return sizePropertyValue; + } + void setSizeProperty(const QSize &v) { + sizePropertyValue = v; + } + + QSizeF sizeFPropertyValue; + QSizeF sizeFProperty() const { + return sizeFPropertyValue; + } + void setSizeFProperty(const QSizeF &v) { + sizeFPropertyValue = v; + } + + QRect rectPropertyValue; + QRect rectProperty() const { + return rectPropertyValue; + } + void setRectProperty(const QRect &v) { + rectPropertyValue = v; + emit rectPropertyChanged(); + } + + QRect rectPropertyValue2; + QRect rectProperty2() const { + return rectPropertyValue2; + } + void setRectProperty2(const QRect &v) { + rectPropertyValue2 = v; + } + + QRectF rectFPropertyValue; + QRectF rectFProperty() const { + return rectFPropertyValue; + } + void setRectFProperty(const QRectF &v) { + rectFPropertyValue = v; + } + + bool boolPropertyValue; + bool boolProperty() const { + return boolPropertyValue; + } + void setBoolProperty(const bool &v) { + boolPropertyValue = v; + } + + QVariant variantPropertyValue; + QVariant variantProperty() const { + return variantPropertyValue; + } + void setVariantProperty(const QVariant &v) { + variantPropertyValue = v; + } + + void doAction() { emit action(); } +signals: + void action(); + void rectPropertyChanged(); +}; +Q_DECLARE_OPERATORS_FOR_FLAGS(MyTypeObject::MyFlags) +QML_DECLARE_TYPE(MyTypeObject); + +class MyContainer : public QObject +{ + Q_OBJECT + Q_PROPERTY(QList* children READ children) + Q_PROPERTY(QList* qlistInterfaces READ qlistInterfaces) + Q_PROPERTY(QmlList* qmllistInterfaces READ qmllistInterfaces) + Q_CLASSINFO("DefaultProperty", "children"); +public: + MyContainer() {} + + QList *children() { return &m_children; } + QList *qlistInterfaces() { return &m_interfaces; } + QmlList *qmllistInterfaces() { return &m_qmlinterfaces; } + const QmlConcreteList &qmllistAccessor() const { return m_qmlinterfaces; } + +private: + QList m_children; + QList m_interfaces; + QmlConcreteList m_qmlinterfaces; +}; + +QML_DECLARE_TYPE(MyContainer); + +class MyPropertyValueSource : public QObject, public QmlPropertyValueSource +{ + Q_OBJECT + Q_INTERFACES(QmlPropertyValueSource) +public: + MyPropertyValueSource() + : QmlPropertyValueSource() {} + + QmlMetaProperty prop; + virtual void setTarget(const QmlMetaProperty &p) + { + prop = p; + } +}; +QML_DECLARE_TYPE(MyPropertyValueSource); + +class MyDotPropertyObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(MyQmlObject *obj READ obj) + Q_PROPERTY(MyQmlObject *readWriteObj READ readWriteObj WRITE setReadWriteObj) +public: + MyDotPropertyObject() : m_rwobj(0), m_ownRWObj(false) {} + ~MyDotPropertyObject() + { + if (m_ownRWObj) + delete m_rwobj; + } + + MyQmlObject *obj() { return 0; } + + MyQmlObject *readWriteObj() + { + if (!m_rwobj) { + m_rwobj = new MyQmlObject; + m_ownRWObj = true; + } + return m_rwobj; + } + + void setReadWriteObj(MyQmlObject *obj) + { + if (m_ownRWObj) { + delete m_rwobj; + m_ownRWObj = false; + } + + m_rwobj = obj; + } + +private: + MyQmlObject *m_rwobj; + bool m_ownRWObj; +}; + +QML_DECLARE_TYPE(MyDotPropertyObject); + +namespace MyNamespace { + class MyNamespacedType : public QObject + { + Q_OBJECT + }; +} +QML_DECLARE_TYPE(MyNamespace::MyNamespacedType); + +#endif // TESTTYPES_H diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp new file mode 100644 index 0000000..1bf98df --- /dev/null +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -0,0 +1,863 @@ +#include +#include +#include +#include +#include +#include +#include +#include "testtypes.h" + +/* +This test case covers QML language issues. This covers everything that does +involve evaluating ECMAScript expressions and bindings. + +Evaluation of expressions and bindings is covered in qmlecmascript +*/ +class tst_qmllanguage : public QObject +{ + Q_OBJECT +public: + tst_qmllanguage() { + QmlMetaType::registerCustomStringConverter(qMetaTypeId(), myCustomVariantTypeConverter); + QFileInfo fileInfo(__FILE__); + engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("data/lib"))); + } + +private slots: + + void errors_data(); + void errors(); + + void simpleObject(); + void simpleContainer(); + void interfaceProperty(); + void interfaceQmlList(); + void interfaceQList(); + void assignObjectToSignal(); + void assignObjectToVariant(); + void assignLiteralSignalProperty(); + void assignQmlComponent(); + void assignBasicTypes(); + void assignTypeExtremes(); + void customParserTypes(); + void rootAsQmlComponent(); + void inlineQmlComponents(); + void idProperty(); + void assignSignal(); + void dynamicProperties(); + void dynamicSignalsAndSlots(); + void simpleBindings(); + void autoComponentCreation(); + void propertyValueSource(); + void attachedProperties(); + void dynamicObjects(); + void customVariantTypes(); + void valueTypes(); + void cppnamespace(); + void aliasProperties(); + + void importsBuiltin_data(); + void importsBuiltin(); + void importsLocal_data(); + void importsLocal(); + void importsInstalled_data(); + void importsInstalled(); + void importsOrder_data(); + void importsOrder(); + + // regression tests for crashes + void crash1(); + +private: + QmlEngine engine; + void testType(const QString& qml, const QString& type); +}; + +#define VERIFY_ERRORS(errorfile) \ + if (!errorfile) { \ + if (qgetenv("DEBUG") != "" && !component.errors().isEmpty()) \ + qWarning() << "Unexpected Errors:" << component.errors(); \ + QVERIFY(!component.isError()); \ + QVERIFY(component.errors().isEmpty()); \ + } else { \ + QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \ + QVERIFY(file.open(QIODevice::ReadOnly)); \ + QByteArray data = file.readAll(); \ + QList expected = data.split('\n'); \ + expected.removeAll(QByteArray("")); \ + QList errors = component.errors(); \ + QList actual; \ + for (int ii = 0; ii < errors.count(); ++ii) { \ + const QmlError &error = errors.at(ii); \ + QByteArray errorStr = QByteArray::number(error.line()) + ":" + \ + QByteArray::number(error.column()) + ":" + \ + error.description().toUtf8(); \ + actual << errorStr; \ + } \ + if (qgetenv("DEBUG") != "" && expected != actual) \ + qWarning() << "Expected:" << expected << "Actual:" << actual; \ + QCOMPARE(expected, actual); \ + } + +inline QUrl TEST_FILE(const QString &filename) +{ + QFileInfo fileInfo(__FILE__); + return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(QLatin1String("data/") + filename)); +} + +inline QUrl TEST_FILE(const char *filename) +{ + return TEST_FILE(QLatin1String(filename)); +} + +void tst_qmllanguage::errors_data() +{ + QTest::addColumn("file"); + QTest::addColumn("errorFile"); + QTest::addColumn("create"); + + QTest::newRow("nonexistantProperty.1") << "nonexistantProperty.1.qml" << "nonexistantProperty.1.errors.txt" << false; + QTest::newRow("nonexistantProperty.2") << "nonexistantProperty.2.qml" << "nonexistantProperty.2.errors.txt" << false; + QTest::newRow("nonexistantProperty.3") << "nonexistantProperty.3.qml" << "nonexistantProperty.3.errors.txt" << false; + QTest::newRow("nonexistantProperty.4") << "nonexistantProperty.4.qml" << "nonexistantProperty.4.errors.txt" << false; + QTest::newRow("nonexistantProperty.5") << "nonexistantProperty.5.qml" << "nonexistantProperty.5.errors.txt" << false; + QTest::newRow("nonexistantProperty.6") << "nonexistantProperty.6.qml" << "nonexistantProperty.6.errors.txt" << false; + + QTest::newRow("wrongType (string for int)") << "wrongType.1.qml" << "wrongType.1.errors.txt" << false; + QTest::newRow("wrongType (int for bool)") << "wrongType.2.qml" << "wrongType.2.errors.txt" << false; + QTest::newRow("wrongType (bad rect)") << "wrongType.3.qml" << "wrongType.3.errors.txt" << false; + + QTest::newRow("wrongType (invalid enum)") << "wrongType.4.qml" << "wrongType.4.errors.txt" << false; + QTest::newRow("wrongType (int for uint)") << "wrongType.5.qml" << "wrongType.5.errors.txt" << false; + QTest::newRow("wrongType (string for real)") << "wrongType.6.qml" << "wrongType.6.errors.txt" << false; + QTest::newRow("wrongType (int for color)") << "wrongType.7.qml" << "wrongType.7.errors.txt" << false; + QTest::newRow("wrongType (int for date)") << "wrongType.8.qml" << "wrongType.8.errors.txt" << false; + QTest::newRow("wrongType (int for time)") << "wrongType.9.qml" << "wrongType.9.errors.txt" << false; + QTest::newRow("wrongType (int for datetime)") << "wrongType.10.qml" << "wrongType.10.errors.txt" << false; + QTest::newRow("wrongType (string for point)") << "wrongType.11.qml" << "wrongType.11.errors.txt" << false; + QTest::newRow("wrongType (color for size)") << "wrongType.12.qml" << "wrongType.12.errors.txt" << false; + QTest::newRow("wrongType (number string for int)") << "wrongType.13.qml" << "wrongType.13.errors.txt" << false; + QTest::newRow("wrongType (int for string)") << "wrongType.14.qml" << "wrongType.14.errors.txt" << false; + + QTest::newRow("readOnly.1") << "readOnly.1.qml" << "readOnly.1.errors.txt" << false; + QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false; + + QTest::newRow("listAssignment.1") << "listAssignment.1.qml" << "listAssignment.1.errors.txt" << false; + QTest::newRow("listAssignment.2") << "listAssignment.2.qml" << "listAssignment.2.errors.txt" << false; + QTest::newRow("listAssignment.3") << "listAssignment.3.qml" << "listAssignment.3.errors.txt" << false; + + QTest::newRow("invalidID.1") << "invalidID.qml" << "invalidID.errors.txt" << false; + QTest::newRow("invalidID.2") << "invalidID.2.qml" << "invalidID.2.errors.txt" << false; + QTest::newRow("invalidID.3") << "invalidID.3.qml" << "invalidID.3.errors.txt" << false; + QTest::newRow("invalidID.4") << "invalidID.4.qml" << "invalidID.4.errors.txt" << false; + QTest::newRow("invalidID.5") << "invalidID.5.qml" << "invalidID.5.errors.txt" << false; + QTest::newRow("invalidID.6") << "invalidID.6.qml" << "invalidID.6.errors.txt" << false; + + + QTest::newRow("unsupportedProperty") << "unsupportedProperty.qml" << "unsupportedProperty.errors.txt" << false; + QTest::newRow("nullDotProperty") << "nullDotProperty.qml" << "nullDotProperty.errors.txt" << true; + QTest::newRow("fakeDotProperty") << "fakeDotProperty.qml" << "fakeDotProperty.errors.txt" << false; + QTest::newRow("duplicateIDs") << "duplicateIDs.qml" << "duplicateIDs.errors.txt" << false; + QTest::newRow("unregisteredObject") << "unregisteredObject.qml" << "unregisteredObject.errors.txt" << false; + QTest::newRow("empty") << "empty.qml" << "empty.errors.txt" << false; + QTest::newRow("missingObject") << "missingObject.qml" << "missingObject.errors.txt" << false; + QTest::newRow("failingComponent") << "failingComponentTest.qml" << "failingComponent.errors.txt" << false; + QTest::newRow("missingSignal") << "missingSignal.qml" << "missingSignal.errors.txt" << false; + QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false; + + QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false; + QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false; + QTest::newRow("importVersionMissing (installed)") << "importVersionMissingInstalled.qml" << "importVersionMissingInstalled.errors.txt" << false; + + QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false; +} + +void tst_qmllanguage::errors() +{ + QFETCH(QString, file); + QFETCH(QString, errorFile); + QFETCH(bool, create); + + QmlComponent component(&engine, TEST_FILE(file)); + + if(create) { + QObject *object = component.create(); + QVERIFY(object == 0); + } + + VERIFY_ERRORS(errorFile.toLatin1().constData()); +} + +void tst_qmllanguage::simpleObject() +{ + QmlComponent component(&engine, TEST_FILE("simpleObject.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); +} + +void tst_qmllanguage::simpleContainer() +{ + QmlComponent component(&engine, TEST_FILE("simpleContainer.qml")); + VERIFY_ERRORS(0); + MyContainer *container= qobject_cast(component.create()); + QVERIFY(container != 0); + QCOMPARE(container->children()->count(),2); +} + +void tst_qmllanguage::interfaceProperty() +{ + QmlComponent component(&engine, TEST_FILE("interfaceProperty.qml")); + VERIFY_ERRORS(0); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QVERIFY(object->interface()); + QVERIFY(object->interface()->id == 913); +} + +void tst_qmllanguage::interfaceQmlList() +{ + QmlComponent component(&engine, TEST_FILE("interfaceQmlList.qml")); + VERIFY_ERRORS(0); + MyContainer *container= qobject_cast(component.create()); + QVERIFY(container != 0); + QVERIFY(container->qmllistAccessor().count() == 2); + for(int ii = 0; ii < 2; ++ii) + QVERIFY(container->qmllistAccessor().at(ii)->id == 913); +} + +void tst_qmllanguage::interfaceQList() +{ + QmlComponent component(&engine, TEST_FILE("interfaceQList.qml")); + VERIFY_ERRORS(0); + MyContainer *container= qobject_cast(component.create()); + QVERIFY(container != 0); + QVERIFY(container->qlistInterfaces()->count() == 2); + for(int ii = 0; ii < 2; ++ii) + QVERIFY(container->qlistInterfaces()->at(ii)->id == 913); +} + +void tst_qmllanguage::assignObjectToSignal() +{ + QmlComponent component(&engine, TEST_FILE("assignObjectToSignal.qml")); + VERIFY_ERRORS(0); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot"); + emit object->basicSignal(); +} + +void tst_qmllanguage::assignObjectToVariant() +{ + QmlComponent component(&engine, TEST_FILE("assignObjectToVariant.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + QVariant v = object->property("a"); + QVERIFY(v.userType() == qMetaTypeId()); +} + +void tst_qmllanguage::assignLiteralSignalProperty() +{ + QmlComponent component(&engine, TEST_FILE("assignLiteralSignalProperty.qml")); + VERIFY_ERRORS(0); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->onLiteralSignal(), 10); +} + +// Test is an external component can be loaded and assigned (to a qlist) +void tst_qmllanguage::assignQmlComponent() +{ + QmlComponent component(&engine, TEST_FILE("assignQmlComponent.qml")); + VERIFY_ERRORS(0); + MyContainer *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QVERIFY(object->children()->count() == 1); + QObject *child = object->children()->at(0); + QCOMPARE(child->property("x"), QVariant(10)); + QCOMPARE(child->property("y"), QVariant(11)); +} + +// Test literal assignment to all the basic types +void tst_qmllanguage::assignBasicTypes() +{ + QmlComponent component(&engine, TEST_FILE("assignBasicTypes.qml")); + VERIFY_ERRORS(0); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3); + QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2); + QCOMPARE(object->stringProperty(), QString("Hello World!")); + QCOMPARE(object->uintProperty(), uint(10)); + QCOMPARE(object->intProperty(), -19); + QCOMPARE((float)object->realProperty(), float(23.2)); + QCOMPARE((float)object->doubleProperty(), float(-19.7)); + QCOMPARE(object->colorProperty(), QColor("red")); + QCOMPARE(object->dateProperty(), QDate(1982, 11, 25)); + QCOMPARE(object->timeProperty(), QTime(11, 11, 32)); + QCOMPARE(object->dateTimeProperty(), QDateTime(QDate(2009, 5, 12), QTime(13, 22, 1))); + QCOMPARE(object->pointProperty(), QPoint(99,13)); + QCOMPARE(object->pointFProperty(), QPointF((float)-10.1, (float)12.3)); + QCOMPARE(object->sizeProperty(), QSize(99, 13)); + QCOMPARE(object->sizeFProperty(), QSizeF((float)0.1, (float)0.2)); + QCOMPARE(object->rectProperty(), QRect(9, 7, 100, 200)); + QCOMPARE(object->rectFProperty(), QRectF((float)1000.1, (float)-10.9, (float)400, (float)90.99)); + QCOMPARE(object->boolProperty(), true); + QCOMPARE(object->variantProperty(), QVariant("Hello World!")); + QVERIFY(object->objectProperty() != 0); + MyTypeObject *child = qobject_cast(object->objectProperty()); + QVERIFY(child != 0); + QCOMPARE(child->intProperty(), 8); +} + +// Test edge case type assignments +void tst_qmllanguage::assignTypeExtremes() +{ + QmlComponent component(&engine, TEST_FILE("assignTypeExtremes.qml")); + VERIFY_ERRORS(0); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->uintProperty(), 0xEE6B2800); + QCOMPARE(object->intProperty(), -0x77359400); +} + +// Tests that custom parser types can be instantiated +void tst_qmllanguage::customParserTypes() +{ + QmlComponent component(&engine, TEST_FILE("customParserTypes.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + QVERIFY(object->property("count") == QVariant(2)); +} + +// Tests that the root item can be a custom component +void tst_qmllanguage::rootAsQmlComponent() +{ + QmlComponent component(&engine, TEST_FILE("rootAsQmlComponent.qml")); + VERIFY_ERRORS(0); + MyContainer *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->property("x"), QVariant(11)); + QCOMPARE(object->children()->count(), 2); +} + +// Tests that components can be specified inline +void tst_qmllanguage::inlineQmlComponents() +{ + QmlComponent component(&engine, TEST_FILE("inlineQmlComponents.qml")); + VERIFY_ERRORS(0); + MyContainer *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->children()->count(), 1); + QmlComponent *comp = qobject_cast(object->children()->at(0)); + QVERIFY(comp != 0); + MyQmlObject *compObject = qobject_cast(comp->create()); + QVERIFY(compObject != 0); + QCOMPARE(compObject->value(), 11); +} + +// Tests that types that have an id property have it set +void tst_qmllanguage::idProperty() +{ + QmlComponent component(&engine, TEST_FILE("idProperty.qml")); + VERIFY_ERRORS(0); + MyContainer *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->children()->count(), 1); + MyTypeObject *child = + qobject_cast(object->children()->at(0)); + QVERIFY(child != 0); + QCOMPARE(child->id(), QString("MyObjectId")); + QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child)); +} + +// Tests that signals can be assigned to +void tst_qmllanguage::assignSignal() +{ + QmlComponent component(&engine, TEST_FILE("assignSignal.qml")); + VERIFY_ERRORS(0); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot"); + emit object->basicSignal(); + QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot(9)"); + emit object->basicParameterizedSignal(9); +} + +// Tests the creation and assignment of dynamic properties +void tst_qmllanguage::dynamicProperties() +{ + QmlComponent component(&engine, TEST_FILE("dynamicProperties.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(object->property("intProperty"), QVariant(10)); + QCOMPARE(object->property("boolProperty"), QVariant(false)); + QCOMPARE(object->property("doubleProperty"), QVariant(-10.1)); + QCOMPARE(object->property("realProperty"), QVariant((qreal)-19.9)); + QCOMPARE(object->property("stringProperty"), QVariant("Hello World!")); + QCOMPARE(object->property("colorProperty"), QVariant(QColor("red"))); + QCOMPARE(object->property("dateProperty"), QVariant(QDate(1945, 9, 2))); + QCOMPARE(object->property("varProperty"), QVariant("Hello World!")); + QCOMPARE(object->property("variantProperty"), QVariant(12)); +} + +// Tests the declaration of dynamic signals and slots +void tst_qmllanguage::dynamicSignalsAndSlots() +{ + QmlComponent component(&engine, TEST_FILE("dynamicSignalsAndSlots.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + QVERIFY(object->metaObject()->indexOfMethod("signal1()") != -1); + QVERIFY(object->metaObject()->indexOfMethod("signal2()") != -1); + QVERIFY(object->metaObject()->indexOfMethod("slot1()") != -1); + QVERIFY(object->metaObject()->indexOfMethod("slot2()") != -1); +} + +void tst_qmllanguage::simpleBindings() +{ + QmlComponent component(&engine, TEST_FILE("simpleBindings.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(object->property("value1"), QVariant(10)); + QCOMPARE(object->property("value2"), QVariant(10)); + QCOMPARE(object->property("value3"), QVariant(21)); + QCOMPARE(object->property("value4"), QVariant(10)); + QCOMPARE(object->property("objectProperty"), QVariant::fromValue(object)); +} + +void tst_qmllanguage::autoComponentCreation() +{ + QmlComponent component(&engine, TEST_FILE("autoComponentCreation.qml")); + VERIFY_ERRORS(0); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QVERIFY(object->componentProperty() != 0); + MyTypeObject *child = qobject_cast(object->componentProperty()->create()); + QVERIFY(child != 0); + QCOMPARE(child->realProperty(), qreal(9)); +} + +void tst_qmllanguage::propertyValueSource() +{ + QmlComponent component(&engine, TEST_FILE("propertyValueSource.qml")); + VERIFY_ERRORS(0); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QList valueSources; + QObjectList allChildren = object->findChildren(); + foreach (QObject *child, allChildren) { + QmlType *type = QmlMetaType::qmlType(child->metaObject()); + if (type && type->propertyValueSourceCast() != -1) + valueSources.append(child); + } + + QCOMPARE(valueSources.count(), 1); + MyPropertyValueSource *valueSource = + qobject_cast(valueSources.at(0)); + QVERIFY(valueSource != 0); + QCOMPARE(valueSource->prop.object(), object); + QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty"))); +} + +void tst_qmllanguage::attachedProperties() +{ + QmlComponent component(&engine, TEST_FILE("attachedProperties.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + QObject *attached = qmlAttachedPropertiesObject(object); + QVERIFY(attached != 0); + QCOMPARE(attached->property("value"), QVariant(10)); +} + +// Tests non-static object properties +void tst_qmllanguage::dynamicObjects() +{ + QmlComponent component(&engine, TEST_FILE("dynamicObject.1.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); +} + +// Tests the registration of custom variant string converters +void tst_qmllanguage::customVariantTypes() +{ + QmlComponent component(&engine, TEST_FILE("customVariantTypes.qml")); + VERIFY_ERRORS(0); + MyQmlObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->customType().a, 10); +} + +void tst_qmllanguage::valueTypes() +{ + QmlComponent component(&engine, TEST_FILE("valueTypes.qml")); + VERIFY_ERRORS(0); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rectProperty(), QRect(10, 11, 12, 13)); + QCOMPARE(object->rectProperty2(), QRect(10, 11, 12, 13)); + QCOMPARE(object->intProperty(), 10); + object->doAction(); + QCOMPARE(object->rectProperty(), QRect(12, 11, 14, 13)); + QCOMPARE(object->rectProperty2(), QRect(12, 11, 14, 13)); + QCOMPARE(object->intProperty(), 12); + + QmlMetaProperty p = QmlMetaProperty::createProperty(object, "rectProperty.x"); + QCOMPARE(p.read(), QVariant(12)); + p.write(13); + QCOMPARE(p.read(), QVariant(13)); + + quint32 r = p.save(); + QmlMetaProperty p2; + p2.restore(r, object); + QCOMPARE(p2.read(), QVariant(13)); +} + +void tst_qmllanguage::cppnamespace() +{ + QmlComponent component(&engine, TEST_FILE("cppnamespace.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + delete object; +} + +void tst_qmllanguage::aliasProperties() +{ + // Simple "int" alias + { + QmlComponent component(&engine, TEST_FILE("alias.1.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + // Read through alias + QCOMPARE(object->property("valueAlias").toInt(), 10); + object->setProperty("value", QVariant(13)); + QCOMPARE(object->property("valueAlias").toInt(), 13); + + // Write throught alias + object->setProperty("valueAlias", QVariant(19)); + QCOMPARE(object->property("valueAlias").toInt(), 19); + QCOMPARE(object->property("value").toInt(), 19); + + delete object; + } + + // Complex object alias + { + QmlComponent component(&engine, TEST_FILE("alias.2.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + // Read through alias + MyQmlObject *v = + qvariant_cast(object->property("aliasObject")); + QVERIFY(v != 0); + QCOMPARE(v->value(), 10); + + // Write through alias + MyQmlObject *v2 = new MyQmlObject(); + v2->setParent(object); + object->setProperty("aliasObject", qVariantFromValue(v2)); + MyQmlObject *v3 = + qvariant_cast(object->property("aliasObject")); + QVERIFY(v3 != 0); + QCOMPARE(v3, v2); + + delete object; + } + + // Nested aliases + { + QmlComponent component(&engine, TEST_FILE("alias.3.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("value").toInt(), 1892); + QCOMPARE(object->property("value2").toInt(), 1892); + + object->setProperty("value", QVariant(1313)); + QCOMPARE(object->property("value").toInt(), 1313); + QCOMPARE(object->property("value2").toInt(), 1313); + + object->setProperty("value2", QVariant(8080)); + QCOMPARE(object->property("value").toInt(), 8080); + QCOMPARE(object->property("value2").toInt(), 8080); + + delete object; + } + +} + +class TestType : public QObject { + Q_OBJECT +public: + TestType(QObject *p=0) : QObject(p) {} +}; + +class TestType2 : public QObject { + Q_OBJECT +public: + TestType2(QObject *p=0) : QObject(p) {} +}; + +// Check that first child of qml is of given type. Empty type insists on error. +void tst_qmllanguage::testType(const QString& qml, const QString& type) +{ + QmlComponent component(&engine, qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports + + if (type.isEmpty()) { + QVERIFY(component.isError()); + } else { + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(QString(object->metaObject()->className()), type); + } +} + +QML_DECLARE_TYPE(TestType) +QML_DECLARE_TYPE(TestType2) + +QML_DEFINE_TYPE(com.nokia.Test, 1, 0, 3, Test, TestType) +QML_DEFINE_TYPE(com.nokia.Test, 1, 5, 7, Test, TestType) +QML_DEFINE_TYPE(com.nokia.Test, 1, 8, 9, Test, TestType2) +QML_DEFINE_TYPE(com.nokia.Test, 1, 12, 13, Test, TestType2) +QML_DEFINE_TYPE(com.nokia.Test, 1, 9, 11, OldTest, TestType) + +void tst_qmllanguage::importsBuiltin_data() +{ + QTest::addColumn("qml"); + QTest::addColumn("type"); + + // import built-ins + QTest::newRow("missing import") + << "Test {}" + << ""; + QTest::newRow("not in version 0.0") + << "import com.nokia.Test 0.0\n" + "Test {}" + << ""; + QTest::newRow("in version 1.0") + << "import com.nokia.Test 1.0\n" + "Test {}" + << "TestType"; + QTest::newRow("qualified wrong") + << "import com.nokia.Test 1.0 as T\n" + "Test {}" + << ""; + QTest::newRow("qualified right") + << "import com.nokia.Test 1.0 as T\n" + "T.Test {}" + << "TestType"; + QTest::newRow("qualified right but not in version 0.0") + << "import com.nokia.Test 0.0 as T\n" + "T.Test {}" + << ""; + QTest::newRow("in version 1.1") + << "import com.nokia.Test 1.1\n" + "Test {}" + << "TestType"; + QTest::newRow("in version 1.3") + << "import com.nokia.Test 1.3\n" + "Test {}" + << "TestType"; + QTest::newRow("not in version 1.4") + << "import com.nokia.Test 1.4\n" + "Test {}" + << ""; + QTest::newRow("in version 1.5") + << "import com.nokia.Test 1.5\n" + "Test {}" + << "TestType"; + QTest::newRow("changed in version 1.8") + << "import com.nokia.Test 1.8\n" + "Test {}" + << "TestType2"; + QTest::newRow("not in version 1.10") + << "import com.nokia.Test 1.10\n" + "Test {}" + << ""; + QTest::newRow("back in version 1.12") + << "import com.nokia.Test 1.12\n" + "Test {}" + << "TestType2"; + QTest::newRow("old in version 1.9") + << "import com.nokia.Test 1.9\n" + "OldTest {}" + << "TestType"; + QTest::newRow("old in version 1.11") + << "import com.nokia.Test 1.11\n" + "OldTest {}" + << "TestType"; + QTest::newRow("no old in version 1.12") + << "import com.nokia.Test 1.12\n" + "OldTest {}" + << ""; + QTest::newRow("multiversion 1") + << "import com.nokia.Test 1.11\n" + "import com.nokia.Test 1.12\n" + "Test {}" + << "TestType2"; + QTest::newRow("multiversion 2") + << "import com.nokia.Test 1.11\n" + "import com.nokia.Test 1.12\n" + "OldTest {}" + << "TestType"; + QTest::newRow("qualified multiversion 3") + << "import com.nokia.Test 1.0 as T0\n" + "import com.nokia.Test 1.8 as T8\n" + "T0.Test {}" + << "TestType"; + QTest::newRow("qualified multiversion 4") + << "import com.nokia.Test 1.0 as T0\n" + "import com.nokia.Test 1.8 as T8\n" + "T8.Test {}" + << "TestType2"; + QTest::newRow("qualified multiversion 5") + << "import com.nokia.Test 1.0 as T0\n" + "import com.nokia.Test 1.10 as T10\n" + "T10.Test {}" + << ""; +} + +void tst_qmllanguage::importsBuiltin() +{ + QFETCH(QString, qml); + QFETCH(QString, type); + testType(qml,type); +} + +void tst_qmllanguage::importsLocal_data() +{ + QTest::addColumn("qml"); + QTest::addColumn("type"); + + // import locals + QTest::newRow("local import") + << "import \"subdir\"\n" + "Test {}" + << "QFxRect"; + QTest::newRow("local import as") + << "import \"subdir\" as T\n" + "T.Test {}" + << "QFxRect"; + QTest::newRow("wrong local import as") + << "import \"subdir\" as T\n" + "Test {}" + << ""; + QTest::newRow("library precedence over local import") + << "import \"subdir\"\n" + "import com.nokia.Test 1.0\n" + "Test {}" + << "TestType"; +} + +void tst_qmllanguage::importsLocal() +{ + QFETCH(QString, qml); + QFETCH(QString, type); + testType(qml,type); +} + +void tst_qmllanguage::importsInstalled_data() +{ + QTest::addColumn("qml"); + QTest::addColumn("type"); + + // import installed + QTest::newRow("installed import") + << "import com.nokia.installedtest 1.0\n" + "InstalledTest {}" + << "QFxRect"; + QTest::newRow("installed import") + << "import com.nokia.installedtest 1.4\n" + "InstalledTest {}" + << "QFxText"; +} + +void tst_qmllanguage::importsInstalled() +{ + QFETCH(QString, qml); + QFETCH(QString, type); + testType(qml,type); +} + + +void tst_qmllanguage::importsOrder_data() +{ + QTest::addColumn("qml"); + QTest::addColumn("type"); + + QTest::newRow("installed import overrides 1") << + "import com.nokia.installedtest 1.0\n" + "import com.nokia.installedtest 1.4\n" + "InstalledTest {}" + << "QFxText"; + QTest::newRow("installed import overrides 2") << + "import com.nokia.installedtest 1.4\n" + "import com.nokia.installedtest 1.0\n" + "InstalledTest {}" + << "QFxRect"; + QTest::newRow("installed import re-overrides 1") << + "import com.nokia.installedtest 1.4\n" + "import com.nokia.installedtest 1.0\n" + "import com.nokia.installedtest 1.4\n" + "InstalledTest {}" + << "QFxText"; + QTest::newRow("installed import re-overrides 2") << + "import com.nokia.installedtest 1.4\n" + "import com.nokia.installedtest 1.0\n" + "import com.nokia.installedtest 1.4\n" + "import com.nokia.installedtest 1.0\n" + "InstalledTest {}" + << "QFxRect"; + + QTest::newRow("installed import versus builtin 1") << + "import com.nokia.installedtest 1.5\n" + "import Qt 4.6\n" + "Rectangle {}" + << "QFxRect"; + QTest::newRow("installed import versus builtin 2") << + "import Qt 4.6\n" + "import com.nokia.installedtest 1.5\n" + "Rectangle {}" + << "QFxText"; + QTest::newRow("namespaces cannot be overridden by types 1") << + "import Qt 4.6 as Rectangle\n" + "import com.nokia.installedtest 1.5\n" + "Rectangle {}" + << ""; + QTest::newRow("namespaces cannot be overridden by types 2") << + "import Qt 4.6 as Rectangle\n" + "import com.nokia.installedtest 1.5\n" + "Rectangle.Image {}" + << "QFxImage"; +} + +void tst_qmllanguage::importsOrder() +{ + QFETCH(QString, qml); + QFETCH(QString, type); + testType(qml,type); +} + +void tst_qmllanguage::crash1() +{ + QmlComponent component(&engine, "Component {}"); +} + +QTEST_MAIN(tst_qmllanguage) + +#include "tst_qmllanguage.moc" diff --git a/tests/auto/declarative/qmlparser/data/Alias.qml b/tests/auto/declarative/qmlparser/data/Alias.qml deleted file mode 100644 index 8264e0d..0000000 --- a/tests/auto/declarative/qmlparser/data/Alias.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Qt 4.6 - -Object { - id: Root - property int value: 1892 - property alias aliasValue: Root.value -} - diff --git a/tests/auto/declarative/qmlparser/data/MyComponent.qml b/tests/auto/declarative/qmlparser/data/MyComponent.qml deleted file mode 100644 index 1a23277..0000000 --- a/tests/auto/declarative/qmlparser/data/MyComponent.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 - -MyQmlObject { - property real x; - property real y; -} diff --git a/tests/auto/declarative/qmlparser/data/MyContainerComponent.qml b/tests/auto/declarative/qmlparser/data/MyContainerComponent.qml deleted file mode 100644 index 61f54c5..0000000 --- a/tests/auto/declarative/qmlparser/data/MyContainerComponent.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 - -MyContainer { - property int x -} diff --git a/tests/auto/declarative/qmlparser/data/alias.1.qml b/tests/auto/declarative/qmlparser/data/alias.1.qml deleted file mode 100644 index 492d99a..0000000 --- a/tests/auto/declarative/qmlparser/data/alias.1.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 -import Qt 4.6 - -Object { - id: Root - property int value: 10 - property alias valueAlias: Root.value -} diff --git a/tests/auto/declarative/qmlparser/data/alias.2.qml b/tests/auto/declarative/qmlparser/data/alias.2.qml deleted file mode 100644 index aa4d103..0000000 --- a/tests/auto/declarative/qmlparser/data/alias.2.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 - -MyQmlObject { - id: Root - property alias aliasObject: Root.qmlobjectProperty - - qmlobjectProperty: MyQmlObject { value : 10 } -} diff --git a/tests/auto/declarative/qmlparser/data/alias.3.qml b/tests/auto/declarative/qmlparser/data/alias.3.qml deleted file mode 100644 index e25fbae..0000000 --- a/tests/auto/declarative/qmlparser/data/alias.3.qml +++ /dev/null @@ -1,10 +0,0 @@ -import Qt 4.6 - -Object { - property var other - other: Alias { id: MyAliasObject } - - property alias value: MyAliasObject.aliasValue - property alias value2: MyAliasObject.value -} - diff --git a/tests/auto/declarative/qmlparser/data/assignBasicTypes.qml b/tests/auto/declarative/qmlparser/data/assignBasicTypes.qml deleted file mode 100644 index cef9f8d..0000000 --- a/tests/auto/declarative/qmlparser/data/assignBasicTypes.qml +++ /dev/null @@ -1,26 +0,0 @@ -import Test 1.0 -MyTypeObject { - flagProperty: "FlagVal1 | FlagVal3" - enumProperty: "EnumVal2" - stringProperty: "Hello World!" - uintProperty: 10 - intProperty: -19 - realProperty: 23.2 - doubleProperty: -19.7 - colorProperty: "red" - dateProperty: "1982-11-25" - timeProperty: "11:11:31" - timeProperty: "11:11:32" - timeProperty: "11:11:32" - dateTimeProperty: "2009-05-12T13:22:01" - pointProperty: "99,13" - pointFProperty: "-10.1,12.3" - sizeProperty: "99x13" - sizeFProperty: "0.1x0.2" - rectProperty: "9,7,100x200" - rectFProperty: "1000.1,-10.9,400x90.99" - boolProperty: true - variantProperty: "Hello World!" - - objectProperty: MyTypeObject { intProperty: 8 } -} diff --git a/tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml b/tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml deleted file mode 100644 index 399fcea..0000000 --- a/tests/auto/declarative/qmlparser/data/assignLiteralSignalProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - onLiteralSignal: 10 -} diff --git a/tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml b/tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml deleted file mode 100644 index 789cc66..0000000 --- a/tests/auto/declarative/qmlparser/data/assignObjectToSignal.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - onBasicSignal: MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml b/tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml deleted file mode 100644 index 28c68c4..0000000 --- a/tests/auto/declarative/qmlparser/data/assignObjectToVariant.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - property var a; - a: MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/data/assignQmlComponent.qml b/tests/auto/declarative/qmlparser/data/assignQmlComponent.qml deleted file mode 100644 index 20bdc55..0000000 --- a/tests/auto/declarative/qmlparser/data/assignQmlComponent.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - MyComponent { x: 10; y: 11; } -} diff --git a/tests/auto/declarative/qmlparser/data/assignSignal.qml b/tests/auto/declarative/qmlparser/data/assignSignal.qml deleted file mode 100644 index 3abc04d..0000000 --- a/tests/auto/declarative/qmlparser/data/assignSignal.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - onBasicSignal: basicSlot() - onBasicParameterizedSignal: basicSlot(parameter) -} diff --git a/tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml b/tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml deleted file mode 100644 index 60ede52..0000000 --- a/tests/auto/declarative/qmlparser/data/assignTypeExtremes.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - uintProperty: 4000000000 - intProperty: -2000000000 -} diff --git a/tests/auto/declarative/qmlparser/data/attachedProperties.qml b/tests/auto/declarative/qmlparser/data/attachedProperties.qml deleted file mode 100644 index 8343754..0000000 --- a/tests/auto/declarative/qmlparser/data/attachedProperties.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - MyQmlObject.value: 10 -} diff --git a/tests/auto/declarative/qmlparser/data/autoComponentCreation.qml b/tests/auto/declarative/qmlparser/data/autoComponentCreation.qml deleted file mode 100644 index 5d00144..0000000 --- a/tests/auto/declarative/qmlparser/data/autoComponentCreation.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyTypeObject { - componentProperty : MyTypeObject { realProperty: 9 } -} diff --git a/tests/auto/declarative/qmlparser/data/cppnamespace.qml b/tests/auto/declarative/qmlparser/data/cppnamespace.qml deleted file mode 100644 index e1daf3b..0000000 --- a/tests/auto/declarative/qmlparser/data/cppnamespace.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 - -MyNamespacedType { -} diff --git a/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt b/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt deleted file mode 100644 index d28c0bd..0000000 --- a/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:19:Cannot use reserved "id" property in ListModel diff --git a/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml b/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml deleted file mode 100644 index e607768..0000000 --- a/tests/auto/declarative/qmlparser/data/customParserIdNotAllowed.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt 4.6 -ListModel { - ListElement { a: 10 } - ListElement { id: Foo; a: 12 } -} diff --git a/tests/auto/declarative/qmlparser/data/customParserTypes.qml b/tests/auto/declarative/qmlparser/data/customParserTypes.qml deleted file mode 100644 index cf2f272..0000000 --- a/tests/auto/declarative/qmlparser/data/customParserTypes.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt 4.6 -ListModel { - ListElement { a: 10 } - ListElement { a: 12 } -} diff --git a/tests/auto/declarative/qmlparser/data/customVariantTypes.qml b/tests/auto/declarative/qmlparser/data/customVariantTypes.qml deleted file mode 100644 index 0263ed2..0000000 --- a/tests/auto/declarative/qmlparser/data/customVariantTypes.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - customType: "10" -} diff --git a/tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt b/tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt deleted file mode 100644 index 66241cf..0000000 --- a/tests/auto/declarative/qmlparser/data/duplicateIDs.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:19:id is not unique diff --git a/tests/auto/declarative/qmlparser/data/duplicateIDs.qml b/tests/auto/declarative/qmlparser/data/duplicateIDs.qml deleted file mode 100644 index 9605b5b..0000000 --- a/tests/auto/declarative/qmlparser/data/duplicateIDs.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyContainer { - MyQmlObject { id: MyID } - MyQmlObject { id: MyID } -} - diff --git a/tests/auto/declarative/qmlparser/data/dynamicObject.1.qml b/tests/auto/declarative/qmlparser/data/dynamicObject.1.qml deleted file mode 100644 index 85d1052..0000000 --- a/tests/auto/declarative/qmlparser/data/dynamicObject.1.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 -import Qt 4.6 -PropertyChanges { - propa: a + 10 - propb: Math.min(a, 10) - propc: MyPropertyValueSource {} - onPropA: a -} diff --git a/tests/auto/declarative/qmlparser/data/dynamicProperties.qml b/tests/auto/declarative/qmlparser/data/dynamicProperties.qml deleted file mode 100644 index f93e446..0000000 --- a/tests/auto/declarative/qmlparser/data/dynamicProperties.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - default property int intProperty : 10 - property bool boolProperty: false - property double doubleProperty: -10.1 - property real realProperty: -19.9 - property string stringProperty: "Hello World!" - property color colorProperty: "red" - property date dateProperty: "1945-09-02" - property var varProperty: "Hello World!" - property variant variantProperty: 12 -} diff --git a/tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml deleted file mode 100644 index b0ca970..0000000 --- a/tests/auto/declarative/qmlparser/data/dynamicSignalsAndSlots.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Qt 4.6 -Object { - signal signal1 - function slot1() {} - signal signal2 - function slot2() {} -} diff --git a/tests/auto/declarative/qmlparser/data/empty.errors.txt b/tests/auto/declarative/qmlparser/data/empty.errors.txt deleted file mode 100644 index d416e76..0000000 --- a/tests/auto/declarative/qmlparser/data/empty.errors.txt +++ /dev/null @@ -1,2 +0,0 @@ -0:0:Expected token `numeric literal' -0:0:Expected a qualified name id diff --git a/tests/auto/declarative/qmlparser/data/empty.qml b/tests/auto/declarative/qmlparser/data/empty.qml deleted file mode 100644 index e69de29..0000000 diff --git a/tests/auto/declarative/qmlparser/data/failingComponent.errors.txt b/tests/auto/declarative/qmlparser/data/failingComponent.errors.txt deleted file mode 100644 index 0cf0ef3..0000000 --- a/tests/auto/declarative/qmlparser/data/failingComponent.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Type FailingComponent unavailable diff --git a/tests/auto/declarative/qmlparser/data/failingComponentTest.qml b/tests/auto/declarative/qmlparser/data/failingComponentTest.qml deleted file mode 100644 index 74a6acf..0000000 --- a/tests/auto/declarative/qmlparser/data/failingComponentTest.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - FailingComponent {} -} diff --git a/tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt b/tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt deleted file mode 100644 index e56ad3a..0000000 --- a/tests/auto/declarative/qmlparser/data/fakeDotProperty.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Invalid property access diff --git a/tests/auto/declarative/qmlparser/data/fakeDotProperty.qml b/tests/auto/declarative/qmlparser/data/fakeDotProperty.qml deleted file mode 100644 index d971eee..0000000 --- a/tests/auto/declarative/qmlparser/data/fakeDotProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - value.something: "hello" -} diff --git a/tests/auto/declarative/qmlparser/data/finalOverride.errors.txt b/tests/auto/declarative/qmlparser/data/finalOverride.errors.txt deleted file mode 100644 index 49e06cb..0000000 --- a/tests/auto/declarative/qmlparser/data/finalOverride.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot override FINAL property diff --git a/tests/auto/declarative/qmlparser/data/finalOverride.qml b/tests/auto/declarative/qmlparser/data/finalOverride.qml deleted file mode 100644 index a84393a..0000000 --- a/tests/auto/declarative/qmlparser/data/finalOverride.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - property int value: 10 -} diff --git a/tests/auto/declarative/qmlparser/data/idProperty.qml b/tests/auto/declarative/qmlparser/data/idProperty.qml deleted file mode 100644 index a413c0b..0000000 --- a/tests/auto/declarative/qmlparser/data/idProperty.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Test 1.0 -MyContainer { - property var object : MyObjectId - - MyTypeObject { - id: "MyObjectId" - } -} diff --git a/tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt b/tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt deleted file mode 100644 index 231998d..0000000 --- a/tests/auto/declarative/qmlparser/data/importNamespaceConflict.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:1:Namespace Rectangle cannot be used as a type diff --git a/tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml b/tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml deleted file mode 100644 index cd112af..0000000 --- a/tests/auto/declarative/qmlparser/data/importNamespaceConflict.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 as Rectangle -import Qt 4.6 - -Rectangle { } diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt deleted file mode 100644 index 2235cbc..0000000 --- a/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.errors.txt +++ /dev/null @@ -1 +0,0 @@ -SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml b/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml deleted file mode 100644 index 23ed566..0000000 --- a/tests/auto/declarative/qmlparser/data/importVersionMissingBuiltIn.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Test as S - -S.MyQmlObject { - property real x; - property real y; -} - diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt deleted file mode 100644 index 2235cbc..0000000 --- a/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.errors.txt +++ /dev/null @@ -1 +0,0 @@ -SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml b/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml deleted file mode 100644 index 97ec222..0000000 --- a/tests/auto/declarative/qmlparser/data/importVersionMissingInstalled.qml +++ /dev/null @@ -1,3 +0,0 @@ -import com.nokia.installedtest as T - -T.InstalledTest {} diff --git a/tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml b/tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml deleted file mode 100644 index 79ceda6..0000000 --- a/tests/auto/declarative/qmlparser/data/inlineQmlComponents.qml +++ /dev/null @@ -1,10 +0,0 @@ -import Test 1.0 -import Qt 4.6 -MyContainer { - Component { - id: MyComponent - MyQmlObject { - value: 11 - } - } -} diff --git a/tests/auto/declarative/qmlparser/data/interfaceProperty.qml b/tests/auto/declarative/qmlparser/data/interfaceProperty.qml deleted file mode 100644 index 70879ff..0000000 --- a/tests/auto/declarative/qmlparser/data/interfaceProperty.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -import Qt 4.6 -MyQmlObject { - interfaceProperty: MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/data/interfaceQList.qml b/tests/auto/declarative/qmlparser/data/interfaceQList.qml deleted file mode 100644 index c87dfae..0000000 --- a/tests/auto/declarative/qmlparser/data/interfaceQList.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Test 1.0 -MyContainer { - qlistInterfaces: [ - MyQmlObject {}, - MyQmlObject {} - ] -} diff --git a/tests/auto/declarative/qmlparser/data/interfaceQmlList.qml b/tests/auto/declarative/qmlparser/data/interfaceQmlList.qml deleted file mode 100644 index 8392bea..0000000 --- a/tests/auto/declarative/qmlparser/data/interfaceQmlList.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Test 1.0 -MyContainer { - qmllistInterfaces: [ - MyQmlObject {}, - MyQmlObject {} - ] -} diff --git a/tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt deleted file mode 100644 index 56e3eeb..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.2.errors.txt +++ /dev/null @@ -1,2 +0,0 @@ -3:5:"" is not a valid object id - diff --git a/tests/auto/declarative/qmlparser/data/invalidID.2.qml b/tests/auto/declarative/qmlparser/data/invalidID.2.qml deleted file mode 100644 index 4fb3b29..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.2.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: "" -} - diff --git a/tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt deleted file mode 100644 index bb811cf..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Invalid use of id property diff --git a/tests/auto/declarative/qmlparser/data/invalidID.3.qml b/tests/auto/declarative/qmlparser/data/invalidID.3.qml deleted file mode 100644 index 6684172..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.3.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - id.other: 10 -} - diff --git a/tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt deleted file mode 100644 index cfe8756..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.4.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:5:Invalid use of id property diff --git a/tests/auto/declarative/qmlparser/data/invalidID.4.qml b/tests/auto/declarative/qmlparser/data/invalidID.4.qml deleted file mode 100644 index 1f15fce..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.4.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: Hello - id: World -} - diff --git a/tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt deleted file mode 100644 index b0a63a0..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.5.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:9:id conflicts with namespace prefix diff --git a/tests/auto/declarative/qmlparser/data/invalidID.5.qml b/tests/auto/declarative/qmlparser/data/invalidID.5.qml deleted file mode 100644 index 0545b0d..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.5.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -import Test 1.0 as Hello -MyQmlObject { - id: Hello -} - diff --git a/tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt deleted file mode 100644 index 861e3d7..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.6.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:9:id conflicts with type name diff --git a/tests/auto/declarative/qmlparser/data/invalidID.6.qml b/tests/auto/declarative/qmlparser/data/invalidID.6.qml deleted file mode 100644 index ea34007..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.6.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: MyQmlObject -} - diff --git a/tests/auto/declarative/qmlparser/data/invalidID.errors.txt b/tests/auto/declarative/qmlparser/data/invalidID.errors.txt deleted file mode 100644 index 1ca678c..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:"1" is not a valid object id diff --git a/tests/auto/declarative/qmlparser/data/invalidID.qml b/tests/auto/declarative/qmlparser/data/invalidID.qml deleted file mode 100644 index 04db3eb..0000000 --- a/tests/auto/declarative/qmlparser/data/invalidID.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - id: 1 -} diff --git a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml deleted file mode 100644 index d8a22a8..0000000 --- a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Qt 4.6 -Rectangle {} diff --git a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml deleted file mode 100644 index a0706ad..0000000 --- a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/InstalledTest2.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Qt 4.6 -Text {} diff --git a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir deleted file mode 100644 index ba0b42a..0000000 --- a/tests/auto/declarative/qmlparser/data/lib/com/nokia/installedtest/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -InstalledTest 1.0-3 InstalledTest.qml -InstalledTest 1.4 InstalledTest2.qml -Rectangle 1.5 InstalledTest2.qml diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt b/tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt deleted file mode 100644 index d68d487..0000000 --- a/tests/auto/declarative/qmlparser/data/listAssignment.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:24:Cannot assign primitives to lists diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.1.qml b/tests/auto/declarative/qmlparser/data/listAssignment.1.qml deleted file mode 100644 index 4240425..0000000 --- a/tests/auto/declarative/qmlparser/data/listAssignment.1.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - qmllistInterfaces: 1 -} diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt b/tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt deleted file mode 100644 index 8b40aa3..0000000 --- a/tests/auto/declarative/qmlparser/data/listAssignment.2.errors.txt +++ /dev/null @@ -1,2 +0,0 @@ -3:15:Cannot assign primitives to lists - diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.2.qml b/tests/auto/declarative/qmlparser/data/listAssignment.2.qml deleted file mode 100644 index e3baadb..0000000 --- a/tests/auto/declarative/qmlparser/data/listAssignment.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyContainer { - children: 2 -} diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt b/tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt deleted file mode 100644 index 8c7b7e9..0000000 --- a/tests/auto/declarative/qmlparser/data/listAssignment.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:15:Can only assign one binding to lists diff --git a/tests/auto/declarative/qmlparser/data/listAssignment.3.qml b/tests/auto/declarative/qmlparser/data/listAssignment.3.qml deleted file mode 100644 index 00c4c6b..0000000 --- a/tests/auto/declarative/qmlparser/data/listAssignment.3.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyContainer { - children: childBinding.expression - children: childBinding2.expression -} - diff --git a/tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml b/tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml deleted file mode 100644 index fa2e831..0000000 --- a/tests/auto/declarative/qmlparser/data/listItemDeleteSelf.qml +++ /dev/null @@ -1,38 +0,0 @@ -import Qt 4.6 - -Item { - ListModel { - id: FruitModel - ListElement { - name: "Apple" - cost: 2.45 - } - ListElement { - name: "Orange" - cost: 3.25 - } - ListElement { - name: "Banana" - cost: 1.95 - } - } - - Component { - id: FruitDelegate - Item { - width: 200; height: 50 - Text { text: name } - Text { text: '$'+cost; anchors.right: parent.right } - MouseRegion { - anchors.fill: parent - onClicked: FruitModel.remove(index) - } - } - } - - ListView { - model: FruitModel - delegate: FruitDelegate - anchors.fill: parent - } -} diff --git a/tests/auto/declarative/qmlparser/data/missingObject.errors.txt b/tests/auto/declarative/qmlparser/data/missingObject.errors.txt deleted file mode 100644 index b31b562..0000000 --- a/tests/auto/declarative/qmlparser/data/missingObject.errors.txt +++ /dev/null @@ -1 +0,0 @@ -1:10:Expected token `{' diff --git a/tests/auto/declarative/qmlparser/data/missingObject.qml b/tests/auto/declarative/qmlparser/data/missingObject.qml deleted file mode 100644 index 2f17045..0000000 --- a/tests/auto/declarative/qmlparser/data/missingObject.qml +++ /dev/null @@ -1 +0,0 @@ -something: 24 diff --git a/tests/auto/declarative/qmlparser/data/missingSignal.errors.txt b/tests/auto/declarative/qmlparser/data/missingSignal.errors.txt deleted file mode 100644 index e243ae5..0000000 --- a/tests/auto/declarative/qmlparser/data/missingSignal.errors.txt +++ /dev/null @@ -1 +0,0 @@ -4:5:Cannot assign to non-existant property "onClicked" diff --git a/tests/auto/declarative/qmlparser/data/missingSignal.qml b/tests/auto/declarative/qmlparser/data/missingSignal.qml deleted file mode 100644 index fd489ca..0000000 --- a/tests/auto/declarative/qmlparser/data/missingSignal.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -import Qt 4.6 -Object { - onClicked: print("Hello world!") -} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt deleted file mode 100644 index cfc6fc8..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -2:15:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml deleted file mode 100644 index df7406c..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.1.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Test 1.0 -MyQmlObject { something: 24 } diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt deleted file mode 100644 index 8b13585..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml deleted file mode 100644 index 06ccd37..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - something: 24 -} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt deleted file mode 100644 index 8b13585..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml deleted file mode 100644 index 5b08608..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.3.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - something: 1 + 1 -} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt deleted file mode 100644 index 8b13585..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant property "something" diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml deleted file mode 100644 index 6579191..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.4.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - something: ; -} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt deleted file mode 100644 index c07f2b9..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Expected a qualified name id diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml deleted file mode 100644 index 37af057..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.5.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - 24 -} diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt b/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt deleted file mode 100644 index c02d7bd..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Cannot assign to non-existant default property diff --git a/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml b/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml deleted file mode 100644 index 5cd55d0..0000000 --- a/tests/auto/declarative/qmlparser/data/nonexistantProperty.6.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt b/tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt deleted file mode 100644 index 07a4094..0000000 --- a/tests/auto/declarative/qmlparser/data/nullDotProperty.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:-1:Cannot set properties on obj as it is null diff --git a/tests/auto/declarative/qmlparser/data/nullDotProperty.qml b/tests/auto/declarative/qmlparser/data/nullDotProperty.qml deleted file mode 100644 index 4e36779..0000000 --- a/tests/auto/declarative/qmlparser/data/nullDotProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyDotPropertyObject { - obj.value: 1 -} diff --git a/tests/auto/declarative/qmlparser/data/propertyValueSource.qml b/tests/auto/declarative/qmlparser/data/propertyValueSource.qml deleted file mode 100644 index ad71fcf..0000000 --- a/tests/auto/declarative/qmlparser/data/propertyValueSource.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyTypeObject { - intProperty : MyPropertyValueSource {} -} diff --git a/tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt b/tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt deleted file mode 100644 index b8c3404..0000000 --- a/tests/auto/declarative/qmlparser/data/readOnly.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:21:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmlparser/data/readOnly.1.qml b/tests/auto/declarative/qmlparser/data/readOnly.1.qml deleted file mode 100644 index 60757bd..0000000 --- a/tests/auto/declarative/qmlparser/data/readOnly.1.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - readOnlyString: "Hello World" -} diff --git a/tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt b/tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt deleted file mode 100644 index d857a04..0000000 --- a/tests/auto/declarative/qmlparser/data/readOnly.2.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:5:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qmlparser/data/readOnly.2.qml b/tests/auto/declarative/qmlparser/data/readOnly.2.qml deleted file mode 100644 index 8f1633c..0000000 --- a/tests/auto/declarative/qmlparser/data/readOnly.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - readOnlyString: "Hello" + "World" -} diff --git a/tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml b/tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml deleted file mode 100644 index 8d72cd3..0000000 --- a/tests/auto/declarative/qmlparser/data/rootAsQmlComponent.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Test 1.0 -MyContainerComponent { - x: 11 - MyQmlObject {} - MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/data/simpleBindings.qml b/tests/auto/declarative/qmlparser/data/simpleBindings.qml deleted file mode 100644 index 74867b3..0000000 --- a/tests/auto/declarative/qmlparser/data/simpleBindings.qml +++ /dev/null @@ -1,18 +0,0 @@ -import Test 1.0 -MyTypeObject { - id: Me - property int v1: 10 - property int v2: 11 - - property int value1 - property int value2 - property int value3 - property int value4 - - value1: v1 - value2: Me.v1 - value3: v1 + v2 - value4: Math.min(v1, v2) - - objectProperty: Me -} diff --git a/tests/auto/declarative/qmlparser/data/simpleContainer.qml b/tests/auto/declarative/qmlparser/data/simpleContainer.qml deleted file mode 100644 index c3a795f..0000000 --- a/tests/auto/declarative/qmlparser/data/simpleContainer.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyContainer { - MyQmlObject {} - MyQmlObject {} -} diff --git a/tests/auto/declarative/qmlparser/data/simpleObject.qml b/tests/auto/declarative/qmlparser/data/simpleObject.qml deleted file mode 100644 index 30c7823..0000000 --- a/tests/auto/declarative/qmlparser/data/simpleObject.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Test 1.0 -MyQmlObject {} diff --git a/tests/auto/declarative/qmlparser/data/subdir/Test.qml b/tests/auto/declarative/qmlparser/data/subdir/Test.qml deleted file mode 100644 index c4d5905..0000000 --- a/tests/auto/declarative/qmlparser/data/subdir/Test.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Qt 4.6 -Rectangle { } diff --git a/tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt b/tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt deleted file mode 100644 index bc4f7f4..0000000 --- a/tests/auto/declarative/qmlparser/data/unregisteredObject.errors.txt +++ /dev/null @@ -1 +0,0 @@ -2:1:Type UnregisteredObject unavailable diff --git a/tests/auto/declarative/qmlparser/data/unregisteredObject.qml b/tests/auto/declarative/qmlparser/data/unregisteredObject.qml deleted file mode 100644 index 9498e31..0000000 --- a/tests/auto/declarative/qmlparser/data/unregisteredObject.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Test 1.0 -UnregisteredObject {} diff --git a/tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt b/tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt deleted file mode 100644 index 3a90a7d..0000000 --- a/tests/auto/declarative/qmlparser/data/unsupportedProperty.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:13:Invalid property assignment: unknown type QVariant::QMatrix diff --git a/tests/auto/declarative/qmlparser/data/unsupportedProperty.qml b/tests/auto/declarative/qmlparser/data/unsupportedProperty.qml deleted file mode 100644 index 9f19680..0000000 --- a/tests/auto/declarative/qmlparser/data/unsupportedProperty.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - matrix: "1,0,0,0,1,0,0,0,1" -} diff --git a/tests/auto/declarative/qmlparser/data/valueTypes.qml b/tests/auto/declarative/qmlparser/data/valueTypes.qml deleted file mode 100644 index bf325a7..0000000 --- a/tests/auto/declarative/qmlparser/data/valueTypes.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Test 1.0 -MyTypeObject { - rectProperty.x: 10 - rectProperty.y: 11 - rectProperty.width: rectProperty.x + 2 - rectProperty.height: 13 - - intProperty: rectProperty.x - - onAction: { var a = rectProperty; a.x = 12; } - - rectProperty2: rectProperty -} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt deleted file mode 100644 index ba7a076..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.1.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.1.qml b/tests/auto/declarative/qmlparser/data/wrongType.1.qml deleted file mode 100644 index 289d37f..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.1.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - value: "hello" -} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt deleted file mode 100644 index ae75b52..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.10.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:23:Invalid property assignment: datetime expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.10.qml b/tests/auto/declarative/qmlparser/data/wrongType.10.qml deleted file mode 100644 index 2cf0e50..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.10.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - dateTimeProperty: 12 -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt deleted file mode 100644 index 23a4cda..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.11.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:20:Invalid property assignment: point expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.11.qml b/tests/auto/declarative/qmlparser/data/wrongType.11.qml deleted file mode 100644 index ae77ba1..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.11.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - pointProperty: "apples" -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt deleted file mode 100644 index 3092100..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.12.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: size expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.12.qml b/tests/auto/declarative/qmlparser/data/wrongType.12.qml deleted file mode 100644 index b7a366f..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.12.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - sizeProperty: "red" -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt deleted file mode 100644 index ba7a076..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.13.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:12:Invalid property assignment: int expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.13.qml b/tests/auto/declarative/qmlparser/data/wrongType.13.qml deleted file mode 100644 index 477aff1..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.13.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - value: "12" -} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt deleted file mode 100644 index d621fdd..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.14.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:21:Invalid property assignment: string expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.14.qml b/tests/auto/declarative/qmlparser/data/wrongType.14.qml deleted file mode 100644 index 672d693..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.14.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - stringProperty: 10 -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt deleted file mode 100644 index 9ff9f25..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.2.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:14:Invalid property assignment: boolean expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.2.qml b/tests/auto/declarative/qmlparser/data/wrongType.2.qml deleted file mode 100644 index 34b74f7..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - enabled: 5 -} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt deleted file mode 100644 index 6d971c6..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.3.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:11:Invalid property assignment: rect expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.3.qml b/tests/auto/declarative/qmlparser/data/wrongType.3.qml deleted file mode 100644 index 384181a..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.3.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyQmlObject { - rect: "5,5x10" -} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt deleted file mode 100644 index ef34d0e..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.4.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: unknown enumeration diff --git a/tests/auto/declarative/qmlparser/data/wrongType.4.qml b/tests/auto/declarative/qmlparser/data/wrongType.4.qml deleted file mode 100644 index 0787bf5..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.4.qml +++ /dev/null @@ -1,4 +0,0 @@ -import Test 1.0 -MyTypeObject { - enumProperty: "InvalidEnumName" -} diff --git a/tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt deleted file mode 100644 index cab10bd..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.5.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: unsigned int expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.5.qml b/tests/auto/declarative/qmlparser/data/wrongType.5.qml deleted file mode 100644 index c50ae9a..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.5.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - uintProperty: -13 -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt deleted file mode 100644 index d0a0b00..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.6.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: double expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.6.qml b/tests/auto/declarative/qmlparser/data/wrongType.6.qml deleted file mode 100644 index da10b78..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.6.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - realProperty: "Hello" -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt deleted file mode 100644 index 614346b..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.7.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:20:Invalid property assignment: color expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.7.qml b/tests/auto/declarative/qmlparser/data/wrongType.7.qml deleted file mode 100644 index ddc3835..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.7.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - colorProperty: 12 -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt deleted file mode 100644 index 1773c00..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.8.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: date expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.8.qml b/tests/auto/declarative/qmlparser/data/wrongType.8.qml deleted file mode 100644 index a5f6756..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.8.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - dateProperty: 12 -} - diff --git a/tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt b/tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt deleted file mode 100644 index 8630975..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.9.errors.txt +++ /dev/null @@ -1 +0,0 @@ -3:19:Invalid property assignment: time expected diff --git a/tests/auto/declarative/qmlparser/data/wrongType.9.qml b/tests/auto/declarative/qmlparser/data/wrongType.9.qml deleted file mode 100644 index a3db732..0000000 --- a/tests/auto/declarative/qmlparser/data/wrongType.9.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Test 1.0 -MyTypeObject { - timeProperty: 12 -} - diff --git a/tests/auto/declarative/qmlparser/qmlparser.pro b/tests/auto/declarative/qmlparser/qmlparser.pro deleted file mode 100644 index dda5c61..0000000 --- a/tests/auto/declarative/qmlparser/qmlparser.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_qmlparser.cpp \ - testtypes.cpp -HEADERS = testtypes.h -macx:CONFIG -= app_bundle - -# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -# LIBS += -lgcov diff --git a/tests/auto/declarative/qmlparser/testtypes.cpp b/tests/auto/declarative/qmlparser/testtypes.cpp deleted file mode 100644 index c11e195..0000000 --- a/tests/auto/declarative/qmlparser/testtypes.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "testtypes.h" - -QML_DEFINE_INTERFACE(MyInterface); -QML_DEFINE_TYPE(Test,1,0,0,MyQmlObject,MyQmlObject); -QML_DEFINE_TYPE(Test,1,0,0,MyTypeObject,MyTypeObject); -QML_DEFINE_TYPE(Test,1,0,0,MyContainer,MyContainer); -QML_DEFINE_TYPE(Test,1,0,0,MyPropertyValueSource,MyPropertyValueSource); -QML_DEFINE_TYPE(Test,1,0,0,MyDotPropertyObject,MyDotPropertyObject); -QML_DEFINE_TYPE(Test,1,0,0,MyNamespacedType,MyNamespace::MyNamespacedType); - diff --git a/tests/auto/declarative/qmlparser/testtypes.h b/tests/auto/declarative/qmlparser/testtypes.h deleted file mode 100644 index f6f966f..0000000 --- a/tests/auto/declarative/qmlparser/testtypes.h +++ /dev/null @@ -1,433 +0,0 @@ -#ifndef TESTTYPES_H -#define TESTTYPES_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class MyInterface -{ -public: - MyInterface() : id(913) {} - int id; -}; -Q_DECLARE_INTERFACE(MyInterface, "com.trolltech.Qt.Test.MyInterface"); -QML_DECLARE_INTERFACE(MyInterface); - -struct MyCustomVariantType -{ - MyCustomVariantType() : a(0) {} - int a; -}; -Q_DECLARE_METATYPE(MyCustomVariantType); - -static QVariant myCustomVariantTypeConverter(const QString &data) -{ - MyCustomVariantType rv; - rv.a = data.toInt(); - return QVariant::fromValue(rv); -} - -class MyAttachedObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int value READ value WRITE setValue) -public: - MyAttachedObject(QObject *parent) : QObject(parent), m_value(0) {} - - int value() const { return m_value; } - void setValue(int v) { m_value = v; } - -private: - int m_value; -}; - -class MyQmlObject : public QObject, public MyInterface, public QmlParserStatus -{ - Q_OBJECT - Q_PROPERTY(int value READ value WRITE setValue FINAL) - Q_PROPERTY(QString readOnlyString READ readOnlyString) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled) - Q_PROPERTY(QRect rect READ rect WRITE setRect) - Q_PROPERTY(QMatrix matrix READ matrix WRITE setMatrix) //assumed to be unsupported by QML - Q_PROPERTY(MyInterface *interfaceProperty READ interface WRITE setInterface) - Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal); - Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType); - Q_PROPERTY(MyQmlObject *qmlobjectProperty READ qmlobject WRITE setQmlobject) - - Q_INTERFACES(MyInterface QmlParserStatus) -public: - MyQmlObject() : m_value(-1), m_interface(0), m_qmlobject(0) { qRegisterMetaType("MyCustomVariantType"); } - - int value() const { return m_value; } - void setValue(int v) { m_value = v; } - - QString readOnlyString() const { return QLatin1String(""); } - - bool enabled() const { return false; } - void setEnabled(bool) {} - - QRect rect() const { return QRect(); } - void setRect(const QRect&) {} - - QMatrix matrix() const { return QMatrix(); } - void setMatrix(const QMatrix&) {} - - MyInterface *interface() const { return m_interface; } - void setInterface(MyInterface *iface) { m_interface = iface; } - - static MyAttachedObject *qmlAttachedProperties(QObject *other) { - return new MyAttachedObject(other); - } - Q_CLASSINFO("DefaultMethod", "basicSlot()"); - - int onLiteralSignal() const { return m_value; } - void setOnLiteralSignal(int v) { m_value = v; } - - MyQmlObject *qmlobject() const { return m_qmlobject; } - void setQmlobject(MyQmlObject *o) { m_qmlobject = o; } - - MyCustomVariantType customType() const { return m_custom; } - void setCustomType(const MyCustomVariantType &v) { m_custom = v; } -public slots: - void basicSlot() { qWarning("MyQmlObject::basicSlot"); } - void basicSlot(int v) { qWarning("MyQmlObject::basicSlot(%d)", v); } - -signals: - void basicSignal(); - void basicParameterizedSignal(int parameter); - -private: - friend class tst_qmlparser; - int m_value; - MyInterface *m_interface; - MyQmlObject *m_qmlobject; - MyCustomVariantType m_custom; -}; -QML_DECLARE_TYPE(MyQmlObject); - -class MyTypeObject : public QObject -{ - Q_OBJECT - Q_ENUMS(MyEnum) - Q_FLAGS(MyFlags) - - Q_PROPERTY(QString id READ id WRITE setId); - Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty); - Q_PROPERTY(QmlComponent *componentProperty READ componentProperty WRITE setComponentProperty); - Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty); - Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty); - Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty); - Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty); - Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty); - Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty); - Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty); - Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty); - Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty); - Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty); - Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty); - Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); - Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); - Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); - Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); - Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); - Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2); - Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); - Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty); - Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty); - -public: - MyTypeObject() - : objectPropertyValue(0), componentPropertyValue(0) {} - - QString idValue; - QString id() const { - return idValue; - } - void setId(const QString &v) { - idValue = v; - } - - QObject *objectPropertyValue; - QObject *objectProperty() const { - return objectPropertyValue; - } - void setObjectProperty(QObject *v) { - objectPropertyValue = v; - } - - QmlComponent *componentPropertyValue; - QmlComponent *componentProperty() const { - return componentPropertyValue; - } - void setComponentProperty(QmlComponent *v) { - componentPropertyValue = v; - } - - enum MyFlag { FlagVal1 = 0x01, FlagVal2 = 0x02, FlagVal3 = 0x04 }; - Q_DECLARE_FLAGS(MyFlags, MyFlag) - MyFlags flagPropertyValue; - MyFlags flagProperty() const { - return flagPropertyValue; - } - void setFlagProperty(MyFlags v) { - flagPropertyValue = v; - } - - enum MyEnum { EnumVal1, EnumVal2 }; - MyEnum enumPropertyValue; - MyEnum enumProperty() const { - return enumPropertyValue; - } - void setEnumProperty(MyEnum v) { - enumPropertyValue = v; - } - - QString stringPropertyValue; - QString stringProperty() const { - return stringPropertyValue; - } - void setStringProperty(const QString &v) { - stringPropertyValue = v; - } - - uint uintPropertyValue; - uint uintProperty() const { - return uintPropertyValue; - } - void setUintProperty(const uint &v) { - uintPropertyValue = v; - } - - int intPropertyValue; - int intProperty() const { - return intPropertyValue; - } - void setIntProperty(const int &v) { - intPropertyValue = v; - } - - qreal realPropertyValue; - qreal realProperty() const { - return realPropertyValue; - } - void setRealProperty(const qreal &v) { - realPropertyValue = v; - } - - double doublePropertyValue; - double doubleProperty() const { - return doublePropertyValue; - } - void setDoubleProperty(const double &v) { - doublePropertyValue = v; - } - - QColor colorPropertyValue; - QColor colorProperty() const { - return colorPropertyValue; - } - void setColorProperty(const QColor &v) { - colorPropertyValue = v; - } - - QDate datePropertyValue; - QDate dateProperty() const { - return datePropertyValue; - } - void setDateProperty(const QDate &v) { - datePropertyValue = v; - } - - QTime timePropertyValue; - QTime timeProperty() const { - return timePropertyValue; - } - void setTimeProperty(const QTime &v) { - timePropertyValue = v; - } - - QDateTime dateTimePropertyValue; - QDateTime dateTimeProperty() const { - return dateTimePropertyValue; - } - void setDateTimeProperty(const QDateTime &v) { - dateTimePropertyValue = v; - } - - QPoint pointPropertyValue; - QPoint pointProperty() const { - return pointPropertyValue; - } - void setPointProperty(const QPoint &v) { - pointPropertyValue = v; - } - - QPointF pointFPropertyValue; - QPointF pointFProperty() const { - return pointFPropertyValue; - } - void setPointFProperty(const QPointF &v) { - pointFPropertyValue = v; - } - - QSize sizePropertyValue; - QSize sizeProperty() const { - return sizePropertyValue; - } - void setSizeProperty(const QSize &v) { - sizePropertyValue = v; - } - - QSizeF sizeFPropertyValue; - QSizeF sizeFProperty() const { - return sizeFPropertyValue; - } - void setSizeFProperty(const QSizeF &v) { - sizeFPropertyValue = v; - } - - QRect rectPropertyValue; - QRect rectProperty() const { - return rectPropertyValue; - } - void setRectProperty(const QRect &v) { - rectPropertyValue = v; - emit rectPropertyChanged(); - } - - QRect rectPropertyValue2; - QRect rectProperty2() const { - return rectPropertyValue2; - } - void setRectProperty2(const QRect &v) { - rectPropertyValue2 = v; - } - - QRectF rectFPropertyValue; - QRectF rectFProperty() const { - return rectFPropertyValue; - } - void setRectFProperty(const QRectF &v) { - rectFPropertyValue = v; - } - - bool boolPropertyValue; - bool boolProperty() const { - return boolPropertyValue; - } - void setBoolProperty(const bool &v) { - boolPropertyValue = v; - } - - QVariant variantPropertyValue; - QVariant variantProperty() const { - return variantPropertyValue; - } - void setVariantProperty(const QVariant &v) { - variantPropertyValue = v; - } - - void doAction() { emit action(); } -signals: - void action(); - void rectPropertyChanged(); -}; -Q_DECLARE_OPERATORS_FOR_FLAGS(MyTypeObject::MyFlags) -QML_DECLARE_TYPE(MyTypeObject); - -class MyContainer : public QObject -{ - Q_OBJECT - Q_PROPERTY(QList* children READ children) - Q_PROPERTY(QList* qlistInterfaces READ qlistInterfaces) - Q_PROPERTY(QmlList* qmllistInterfaces READ qmllistInterfaces) - Q_CLASSINFO("DefaultProperty", "children"); -public: - MyContainer() {} - - QList *children() { return &m_children; } - QList *qlistInterfaces() { return &m_interfaces; } - QmlList *qmllistInterfaces() { return &m_qmlinterfaces; } - const QmlConcreteList &qmllistAccessor() const { return m_qmlinterfaces; } - -private: - QList m_children; - QList m_interfaces; - QmlConcreteList m_qmlinterfaces; -}; - -QML_DECLARE_TYPE(MyContainer); - -class MyPropertyValueSource : public QObject, public QmlPropertyValueSource -{ - Q_OBJECT - Q_INTERFACES(QmlPropertyValueSource) -public: - MyPropertyValueSource() - : QmlPropertyValueSource() {} - - QmlMetaProperty prop; - virtual void setTarget(const QmlMetaProperty &p) - { - prop = p; - } -}; -QML_DECLARE_TYPE(MyPropertyValueSource); - -class MyDotPropertyObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(MyQmlObject *obj READ obj) - Q_PROPERTY(MyQmlObject *readWriteObj READ readWriteObj WRITE setReadWriteObj) -public: - MyDotPropertyObject() : m_rwobj(0), m_ownRWObj(false) {} - ~MyDotPropertyObject() - { - if (m_ownRWObj) - delete m_rwobj; - } - - MyQmlObject *obj() { return 0; } - - MyQmlObject *readWriteObj() - { - if (!m_rwobj) { - m_rwobj = new MyQmlObject; - m_ownRWObj = true; - } - return m_rwobj; - } - - void setReadWriteObj(MyQmlObject *obj) - { - if (m_ownRWObj) { - delete m_rwobj; - m_ownRWObj = false; - } - - m_rwobj = obj; - } - -private: - MyQmlObject *m_rwobj; - bool m_ownRWObj; -}; - -QML_DECLARE_TYPE(MyDotPropertyObject); - -namespace MyNamespace { - class MyNamespacedType : public QObject - { - Q_OBJECT - }; -} -QML_DECLARE_TYPE(MyNamespace::MyNamespacedType); - -#endif // TESTTYPES_H diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp deleted file mode 100644 index 7f51639..0000000 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ /dev/null @@ -1,857 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include "testtypes.h" - -class tst_qmlparser : public QObject -{ - Q_OBJECT -public: - tst_qmlparser() { - QmlMetaType::registerCustomStringConverter(qMetaTypeId(), myCustomVariantTypeConverter); - QFileInfo fileInfo(__FILE__); - engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("data/lib"))); - } - -private slots: - - void errors_data(); - void errors(); - - void simpleObject(); - void simpleContainer(); - void interfaceProperty(); - void interfaceQmlList(); - void interfaceQList(); - void assignObjectToSignal(); - void assignObjectToVariant(); - void assignLiteralSignalProperty(); - void assignQmlComponent(); - void assignBasicTypes(); - void assignTypeExtremes(); - void customParserTypes(); - void rootAsQmlComponent(); - void inlineQmlComponents(); - void idProperty(); - void assignSignal(); - void dynamicProperties(); - void dynamicSignalsAndSlots(); - void simpleBindings(); - void autoComponentCreation(); - void propertyValueSource(); - void attachedProperties(); - void dynamicObjects(); - void customVariantTypes(); - void valueTypes(); - void cppnamespace(); - void aliasProperties(); - - void importsBuiltin_data(); - void importsBuiltin(); - void importsLocal_data(); - void importsLocal(); - void importsInstalled_data(); - void importsInstalled(); - void importsOrder_data(); - void importsOrder(); - - // regression tests for crashes - void crash1(); - -private: - QmlEngine engine; - void testType(const QString& qml, const QString& type); -}; - -#define VERIFY_ERRORS(errorfile) \ - if (!errorfile) { \ - if (qgetenv("DEBUG") != "" && !component.errors().isEmpty()) \ - qWarning() << "Unexpected Errors:" << component.errors(); \ - QVERIFY(!component.isError()); \ - QVERIFY(component.errors().isEmpty()); \ - } else { \ - QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \ - QVERIFY(file.open(QIODevice::ReadOnly)); \ - QByteArray data = file.readAll(); \ - QList expected = data.split('\n'); \ - expected.removeAll(QByteArray("")); \ - QList errors = component.errors(); \ - QList actual; \ - for (int ii = 0; ii < errors.count(); ++ii) { \ - const QmlError &error = errors.at(ii); \ - QByteArray errorStr = QByteArray::number(error.line()) + ":" + \ - QByteArray::number(error.column()) + ":" + \ - error.description().toUtf8(); \ - actual << errorStr; \ - } \ - if (qgetenv("DEBUG") != "" && expected != actual) \ - qWarning() << "Expected:" << expected << "Actual:" << actual; \ - QCOMPARE(expected, actual); \ - } - -inline QUrl TEST_FILE(const QString &filename) -{ - QFileInfo fileInfo(__FILE__); - return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(QLatin1String("data/") + filename)); -} - -inline QUrl TEST_FILE(const char *filename) -{ - return TEST_FILE(QLatin1String(filename)); -} - -void tst_qmlparser::errors_data() -{ - QTest::addColumn("file"); - QTest::addColumn("errorFile"); - QTest::addColumn("create"); - - QTest::newRow("nonexistantProperty.1") << "nonexistantProperty.1.qml" << "nonexistantProperty.1.errors.txt" << false; - QTest::newRow("nonexistantProperty.2") << "nonexistantProperty.2.qml" << "nonexistantProperty.2.errors.txt" << false; - QTest::newRow("nonexistantProperty.3") << "nonexistantProperty.3.qml" << "nonexistantProperty.3.errors.txt" << false; - QTest::newRow("nonexistantProperty.4") << "nonexistantProperty.4.qml" << "nonexistantProperty.4.errors.txt" << false; - QTest::newRow("nonexistantProperty.5") << "nonexistantProperty.5.qml" << "nonexistantProperty.5.errors.txt" << false; - QTest::newRow("nonexistantProperty.6") << "nonexistantProperty.6.qml" << "nonexistantProperty.6.errors.txt" << false; - - QTest::newRow("wrongType (string for int)") << "wrongType.1.qml" << "wrongType.1.errors.txt" << false; - QTest::newRow("wrongType (int for bool)") << "wrongType.2.qml" << "wrongType.2.errors.txt" << false; - QTest::newRow("wrongType (bad rect)") << "wrongType.3.qml" << "wrongType.3.errors.txt" << false; - - QTest::newRow("wrongType (invalid enum)") << "wrongType.4.qml" << "wrongType.4.errors.txt" << false; - QTest::newRow("wrongType (int for uint)") << "wrongType.5.qml" << "wrongType.5.errors.txt" << false; - QTest::newRow("wrongType (string for real)") << "wrongType.6.qml" << "wrongType.6.errors.txt" << false; - QTest::newRow("wrongType (int for color)") << "wrongType.7.qml" << "wrongType.7.errors.txt" << false; - QTest::newRow("wrongType (int for date)") << "wrongType.8.qml" << "wrongType.8.errors.txt" << false; - QTest::newRow("wrongType (int for time)") << "wrongType.9.qml" << "wrongType.9.errors.txt" << false; - QTest::newRow("wrongType (int for datetime)") << "wrongType.10.qml" << "wrongType.10.errors.txt" << false; - QTest::newRow("wrongType (string for point)") << "wrongType.11.qml" << "wrongType.11.errors.txt" << false; - QTest::newRow("wrongType (color for size)") << "wrongType.12.qml" << "wrongType.12.errors.txt" << false; - QTest::newRow("wrongType (number string for int)") << "wrongType.13.qml" << "wrongType.13.errors.txt" << false; - QTest::newRow("wrongType (int for string)") << "wrongType.14.qml" << "wrongType.14.errors.txt" << false; - - QTest::newRow("readOnly.1") << "readOnly.1.qml" << "readOnly.1.errors.txt" << false; - QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false; - - QTest::newRow("listAssignment.1") << "listAssignment.1.qml" << "listAssignment.1.errors.txt" << false; - QTest::newRow("listAssignment.2") << "listAssignment.2.qml" << "listAssignment.2.errors.txt" << false; - QTest::newRow("listAssignment.3") << "listAssignment.3.qml" << "listAssignment.3.errors.txt" << false; - - QTest::newRow("invalidID.1") << "invalidID.qml" << "invalidID.errors.txt" << false; - QTest::newRow("invalidID.2") << "invalidID.2.qml" << "invalidID.2.errors.txt" << false; - QTest::newRow("invalidID.3") << "invalidID.3.qml" << "invalidID.3.errors.txt" << false; - QTest::newRow("invalidID.4") << "invalidID.4.qml" << "invalidID.4.errors.txt" << false; - QTest::newRow("invalidID.5") << "invalidID.5.qml" << "invalidID.5.errors.txt" << false; - QTest::newRow("invalidID.6") << "invalidID.6.qml" << "invalidID.6.errors.txt" << false; - - - QTest::newRow("unsupportedProperty") << "unsupportedProperty.qml" << "unsupportedProperty.errors.txt" << false; - QTest::newRow("nullDotProperty") << "nullDotProperty.qml" << "nullDotProperty.errors.txt" << true; - QTest::newRow("fakeDotProperty") << "fakeDotProperty.qml" << "fakeDotProperty.errors.txt" << false; - QTest::newRow("duplicateIDs") << "duplicateIDs.qml" << "duplicateIDs.errors.txt" << false; - QTest::newRow("unregisteredObject") << "unregisteredObject.qml" << "unregisteredObject.errors.txt" << false; - QTest::newRow("empty") << "empty.qml" << "empty.errors.txt" << false; - QTest::newRow("missingObject") << "missingObject.qml" << "missingObject.errors.txt" << false; - QTest::newRow("failingComponent") << "failingComponentTest.qml" << "failingComponent.errors.txt" << false; - QTest::newRow("missingSignal") << "missingSignal.qml" << "missingSignal.errors.txt" << false; - QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false; - - QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false; - QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false; - QTest::newRow("importVersionMissing (installed)") << "importVersionMissingInstalled.qml" << "importVersionMissingInstalled.errors.txt" << false; - - QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false; -} - -void tst_qmlparser::errors() -{ - QFETCH(QString, file); - QFETCH(QString, errorFile); - QFETCH(bool, create); - - QmlComponent component(&engine, TEST_FILE(file)); - - if(create) { - QObject *object = component.create(); - QVERIFY(object == 0); - } - - VERIFY_ERRORS(errorFile.toLatin1().constData()); -} - -void tst_qmlparser::simpleObject() -{ - QmlComponent component(&engine, TEST_FILE("simpleObject.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); -} - -void tst_qmlparser::simpleContainer() -{ - QmlComponent component(&engine, TEST_FILE("simpleContainer.qml")); - VERIFY_ERRORS(0); - MyContainer *container= qobject_cast(component.create()); - QVERIFY(container != 0); - QCOMPARE(container->children()->count(),2); -} - -void tst_qmlparser::interfaceProperty() -{ - QmlComponent component(&engine, TEST_FILE("interfaceProperty.qml")); - VERIFY_ERRORS(0); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QVERIFY(object->interface()); - QVERIFY(object->interface()->id == 913); -} - -void tst_qmlparser::interfaceQmlList() -{ - QmlComponent component(&engine, TEST_FILE("interfaceQmlList.qml")); - VERIFY_ERRORS(0); - MyContainer *container= qobject_cast(component.create()); - QVERIFY(container != 0); - QVERIFY(container->qmllistAccessor().count() == 2); - for(int ii = 0; ii < 2; ++ii) - QVERIFY(container->qmllistAccessor().at(ii)->id == 913); -} - -void tst_qmlparser::interfaceQList() -{ - QmlComponent component(&engine, TEST_FILE("interfaceQList.qml")); - VERIFY_ERRORS(0); - MyContainer *container= qobject_cast(component.create()); - QVERIFY(container != 0); - QVERIFY(container->qlistInterfaces()->count() == 2); - for(int ii = 0; ii < 2; ++ii) - QVERIFY(container->qlistInterfaces()->at(ii)->id == 913); -} - -void tst_qmlparser::assignObjectToSignal() -{ - QmlComponent component(&engine, TEST_FILE("assignObjectToSignal.qml")); - VERIFY_ERRORS(0); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot"); - emit object->basicSignal(); -} - -void tst_qmlparser::assignObjectToVariant() -{ - QmlComponent component(&engine, TEST_FILE("assignObjectToVariant.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - QVariant v = object->property("a"); - QVERIFY(v.userType() == qMetaTypeId()); -} - -void tst_qmlparser::assignLiteralSignalProperty() -{ - QmlComponent component(&engine, TEST_FILE("assignLiteralSignalProperty.qml")); - VERIFY_ERRORS(0); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->onLiteralSignal(), 10); -} - -// Test is an external component can be loaded and assigned (to a qlist) -void tst_qmlparser::assignQmlComponent() -{ - QmlComponent component(&engine, TEST_FILE("assignQmlComponent.qml")); - VERIFY_ERRORS(0); - MyContainer *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QVERIFY(object->children()->count() == 1); - QObject *child = object->children()->at(0); - QCOMPARE(child->property("x"), QVariant(10)); - QCOMPARE(child->property("y"), QVariant(11)); -} - -// Test literal assignment to all the basic types -void tst_qmlparser::assignBasicTypes() -{ - QmlComponent component(&engine, TEST_FILE("assignBasicTypes.qml")); - VERIFY_ERRORS(0); - MyTypeObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3); - QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2); - QCOMPARE(object->stringProperty(), QString("Hello World!")); - QCOMPARE(object->uintProperty(), uint(10)); - QCOMPARE(object->intProperty(), -19); - QCOMPARE((float)object->realProperty(), float(23.2)); - QCOMPARE((float)object->doubleProperty(), float(-19.7)); - QCOMPARE(object->colorProperty(), QColor("red")); - QCOMPARE(object->dateProperty(), QDate(1982, 11, 25)); - QCOMPARE(object->timeProperty(), QTime(11, 11, 32)); - QCOMPARE(object->dateTimeProperty(), QDateTime(QDate(2009, 5, 12), QTime(13, 22, 1))); - QCOMPARE(object->pointProperty(), QPoint(99,13)); - QCOMPARE(object->pointFProperty(), QPointF((float)-10.1, (float)12.3)); - QCOMPARE(object->sizeProperty(), QSize(99, 13)); - QCOMPARE(object->sizeFProperty(), QSizeF((float)0.1, (float)0.2)); - QCOMPARE(object->rectProperty(), QRect(9, 7, 100, 200)); - QCOMPARE(object->rectFProperty(), QRectF((float)1000.1, (float)-10.9, (float)400, (float)90.99)); - QCOMPARE(object->boolProperty(), true); - QCOMPARE(object->variantProperty(), QVariant("Hello World!")); - QVERIFY(object->objectProperty() != 0); - MyTypeObject *child = qobject_cast(object->objectProperty()); - QVERIFY(child != 0); - QCOMPARE(child->intProperty(), 8); -} - -// Test edge case type assignments -void tst_qmlparser::assignTypeExtremes() -{ - QmlComponent component(&engine, TEST_FILE("assignTypeExtremes.qml")); - VERIFY_ERRORS(0); - MyTypeObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->uintProperty(), 0xEE6B2800); - QCOMPARE(object->intProperty(), -0x77359400); -} - -// Tests that custom parser types can be instantiated -void tst_qmlparser::customParserTypes() -{ - QmlComponent component(&engine, TEST_FILE("customParserTypes.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - QVERIFY(object->property("count") == QVariant(2)); -} - -// Tests that the root item can be a custom component -void tst_qmlparser::rootAsQmlComponent() -{ - QmlComponent component(&engine, TEST_FILE("rootAsQmlComponent.qml")); - VERIFY_ERRORS(0); - MyContainer *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->property("x"), QVariant(11)); - QCOMPARE(object->children()->count(), 2); -} - -// Tests that components can be specified inline -void tst_qmlparser::inlineQmlComponents() -{ - QmlComponent component(&engine, TEST_FILE("inlineQmlComponents.qml")); - VERIFY_ERRORS(0); - MyContainer *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->children()->count(), 1); - QmlComponent *comp = qobject_cast(object->children()->at(0)); - QVERIFY(comp != 0); - MyQmlObject *compObject = qobject_cast(comp->create()); - QVERIFY(compObject != 0); - QCOMPARE(compObject->value(), 11); -} - -// Tests that types that have an id property have it set -void tst_qmlparser::idProperty() -{ - QmlComponent component(&engine, TEST_FILE("idProperty.qml")); - VERIFY_ERRORS(0); - MyContainer *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->children()->count(), 1); - MyTypeObject *child = - qobject_cast(object->children()->at(0)); - QVERIFY(child != 0); - QCOMPARE(child->id(), QString("MyObjectId")); - QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child)); -} - -// Tests that signals can be assigned to -void tst_qmlparser::assignSignal() -{ - QmlComponent component(&engine, TEST_FILE("assignSignal.qml")); - VERIFY_ERRORS(0); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot"); - emit object->basicSignal(); - QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot(9)"); - emit object->basicParameterizedSignal(9); -} - -// Tests the creation and assignment of dynamic properties -void tst_qmlparser::dynamicProperties() -{ - QmlComponent component(&engine, TEST_FILE("dynamicProperties.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - QCOMPARE(object->property("intProperty"), QVariant(10)); - QCOMPARE(object->property("boolProperty"), QVariant(false)); - QCOMPARE(object->property("doubleProperty"), QVariant(-10.1)); - QCOMPARE(object->property("realProperty"), QVariant((qreal)-19.9)); - QCOMPARE(object->property("stringProperty"), QVariant("Hello World!")); - QCOMPARE(object->property("colorProperty"), QVariant(QColor("red"))); - QCOMPARE(object->property("dateProperty"), QVariant(QDate(1945, 9, 2))); - QCOMPARE(object->property("varProperty"), QVariant("Hello World!")); - QCOMPARE(object->property("variantProperty"), QVariant(12)); -} - -// Tests the declaration of dynamic signals and slots -void tst_qmlparser::dynamicSignalsAndSlots() -{ - QmlComponent component(&engine, TEST_FILE("dynamicSignalsAndSlots.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - QVERIFY(object->metaObject()->indexOfMethod("signal1()") != -1); - QVERIFY(object->metaObject()->indexOfMethod("signal2()") != -1); - QVERIFY(object->metaObject()->indexOfMethod("slot1()") != -1); - QVERIFY(object->metaObject()->indexOfMethod("slot2()") != -1); -} - -void tst_qmlparser::simpleBindings() -{ - QmlComponent component(&engine, TEST_FILE("simpleBindings.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - QCOMPARE(object->property("value1"), QVariant(10)); - QCOMPARE(object->property("value2"), QVariant(10)); - QCOMPARE(object->property("value3"), QVariant(21)); - QCOMPARE(object->property("value4"), QVariant(10)); - QCOMPARE(object->property("objectProperty"), QVariant::fromValue(object)); -} - -void tst_qmlparser::autoComponentCreation() -{ - QmlComponent component(&engine, TEST_FILE("autoComponentCreation.qml")); - VERIFY_ERRORS(0); - MyTypeObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QVERIFY(object->componentProperty() != 0); - MyTypeObject *child = qobject_cast(object->componentProperty()->create()); - QVERIFY(child != 0); - QCOMPARE(child->realProperty(), qreal(9)); -} - -void tst_qmlparser::propertyValueSource() -{ - QmlComponent component(&engine, TEST_FILE("propertyValueSource.qml")); - VERIFY_ERRORS(0); - MyTypeObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - - QList valueSources; - QObjectList allChildren = object->findChildren(); - foreach (QObject *child, allChildren) { - QmlType *type = QmlMetaType::qmlType(child->metaObject()); - if (type && type->propertyValueSourceCast() != -1) - valueSources.append(child); - } - - QCOMPARE(valueSources.count(), 1); - MyPropertyValueSource *valueSource = - qobject_cast(valueSources.at(0)); - QVERIFY(valueSource != 0); - QCOMPARE(valueSource->prop.object(), object); - QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty"))); -} - -void tst_qmlparser::attachedProperties() -{ - QmlComponent component(&engine, TEST_FILE("attachedProperties.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - QObject *attached = qmlAttachedPropertiesObject(object); - QVERIFY(attached != 0); - QCOMPARE(attached->property("value"), QVariant(10)); -} - -// Tests non-static object properties -void tst_qmlparser::dynamicObjects() -{ - QmlComponent component(&engine, TEST_FILE("dynamicObject.1.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); -} - -// Tests the registration of custom variant string converters -void tst_qmlparser::customVariantTypes() -{ - QmlComponent component(&engine, TEST_FILE("customVariantTypes.qml")); - VERIFY_ERRORS(0); - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - QCOMPARE(object->customType().a, 10); -} - -void tst_qmlparser::valueTypes() -{ - QmlComponent component(&engine, TEST_FILE("valueTypes.qml")); - VERIFY_ERRORS(0); - MyTypeObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - - QCOMPARE(object->rectProperty(), QRect(10, 11, 12, 13)); - QCOMPARE(object->rectProperty2(), QRect(10, 11, 12, 13)); - QCOMPARE(object->intProperty(), 10); - object->doAction(); - QCOMPARE(object->rectProperty(), QRect(12, 11, 14, 13)); - QCOMPARE(object->rectProperty2(), QRect(12, 11, 14, 13)); - QCOMPARE(object->intProperty(), 12); - - QmlMetaProperty p = QmlMetaProperty::createProperty(object, "rectProperty.x"); - QCOMPARE(p.read(), QVariant(12)); - p.write(13); - QCOMPARE(p.read(), QVariant(13)); - - quint32 r = p.save(); - QmlMetaProperty p2; - p2.restore(r, object); - QCOMPARE(p2.read(), QVariant(13)); -} - -void tst_qmlparser::cppnamespace() -{ - QmlComponent component(&engine, TEST_FILE("cppnamespace.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - delete object; -} - -void tst_qmlparser::aliasProperties() -{ - // Simple "int" alias - { - QmlComponent component(&engine, TEST_FILE("alias.1.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - - // Read through alias - QCOMPARE(object->property("valueAlias").toInt(), 10); - object->setProperty("value", QVariant(13)); - QCOMPARE(object->property("valueAlias").toInt(), 13); - - // Write throught alias - object->setProperty("valueAlias", QVariant(19)); - QCOMPARE(object->property("valueAlias").toInt(), 19); - QCOMPARE(object->property("value").toInt(), 19); - - delete object; - } - - // Complex object alias - { - QmlComponent component(&engine, TEST_FILE("alias.2.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - - // Read through alias - MyQmlObject *v = - qvariant_cast(object->property("aliasObject")); - QVERIFY(v != 0); - QCOMPARE(v->value(), 10); - - // Write through alias - MyQmlObject *v2 = new MyQmlObject(); - v2->setParent(object); - object->setProperty("aliasObject", qVariantFromValue(v2)); - MyQmlObject *v3 = - qvariant_cast(object->property("aliasObject")); - QVERIFY(v3 != 0); - QCOMPARE(v3, v2); - - delete object; - } - - // Nested aliases - { - QmlComponent component(&engine, TEST_FILE("alias.3.qml")); - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - - QCOMPARE(object->property("value").toInt(), 1892); - QCOMPARE(object->property("value2").toInt(), 1892); - - object->setProperty("value", QVariant(1313)); - QCOMPARE(object->property("value").toInt(), 1313); - QCOMPARE(object->property("value2").toInt(), 1313); - - object->setProperty("value2", QVariant(8080)); - QCOMPARE(object->property("value").toInt(), 8080); - QCOMPARE(object->property("value2").toInt(), 8080); - - delete object; - } - -} - -class TestType : public QObject { - Q_OBJECT -public: - TestType(QObject *p=0) : QObject(p) {} -}; - -class TestType2 : public QObject { - Q_OBJECT -public: - TestType2(QObject *p=0) : QObject(p) {} -}; - -// Check that first child of qml is of given type. Empty type insists on error. -void tst_qmlparser::testType(const QString& qml, const QString& type) -{ - QmlComponent component(&engine, qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports - - if (type.isEmpty()) { - QVERIFY(component.isError()); - } else { - VERIFY_ERRORS(0); - QObject *object = component.create(); - QVERIFY(object != 0); - QCOMPARE(QString(object->metaObject()->className()), type); - } -} - -QML_DECLARE_TYPE(TestType) -QML_DECLARE_TYPE(TestType2) - -QML_DEFINE_TYPE(com.nokia.Test, 1, 0, 3, Test, TestType) -QML_DEFINE_TYPE(com.nokia.Test, 1, 5, 7, Test, TestType) -QML_DEFINE_TYPE(com.nokia.Test, 1, 8, 9, Test, TestType2) -QML_DEFINE_TYPE(com.nokia.Test, 1, 12, 13, Test, TestType2) -QML_DEFINE_TYPE(com.nokia.Test, 1, 9, 11, OldTest, TestType) - -void tst_qmlparser::importsBuiltin_data() -{ - QTest::addColumn("qml"); - QTest::addColumn("type"); - - // import built-ins - QTest::newRow("missing import") - << "Test {}" - << ""; - QTest::newRow("not in version 0.0") - << "import com.nokia.Test 0.0\n" - "Test {}" - << ""; - QTest::newRow("in version 1.0") - << "import com.nokia.Test 1.0\n" - "Test {}" - << "TestType"; - QTest::newRow("qualified wrong") - << "import com.nokia.Test 1.0 as T\n" - "Test {}" - << ""; - QTest::newRow("qualified right") - << "import com.nokia.Test 1.0 as T\n" - "T.Test {}" - << "TestType"; - QTest::newRow("qualified right but not in version 0.0") - << "import com.nokia.Test 0.0 as T\n" - "T.Test {}" - << ""; - QTest::newRow("in version 1.1") - << "import com.nokia.Test 1.1\n" - "Test {}" - << "TestType"; - QTest::newRow("in version 1.3") - << "import com.nokia.Test 1.3\n" - "Test {}" - << "TestType"; - QTest::newRow("not in version 1.4") - << "import com.nokia.Test 1.4\n" - "Test {}" - << ""; - QTest::newRow("in version 1.5") - << "import com.nokia.Test 1.5\n" - "Test {}" - << "TestType"; - QTest::newRow("changed in version 1.8") - << "import com.nokia.Test 1.8\n" - "Test {}" - << "TestType2"; - QTest::newRow("not in version 1.10") - << "import com.nokia.Test 1.10\n" - "Test {}" - << ""; - QTest::newRow("back in version 1.12") - << "import com.nokia.Test 1.12\n" - "Test {}" - << "TestType2"; - QTest::newRow("old in version 1.9") - << "import com.nokia.Test 1.9\n" - "OldTest {}" - << "TestType"; - QTest::newRow("old in version 1.11") - << "import com.nokia.Test 1.11\n" - "OldTest {}" - << "TestType"; - QTest::newRow("no old in version 1.12") - << "import com.nokia.Test 1.12\n" - "OldTest {}" - << ""; - QTest::newRow("multiversion 1") - << "import com.nokia.Test 1.11\n" - "import com.nokia.Test 1.12\n" - "Test {}" - << "TestType2"; - QTest::newRow("multiversion 2") - << "import com.nokia.Test 1.11\n" - "import com.nokia.Test 1.12\n" - "OldTest {}" - << "TestType"; - QTest::newRow("qualified multiversion 3") - << "import com.nokia.Test 1.0 as T0\n" - "import com.nokia.Test 1.8 as T8\n" - "T0.Test {}" - << "TestType"; - QTest::newRow("qualified multiversion 4") - << "import com.nokia.Test 1.0 as T0\n" - "import com.nokia.Test 1.8 as T8\n" - "T8.Test {}" - << "TestType2"; - QTest::newRow("qualified multiversion 5") - << "import com.nokia.Test 1.0 as T0\n" - "import com.nokia.Test 1.10 as T10\n" - "T10.Test {}" - << ""; -} - -void tst_qmlparser::importsBuiltin() -{ - QFETCH(QString, qml); - QFETCH(QString, type); - testType(qml,type); -} - -void tst_qmlparser::importsLocal_data() -{ - QTest::addColumn("qml"); - QTest::addColumn("type"); - - // import locals - QTest::newRow("local import") - << "import \"subdir\"\n" - "Test {}" - << "QFxRect"; - QTest::newRow("local import as") - << "import \"subdir\" as T\n" - "T.Test {}" - << "QFxRect"; - QTest::newRow("wrong local import as") - << "import \"subdir\" as T\n" - "Test {}" - << ""; - QTest::newRow("library precedence over local import") - << "import \"subdir\"\n" - "import com.nokia.Test 1.0\n" - "Test {}" - << "TestType"; -} - -void tst_qmlparser::importsLocal() -{ - QFETCH(QString, qml); - QFETCH(QString, type); - testType(qml,type); -} - -void tst_qmlparser::importsInstalled_data() -{ - QTest::addColumn("qml"); - QTest::addColumn("type"); - - // import installed - QTest::newRow("installed import") - << "import com.nokia.installedtest 1.0\n" - "InstalledTest {}" - << "QFxRect"; - QTest::newRow("installed import") - << "import com.nokia.installedtest 1.4\n" - "InstalledTest {}" - << "QFxText"; -} - -void tst_qmlparser::importsInstalled() -{ - QFETCH(QString, qml); - QFETCH(QString, type); - testType(qml,type); -} - - -void tst_qmlparser::importsOrder_data() -{ - QTest::addColumn("qml"); - QTest::addColumn("type"); - - QTest::newRow("installed import overrides 1") << - "import com.nokia.installedtest 1.0\n" - "import com.nokia.installedtest 1.4\n" - "InstalledTest {}" - << "QFxText"; - QTest::newRow("installed import overrides 2") << - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" - "InstalledTest {}" - << "QFxRect"; - QTest::newRow("installed import re-overrides 1") << - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" - "import com.nokia.installedtest 1.4\n" - "InstalledTest {}" - << "QFxText"; - QTest::newRow("installed import re-overrides 2") << - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" - "InstalledTest {}" - << "QFxRect"; - - QTest::newRow("installed import versus builtin 1") << - "import com.nokia.installedtest 1.5\n" - "import Qt 4.6\n" - "Rectangle {}" - << "QFxRect"; - QTest::newRow("installed import versus builtin 2") << - "import Qt 4.6\n" - "import com.nokia.installedtest 1.5\n" - "Rectangle {}" - << "QFxText"; - QTest::newRow("namespaces cannot be overridden by types 1") << - "import Qt 4.6 as Rectangle\n" - "import com.nokia.installedtest 1.5\n" - "Rectangle {}" - << ""; - QTest::newRow("namespaces cannot be overridden by types 2") << - "import Qt 4.6 as Rectangle\n" - "import com.nokia.installedtest 1.5\n" - "Rectangle.Image {}" - << "QFxImage"; -} - -void tst_qmlparser::importsOrder() -{ - QFETCH(QString, qml); - QFETCH(QString, type); - testType(qml,type); -} - -void tst_qmlparser::crash1() -{ - QmlComponent component(&engine, "Component {}"); -} - -QTEST_MAIN(tst_qmlparser) - -#include "tst_qmlparser.moc" -- cgit v0.12 From 30226cd8b9587fddef604f5ace6219a4d9cba633 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 23 Sep 2009 13:24:53 +1000 Subject: missed file --- tests/auto/declarative/sql/sql.pro | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/auto/declarative/sql/sql.pro diff --git a/tests/auto/declarative/sql/sql.pro b/tests/auto/declarative/sql/sql.pro new file mode 100644 index 0000000..36a867f --- /dev/null +++ b/tests/auto/declarative/sql/sql.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +SOURCES += tst_sql.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" -- cgit v0.12 From 1ae22e98231368e5e8bcbb1d6e74fa59a9d17944 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 23 Sep 2009 13:32:15 +1000 Subject: Off by one bug in binding bit test --- src/declarative/qml/qmlengine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 0efb5c8..a58b35e 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -730,7 +730,7 @@ void QmlDeclarativeData::destroyed(QObject *object) bool QmlDeclarativeData::hasBindingBit(int bit) const { - if (bindingBitsSize >= bit) + if (bindingBitsSize > bit) return bindingBits[bit / 32] & (1 << (bit % 32)); else return false; @@ -738,13 +738,13 @@ bool QmlDeclarativeData::hasBindingBit(int bit) const void QmlDeclarativeData::clearBindingBit(int bit) { - if (bindingBitsSize >= bit) + if (bindingBitsSize > bit) bindingBits[bit / 32] &= ~(1 << (bit % 32)); } void QmlDeclarativeData::setBindingBit(QObject *obj, int bit) { - if (bindingBitsSize < bit) { + if (bindingBitsSize <= bit) { int props = obj->metaObject()->propertyCount(); Q_ASSERT(bit < props); -- cgit v0.12