diff options
-rw-r--r-- | src/declarative/debugger/qmldebug.cpp | 205 | ||||
-rw-r--r-- | src/declarative/debugger/qmldebug.h | 59 | ||||
-rw-r--r-- | src/declarative/debugger/qmldebugservice.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qml.pri | 6 | ||||
-rw-r--r-- | src/declarative/qml/qmlbinding.cpp | 29 | ||||
-rw-r--r-- | src/declarative/qml/qmlbinding.h | 1 | ||||
-rw-r--r-- | src/declarative/qml/qmldeclarativedata_p.h | 6 | ||||
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 43 | ||||
-rw-r--r-- | src/declarative/qml/qmlenginedebug.cpp | 82 | ||||
-rw-r--r-- | src/declarative/qml/qmlenginedebug_p.h | 8 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.cpp | 37 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetaproperty_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qmlwatcher.cpp | 183 | ||||
-rw-r--r-- | src/declarative/qml/qmlwatcher_p.h | 93 | ||||
-rw-r--r-- | tests/auto/declarative/declarative.pro | 7 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/bindingLoop.qml (renamed from tests/auto/declarative/qmlbindengine/bindingLoop.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.1.qml (renamed from tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.1.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.2.qml (renamed from tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.2.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/deferredProperties.qml (renamed from tests/auto/declarative/qmlbindengine/deferredProperties.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/enums.1.qml (renamed from tests/auto/declarative/qmlbindengine/enums.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/extensionObjects.qml (renamed from tests/auto/declarative/qmlbindengine/extensionObjects.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml (renamed from tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml (renamed from tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/methods.1.qml (renamed from tests/auto/declarative/qmlbindengine/methods.1.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/methods.2.qml (renamed from tests/auto/declarative/qmlbindengine/methods.2.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/signalAssignment.1.qml (renamed from tests/auto/declarative/qmlbindengine/signalAssignment.1.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/signalAssignment.2.qml (renamed from tests/auto/declarative/qmlbindengine/signalAssignment.2.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/valueTypeFunctions.qml (renamed from tests/auto/declarative/qmlengine/functions.qml) | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/qmlecmascript.pro (renamed from tests/auto/declarative/qmlbindengine/qmlbindengine.pro) | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/testtypes.cpp (renamed from tests/auto/declarative/qmlbindengine/testtypes.cpp) | 1 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/testtypes.h (renamed from tests/auto/declarative/qmlbindengine/testtypes.h) | 69 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp (renamed from tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp) | 75 | ||||
-rw-r--r-- | tests/auto/declarative/qmlengine/tst_qmlengine.cpp | 98 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/Alias.qml (renamed from tests/auto/declarative/qmlparser/Alias.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/MyComponent.qml (renamed from tests/auto/declarative/qmlparser/MyComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/MyContainerComponent.qml (renamed from tests/auto/declarative/qmlparser/MyContainerComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/alias.1.qml (renamed from tests/auto/declarative/qmlparser/alias.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/alias.2.qml (renamed from tests/auto/declarative/qmlparser/alias.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/alias.3.qml (renamed from tests/auto/declarative/qmlparser/alias.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml (renamed from tests/auto/declarative/qmlparser/assignBasicTypes.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/assignLiteralSignalProperty.qml (renamed from tests/auto/declarative/qmlparser/assignLiteralSignalProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/assignObjectToSignal.qml (renamed from tests/auto/declarative/qmlparser/assignObjectToSignal.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/assignObjectToVariant.qml (renamed from tests/auto/declarative/qmlparser/assignObjectToVariant.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/assignQmlComponent.qml (renamed from tests/auto/declarative/qmlparser/assignQmlComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/assignSignal.qml (renamed from tests/auto/declarative/qmlparser/assignSignal.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/assignTypeExtremes.qml (renamed from tests/auto/declarative/qmlparser/assignTypeExtremes.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/attachedProperties.qml (renamed from tests/auto/declarative/qmlparser/attachedProperties.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/autoComponentCreation.qml (renamed from tests/auto/declarative/qmlparser/autoComponentCreation.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/cppnamespace.qml (renamed from tests/auto/declarative/qmlparser/cppnamespace.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt (renamed from tests/auto/declarative/qmlparser/customParserIdNotAllowed.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml (renamed from tests/auto/declarative/qmlparser/customParserIdNotAllowed.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/customParserTypes.qml (renamed from tests/auto/declarative/qmlparser/customParserTypes.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/customVariantTypes.qml (renamed from tests/auto/declarative/qmlparser/customVariantTypes.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/duplicateIDs.errors.txt (renamed from tests/auto/declarative/qmlparser/duplicateIDs.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/duplicateIDs.qml (renamed from tests/auto/declarative/qmlparser/duplicateIDs.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/dynamicObject.1.qml (renamed from tests/auto/declarative/qmlparser/dynamicObject.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/dynamicProperties.qml (renamed from tests/auto/declarative/qmlparser/dynamicProperties.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml (renamed from tests/auto/declarative/qmlparser/dynamicSignalsAndSlots.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/empty.errors.txt (renamed from tests/auto/declarative/qmlparser/empty.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/empty.qml (renamed from tests/auto/declarative/qmlparser/empty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/failingComponent.errors.txt (renamed from tests/auto/declarative/qmlparser/failingComponent.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/failingComponentTest.qml (renamed from tests/auto/declarative/qmlparser/failingComponentTest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt (renamed from tests/auto/declarative/qmlparser/fakeDotProperty.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/fakeDotProperty.qml (renamed from tests/auto/declarative/qmlparser/fakeDotProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/finalOverride.errors.txt (renamed from tests/auto/declarative/qmlparser/finalOverride.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/finalOverride.qml (renamed from tests/auto/declarative/qmlparser/finalOverride.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/idProperty.qml (renamed from tests/auto/declarative/qmlparser/idProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/importNamespaceConflict.errors.txt (renamed from tests/auto/declarative/qmlparser/importNamespaceConflict.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/importNamespaceConflict.qml (renamed from tests/auto/declarative/qmlparser/importNamespaceConflict.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt (renamed from tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.qml (renamed from tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt (renamed from tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.qml (renamed from tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml (renamed from tests/auto/declarative/qmlparser/inlineQmlComponents.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/interfaceProperty.qml (renamed from tests/auto/declarative/qmlparser/interfaceProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/interfaceQList.qml (renamed from tests/auto/declarative/qmlparser/interfaceQList.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml (renamed from tests/auto/declarative/qmlparser/interfaceQmlList.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.2.errors.txt (renamed from tests/auto/declarative/qmlparser/invalidID.2.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.2.qml (renamed from tests/auto/declarative/qmlparser/invalidID.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.3.errors.txt (renamed from tests/auto/declarative/qmlparser/invalidID.3.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.3.qml (renamed from tests/auto/declarative/qmlparser/invalidID.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.4.errors.txt (renamed from tests/auto/declarative/qmlparser/invalidID.4.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.4.qml (renamed from tests/auto/declarative/qmlparser/invalidID.4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.5.errors.txt (renamed from tests/auto/declarative/qmlparser/invalidID.5.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.5.qml (renamed from tests/auto/declarative/qmlparser/invalidID.5.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt (renamed from tests/auto/declarative/qmlparser/invalidID.6.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.6.qml (renamed from tests/auto/declarative/qmlparser/invalidID.6.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.errors.txt (renamed from tests/auto/declarative/qmlparser/invalidID.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/invalidID.qml (renamed from tests/auto/declarative/qmlparser/invalidID.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest.qml (renamed from tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml (renamed from tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir (renamed from tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt (renamed from tests/auto/declarative/qmlparser/listAssignment.1.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/listAssignment.1.qml (renamed from tests/auto/declarative/qmlparser/listAssignment.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/listAssignment.2.errors.txt (renamed from tests/auto/declarative/qmlparser/listAssignment.2.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/listAssignment.2.qml (renamed from tests/auto/declarative/qmlparser/listAssignment.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/listAssignment.3.errors.txt (renamed from tests/auto/declarative/qmlparser/listAssignment.3.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/listAssignment.3.qml (renamed from tests/auto/declarative/qmlparser/listAssignment.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml (renamed from tests/auto/declarative/qmlparser/listItemDeleteSelf.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/missingObject.errors.txt (renamed from tests/auto/declarative/qmlparser/missingObject.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/missingObject.qml (renamed from tests/auto/declarative/qmlparser/missingObject.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt (renamed from tests/auto/declarative/qmlparser/missingSignal.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/missingSignal.qml (renamed from tests/auto/declarative/qmlparser/missingSignal.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.1.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.qml (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.2.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.qml (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.3.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.qml (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.4.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.qml (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.errors.txt (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.5.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.qml (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.5.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.6.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.qml (renamed from tests/auto/declarative/qmlparser/nonexistantProperty.6.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nullDotProperty.errors.txt (renamed from tests/auto/declarative/qmlparser/nullDotProperty.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/nullDotProperty.qml (renamed from tests/auto/declarative/qmlparser/nullDotProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/propertyValueSource.qml (renamed from tests/auto/declarative/qmlparser/propertyValueSource.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/readOnly.1.errors.txt (renamed from tests/auto/declarative/qmlparser/readOnly.1.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/readOnly.1.qml (renamed from tests/auto/declarative/qmlparser/readOnly.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/readOnly.2.errors.txt (renamed from tests/auto/declarative/qmlparser/readOnly.2.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/readOnly.2.qml (renamed from tests/auto/declarative/qmlparser/readOnly.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/rootAsQmlComponent.qml (renamed from tests/auto/declarative/qmlparser/rootAsQmlComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/simpleBindings.qml (renamed from tests/auto/declarative/qmlparser/simpleBindings.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/simpleContainer.qml (renamed from tests/auto/declarative/qmlparser/simpleContainer.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/simpleObject.qml (renamed from tests/auto/declarative/qmlparser/simpleObject.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/subdir/Test.qml (renamed from tests/auto/declarative/qmlparser/subdir/Test.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/unregisteredObject.errors.txt (renamed from tests/auto/declarative/qmlparser/unregisteredObject.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/unregisteredObject.qml (renamed from tests/auto/declarative/qmlparser/unregisteredObject.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/unsupportedProperty.errors.txt (renamed from tests/auto/declarative/qmlparser/unsupportedProperty.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/unsupportedProperty.qml (renamed from tests/auto/declarative/qmlparser/unsupportedProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/valueTypes.qml (renamed from tests/auto/declarative/qmlparser/valueTypes.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.1.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.1.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.1.qml (renamed from tests/auto/declarative/qmlparser/wrongType.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.10.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.10.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.10.qml (renamed from tests/auto/declarative/qmlparser/wrongType.10.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.11.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.11.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.11.qml (renamed from tests/auto/declarative/qmlparser/wrongType.11.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.12.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.12.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.12.qml (renamed from tests/auto/declarative/qmlparser/wrongType.12.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.13.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.13.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.13.qml (renamed from tests/auto/declarative/qmlparser/wrongType.13.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.14.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.14.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.14.qml (renamed from tests/auto/declarative/qmlparser/wrongType.14.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.2.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.2.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.2.qml (renamed from tests/auto/declarative/qmlparser/wrongType.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.3.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.3.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.3.qml (renamed from tests/auto/declarative/qmlparser/wrongType.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.4.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.4.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.4.qml (renamed from tests/auto/declarative/qmlparser/wrongType.4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.5.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.5.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.5.qml (renamed from tests/auto/declarative/qmlparser/wrongType.5.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.6.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.6.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.6.qml (renamed from tests/auto/declarative/qmlparser/wrongType.6.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.7.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.7.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.7.qml (renamed from tests/auto/declarative/qmlparser/wrongType.7.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.8.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.8.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.8.qml (renamed from tests/auto/declarative/qmlparser/wrongType.8.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.9.errors.txt (renamed from tests/auto/declarative/qmlparser/wrongType.9.errors.txt) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/wrongType.9.qml (renamed from tests/auto/declarative/qmlparser/wrongType.9.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/qmllanguage.pro (renamed from tests/auto/declarative/qmlparser/qmlparser.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/testtypes.cpp (renamed from tests/auto/declarative/qmlparser/testtypes.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/testtypes.h (renamed from tests/auto/declarative/qmlparser/testtypes.h) | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp (renamed from tests/auto/declarative/qmlparser/tst_qmlparser.cpp) | 98 | ||||
-rw-r--r-- | tests/auto/declarative/sql/sql.pro (renamed from tests/auto/declarative/qmlengine/qmlengine.pro) | 3 | ||||
-rw-r--r-- | tools/qmldebugger/engine.cpp | 407 | ||||
-rw-r--r-- | tools/qmldebugger/engine.h | 25 |
169 files changed, 1305 insertions, 249 deletions
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<int, QmlDebugEnginesQuery *> enginesQuery; QHash<int, QmlDebugRootContextQuery *> rootContextQuery; QHash<int, QmlDebugObjectQuery *> objectQuery; + + QHash<int, QmlDebugWatch *> 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<QmlDebugPropertyReference> 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<QmlDebugPropertyReference> properties() const; QList<QmlDebugObjectReference> children() const; @@ -144,6 +192,7 @@ private: QString m_class; QString m_name; QmlDebugFileReference m_source; + int m_contextDebugId; QList<QmlDebugPropertyReference> m_properties; QList<QmlDebugObjectReference> 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 9ca69df..b72c019 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -33,7 +33,8 @@ SOURCES += qml/qmlparser.cpp \ qml/qmlbindingoptimizations.cpp \ qml/qmlxmlhttprequest.cpp \ qml/qmlsqldatabase.cpp \ - qml/qmetaobjectbuilder.cpp + qml/qmetaobjectbuilder.cpp \ + qml/qmlwatcher.cpp HEADERS += qml/qmlparser_p.h \ qml/qmlinstruction_p.h \ @@ -83,7 +84,8 @@ HEADERS += qml/qmlparser_p.h \ qml/qmlbindingoptimizations_p.h \ qml/qmlxmlhttprequest_p.h \ qml/qmlsqldatabase_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/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..a58b35e 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()) { @@ -700,7 +698,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 +722,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/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index a53ab2a..7896afe 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -48,20 +48,24 @@ #include <qmlmetaproperty.h> #include <qmlbinding.h> #include "qmlcontext_p.h" +#include "qmlwatcher_p.h" QT_BEGIN_NAMESPACE QList<QmlEngine *> 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; } @@ -196,6 +200,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; } @@ -207,6 +212,8 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) QByteArray type; ds >> type; + //qDebug() << "QmlEngineDebugServer::messageReceived()" << type; + if (type == "LIST_ENGINES") { int queryId; ds >> queryId; @@ -259,9 +266,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("<unnamed>"); + 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<QmlEngine *> 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/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<QObject *> &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; diff --git a/src/declarative/qml/qmlwatcher.cpp b/src/declarative/qml/qmlwatcher.cpp new file mode 100644 index 0000000..ca99472 --- /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 <QtCore/qmetaobject.h> +#include <QtCore/qdebug.h> +#include <QtDeclarative/qmlexpression.h> +#include <QtDeclarative/qmldebugservice.h> +#include <QtDeclarative/qmlcontext.h> +#include <QtDeclarative/qml.h> + +#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; ii<propCount; ii++) + addPropertyWatch(id, object, debugId, object->metaObject()->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<QPointer<QmlWatchProxy> > 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 "qmlwatcher.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 <QtCore/qobject.h> +#include <QtCore/qlist.h> +#include <QtCore/qpair.h> +#include <QtCore/qhash.h> +#include <QtCore/qset.h> +#include <QtCore/qpointer.h> + +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<int, QList<QPointer<QmlWatchProxy> > > m_proxies; +}; + +QT_END_NAMESPACE + +#endif // QMLWATCHER_P_H 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/bindingLoop.txt b/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml index 8b22dd1..8b22dd1 100644 --- a/tests/auto/declarative/qmlbindengine/bindingLoop.txt +++ b/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml diff --git a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.1.txt b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.1.qml index 3147f63..3147f63 100644 --- a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.1.txt +++ b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.1.qml diff --git a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.2.txt b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.2.qml index c89bb49..c89bb49 100644 --- a/tests/auto/declarative/qmlbindengine/boolPropertiesEvaluateAsBool.2.txt +++ b/tests/auto/declarative/qmlecmascript/data/boolPropertiesEvaluateAsBool.2.qml diff --git a/tests/auto/declarative/qmlbindengine/deferredProperties.txt b/tests/auto/declarative/qmlecmascript/data/deferredProperties.qml index 9dabafe..9dabafe 100644 --- a/tests/auto/declarative/qmlbindengine/deferredProperties.txt +++ b/tests/auto/declarative/qmlecmascript/data/deferredProperties.qml diff --git a/tests/auto/declarative/qmlbindengine/enums.1.qml b/tests/auto/declarative/qmlecmascript/data/enums.1.qml index 6351823..6351823 100644 --- a/tests/auto/declarative/qmlbindengine/enums.1.qml +++ b/tests/auto/declarative/qmlecmascript/data/enums.1.qml diff --git a/tests/auto/declarative/qmlbindengine/extensionObjects.txt b/tests/auto/declarative/qmlecmascript/data/extensionObjects.qml index a902312..a902312 100644 --- a/tests/auto/declarative/qmlbindengine/extensionObjects.txt +++ b/tests/auto/declarative/qmlecmascript/data/extensionObjects.qml diff --git a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml index ccb3a22..ccb3a22 100644 --- a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt +++ b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml diff --git a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml index 6c1fca6..6c1fca6 100644 --- a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt +++ b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml diff --git a/tests/auto/declarative/qmlbindengine/methods.1.txt b/tests/auto/declarative/qmlecmascript/data/methods.1.qml index 8ba300f..8ba300f 100644 --- a/tests/auto/declarative/qmlbindengine/methods.1.txt +++ b/tests/auto/declarative/qmlecmascript/data/methods.1.qml diff --git a/tests/auto/declarative/qmlbindengine/methods.2.txt b/tests/auto/declarative/qmlecmascript/data/methods.2.qml index 70911f7..70911f7 100644 --- a/tests/auto/declarative/qmlbindengine/methods.2.txt +++ b/tests/auto/declarative/qmlecmascript/data/methods.2.qml diff --git a/tests/auto/declarative/qmlbindengine/signalAssignment.1.txt b/tests/auto/declarative/qmlecmascript/data/signalAssignment.1.qml index fbd0914..fbd0914 100644 --- a/tests/auto/declarative/qmlbindengine/signalAssignment.1.txt +++ b/tests/auto/declarative/qmlecmascript/data/signalAssignment.1.qml diff --git a/tests/auto/declarative/qmlbindengine/signalAssignment.2.txt b/tests/auto/declarative/qmlecmascript/data/signalAssignment.2.qml index 8addcb9..8addcb9 100644 --- a/tests/auto/declarative/qmlbindengine/signalAssignment.2.txt +++ b/tests/auto/declarative/qmlecmascript/data/signalAssignment.2.qml diff --git a/tests/auto/declarative/qmlengine/functions.qml b/tests/auto/declarative/qmlecmascript/data/valueTypeFunctions.qml index 28e8ed4..33b4a68 100644 --- a/tests/auto/declarative/qmlengine/functions.qml +++ b/tests/auto/declarative/qmlecmascript/data/valueTypeFunctions.qml @@ -1,4 +1,4 @@ -import Test 1.0 +import Qt.test 1.0 MyTypeObject { rectProperty: Qt.rect(0,0,100,100) diff --git a/tests/auto/declarative/qmlbindengine/qmlbindengine.pro b/tests/auto/declarative/qmlecmascript/qmlecmascript.pro index 4a38ac9..ff4d20f 100644 --- a/tests/auto/declarative/qmlbindengine/qmlbindengine.pro +++ b/tests/auto/declarative/qmlecmascript/qmlecmascript.pro @@ -1,7 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative macx:CONFIG -= app_bundle -SOURCES += tst_qmlbindengine.cpp \ +SOURCES += tst_qmlecmascript.cpp \ testtypes.cpp HEADERS += testtypes.h diff --git a/tests/auto/declarative/qmlbindengine/testtypes.cpp b/tests/auto/declarative/qmlecmascript/testtypes.cpp index 3ff05d7..22e3071 100644 --- a/tests/auto/declarative/qmlbindengine/testtypes.cpp +++ b/tests/auto/declarative/qmlecmascript/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/qmlecmascript/testtypes.h index f27c0b0..ffc8fec 100644 --- a/tests/auto/declarative/qmlbindengine/testtypes.h +++ b/tests/auto/declarative/qmlecmascript/testtypes.h @@ -4,6 +4,9 @@ #include <QtCore/qobject.h> #include <QtDeclarative/qml.h> #include <QtDeclarative/qmlexpression.h> +#include <QtCore/qpoint.h> +#include <QtCore/qsize.h> +#include <QtCore/qrect.h> class MyQmlAttachedObject : public QObject { @@ -70,7 +73,7 @@ public slots: void setString(const QString &s) { m_string = s; } private: - friend class tst_qmlbindengine; + friend class tst_qmlecmascript; bool m_methodCalled; bool m_methodIntCalled; @@ -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/qmlecmascript/tst_qmlecmascript.cpp index 80373fe..40e4fff 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -8,10 +8,16 @@ #include <QtCore/qdir.h> #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(filename)); + return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename)); } inline QUrl TEST_FILE(const char *filename) @@ -19,11 +25,11 @@ inline QUrl TEST_FILE(const char *filename) return TEST_FILE(QLatin1String(filename)); } -class tst_qmlbindengine : public QObject +class tst_qmlecmascript : public QObject { Q_OBJECT public: - tst_qmlbindengine() {} + tst_qmlecmascript() {} private slots: void idShortcutInvalidates(); @@ -39,15 +45,16 @@ private slots: void deferredProperties(); void extensionObjects(); void enums(); + void valueTypeFunctions(); private: QmlEngine engine; }; -void tst_qmlbindengine::idShortcutInvalidates() +void tst_qmlecmascript::idShortcutInvalidates() { { - QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.txt")); + QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.qml")); MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create()); QVERIFY(object != 0); QVERIFY(object->objectProperty() != 0); @@ -56,7 +63,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<MyQmlObject *>(component.create()); QVERIFY(object != 0); QVERIFY(object->objectProperty() != 0); @@ -65,26 +72,26 @@ void tst_qmlbindengine::idShortcutInvalidates() } } -void tst_qmlbindengine::boolPropertiesEvaluateAsBool() +void tst_qmlecmascript::boolPropertiesEvaluateAsBool() { { - QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.1.txt")); + QmlComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.1.qml")); MyQmlObject *object = qobject_cast<MyQmlObject *>(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<MyQmlObject *>(component.create()); QVERIFY(object != 0); QCOMPARE(object->stringProperty(), QLatin1String("pass")); } } -void tst_qmlbindengine::signalAssignment() +void tst_qmlecmascript::signalAssignment() { { - QmlComponent component(&engine, TEST_FILE("signalAssignment.1.txt")); + QmlComponent component(&engine, TEST_FILE("signalAssignment.1.qml")); MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create()); QVERIFY(object != 0); QCOMPARE(object->string(), QString()); @@ -93,7 +100,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<MyQmlObject *>(component.create()); QVERIFY(object != 0); QCOMPARE(object->string(), QString()); @@ -102,10 +109,10 @@ void tst_qmlbindengine::signalAssignment() } } -void tst_qmlbindengine::methods() +void tst_qmlecmascript::methods() { { - QmlComponent component(&engine, TEST_FILE("methods.1.txt")); + QmlComponent component(&engine, TEST_FILE("methods.1.qml")); MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create()); QVERIFY(object != 0); QCOMPARE(object->methodCalled(), false); @@ -116,7 +123,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<MyQmlObject *>(component.create()); QVERIFY(object != 0); QCOMPARE(object->methodCalled(), false); @@ -127,15 +134,15 @@ void tst_qmlbindengine::methods() } } -void tst_qmlbindengine::bindingLoop() +void tst_qmlecmascript::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); } -void tst_qmlbindengine::basicExpressions_data() +void tst_qmlecmascript::basicExpressions_data() { QTest::addColumn<QString>("expression"); QTest::addColumn<QVariant>("result"); @@ -161,7 +168,7 @@ void tst_qmlbindengine::basicExpressions_data() QTest::newRow("Context property override default object property") << "millipedeLegs" << QVariant(100) << true; } -void tst_qmlbindengine::basicExpressions() +void tst_qmlecmascript::basicExpressions() { QFETCH(QString, expression); QFETCH(QVariant, result); @@ -196,7 +203,7 @@ void tst_qmlbindengine::basicExpressions() } Q_DECLARE_METATYPE(QList<QObject *>); -void tst_qmlbindengine::arrayExpressions() +void tst_qmlecmascript::arrayExpressions() { QObject obj1; QObject obj2; @@ -219,7 +226,7 @@ void tst_qmlbindengine::arrayExpressions() } // Tests that modifying a context property will reevaluate expressions -void tst_qmlbindengine::contextPropertiesTriggerReeval() +void tst_qmlecmascript::contextPropertiesTriggerReeval() { QmlContext context(engine.rootContext()); MyQmlObject object1; @@ -281,7 +288,7 @@ void tst_qmlbindengine::contextPropertiesTriggerReeval() } -void tst_qmlbindengine::objectPropertiesTriggerReeval() +void tst_qmlecmascript::objectPropertiesTriggerReeval() { QmlContext context(engine.rootContext()); MyQmlObject object1; @@ -335,9 +342,9 @@ void tst_qmlbindengine::objectPropertiesTriggerReeval() } } -void tst_qmlbindengine::deferredProperties() +void tst_qmlecmascript::deferredProperties() { - QmlComponent component(&engine, TEST_FILE("deferredProperties.txt")); + QmlComponent component(&engine, TEST_FILE("deferredProperties.qml")); MyDeferredObject *object = qobject_cast<MyDeferredObject *>(component.create()); QVERIFY(object != 0); @@ -352,9 +359,9 @@ void tst_qmlbindengine::deferredProperties() QVERIFY(qmlObject != 0); } -void tst_qmlbindengine::extensionObjects() +void tst_qmlecmascript::extensionObjects() { - QmlComponent component(&engine, TEST_FILE("extensionObjects.txt")); + QmlComponent component(&engine, TEST_FILE("extensionObjects.qml")); MyExtendedObject *object = qobject_cast<MyExtendedObject *>(component.create()); QVERIFY(object != 0); @@ -367,7 +374,7 @@ void tst_qmlbindengine::extensionObjects() QCOMPARE(object->baseProperty(), 92); } -void tst_qmlbindengine::enums() +void tst_qmlecmascript::enums() { QmlComponent component(&engine, TEST_FILE("enums.1.qml")); QObject *object = component.create(); @@ -385,6 +392,16 @@ void tst_qmlbindengine::enums() QCOMPARE(object->property("j").toInt(), 19); } -QTEST_MAIN(tst_qmlbindengine) +void tst_qmlecmascript::valueTypeFunctions() +{ + QmlComponent component(&engine, TEST_FILE("valueTypeFunctions.qml")); + MyTypeObject *obj = qobject_cast<MyTypeObject*>(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_qmlbindengine.moc" +#include "tst_qmlecmascript.moc" 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 <qtest.h> -#include <QtDeclarative/qml.h> -#include <QtDeclarative/QmlComponent> -#include <QtDeclarative/QmlEngine> - -#include <QtCore/QDebug> -#include <QtCore/QFile> -#include <QtCore/QUrl> - -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<MyTypeObject*>(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" diff --git a/tests/auto/declarative/qmlparser/Alias.qml b/tests/auto/declarative/qmllanguage/data/Alias.qml index 8264e0d..8264e0d 100644 --- a/tests/auto/declarative/qmlparser/Alias.qml +++ b/tests/auto/declarative/qmllanguage/data/Alias.qml diff --git a/tests/auto/declarative/qmlparser/MyComponent.qml b/tests/auto/declarative/qmllanguage/data/MyComponent.qml index 1a23277..1a23277 100644 --- a/tests/auto/declarative/qmlparser/MyComponent.qml +++ b/tests/auto/declarative/qmllanguage/data/MyComponent.qml diff --git a/tests/auto/declarative/qmlparser/MyContainerComponent.qml b/tests/auto/declarative/qmllanguage/data/MyContainerComponent.qml index 61f54c5..61f54c5 100644 --- a/tests/auto/declarative/qmlparser/MyContainerComponent.qml +++ b/tests/auto/declarative/qmllanguage/data/MyContainerComponent.qml diff --git a/tests/auto/declarative/qmlparser/alias.1.qml b/tests/auto/declarative/qmllanguage/data/alias.1.qml index 492d99a..492d99a 100644 --- a/tests/auto/declarative/qmlparser/alias.1.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.1.qml diff --git a/tests/auto/declarative/qmlparser/alias.2.qml b/tests/auto/declarative/qmllanguage/data/alias.2.qml index aa4d103..aa4d103 100644 --- a/tests/auto/declarative/qmlparser/alias.2.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.2.qml diff --git a/tests/auto/declarative/qmlparser/alias.3.qml b/tests/auto/declarative/qmllanguage/data/alias.3.qml index e25fbae..e25fbae 100644 --- a/tests/auto/declarative/qmlparser/alias.3.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.3.qml diff --git a/tests/auto/declarative/qmlparser/assignBasicTypes.qml b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml index cef9f8d..cef9f8d 100644 --- a/tests/auto/declarative/qmlparser/assignBasicTypes.qml +++ b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml diff --git a/tests/auto/declarative/qmlparser/assignLiteralSignalProperty.qml b/tests/auto/declarative/qmllanguage/data/assignLiteralSignalProperty.qml index 399fcea..399fcea 100644 --- a/tests/auto/declarative/qmlparser/assignLiteralSignalProperty.qml +++ b/tests/auto/declarative/qmllanguage/data/assignLiteralSignalProperty.qml diff --git a/tests/auto/declarative/qmlparser/assignObjectToSignal.qml b/tests/auto/declarative/qmllanguage/data/assignObjectToSignal.qml index 789cc66..789cc66 100644 --- a/tests/auto/declarative/qmlparser/assignObjectToSignal.qml +++ b/tests/auto/declarative/qmllanguage/data/assignObjectToSignal.qml diff --git a/tests/auto/declarative/qmlparser/assignObjectToVariant.qml b/tests/auto/declarative/qmllanguage/data/assignObjectToVariant.qml index 28c68c4..28c68c4 100644 --- a/tests/auto/declarative/qmlparser/assignObjectToVariant.qml +++ b/tests/auto/declarative/qmllanguage/data/assignObjectToVariant.qml diff --git a/tests/auto/declarative/qmlparser/assignQmlComponent.qml b/tests/auto/declarative/qmllanguage/data/assignQmlComponent.qml index 20bdc55..20bdc55 100644 --- a/tests/auto/declarative/qmlparser/assignQmlComponent.qml +++ b/tests/auto/declarative/qmllanguage/data/assignQmlComponent.qml diff --git a/tests/auto/declarative/qmlparser/assignSignal.qml b/tests/auto/declarative/qmllanguage/data/assignSignal.qml index 3abc04d..3abc04d 100644 --- a/tests/auto/declarative/qmlparser/assignSignal.qml +++ b/tests/auto/declarative/qmllanguage/data/assignSignal.qml diff --git a/tests/auto/declarative/qmlparser/assignTypeExtremes.qml b/tests/auto/declarative/qmllanguage/data/assignTypeExtremes.qml index 60ede52..60ede52 100644 --- a/tests/auto/declarative/qmlparser/assignTypeExtremes.qml +++ b/tests/auto/declarative/qmllanguage/data/assignTypeExtremes.qml diff --git a/tests/auto/declarative/qmlparser/attachedProperties.qml b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml index 8343754..8343754 100644 --- a/tests/auto/declarative/qmlparser/attachedProperties.qml +++ b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml diff --git a/tests/auto/declarative/qmlparser/autoComponentCreation.qml b/tests/auto/declarative/qmllanguage/data/autoComponentCreation.qml index 5d00144..5d00144 100644 --- a/tests/auto/declarative/qmlparser/autoComponentCreation.qml +++ b/tests/auto/declarative/qmllanguage/data/autoComponentCreation.qml diff --git a/tests/auto/declarative/qmlparser/cppnamespace.qml b/tests/auto/declarative/qmllanguage/data/cppnamespace.qml index e1daf3b..e1daf3b 100644 --- a/tests/auto/declarative/qmlparser/cppnamespace.qml +++ b/tests/auto/declarative/qmllanguage/data/cppnamespace.qml diff --git a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.errors.txt b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt index d28c0bd..d28c0bd 100644 --- a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt diff --git a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.qml b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml index e607768..e607768 100644 --- a/tests/auto/declarative/qmlparser/customParserIdNotAllowed.qml +++ b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml diff --git a/tests/auto/declarative/qmlparser/customParserTypes.qml b/tests/auto/declarative/qmllanguage/data/customParserTypes.qml index cf2f272..cf2f272 100644 --- a/tests/auto/declarative/qmlparser/customParserTypes.qml +++ b/tests/auto/declarative/qmllanguage/data/customParserTypes.qml diff --git a/tests/auto/declarative/qmlparser/customVariantTypes.qml b/tests/auto/declarative/qmllanguage/data/customVariantTypes.qml index 0263ed2..0263ed2 100644 --- a/tests/auto/declarative/qmlparser/customVariantTypes.qml +++ b/tests/auto/declarative/qmllanguage/data/customVariantTypes.qml diff --git a/tests/auto/declarative/qmlparser/duplicateIDs.errors.txt b/tests/auto/declarative/qmllanguage/data/duplicateIDs.errors.txt index 66241cf..66241cf 100644 --- a/tests/auto/declarative/qmlparser/duplicateIDs.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/duplicateIDs.errors.txt diff --git a/tests/auto/declarative/qmlparser/duplicateIDs.qml b/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml index 9605b5b..9605b5b 100644 --- a/tests/auto/declarative/qmlparser/duplicateIDs.qml +++ b/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml diff --git a/tests/auto/declarative/qmlparser/dynamicObject.1.qml b/tests/auto/declarative/qmllanguage/data/dynamicObject.1.qml index 85d1052..85d1052 100644 --- a/tests/auto/declarative/qmlparser/dynamicObject.1.qml +++ b/tests/auto/declarative/qmllanguage/data/dynamicObject.1.qml diff --git a/tests/auto/declarative/qmlparser/dynamicProperties.qml b/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml index f93e446..f93e446 100644 --- a/tests/auto/declarative/qmlparser/dynamicProperties.qml +++ b/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml diff --git a/tests/auto/declarative/qmlparser/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml index b0ca970..b0ca970 100644 --- a/tests/auto/declarative/qmlparser/dynamicSignalsAndSlots.qml +++ b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml diff --git a/tests/auto/declarative/qmlparser/empty.errors.txt b/tests/auto/declarative/qmllanguage/data/empty.errors.txt index d416e76..d416e76 100644 --- a/tests/auto/declarative/qmlparser/empty.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/empty.errors.txt diff --git a/tests/auto/declarative/qmlparser/empty.qml b/tests/auto/declarative/qmllanguage/data/empty.qml index e69de29..e69de29 100644 --- a/tests/auto/declarative/qmlparser/empty.qml +++ b/tests/auto/declarative/qmllanguage/data/empty.qml diff --git a/tests/auto/declarative/qmlparser/failingComponent.errors.txt b/tests/auto/declarative/qmllanguage/data/failingComponent.errors.txt index 0cf0ef3..0cf0ef3 100644 --- a/tests/auto/declarative/qmlparser/failingComponent.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/failingComponent.errors.txt diff --git a/tests/auto/declarative/qmlparser/failingComponentTest.qml b/tests/auto/declarative/qmllanguage/data/failingComponentTest.qml index 74a6acf..74a6acf 100644 --- a/tests/auto/declarative/qmlparser/failingComponentTest.qml +++ b/tests/auto/declarative/qmllanguage/data/failingComponentTest.qml diff --git a/tests/auto/declarative/qmlparser/fakeDotProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt index e56ad3a..e56ad3a 100644 --- a/tests/auto/declarative/qmlparser/fakeDotProperty.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt diff --git a/tests/auto/declarative/qmlparser/fakeDotProperty.qml b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.qml index d971eee..d971eee 100644 --- a/tests/auto/declarative/qmlparser/fakeDotProperty.qml +++ b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.qml diff --git a/tests/auto/declarative/qmlparser/finalOverride.errors.txt b/tests/auto/declarative/qmllanguage/data/finalOverride.errors.txt index 49e06cb..49e06cb 100644 --- a/tests/auto/declarative/qmlparser/finalOverride.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/finalOverride.errors.txt diff --git a/tests/auto/declarative/qmlparser/finalOverride.qml b/tests/auto/declarative/qmllanguage/data/finalOverride.qml index a84393a..a84393a 100644 --- a/tests/auto/declarative/qmlparser/finalOverride.qml +++ b/tests/auto/declarative/qmllanguage/data/finalOverride.qml diff --git a/tests/auto/declarative/qmlparser/idProperty.qml b/tests/auto/declarative/qmllanguage/data/idProperty.qml index a413c0b..a413c0b 100644 --- a/tests/auto/declarative/qmlparser/idProperty.qml +++ b/tests/auto/declarative/qmllanguage/data/idProperty.qml diff --git a/tests/auto/declarative/qmlparser/importNamespaceConflict.errors.txt b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.errors.txt index 231998d..231998d 100644 --- a/tests/auto/declarative/qmlparser/importNamespaceConflict.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.errors.txt diff --git a/tests/auto/declarative/qmlparser/importNamespaceConflict.qml b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.qml index cd112af..cd112af 100644 --- a/tests/auto/declarative/qmlparser/importNamespaceConflict.qml +++ b/tests/auto/declarative/qmllanguage/data/importNamespaceConflict.qml diff --git a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt index 2235cbc..2235cbc 100644 --- a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt diff --git a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.qml index 23ed566..23ed566 100644 --- a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.qml diff --git a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt index 2235cbc..2235cbc 100644 --- a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt diff --git a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.qml index 97ec222..97ec222 100644 --- a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml +++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.qml diff --git a/tests/auto/declarative/qmlparser/inlineQmlComponents.qml b/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml index 79ceda6..79ceda6 100644 --- a/tests/auto/declarative/qmlparser/inlineQmlComponents.qml +++ b/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml diff --git a/tests/auto/declarative/qmlparser/interfaceProperty.qml b/tests/auto/declarative/qmllanguage/data/interfaceProperty.qml index 70879ff..70879ff 100644 --- a/tests/auto/declarative/qmlparser/interfaceProperty.qml +++ b/tests/auto/declarative/qmllanguage/data/interfaceProperty.qml diff --git a/tests/auto/declarative/qmlparser/interfaceQList.qml b/tests/auto/declarative/qmllanguage/data/interfaceQList.qml index c87dfae..c87dfae 100644 --- a/tests/auto/declarative/qmlparser/interfaceQList.qml +++ b/tests/auto/declarative/qmllanguage/data/interfaceQList.qml diff --git a/tests/auto/declarative/qmlparser/interfaceQmlList.qml b/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml index 8392bea..8392bea 100644 --- a/tests/auto/declarative/qmlparser/interfaceQmlList.qml +++ b/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml diff --git a/tests/auto/declarative/qmlparser/invalidID.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.2.errors.txt index 56e3eeb..56e3eeb 100644 --- a/tests/auto/declarative/qmlparser/invalidID.2.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidID.2.errors.txt diff --git a/tests/auto/declarative/qmlparser/invalidID.2.qml b/tests/auto/declarative/qmllanguage/data/invalidID.2.qml index 4fb3b29..4fb3b29 100644 --- a/tests/auto/declarative/qmlparser/invalidID.2.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.2.qml diff --git a/tests/auto/declarative/qmlparser/invalidID.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.3.errors.txt index bb811cf..bb811cf 100644 --- a/tests/auto/declarative/qmlparser/invalidID.3.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidID.3.errors.txt diff --git a/tests/auto/declarative/qmlparser/invalidID.3.qml b/tests/auto/declarative/qmllanguage/data/invalidID.3.qml index 6684172..6684172 100644 --- a/tests/auto/declarative/qmlparser/invalidID.3.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.3.qml diff --git a/tests/auto/declarative/qmlparser/invalidID.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.4.errors.txt index cfe8756..cfe8756 100644 --- a/tests/auto/declarative/qmlparser/invalidID.4.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidID.4.errors.txt diff --git a/tests/auto/declarative/qmlparser/invalidID.4.qml b/tests/auto/declarative/qmllanguage/data/invalidID.4.qml index 1f15fce..1f15fce 100644 --- a/tests/auto/declarative/qmlparser/invalidID.4.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.4.qml diff --git a/tests/auto/declarative/qmlparser/invalidID.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.5.errors.txt index b0a63a0..b0a63a0 100644 --- a/tests/auto/declarative/qmlparser/invalidID.5.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidID.5.errors.txt diff --git a/tests/auto/declarative/qmlparser/invalidID.5.qml b/tests/auto/declarative/qmllanguage/data/invalidID.5.qml index 0545b0d..0545b0d 100644 --- a/tests/auto/declarative/qmlparser/invalidID.5.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.5.qml diff --git a/tests/auto/declarative/qmlparser/invalidID.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt index 861e3d7..861e3d7 100644 --- a/tests/auto/declarative/qmlparser/invalidID.6.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt diff --git a/tests/auto/declarative/qmlparser/invalidID.6.qml b/tests/auto/declarative/qmllanguage/data/invalidID.6.qml index ea34007..ea34007 100644 --- a/tests/auto/declarative/qmlparser/invalidID.6.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.6.qml diff --git a/tests/auto/declarative/qmlparser/invalidID.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.errors.txt index 1ca678c..1ca678c 100644 --- a/tests/auto/declarative/qmlparser/invalidID.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidID.errors.txt diff --git a/tests/auto/declarative/qmlparser/invalidID.qml b/tests/auto/declarative/qmllanguage/data/invalidID.qml index 04db3eb..04db3eb 100644 --- a/tests/auto/declarative/qmlparser/invalidID.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.qml diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest.qml index d8a22a8..d8a22a8 100644 --- a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest.qml diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml index a0706ad..a0706ad 100644 --- a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir index ba0b42a..ba0b42a 100644 --- a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir diff --git a/tests/auto/declarative/qmlparser/listAssignment.1.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt index d68d487..d68d487 100644 --- a/tests/auto/declarative/qmlparser/listAssignment.1.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt diff --git a/tests/auto/declarative/qmlparser/listAssignment.1.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml index 4240425..4240425 100644 --- a/tests/auto/declarative/qmlparser/listAssignment.1.qml +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml diff --git a/tests/auto/declarative/qmlparser/listAssignment.2.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.2.errors.txt index 8b40aa3..8b40aa3 100644 --- a/tests/auto/declarative/qmlparser/listAssignment.2.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.2.errors.txt diff --git a/tests/auto/declarative/qmlparser/listAssignment.2.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.2.qml index e3baadb..e3baadb 100644 --- a/tests/auto/declarative/qmlparser/listAssignment.2.qml +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.2.qml diff --git a/tests/auto/declarative/qmlparser/listAssignment.3.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.3.errors.txt index 8c7b7e9..8c7b7e9 100644 --- a/tests/auto/declarative/qmlparser/listAssignment.3.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.3.errors.txt diff --git a/tests/auto/declarative/qmlparser/listAssignment.3.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.3.qml index 00c4c6b..00c4c6b 100644 --- a/tests/auto/declarative/qmlparser/listAssignment.3.qml +++ b/tests/auto/declarative/qmllanguage/data/listAssignment.3.qml diff --git a/tests/auto/declarative/qmlparser/listItemDeleteSelf.qml b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml index fa2e831..fa2e831 100644 --- a/tests/auto/declarative/qmlparser/listItemDeleteSelf.qml +++ b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml diff --git a/tests/auto/declarative/qmlparser/missingObject.errors.txt b/tests/auto/declarative/qmllanguage/data/missingObject.errors.txt index b31b562..b31b562 100644 --- a/tests/auto/declarative/qmlparser/missingObject.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/missingObject.errors.txt diff --git a/tests/auto/declarative/qmlparser/missingObject.qml b/tests/auto/declarative/qmllanguage/data/missingObject.qml index 2f17045..2f17045 100644 --- a/tests/auto/declarative/qmlparser/missingObject.qml +++ b/tests/auto/declarative/qmllanguage/data/missingObject.qml diff --git a/tests/auto/declarative/qmlparser/missingSignal.errors.txt b/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt index e243ae5..e243ae5 100644 --- a/tests/auto/declarative/qmlparser/missingSignal.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt diff --git a/tests/auto/declarative/qmlparser/missingSignal.qml b/tests/auto/declarative/qmllanguage/data/missingSignal.qml index fd489ca..fd489ca 100644 --- a/tests/auto/declarative/qmlparser/missingSignal.qml +++ b/tests/auto/declarative/qmllanguage/data/missingSignal.qml diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt index cfc6fc8..cfc6fc8 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.1.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.1.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.qml index df7406c..df7406c 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.1.qml +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.qml diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt index 8b13585..8b13585 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.2.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.2.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.qml index 06ccd37..06ccd37 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.2.qml +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.qml diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt index 8b13585..8b13585 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.3.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.3.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.qml index 5b08608..5b08608 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.3.qml +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.qml diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt index 8b13585..8b13585 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.4.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.4.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.qml index 6579191..6579191 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.4.qml +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.qml diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.errors.txt index c07f2b9..c07f2b9 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.5.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.errors.txt diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.5.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.qml index 37af057..37af057 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.5.qml +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.5.qml diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt index c02d7bd..c02d7bd 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.6.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt diff --git a/tests/auto/declarative/qmlparser/nonexistantProperty.6.qml b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.qml index 5cd55d0..5cd55d0 100644 --- a/tests/auto/declarative/qmlparser/nonexistantProperty.6.qml +++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.qml diff --git a/tests/auto/declarative/qmlparser/nullDotProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/nullDotProperty.errors.txt index 07a4094..07a4094 100644 --- a/tests/auto/declarative/qmlparser/nullDotProperty.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/nullDotProperty.errors.txt diff --git a/tests/auto/declarative/qmlparser/nullDotProperty.qml b/tests/auto/declarative/qmllanguage/data/nullDotProperty.qml index 4e36779..4e36779 100644 --- a/tests/auto/declarative/qmlparser/nullDotProperty.qml +++ b/tests/auto/declarative/qmllanguage/data/nullDotProperty.qml diff --git a/tests/auto/declarative/qmlparser/propertyValueSource.qml b/tests/auto/declarative/qmllanguage/data/propertyValueSource.qml index ad71fcf..ad71fcf 100644 --- a/tests/auto/declarative/qmlparser/propertyValueSource.qml +++ b/tests/auto/declarative/qmllanguage/data/propertyValueSource.qml diff --git a/tests/auto/declarative/qmlparser/readOnly.1.errors.txt b/tests/auto/declarative/qmllanguage/data/readOnly.1.errors.txt index b8c3404..b8c3404 100644 --- a/tests/auto/declarative/qmlparser/readOnly.1.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/readOnly.1.errors.txt diff --git a/tests/auto/declarative/qmlparser/readOnly.1.qml b/tests/auto/declarative/qmllanguage/data/readOnly.1.qml index 60757bd..60757bd 100644 --- a/tests/auto/declarative/qmlparser/readOnly.1.qml +++ b/tests/auto/declarative/qmllanguage/data/readOnly.1.qml diff --git a/tests/auto/declarative/qmlparser/readOnly.2.errors.txt b/tests/auto/declarative/qmllanguage/data/readOnly.2.errors.txt index d857a04..d857a04 100644 --- a/tests/auto/declarative/qmlparser/readOnly.2.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/readOnly.2.errors.txt diff --git a/tests/auto/declarative/qmlparser/readOnly.2.qml b/tests/auto/declarative/qmllanguage/data/readOnly.2.qml index 8f1633c..8f1633c 100644 --- a/tests/auto/declarative/qmlparser/readOnly.2.qml +++ b/tests/auto/declarative/qmllanguage/data/readOnly.2.qml diff --git a/tests/auto/declarative/qmlparser/rootAsQmlComponent.qml b/tests/auto/declarative/qmllanguage/data/rootAsQmlComponent.qml index 8d72cd3..8d72cd3 100644 --- a/tests/auto/declarative/qmlparser/rootAsQmlComponent.qml +++ b/tests/auto/declarative/qmllanguage/data/rootAsQmlComponent.qml diff --git a/tests/auto/declarative/qmlparser/simpleBindings.qml b/tests/auto/declarative/qmllanguage/data/simpleBindings.qml index 74867b3..74867b3 100644 --- a/tests/auto/declarative/qmlparser/simpleBindings.qml +++ b/tests/auto/declarative/qmllanguage/data/simpleBindings.qml diff --git a/tests/auto/declarative/qmlparser/simpleContainer.qml b/tests/auto/declarative/qmllanguage/data/simpleContainer.qml index c3a795f..c3a795f 100644 --- a/tests/auto/declarative/qmlparser/simpleContainer.qml +++ b/tests/auto/declarative/qmllanguage/data/simpleContainer.qml diff --git a/tests/auto/declarative/qmlparser/simpleObject.qml b/tests/auto/declarative/qmllanguage/data/simpleObject.qml index 30c7823..30c7823 100644 --- a/tests/auto/declarative/qmlparser/simpleObject.qml +++ b/tests/auto/declarative/qmllanguage/data/simpleObject.qml diff --git a/tests/auto/declarative/qmlparser/subdir/Test.qml b/tests/auto/declarative/qmllanguage/data/subdir/Test.qml index c4d5905..c4d5905 100644 --- a/tests/auto/declarative/qmlparser/subdir/Test.qml +++ b/tests/auto/declarative/qmllanguage/data/subdir/Test.qml diff --git a/tests/auto/declarative/qmlparser/unregisteredObject.errors.txt b/tests/auto/declarative/qmllanguage/data/unregisteredObject.errors.txt index bc4f7f4..bc4f7f4 100644 --- a/tests/auto/declarative/qmlparser/unregisteredObject.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/unregisteredObject.errors.txt diff --git a/tests/auto/declarative/qmlparser/unregisteredObject.qml b/tests/auto/declarative/qmllanguage/data/unregisteredObject.qml index 9498e31..9498e31 100644 --- a/tests/auto/declarative/qmlparser/unregisteredObject.qml +++ b/tests/auto/declarative/qmllanguage/data/unregisteredObject.qml diff --git a/tests/auto/declarative/qmlparser/unsupportedProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.errors.txt index 3a90a7d..3a90a7d 100644 --- a/tests/auto/declarative/qmlparser/unsupportedProperty.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.errors.txt diff --git a/tests/auto/declarative/qmlparser/unsupportedProperty.qml b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.qml index 9f19680..9f19680 100644 --- a/tests/auto/declarative/qmlparser/unsupportedProperty.qml +++ b/tests/auto/declarative/qmllanguage/data/unsupportedProperty.qml diff --git a/tests/auto/declarative/qmlparser/valueTypes.qml b/tests/auto/declarative/qmllanguage/data/valueTypes.qml index bf325a7..bf325a7 100644 --- a/tests/auto/declarative/qmlparser/valueTypes.qml +++ b/tests/auto/declarative/qmllanguage/data/valueTypes.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.1.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.1.errors.txt index ba7a076..ba7a076 100644 --- a/tests/auto/declarative/qmlparser/wrongType.1.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.1.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.1.qml b/tests/auto/declarative/qmllanguage/data/wrongType.1.qml index 289d37f..289d37f 100644 --- a/tests/auto/declarative/qmlparser/wrongType.1.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.1.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.10.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.10.errors.txt index ae75b52..ae75b52 100644 --- a/tests/auto/declarative/qmlparser/wrongType.10.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.10.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.10.qml b/tests/auto/declarative/qmllanguage/data/wrongType.10.qml index 2cf0e50..2cf0e50 100644 --- a/tests/auto/declarative/qmlparser/wrongType.10.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.10.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.11.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.11.errors.txt index 23a4cda..23a4cda 100644 --- a/tests/auto/declarative/qmlparser/wrongType.11.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.11.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.11.qml b/tests/auto/declarative/qmllanguage/data/wrongType.11.qml index ae77ba1..ae77ba1 100644 --- a/tests/auto/declarative/qmlparser/wrongType.11.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.11.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.12.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.12.errors.txt index 3092100..3092100 100644 --- a/tests/auto/declarative/qmlparser/wrongType.12.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.12.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.12.qml b/tests/auto/declarative/qmllanguage/data/wrongType.12.qml index b7a366f..b7a366f 100644 --- a/tests/auto/declarative/qmlparser/wrongType.12.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.12.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.13.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.13.errors.txt index ba7a076..ba7a076 100644 --- a/tests/auto/declarative/qmlparser/wrongType.13.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.13.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.13.qml b/tests/auto/declarative/qmllanguage/data/wrongType.13.qml index 477aff1..477aff1 100644 --- a/tests/auto/declarative/qmlparser/wrongType.13.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.13.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.14.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.14.errors.txt index d621fdd..d621fdd 100644 --- a/tests/auto/declarative/qmlparser/wrongType.14.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.14.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.14.qml b/tests/auto/declarative/qmllanguage/data/wrongType.14.qml index 672d693..672d693 100644 --- a/tests/auto/declarative/qmlparser/wrongType.14.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.14.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.2.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.2.errors.txt index 9ff9f25..9ff9f25 100644 --- a/tests/auto/declarative/qmlparser/wrongType.2.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.2.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.2.qml b/tests/auto/declarative/qmllanguage/data/wrongType.2.qml index 34b74f7..34b74f7 100644 --- a/tests/auto/declarative/qmlparser/wrongType.2.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.2.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.3.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.3.errors.txt index 6d971c6..6d971c6 100644 --- a/tests/auto/declarative/qmlparser/wrongType.3.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.3.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.3.qml b/tests/auto/declarative/qmllanguage/data/wrongType.3.qml index 384181a..384181a 100644 --- a/tests/auto/declarative/qmlparser/wrongType.3.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.3.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.4.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.4.errors.txt index ef34d0e..ef34d0e 100644 --- a/tests/auto/declarative/qmlparser/wrongType.4.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.4.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.4.qml b/tests/auto/declarative/qmllanguage/data/wrongType.4.qml index 0787bf5..0787bf5 100644 --- a/tests/auto/declarative/qmlparser/wrongType.4.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.4.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.5.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.5.errors.txt index cab10bd..cab10bd 100644 --- a/tests/auto/declarative/qmlparser/wrongType.5.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.5.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.5.qml b/tests/auto/declarative/qmllanguage/data/wrongType.5.qml index c50ae9a..c50ae9a 100644 --- a/tests/auto/declarative/qmlparser/wrongType.5.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.5.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.6.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.6.errors.txt index d0a0b00..d0a0b00 100644 --- a/tests/auto/declarative/qmlparser/wrongType.6.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.6.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.6.qml b/tests/auto/declarative/qmllanguage/data/wrongType.6.qml index da10b78..da10b78 100644 --- a/tests/auto/declarative/qmlparser/wrongType.6.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.6.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.7.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.7.errors.txt index 614346b..614346b 100644 --- a/tests/auto/declarative/qmlparser/wrongType.7.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.7.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.7.qml b/tests/auto/declarative/qmllanguage/data/wrongType.7.qml index ddc3835..ddc3835 100644 --- a/tests/auto/declarative/qmlparser/wrongType.7.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.7.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.8.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.8.errors.txt index 1773c00..1773c00 100644 --- a/tests/auto/declarative/qmlparser/wrongType.8.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.8.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.8.qml b/tests/auto/declarative/qmllanguage/data/wrongType.8.qml index a5f6756..a5f6756 100644 --- a/tests/auto/declarative/qmlparser/wrongType.8.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.8.qml diff --git a/tests/auto/declarative/qmlparser/wrongType.9.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.9.errors.txt index 8630975..8630975 100644 --- a/tests/auto/declarative/qmlparser/wrongType.9.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/wrongType.9.errors.txt diff --git a/tests/auto/declarative/qmlparser/wrongType.9.qml b/tests/auto/declarative/qmllanguage/data/wrongType.9.qml index a3db732..a3db732 100644 --- a/tests/auto/declarative/qmlparser/wrongType.9.qml +++ b/tests/auto/declarative/qmllanguage/data/wrongType.9.qml diff --git a/tests/auto/declarative/qmlparser/qmlparser.pro b/tests/auto/declarative/qmllanguage/qmllanguage.pro index dda5c61..4e4be9c 100644 --- a/tests/auto/declarative/qmlparser/qmlparser.pro +++ b/tests/auto/declarative/qmllanguage/qmllanguage.pro @@ -1,8 +1,8 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_qmlparser.cpp \ +SOURCES += tst_qmllanguage.cpp \ testtypes.cpp -HEADERS = testtypes.h +HEADERS += testtypes.h macx:CONFIG -= app_bundle # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage diff --git a/tests/auto/declarative/qmlparser/testtypes.cpp b/tests/auto/declarative/qmllanguage/testtypes.cpp index c11e195..c11e195 100644 --- a/tests/auto/declarative/qmlparser/testtypes.cpp +++ b/tests/auto/declarative/qmllanguage/testtypes.cpp diff --git a/tests/auto/declarative/qmlparser/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h index f6f966f..b1da9fb 100644 --- a/tests/auto/declarative/qmlparser/testtypes.h +++ b/tests/auto/declarative/qmllanguage/testtypes.h @@ -104,7 +104,7 @@ signals: void basicParameterizedSignal(int parameter); private: - friend class tst_qmlparser; + friend class tst_qmllanguage; int m_value; MyInterface *m_interface; MyQmlObject *m_qmlobject; diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index c2f1e1a..1bf98df 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -7,14 +7,20 @@ #include <QtCore/qdir.h> #include "testtypes.h" -class tst_qmlparser : public QObject +/* +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_qmlparser() { + tst_qmllanguage() { QmlMetaType::registerCustomStringConverter(qMetaTypeId<MyCustomVariantType>(), myCustomVariantTypeConverter); QFileInfo fileInfo(__FILE__); - engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("lib"))); + engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("data/lib"))); } private slots: @@ -74,7 +80,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<QByteArray> expected = data.split('\n'); \ @@ -96,7 +102,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) @@ -104,7 +110,7 @@ inline QUrl TEST_FILE(const char *filename) return TEST_FILE(QLatin1String(filename)); } -void tst_qmlparser::errors_data() +void tst_qmllanguage::errors_data() { QTest::addColumn<QString>("file"); QTest::addColumn<QString>("errorFile"); @@ -166,7 +172,7 @@ void tst_qmlparser::errors_data() QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false; } -void tst_qmlparser::errors() +void tst_qmllanguage::errors() { QFETCH(QString, file); QFETCH(QString, errorFile); @@ -182,7 +188,7 @@ void tst_qmlparser::errors() VERIFY_ERRORS(errorFile.toLatin1().constData()); } -void tst_qmlparser::simpleObject() +void tst_qmllanguage::simpleObject() { QmlComponent component(&engine, TEST_FILE("simpleObject.qml")); VERIFY_ERRORS(0); @@ -190,7 +196,7 @@ void tst_qmlparser::simpleObject() QVERIFY(object != 0); } -void tst_qmlparser::simpleContainer() +void tst_qmllanguage::simpleContainer() { QmlComponent component(&engine, TEST_FILE("simpleContainer.qml")); VERIFY_ERRORS(0); @@ -199,7 +205,7 @@ void tst_qmlparser::simpleContainer() QCOMPARE(container->children()->count(),2); } -void tst_qmlparser::interfaceProperty() +void tst_qmllanguage::interfaceProperty() { QmlComponent component(&engine, TEST_FILE("interfaceProperty.qml")); VERIFY_ERRORS(0); @@ -209,7 +215,7 @@ void tst_qmlparser::interfaceProperty() QVERIFY(object->interface()->id == 913); } -void tst_qmlparser::interfaceQmlList() +void tst_qmllanguage::interfaceQmlList() { QmlComponent component(&engine, TEST_FILE("interfaceQmlList.qml")); VERIFY_ERRORS(0); @@ -220,7 +226,7 @@ void tst_qmlparser::interfaceQmlList() QVERIFY(container->qmllistAccessor().at(ii)->id == 913); } -void tst_qmlparser::interfaceQList() +void tst_qmllanguage::interfaceQList() { QmlComponent component(&engine, TEST_FILE("interfaceQList.qml")); VERIFY_ERRORS(0); @@ -231,7 +237,7 @@ void tst_qmlparser::interfaceQList() QVERIFY(container->qlistInterfaces()->at(ii)->id == 913); } -void tst_qmlparser::assignObjectToSignal() +void tst_qmllanguage::assignObjectToSignal() { QmlComponent component(&engine, TEST_FILE("assignObjectToSignal.qml")); VERIFY_ERRORS(0); @@ -241,7 +247,7 @@ void tst_qmlparser::assignObjectToSignal() emit object->basicSignal(); } -void tst_qmlparser::assignObjectToVariant() +void tst_qmllanguage::assignObjectToVariant() { QmlComponent component(&engine, TEST_FILE("assignObjectToVariant.qml")); VERIFY_ERRORS(0); @@ -251,7 +257,7 @@ void tst_qmlparser::assignObjectToVariant() QVERIFY(v.userType() == qMetaTypeId<QObject *>()); } -void tst_qmlparser::assignLiteralSignalProperty() +void tst_qmllanguage::assignLiteralSignalProperty() { QmlComponent component(&engine, TEST_FILE("assignLiteralSignalProperty.qml")); VERIFY_ERRORS(0); @@ -261,7 +267,7 @@ void tst_qmlparser::assignLiteralSignalProperty() } // Test is an external component can be loaded and assigned (to a qlist) -void tst_qmlparser::assignQmlComponent() +void tst_qmllanguage::assignQmlComponent() { QmlComponent component(&engine, TEST_FILE("assignQmlComponent.qml")); VERIFY_ERRORS(0); @@ -274,7 +280,7 @@ void tst_qmlparser::assignQmlComponent() } // Test literal assignment to all the basic types -void tst_qmlparser::assignBasicTypes() +void tst_qmllanguage::assignBasicTypes() { QmlComponent component(&engine, TEST_FILE("assignBasicTypes.qml")); VERIFY_ERRORS(0); @@ -306,7 +312,7 @@ void tst_qmlparser::assignBasicTypes() } // Test edge case type assignments -void tst_qmlparser::assignTypeExtremes() +void tst_qmllanguage::assignTypeExtremes() { QmlComponent component(&engine, TEST_FILE("assignTypeExtremes.qml")); VERIFY_ERRORS(0); @@ -317,7 +323,7 @@ void tst_qmlparser::assignTypeExtremes() } // Tests that custom parser types can be instantiated -void tst_qmlparser::customParserTypes() +void tst_qmllanguage::customParserTypes() { QmlComponent component(&engine, TEST_FILE("customParserTypes.qml")); VERIFY_ERRORS(0); @@ -327,7 +333,7 @@ void tst_qmlparser::customParserTypes() } // Tests that the root item can be a custom component -void tst_qmlparser::rootAsQmlComponent() +void tst_qmllanguage::rootAsQmlComponent() { QmlComponent component(&engine, TEST_FILE("rootAsQmlComponent.qml")); VERIFY_ERRORS(0); @@ -338,7 +344,7 @@ void tst_qmlparser::rootAsQmlComponent() } // Tests that components can be specified inline -void tst_qmlparser::inlineQmlComponents() +void tst_qmllanguage::inlineQmlComponents() { QmlComponent component(&engine, TEST_FILE("inlineQmlComponents.qml")); VERIFY_ERRORS(0); @@ -353,7 +359,7 @@ void tst_qmlparser::inlineQmlComponents() } // Tests that types that have an id property have it set -void tst_qmlparser::idProperty() +void tst_qmllanguage::idProperty() { QmlComponent component(&engine, TEST_FILE("idProperty.qml")); VERIFY_ERRORS(0); @@ -368,7 +374,7 @@ void tst_qmlparser::idProperty() } // Tests that signals can be assigned to -void tst_qmlparser::assignSignal() +void tst_qmllanguage::assignSignal() { QmlComponent component(&engine, TEST_FILE("assignSignal.qml")); VERIFY_ERRORS(0); @@ -381,7 +387,7 @@ void tst_qmlparser::assignSignal() } // Tests the creation and assignment of dynamic properties -void tst_qmlparser::dynamicProperties() +void tst_qmllanguage::dynamicProperties() { QmlComponent component(&engine, TEST_FILE("dynamicProperties.qml")); VERIFY_ERRORS(0); @@ -399,7 +405,7 @@ void tst_qmlparser::dynamicProperties() } // Tests the declaration of dynamic signals and slots -void tst_qmlparser::dynamicSignalsAndSlots() +void tst_qmllanguage::dynamicSignalsAndSlots() { QmlComponent component(&engine, TEST_FILE("dynamicSignalsAndSlots.qml")); VERIFY_ERRORS(0); @@ -411,7 +417,7 @@ void tst_qmlparser::dynamicSignalsAndSlots() QVERIFY(object->metaObject()->indexOfMethod("slot2()") != -1); } -void tst_qmlparser::simpleBindings() +void tst_qmllanguage::simpleBindings() { QmlComponent component(&engine, TEST_FILE("simpleBindings.qml")); VERIFY_ERRORS(0); @@ -424,7 +430,7 @@ void tst_qmlparser::simpleBindings() QCOMPARE(object->property("objectProperty"), QVariant::fromValue(object)); } -void tst_qmlparser::autoComponentCreation() +void tst_qmllanguage::autoComponentCreation() { QmlComponent component(&engine, TEST_FILE("autoComponentCreation.qml")); VERIFY_ERRORS(0); @@ -436,7 +442,7 @@ void tst_qmlparser::autoComponentCreation() QCOMPARE(child->realProperty(), qreal(9)); } -void tst_qmlparser::propertyValueSource() +void tst_qmllanguage::propertyValueSource() { QmlComponent component(&engine, TEST_FILE("propertyValueSource.qml")); VERIFY_ERRORS(0); @@ -459,7 +465,7 @@ void tst_qmlparser::propertyValueSource() QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty"))); } -void tst_qmlparser::attachedProperties() +void tst_qmllanguage::attachedProperties() { QmlComponent component(&engine, TEST_FILE("attachedProperties.qml")); VERIFY_ERRORS(0); @@ -471,7 +477,7 @@ void tst_qmlparser::attachedProperties() } // Tests non-static object properties -void tst_qmlparser::dynamicObjects() +void tst_qmllanguage::dynamicObjects() { QmlComponent component(&engine, TEST_FILE("dynamicObject.1.qml")); VERIFY_ERRORS(0); @@ -480,7 +486,7 @@ void tst_qmlparser::dynamicObjects() } // Tests the registration of custom variant string converters -void tst_qmlparser::customVariantTypes() +void tst_qmllanguage::customVariantTypes() { QmlComponent component(&engine, TEST_FILE("customVariantTypes.qml")); VERIFY_ERRORS(0); @@ -489,7 +495,7 @@ void tst_qmlparser::customVariantTypes() QCOMPARE(object->customType().a, 10); } -void tst_qmlparser::valueTypes() +void tst_qmllanguage::valueTypes() { QmlComponent component(&engine, TEST_FILE("valueTypes.qml")); VERIFY_ERRORS(0); @@ -515,7 +521,7 @@ void tst_qmlparser::valueTypes() QCOMPARE(p2.read(), QVariant(13)); } -void tst_qmlparser::cppnamespace() +void tst_qmllanguage::cppnamespace() { QmlComponent component(&engine, TEST_FILE("cppnamespace.qml")); VERIFY_ERRORS(0); @@ -524,7 +530,7 @@ void tst_qmlparser::cppnamespace() delete object; } -void tst_qmlparser::aliasProperties() +void tst_qmllanguage::aliasProperties() { // Simple "int" alias { @@ -607,7 +613,7 @@ public: }; // 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) +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 @@ -630,7 +636,7 @@ 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() +void tst_qmllanguage::importsBuiltin_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("type"); @@ -726,14 +732,14 @@ void tst_qmlparser::importsBuiltin_data() << ""; } -void tst_qmlparser::importsBuiltin() +void tst_qmllanguage::importsBuiltin() { QFETCH(QString, qml); QFETCH(QString, type); testType(qml,type); } -void tst_qmlparser::importsLocal_data() +void tst_qmllanguage::importsLocal_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("type"); @@ -758,14 +764,14 @@ void tst_qmlparser::importsLocal_data() << "TestType"; } -void tst_qmlparser::importsLocal() +void tst_qmllanguage::importsLocal() { QFETCH(QString, qml); QFETCH(QString, type); testType(qml,type); } -void tst_qmlparser::importsInstalled_data() +void tst_qmllanguage::importsInstalled_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("type"); @@ -781,7 +787,7 @@ void tst_qmlparser::importsInstalled_data() << "QFxText"; } -void tst_qmlparser::importsInstalled() +void tst_qmllanguage::importsInstalled() { QFETCH(QString, qml); QFETCH(QString, type); @@ -789,7 +795,7 @@ void tst_qmlparser::importsInstalled() } -void tst_qmlparser::importsOrder_data() +void tst_qmllanguage::importsOrder_data() { QTest::addColumn<QString>("qml"); QTest::addColumn<QString>("type"); @@ -840,18 +846,18 @@ void tst_qmlparser::importsOrder_data() << "QFxImage"; } -void tst_qmlparser::importsOrder() +void tst_qmllanguage::importsOrder() { QFETCH(QString, qml); QFETCH(QString, type); testType(qml,type); } -void tst_qmlparser::crash1() +void tst_qmllanguage::crash1() { QmlComponent component(&engine, "Component {}"); } -QTEST_MAIN(tst_qmlparser) +QTEST_MAIN(tst_qmllanguage) -#include "tst_qmlparser.moc" +#include "tst_qmllanguage.moc" diff --git a/tests/auto/declarative/qmlengine/qmlengine.pro b/tests/auto/declarative/sql/sql.pro index 4ac81e9..36a867f 100644 --- a/tests/auto/declarative/qmlengine/qmlengine.pro +++ b/tests/auto/declarative/sql/sql.pro @@ -1,5 +1,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_qmlengine.cpp +SOURCES += tst_sql.cpp +# Define SRCDIR equal to test's source directory DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp index 6e163e6..5a1a01b 100644 --- a/tools/qmldebugger/engine.cpp +++ b/tools/qmldebugger/engine.cpp @@ -6,13 +6,278 @@ #include <QLineEdit> #include <QTreeWidget> #include <QTableWidget> +#include <QTabWidget> +#include <QMouseEvent> +#include <QAction> +#include <QMenu> +#include <QInputDialog> #include <QFile> +#include <QPointer> #include <private/qmlenginedebug_p.h> #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qfxitem.h> +#include <QtDeclarative/qmldebugservice.h> 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; i<topLevelItemCount(); i++) { + QTreeWidgetItem *item = findItem(topLevelItem(i), debugId); + if (item) + return item; + } + + return 0; +} + +QTreeWidgetItem *QmlObjectTree::findItem(QTreeWidgetItem *item, int debugId) const +{ + if (item->data(0, Qt::UserRole).toInt() == debugId) + return item; + + QTreeWidgetItem *child; + for (int i=0; i<item->childCount(); 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<QAction *> 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<QmlDebugWatch> watch; + }; + + struct Value { + int column; + QVariant variant; + bool first; + }; + + QList<WatchedEntity> m_columns; + QList<Value> 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<Value>::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("<unnamed>"); + 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; i<m_columns.count(); i++) { + if (m_columns.at(i).watch == watch) + return i; + } + return -1; +} + +void WatchTableModel::addValue(int column, const QVariant &value) +{ + int row = columnCount(QModelIndex()); + beginInsertRows(QModelIndex(), row, row); + + Value v; + v.column = column; + v.variant = value; + v.first = false; + m_values.append(v); + + endInsertRows(); +} + + class DebuggerEngineItem : public QObject { Q_OBJECT @@ -32,7 +297,7 @@ private: }; EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent) -: QWidget(parent), m_client(client), m_engines(0), m_context(0), m_object(0) +: QWidget(parent), m_client(client), m_engines(0), m_context(0), m_object(0), m_watchedObject(0), m_watchTableModel(0) { QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins(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<QmlDebugWatch*>(sender()); + + m_watchTableModel->updateWatch(watch, value); + + if (!propertyName.isEmpty()) { + QmlDebugObjectReference obj = m_object->object(); + if (obj.debugId() == watch->objectDebugId()) { + for (int ii=0; ii<m_propTable->rowCount(); 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<QmlDebugPropertyReference> 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<int, QString> 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("<unnamed>") : 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 5ef28ae..b2c8221 100644 --- a/tools/qmldebugger/engine.h +++ b/tools/qmldebugger/engine.h @@ -2,6 +2,7 @@ #define ENGINE_H #include <QWidget> +#include <QtCore/qpointer.h> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcontext.h> #include <QtDeclarative/qmlview.h> @@ -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; QmlView *m_engineView; QList<QObject *> m_engineItems; + + QmlDebugWatch *m_watchedObject; + WatchTableModel *m_watchTableModel; + QHash< QPair<int, QString>, QPointer<QmlDebugWatch> > m_watchedProps; }; QT_END_NAMESPACE |