aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/auto.pro1
-rw-r--r--tests/auto/declarative/declarative.pro28
-rw-r--r--tests/auto/declarative/examples/examples.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro17
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/Double.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/attached.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/rotation.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro4
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp176
-rw-r--r--tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp23
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/binding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/color.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/empty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/loop.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/parent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/simple.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/startup.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro4
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp126
-rw-r--r--tests/auto/declarative/qdeclarativebinding/data/test-binding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp5
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro18
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/data/createObject.qml5
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml2
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp14
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-object.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-property.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/trimming.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro2
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp14
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlots.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/eval.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/function.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/in.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleOne.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleTwo.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImport.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibrary.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportScoping.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFive.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFour.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failOne.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failThree.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failTwo.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testImportPragmaLibrary.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApi.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiCaching.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMajorVersionFail.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMinorVersionFail.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiWriting.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/ScarceResourceSignalComponent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopy.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyFromJs.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImport.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportFail.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportNoBinding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyNoBinding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceDestroyedCopy.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunction.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunctionFail.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceSignal.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestMultiple.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestPreserve.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro18
-rw-r--r--tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro18
-rw-r--r--tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp44
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/NestedComponent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.7.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.8.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.9.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/crash2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/method.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.7.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/propertyInit.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/propertyInit.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp60
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/model.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro2
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp66
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/data/MyType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro20
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/temptest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/Test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/temptest2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml4
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml2
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro18
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/data/TestType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/atob.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/btoa.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml16
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/darker.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/enums.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/formatting.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/hsla.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/lighter.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/md5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/point.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/quit.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/rect.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/rgba.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/size.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/tint.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/vector.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml2
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml2
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicExtension.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/deleting.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/deletingState.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/editProperties.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/explicit.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/extendsBug.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/illegalObj.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/legalTempState.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/reset.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/returnToBase.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/script.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverride.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/urlResolution.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml2
-rw-r--r--tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro2
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp393
-rw-r--r--tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp10
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro15
-rw-r--r--tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp22
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml2
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/fetchException.qml2
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/nullQObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml2
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml2
-rw-r--r--tests/auto/declarative/qsgflickable/data/disabledcontent.qml8
-rw-r--r--tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp39
-rw-r--r--tests/auto/declarative/qsglistview/data/displaylist.qml2
-rw-r--r--tests/auto/declarative/qsglistview/tst_qsglistview.cpp12
-rw-r--r--tests/auto/declarative/shared/debugutil_p.h1
-rw-r--r--tests/auto/qtquick1/moduleqt47/data/importqt47.qml (renamed from tests/auto/declarative/moduleqt47/data/importqt47.qml)0
-rw-r--r--tests/auto/qtquick1/moduleqt47/moduleqt47.pro (renamed from tests/auto/declarative/moduleqt47/moduleqt47.pro)4
-rw-r--r--tests/auto/qtquick1/moduleqt47/tst_moduleqt47.cpp (renamed from tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp)7
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/anchors.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/anchors.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/anchorsqgraphicswidget.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/centerin.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/centerin.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/crash1.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/crash1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/fill.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/fill.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/hvCenter.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/hvCenter.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/loop1.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/loop1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/loop2.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/loop2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/data/margins.qml (renamed from tests/auto/declarative/qdeclarativeanchors/data/margins.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/qdeclarativeanchors.pro (renamed from tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp (renamed from tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp)183
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/colors.gif (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/colors.gif)bin505 -> 505 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/colors.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/hearts.gif (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif)bin6524 -> 6524 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/hearts.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/qmldir (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/qmldir)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/qtbug-16520.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/qtbug-16520.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickman.gif (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.gif)bin164923 -> 164923 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickman.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanerror1.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanpause.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanscaled.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanstopped.qml (renamed from tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro17
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp (renamed from tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp)44
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/Double.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/attached.qml34
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/badproperty1.qml21
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/badproperty2.qml21
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/badtype1.qml12
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/badtype2.qml12
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/badtype3.qml12
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/badtype4.qml27
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/dontAutoStart.qml18
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/dontStart.qml19
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/dontStart2.qml19
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/dotproperty.qml24
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/doubleRegistrationBug.qml8
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype1.qml25
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype2.qml25
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/nonTransitionBug.qml30
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/properties.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/properties2.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/properties3.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/properties4.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/properties5.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition2.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition3.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition4.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition5.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition6.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition7.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/registrationBug.qml18
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/rotation.qml48
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/runningTrueBug.qml30
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/valuesource.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/data/valuesource2.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/qdeclarativeanimations.pro16
-rw-r--r--tests/auto/qtquick1/qdeclarativeanimations/tst_qdeclarativeanimations.cpp855
-rw-r--r--tests/auto/qtquick1/qdeclarativeapplication/qdeclarativeapplication.pro6
-rw-r--r--tests/auto/qtquick1/qdeclarativeapplication/tst_qdeclarativeapplication.cpp123
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/binding.qml26
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/color.qml24
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/cpptrigger.qml11
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/delayedRegistration.qml25
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/disabled.qml27
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/dontStart.qml18
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/empty.qml23
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/explicit.qml26
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty.qml23
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty2.qml23
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/groupedPropertyCrash.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/loop.qml19
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/nonSelecting2.qml26
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/parent.qml28
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/qtbug12295.qml17
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/reassignedAnimation.qml32
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/runningTrue.qml20
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/scripttrigger.qml16
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/simple.qml26
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/startup.qml17
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/data/startup2.qml16
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/qdeclarativebehaviors.pro16
-rw-r--r--tests/auto/qtquick1/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp435
-rw-r--r--tests/auto/qtquick1/qdeclarativebinding/data/test-binding.qml16
-rw-r--r--tests/auto/qtquick1/qdeclarativebinding/data/test-binding2.qml16
-rw-r--r--tests/auto/qtquick1/qdeclarativebinding/qdeclarativebinding.pro17
-rw-r--r--tests/auto/qtquick1/qdeclarativebinding/tst_qdeclarativebinding.cpp118
-rw-r--r--tests/auto/qtquick1/qdeclarativeborderimage/data/colors-round-remote.sci (renamed from tests/auto/declarative/qdeclarativeborderimage/data/colors-round-remote.sci)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeborderimage/data/colors-round.sci (renamed from tests/auto/declarative/qdeclarativeborderimage/data/colors-round.sci)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeborderimage/data/colors.png (renamed from tests/auto/declarative/qdeclarativeborderimage/data/colors.png)bin1655 -> 1655 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeborderimage/data/heart200.png (renamed from tests/auto/declarative/qdeclarativeborderimage/data/heart200.png)bin7943 -> 7943 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeborderimage/data/invalid.sci (renamed from tests/auto/declarative/qdeclarativeborderimage/data/invalid.sci)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeborderimage/qdeclarativeborderimage.pro18
-rw-r--r--tests/auto/qtquick1/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp (renamed from tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp)80
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/connection-targetchange.qml25
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml8
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml7
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-parent.qml7
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals.qml7
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/error-object.qml7
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/error-property.qml5
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/error-property2.qml5
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/error-syntax.qml9
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/test-connection.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/test-connection2.qml3
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/test-connection3.qml3
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/data/trimming.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/qdeclarativeconnection.pro17
-rw-r--r--tests/auto/qtquick1/qdeclarativeconnection/tst_qdeclarativeconnection.cpp234
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/disabledcontent.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/flickable01.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/flickable02.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/flickable03.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/flickable04.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/flickableqgraphicswidget.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/flickableqgraphicswidget.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/nestedPressDelay.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/resize.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/resize.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/data/wheel.qml (renamed from tests/auto/declarative/qdeclarativeflickable/data/wheel.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/qdeclarativeflickable.pro (renamed from tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp (renamed from tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp)76
-rw-r--r--tests/auto/qtquick1/qdeclarativeflipable/data/crash.qml (renamed from tests/auto/declarative/qdeclarativeflipable/data/crash.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflipable/data/flipable-abort.qml (renamed from tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflipable/data/test-flipable.qml (renamed from tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeflipable/qdeclarativeflipable.pro (renamed from tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeflipable/tst_qdeclarativeflipable.cpp (renamed from tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp)16
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/chain.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/chain.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/forceActiveFocus.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/forceActiveFocus.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/forcefocus.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/qtBug13380.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/signalEmission.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/signalEmission.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/test.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/test.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/test2.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/test2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/test3.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/test3.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/test4.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/test4.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/data/test5.qml (renamed from tests/auto/declarative/qdeclarativefocusscope/data/test5.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/qdeclarativefocusscope.pro (renamed from tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp (renamed from tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp)64
-rw-r--r--tests/auto/qtquick1/qdeclarativefontloader/data/daniel.ttf (renamed from tests/auto/declarative/qdeclarativefontloader/data/daniel.ttf)bin51984 -> 51984 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativefontloader/data/dummy.ttf (renamed from tests/auto/declarative/qdeclarativefontloader/data/dummy.ttf)0
-rw-r--r--tests/auto/qtquick1/qdeclarativefontloader/data/tarzeau_ocr_a.ttf (renamed from tests/auto/declarative/qdeclarativefontloader/data/tarzeau_ocr_a.ttf)bin24544 -> 24544 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativefontloader/qdeclarativefontloader.pro18
-rw-r--r--tests/auto/qtquick1/qdeclarativefontloader/tst_qdeclarativefontloader.cpp (renamed from tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp)44
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/attachedSignals.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/displaygrid.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/footer.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/footer.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/gridview-enforcerange.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/gridview-initCurrent.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/gridview-noCurrent.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/gridview-noCurrent.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/gridview1.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/gridview1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/gridview2.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/gridview2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/gridview3.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/gridview3.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/header.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/header.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/manual-highlight.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/manual-highlight.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/mirroring.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/mirroring.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/propertychangestest.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/data/setindex.qml (renamed from tests/auto/declarative/qdeclarativegridview/data/setindex.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/qdeclarativegridview.pro (renamed from tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativegridview/tst_qdeclarativegridview.cpp (renamed from tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp)340
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/aspectratio.qml (renamed from tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/big.jpeg (renamed from tests/auto/declarative/qdeclarativeimage/data/big.jpeg)bin1700081 -> 1700081 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/big256.png (renamed from tests/auto/declarative/qdeclarativeimage/data/big256.png)bin3566 -> 3566 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/colors.png (renamed from tests/auto/declarative/qdeclarativeimage/data/colors.png)bin1655 -> 1655 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/colors1.png (renamed from tests/auto/declarative/qdeclarativeimage/data/colors1.png)bin1655 -> 1655 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/green.png (renamed from tests/auto/declarative/qdeclarativeimage/data/green.png)bin314 -> 314 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/heart-win32.png (renamed from tests/auto/declarative/qdeclarativeimage/data/heart-win32.png)bin12621 -> 12621 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/heart.png (renamed from tests/auto/declarative/qdeclarativeimage/data/heart.png)bin12577 -> 12577 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/heart.svg (renamed from tests/auto/declarative/qdeclarativeimage/data/heart.svg)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/heart200-win32.png (renamed from tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png)bin8062 -> 8062 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/heart200.png (renamed from tests/auto/declarative/qdeclarativeimage/data/heart200.png)bin8063 -> 8063 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/qtbug_16389.qml (renamed from tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/rect.png (renamed from tests/auto/declarative/qdeclarativeimage/data/rect.png)bin171 -> 171 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/data/tiling.qml (renamed from tests/auto/declarative/qdeclarativeimage/data/tiling.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/qdeclarativeimage.pro18
-rw-r--r--tests/auto/qtquick1/qdeclarativeimage/tst_qdeclarativeimage.cpp (renamed from tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp)111
-rw-r--r--tests/auto/qtquick1/qdeclarativeimageprovider/qdeclarativeimageprovider.pro17
-rw-r--r--tests/auto/qtquick1/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp432
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/childrenProperty.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/childrenRect.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug2.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug3.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/childrenRectBug3.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/implicitsize.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/implicitsize.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/keynavigationtest.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/keynavigationtest_implicit.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/keynavigationtest_implicit.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/keyspriority.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/keystest.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/keystest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/layoutmirroring.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/mapCoordinates.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/mouseFocus.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/propertychanges.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/qtbug_16871.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/resourcesProperty.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/data/transformCrash.qml (renamed from tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/qdeclarativeitem.pro (renamed from tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeitem/tst_qdeclarativeitem.cpp (renamed from tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp)8
-rw-r--r--tests/auto/qtquick1/qdeclarativelayoutitem/data/layoutItem.qml (renamed from tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelayoutitem/qdeclarativelayoutitem.pro (renamed from tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp (renamed from tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp)6
-rw-r--r--tests/auto/qtquick1/qdeclarativelistmodel/data/enumerate.qml24
-rw-r--r--tests/auto/qtquick1/qdeclarativelistmodel/data/model.qml22
-rw-r--r--tests/auto/qtquick1/qdeclarativelistmodel/data/multipleroles.qml25
-rw-r--r--tests/auto/qtquick1/qdeclarativelistmodel/data/script.js13
-rw-r--r--tests/auto/qtquick1/qdeclarativelistmodel/data/setmodelcachelist.qml20
-rw-r--r--tests/auto/qtquick1/qdeclarativelistmodel/qdeclarativelistmodel.pro18
-rw-r--r--tests/auto/qtquick1/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp1125
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/attachedSignals.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/attachedSignals.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/displaylist.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/displaylist.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/footer.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/footer.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/header.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/header.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/header1.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/header1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/headerfooter.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/itemlist.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/itemlist.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/listview-enforcerange.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/listview-initCurrent.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/listview-noCurrent.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/listview-noCurrent.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/listview-sections.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/listview-sections_delegate.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/listviewtest.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/manual-highlight.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/manual-highlight.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/orientchange.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/orientchange.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/propertychangestest.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/qtbug14821.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/qtbug14821.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/qtbug16037.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/rightToLeft.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/sizelessthan1.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/sizelessthan1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/data/strictlyenforcerange.qml (renamed from tests/auto/declarative/qdeclarativelistview/data/strictlyenforcerange.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/incrementalmodel.cpp (renamed from tests/auto/declarative/qdeclarativelistview/incrementalmodel.cpp)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/incrementalmodel.h (renamed from tests/auto/declarative/qdeclarativelistview/incrementalmodel.h)0
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/qdeclarativelistview.pro (renamed from tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativelistview/tst_qdeclarativelistview.cpp (renamed from tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp)365
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/AnchoredLoader.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/AnchoredLoader.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/BlueRect.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/CreationContextLoader.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/GraphicsWidget250x250.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/GreenRect.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/NoResize.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/NoResize.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/NoResizeGraphicsWidget.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/QTBUG_16928.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/QTBUG_16928.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/QTBUG_17114.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/QTBUG_17114.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/Rect120x60.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/SetSourceComponent.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/SizeToItem.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/SizeToLoader.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/VmeError.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/VmeError.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/crash.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/crash.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/creationContext.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/creationContext.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/differentorigin.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/implicitSize.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/implicitSize.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/nonItem.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/nonItem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/qmldir (renamed from tests/auto/declarative/qdeclarativeloader/data/qmldir)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/sameorigin-load.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/sameorigin.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/data/vmeErrors.qml (renamed from tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/qdeclarativeloader.pro20
-rw-r--r--tests/auto/qtquick1/qdeclarativeloader/tst_qdeclarativeloader.cpp (renamed from tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp)104
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/clickandhold.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/clicktwice.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/clicktwice.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/doubleclick.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/dragging.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/dragging.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/dragproperties.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/dragreset.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/pressedOrdering.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/preventContextMenu.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/preventstealing.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/rejectEvent.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/updateMousePosOnClick.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/data/updateMousePosOnResize.qml (renamed from tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/qdeclarativemousearea.pro18
-rw-r--r--tests/auto/qtquick1/qdeclarativemousearea/tst_qdeclarativemousearea.cpp (renamed from tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp)76
-rw-r--r--tests/auto/qtquick1/qdeclarativeparticles/data/particle.png (renamed from tests/auto/declarative/qdeclarativeparticles/data/particle.png)bin262 -> 262 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativeparticles/data/particlemotiontest.qml (renamed from tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeparticles/data/particlestest.qml (renamed from tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeparticles/qdeclarativeparticles.pro (renamed from tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeparticles/tst_qdeclarativeparticles.cpp (renamed from tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp)2
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/closedPath.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/closedPath.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/datamodel.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/datamodel.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/displaypath.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/displaypath.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/dragpath.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/dragpath.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/emptymodel.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/openPath.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/openPath.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathUpdate.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathUpdateOnStartChanged.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathtest.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathtest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathview0.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathview0.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathview1.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathview1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathview2.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathview2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathview3.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathview3.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/pathview_package.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/propertychanges.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/treemodel.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/treemodel.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/undefinedpath.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/data/vdm.qml (renamed from tests/auto/declarative/qdeclarativepathview/data/vdm.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/qdeclarativepathview.pro (renamed from tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativepathview/tst_qdeclarativepathview.cpp (renamed from tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp)190
-rw-r--r--tests/auto/qtquick1/qdeclarativepincharea/data/flickresize.qml (renamed from tests/auto/declarative/qdeclarativepincharea/data/flickresize.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepincharea/data/pinchproperties.qml (renamed from tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepincharea/qdeclarativepincharea.pro (renamed from tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativepincharea/tst_qdeclarativepincharea.cpp (renamed from tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp)48
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/flow-testimplicitsize.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/flowtest-toptobottom.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/flowtest-toptobottom.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/flowtest.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/grid-animated.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/grid-spacing.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/grid-toptobottom.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/gridtest.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/gridzerocolumns.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-animated.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-spacing.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/horizontal.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/propertychangestest.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/repeatertest.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/vertical-animated.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/vertical-spacing.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/vertical.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/vertical.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/data/verticalqgraphicswidget.qml (renamed from tests/auto/declarative/qdeclarativepositioners/data/verticalqgraphicswidget.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/qdeclarativepositioners.pro (renamed from tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativepositioners/tst_qdeclarativepositioners.cpp (renamed from tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp)213
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/data/intmodel.qml (renamed from tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/data/itemlist.qml (renamed from tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/data/modelChanged.qml (renamed from tests/auto/declarative/qdeclarativerepeater/data/modelChanged.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/data/objlist.qml (renamed from tests/auto/declarative/qdeclarativerepeater/data/objlist.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/data/properties.qml (renamed from tests/auto/declarative/qdeclarativerepeater/data/properties.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/data/repeater1.qml (renamed from tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/data/repeater2.qml (renamed from tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/qdeclarativerepeater.pro (renamed from tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativerepeater/tst_qdeclarativerepeater.cpp (renamed from tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp)79
-rw-r--r--tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation1.qml3
-rw-r--r--tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation2.qml5
-rw-r--r--tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation3.qml6
-rw-r--r--tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml24
-rw-r--r--tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml13
-rw-r--r--tests/auto/qtquick1/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro17
-rw-r--r--tests/auto/qtquick1/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp216
-rw-r--r--tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation1.qml4
-rw-r--r--tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation2.qml9
-rw-r--r--tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation3.qml8
-rw-r--r--tests/auto/qtquick1/qdeclarativespringanimation/qdeclarativespringanimation.pro17
-rw-r--r--tests/auto/qtquick1/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp136
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/ExtendedRectangle.qml19
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/Implementation/MyType.qml32
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/Implementation/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/QTBUG-14830.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorChanges1.qml23
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorChanges2.qml21
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorChanges3.qml29
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorChanges4.qml22
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorChanges5.qml22
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorChangesCrash.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug.qml37
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug2.qml25
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/attachedPropertyChanges.qml20
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml18
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicBinding.qml12
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicBinding2.qml12
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicBinding3.qml13
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicBinding4.qml17
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicChanges.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicChanges2.qml15
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicChanges3.qml15
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicChanges4.qml19
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/basicExtension.qml16
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/deleting.qml11
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/deletingState.qml13
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/editProperties.qml34
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/explicit.qml15
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/extendsBug.qml26
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/fakeExtension.qml16
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/illegalObj.qml12
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/illegalTempState.qml21
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/image.pngbin0 -> 173 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/legalTempState.qml23
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/nonExistantProp.qml11
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/parentChange1.qml37
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/parentChange2.qml31
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/parentChange3.qml42
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/parentChange4.qml30
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/parentChange5.qml30
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/parentChange6.qml30
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/propertyErrors.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/reset.qml19
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/restoreEntryValues.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/returnToBase.qml21
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/script.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/signalOverride.qml18
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/signalOverride2.qml9
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash.qml15
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash2.qml24
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/unnamedWhen.qml14
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/urlResolution.qml12
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/data/whenOrdering.qml11
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/qdeclarativestates.pro16
-rw-r--r--tests/auto/qtquick1/qdeclarativestates/tst_qdeclarativestates.cpp1514
-rw-r--r--tests/auto/qtquick1/qdeclarativesystempalette/qdeclarativesystempalette.pro13
-rw-r--r--tests/auto/qtquick1/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp192
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments.qml (renamed from tests/auto/declarative/qdeclarativetext/data/alignments.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_cb.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_cb.png)bin496 -> 496 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_cc.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_cc.png)bin556 -> 556 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_ct.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_ct.png)bin533 -> 533 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_lb.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_lb.png)bin496 -> 496 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_lc.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_lc.png)bin535 -> 535 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_lt.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_lt.png)bin514 -> 514 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_rb.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_rb.png)bin505 -> 505 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_rc.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_rc.png)bin559 -> 559 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/alignments_rt.png (renamed from tests/auto/declarative/qdeclarativetext/data/alignments_rt.png)bin539 -> 539 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/elideimplicitwidth.qml (renamed from tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesLocal.qml (renamed from tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesLocalError.qml (renamed from tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesRemote.qml (renamed from tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesRemoteError.qml (renamed from tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml (renamed from tests/auto/declarative/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/http/exists.png (renamed from tests/auto/declarative/qdeclarativetext/data/http/exists.png)bin2738 -> 2738 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/lineCount.qml (renamed from tests/auto/declarative/qdeclarativetext/data/lineCount.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/lineHeight.qml (renamed from tests/auto/declarative/qdeclarativetext/data/lineHeight.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/qtbug_14734.qml (renamed from tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/data/rotated.qml (renamed from tests/auto/declarative/qdeclarativetext/data/rotated.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/qdeclarativetext.pro (renamed from tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro)10
-rw-r--r--tests/auto/qtquick1/qdeclarativetext/tst_qdeclarativetext.cpp (renamed from tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp)228
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/CursorRect.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/CursorRect.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_cb.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png)bin496 -> 496 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_cc.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png)bin556 -> 556 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_ct.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png)bin533 -> 533 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lb.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png)bin496 -> 496 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lc.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png)bin535 -> 535 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lt.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png)bin514 -> 514 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rb.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png)bin505 -> 505 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rc.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png)bin559 -> 559 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rt.png (renamed from tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png)bin539 -> 539 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/cursorTest.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/geometrySignals.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/http/ErrItem.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/http/NormItem.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTest.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestPass.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/http/qmldir (renamed from tests/auto/declarative/qdeclarativetextedit/data/http/qmldir)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/httpfail/FailItem.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/httpslow/WaitItem.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/inputmethodhints.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_default.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_default.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false_readonly.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_readonly.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false_words.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_multiline.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_multiline.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true_readonly.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_readonly.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true_words.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_characters.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_characters.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_default.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_default.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_words.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_words.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/navigation.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/navigation.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/positionAt.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/data/readOnly.qml (renamed from tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/qdeclarativetextedit.pro15
-rw-r--r--tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp (renamed from tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp)350
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/cursorTest.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/echoMode.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/echoMode.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/geometrySignals.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/halign_center.png (renamed from tests/auto/declarative/qdeclarativetextinput/data/halign_center.png)bin293 -> 293 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/halign_left.png (renamed from tests/auto/declarative/qdeclarativetextinput/data/halign_left.png)bin291 -> 291 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/halign_right.png (renamed from tests/auto/declarative/qdeclarativetextinput/data/halign_right.png)bin292 -> 292 bytes
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/horizontalAlignment.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/inputmethods.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/inputmethods.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/masks.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/masks.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/maxLength.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_default.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselection_default.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false_readonly.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_readonly.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false_words.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_words.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true_readonly.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_readonly.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true_words.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_words.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_characters.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_characters.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_default.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_default.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_words.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_words.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/navigation.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/navigation.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/positionAt.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/positionAt.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/readOnly.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/data/validators.qml (renamed from tests/auto/declarative/qdeclarativetextinput/data/validators.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/qdeclarativetextinput.pro (renamed from tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp (renamed from tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp)352
-rw-r--r--tests/auto/qtquick1/qdeclarativetimer/qdeclarativetimer.pro12
-rw-r--r--tests/auto/qtquick1/qdeclarativetimer/tst_qdeclarativetimer.cpp344
-rw-r--r--tests/auto/qtquick1/qdeclarativeview/data/error1.qml (renamed from tests/auto/declarative/qdeclarativeview/data/error1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeview/data/resizemodedeclarativeitem.qml (renamed from tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeview/data/resizemodegraphicswidget.qml (renamed from tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeview/qdeclarativeview.pro (renamed from tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeview/tst_qdeclarativeview.cpp (renamed from tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeviewer/data/orientation.qml (renamed from tests/auto/declarative/qdeclarativeviewer/data/orientation.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativeviewer/qdeclarativeviewer.pro (renamed from tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativeviewer/tst_qdeclarativeviewer.cpp (renamed from tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp)4
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/data/datalist.qml (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/data/modelproperties.qml (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/data/modelproperties2.qml (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/data/objectlist.qml (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/data/singlerole1.qml (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole1.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/data/singlerole2.qml (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole2.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/data/visualdatamodel.qml (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml)0
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro)4
-rw-r--r--tests/auto/qtquick1/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp (renamed from tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp)66
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/get.qml61
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.xml54
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/model2.xml14
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/propertychanges.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.xml90
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleCrash.qml7
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleErrors.qml10
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleKeys.qml13
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/testtypes.qml8
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/data/unique.qml8
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro21
-rw-r--r--tests/auto/qtquick1/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp965
-rw-r--r--tests/auto/qtquick1/qtquick1.pro50
1098 files changed, 12478 insertions, 2843 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 2543261eeb..8f351b7653 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,6 +1,7 @@
TEMPLATE=subdirs
SUBDIRS=\
declarative \
+ qtquick1 \
contains(QT_CONFIG, qmltest): SUBDIRS += qmltest
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index d72f745d25..183c920ece 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -15,51 +15,29 @@ PUBLICTESTS += \
qdeclarativeerror \
qdeclarativefolderlistmodel \
qdeclarativeinfo \
- qdeclarativelayoutitem \
qdeclarativelistreference \
qdeclarativemoduleplugin \
- qdeclarativeparticles \
qdeclarativepixmapcache \
qdeclarativeqt \
- qdeclarativeview \
- qdeclarativeviewer \
- qdeclarativexmlhttprequest \
- moduleqt47
+ qdeclarativexmlhttprequest
PRIVATETESTS += \
- qdeclarativeanchors \
- qdeclarativeanimatedimage \
qdeclarativeanimations \
qdeclarativeapplication \
qdeclarativebehaviors \
qdeclarativebinding \
- qdeclarativeborderimage \
qdeclarativeconnection \
qdeclarativedebug \
qdeclarativedebugclient \
qdeclarativedebughelper \
qdeclarativedebugservice \
qdeclarativeecmascript \
- qdeclarativeflickable \
- qdeclarativeflipable \
- qdeclarativefocusscope \
- qdeclarativefontloader \
- qdeclarativegridview \
- qdeclarativeimage \
qdeclarativeimageprovider \
qdeclarativeinstruction \
- qdeclarativeitem \
qdeclarativelanguage \
qdeclarativelistmodel \
- qdeclarativelistview \
- qdeclarativeloader \
- qdeclarativemousearea \
- qdeclarativepathview \
- qdeclarativepincharea \
- qdeclarativepositioners \
qdeclarativeproperty \
qdeclarativepropertymap \
- qdeclarativerepeater \
# qdeclarativescriptdebugging \
qdeclarativesmoothedanimation \
qdeclarativespringanimation \
@@ -67,12 +45,8 @@ PRIVATETESTS += \
qdeclarativesqldatabase \
qdeclarativestates \
qdeclarativesystempalette \
- qdeclarativetext \
- qdeclarativetextedit \
- qdeclarativetextinput \
qdeclarativetimer \
qdeclarativevaluetypes \
- qdeclarativevisualdatamodel \
qdeclarativeworkerscript \
qdeclarativexmllistmodel \
qpacketprotocol \
diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro
index 5b02c36ae9..8c3c030692 100644
--- a/tests/auto/declarative/examples/examples.pro
+++ b/tests/auto/declarative/examples/examples.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_examples.cpp
@@ -18,4 +18,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
deleted file mode 100644
index d44a902d07..0000000000
--- a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative network
-HEADERS += ../shared/testhttpserver.h
-SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp
-macx:CONFIG -= app_bundle
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-
-CONFIG += parallel_test
-
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/Double.qml b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml
index b247fcee5f..99ffca1d62 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/Double.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: container
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
index c5d5535bb7..9dcfcd8752 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 180; height: 200;
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml
index 3e7ebe7440..9634c2c169 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml
index 40235eee15..c121172a99 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml
index 0a8a7ea7f9..43e1ec8572 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 240
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml
index 118bbbc889..5341cb3d1c 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 240
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml
index 2599e70cc9..182efa0840 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 240
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml
index 5dafb0e344..f091e2430f 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml
index e2ce07fbfc..c0c0c65e3f 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml
index 6b8031769f..3eee0cfd35 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml
index 2563c01d4f..e7b4164e4e 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml
index aff69e5c12..e0e46dcef5 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml
index f0fdf9cfb5..9ef3da20c0 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400; height: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml
index a97b3fd5bf..76129dd15e 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml
index 9a77467820..1a7166e3f3 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml
index 04741ff348..909c533e7b 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: root
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml
index e6af9acc93..f0f730967c 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/properties.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml
index 60ec456c71..6b7f026e0b 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml
index e86eca1316..5eb65496d4 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml
index 04d41c64c1..dfe8ad17e7 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml
index e139f8c6c0..075fc9bc5a 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml
index 8e2b41db6c..968c5f6285 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml
index 6b846852ff..f06165604a 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml
index c9d8e95bd3..7d3b3b9c6d 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml
index 61e8a96788..1c31a79634 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml
index b023943007..a2ff746900 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml
index 7c88a7f038..d3db01efb0 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml
index fbef95e572..98898de8ef 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml
index 7dc29f9315..633da4e17f 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: rect
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml
index ac158df719..4dc42a1bd2 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 600; height: 200
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml
index 7d33ed7175..bec6fab368 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
color: "skyblue"
width: 500
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml
index fa9cd400ac..7a636b4003 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml
index f6343a1bff..9788761ee8 100644
--- a/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml
+++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
index b37714165c..2669e5a8e3 100644
--- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
+++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative opengl
SOURCES += tst_qdeclarativeanimations.cpp
macx:CONFIG -= app_bundle
@@ -13,4 +13,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private opengl-private
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index 00db2d43ae..cf911c6bef 100644
--- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -41,10 +41,10 @@
#include <qtest.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativeanimation_p.h>
-#include <private/qdeclarativeitem_p.h>
+#include <QtDeclarative/qsgview.h>
+#include <QtDeclarative/private/qsgrectangle_p.h>
+#include <QtDeclarative/private/qdeclarativeanimation_p.h>
+#include <QtDeclarative/private/qsgitem_p.h>
#include <QVariantAnimation>
#include <QEasingCurve>
@@ -101,32 +101,32 @@ private slots:
void tst_qdeclarativeanimations::simpleProperty()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativePropertyAnimation animation;
animation.setTarget(&rect);
- animation.setProperty("pos");
- animation.setTo(QPointF(200,200));
+ animation.setProperty("x");
+ animation.setTo(200);
QVERIFY(animation.target() == &rect);
- QVERIFY(animation.property() == "pos");
- QVERIFY(animation.to().toPointF() == QPointF(200,200));
+ QVERIFY(animation.property() == "x");
+ QVERIFY(animation.to().toReal() == 200.0);
animation.start();
QVERIFY(animation.isRunning());
QTest::qWait(animation.duration());
- QTIMED_COMPARE(rect.pos(), QPointF(200,200));
+ QTIMED_COMPARE(rect.x(), 200.0);
- rect.setPos(0,0);
+ rect.setPos(QPointF(0,0));
animation.start();
animation.pause();
QVERIFY(animation.isRunning());
QVERIFY(animation.isPaused());
animation.setCurrentTime(125);
QVERIFY(animation.currentTime() == 125);
- QCOMPARE(rect.pos(), QPointF(100,100));
+ QCOMPARE(rect.x(),100.0);
}
void tst_qdeclarativeanimations::simpleNumber()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativeNumberAnimation animation;
animation.setTarget(&rect);
animation.setProperty("x");
@@ -151,7 +151,7 @@ void tst_qdeclarativeanimations::simpleNumber()
void tst_qdeclarativeanimations::simpleColor()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativeColorAnimation animation;
animation.setTarget(&rect);
animation.setProperty("color");
@@ -185,7 +185,7 @@ void tst_qdeclarativeanimations::simpleColor()
void tst_qdeclarativeanimations::simpleRotation()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativeRotationAnimation animation;
animation.setTarget(&rect);
animation.setProperty("rotation");
@@ -211,7 +211,7 @@ void tst_qdeclarativeanimations::simpleRotation()
void tst_qdeclarativeanimations::alwaysRunToEnd()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativePropertyAnimation animation;
animation.setTarget(&rect);
animation.setProperty("x");
@@ -231,7 +231,7 @@ void tst_qdeclarativeanimations::alwaysRunToEnd()
void tst_qdeclarativeanimations::complete()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativePropertyAnimation animation;
animation.setTarget(&rect);
animation.setProperty("x");
@@ -252,7 +252,7 @@ void tst_qdeclarativeanimations::complete()
void tst_qdeclarativeanimations::resume()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativePropertyAnimation animation;
animation.setTarget(&rect);
animation.setProperty("x");
@@ -279,28 +279,28 @@ void tst_qdeclarativeanimations::resume()
void tst_qdeclarativeanimations::dotProperty()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativeNumberAnimation animation;
animation.setTarget(&rect);
animation.setProperty("border.width");
animation.setTo(10);
animation.start();
QTest::qWait(animation.duration()+50);
- QTIMED_COMPARE(rect.border()->width(), 10);
+ QTIMED_COMPARE(rect.border()->width(), 10.0);
rect.border()->setWidth(0);
animation.start();
animation.pause();
animation.setCurrentTime(125);
QVERIFY(animation.currentTime() == 125);
- QCOMPARE(rect.border()->width(), 5);
+ QCOMPARE(rect.border()->width(), 5.0);
}
void tst_qdeclarativeanimations::badTypes()
{
//don't crash
{
- QDeclarativeView *view = new QDeclarativeView;
+ QSGView *view = new QSGView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/badtype1.qml"));
qApp->processEvents();
@@ -334,12 +334,12 @@ void tst_qdeclarativeanimations::badTypes()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype4.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QSGItemPrivate::get(rect)->setState("state1");
QTest::qWait(1000 + 50);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect");
QVERIFY(myRect);
QCOMPARE(myRect->x(),qreal(200));
}
@@ -354,13 +354,13 @@ void tst_qdeclarativeanimations::badProperties()
QDeclarativeComponent c1(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml"));
QByteArray message = QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate non-existent property \"border.colr\"";
QTest::ignoreMessage(QtWarningMsg, message);
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c1.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c1.create());
QVERIFY(rect);
QDeclarativeComponent c2(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml"));
message = QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate read-only property \"border\"";
QTest::ignoreMessage(QtWarningMsg, message);
- rect = qobject_cast<QDeclarativeRectangle*>(c2.create());
+ rect = qobject_cast<QSGRectangle*>(c2.create());
QVERIFY(rect);
//### should we warn here are well?
@@ -376,12 +376,12 @@ void tst_qdeclarativeanimations::mixedTypes()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype1.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QSGItemPrivate::get(rect)->setState("state1");
QTest::qWait(500);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect");
QVERIFY(myRect);
//rather inexact -- is there a better way?
@@ -392,12 +392,12 @@ void tst_qdeclarativeanimations::mixedTypes()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QSGItemPrivate::get(rect)->setState("state1");
QTest::qWait(500);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect");
QVERIFY(myRect);
//rather inexact -- is there a better way?
@@ -412,10 +412,10 @@ void tst_qdeclarativeanimations::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -424,10 +424,10 @@ void tst_qdeclarativeanimations::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -436,10 +436,10 @@ void tst_qdeclarativeanimations::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties3.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(300));
@@ -448,10 +448,10 @@ void tst_qdeclarativeanimations::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties4.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->y(),qreal(200));
@@ -461,10 +461,10 @@ void tst_qdeclarativeanimations::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties5.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(100));
@@ -478,11 +478,11 @@ void tst_qdeclarativeanimations::propertiesTransition()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGItemPrivate::get(rect)->setState("moved");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -491,12 +491,12 @@ void tst_qdeclarativeanimations::propertiesTransition()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QSGItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(200));
QCOMPARE(myRect->y(),qreal(100));
QTest::qWait(waitDuration);
@@ -506,12 +506,12 @@ void tst_qdeclarativeanimations::propertiesTransition()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition3.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QSGItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(200));
QCOMPARE(myRect->y(),qreal(100));
}
@@ -519,12 +519,12 @@ void tst_qdeclarativeanimations::propertiesTransition()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition4.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QSGItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(100));
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -533,12 +533,12 @@ void tst_qdeclarativeanimations::propertiesTransition()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition5.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QSGItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(100));
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -547,12 +547,12 @@ void tst_qdeclarativeanimations::propertiesTransition()
/*{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition6.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QSGItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(100));
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(100));
@@ -561,11 +561,11 @@ void tst_qdeclarativeanimations::propertiesTransition()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition7.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QSGItemPrivate::get(rect)->setState("moved");
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -593,7 +593,7 @@ void tst_qdeclarativeanimations::attached()
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/attached.qml"));
QTest::ignoreMessage(QtDebugMsg, "off");
QTest::ignoreMessage(QtDebugMsg, "on");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
}
@@ -604,7 +604,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart()
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
@@ -617,7 +617,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart()
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
@@ -630,7 +630,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart()
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontAutoStart.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
@@ -649,7 +649,7 @@ void tst_qdeclarativeanimations::dontStart()
QString warning = c.url().toString() + ":14:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
@@ -664,7 +664,7 @@ void tst_qdeclarativeanimations::dontStart()
QString warning = c.url().toString() + ":15:17: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
@@ -677,7 +677,7 @@ void tst_qdeclarativeanimations::easingProperties()
{
{
QDeclarativeEngine engine;
- QString componentStr = "import QtQuick 1.0\nNumberAnimation { easing.type: \"InOutQuad\" }";
+ QString componentStr = "import QtQuick 2.0\nNumberAnimation { easing.type: \"InOutQuad\" }";
QDeclarativeComponent animationComponent(&engine);
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
@@ -688,7 +688,7 @@ void tst_qdeclarativeanimations::easingProperties()
{
QDeclarativeEngine engine;
- QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutBounce\"; easing.amplitude: 5.0 }";
+ QString componentStr = "import QtQuick 2.0\nPropertyAnimation { easing.type: \"OutBounce\"; easing.amplitude: 5.0 }";
QDeclarativeComponent animationComponent(&engine);
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
@@ -700,7 +700,7 @@ void tst_qdeclarativeanimations::easingProperties()
{
QDeclarativeEngine engine;
- QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutElastic\"; easing.amplitude: 5.0; easing.period: 3.0}";
+ QString componentStr = "import QtQuick 2.0\nPropertyAnimation { easing.type: \"OutElastic\"; easing.amplitude: 5.0; easing.period: 3.0}";
QDeclarativeComponent animationComponent(&engine);
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
@@ -713,7 +713,7 @@ void tst_qdeclarativeanimations::easingProperties()
{
QDeclarativeEngine engine;
- QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"InOutBack\"; easing.overshoot: 2 }";
+ QString componentStr = "import QtQuick 2.0\nPropertyAnimation { easing.type: \"InOutBack\"; easing.overshoot: 2 }";
QDeclarativeComponent animationComponent(&engine);
animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
@@ -728,15 +728,15 @@ void tst_qdeclarativeanimations::rotation()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/rotation.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *rr = rect->findChild<QDeclarativeRectangle*>("rr");
- QDeclarativeRectangle *rr2 = rect->findChild<QDeclarativeRectangle*>("rr2");
- QDeclarativeRectangle *rr3 = rect->findChild<QDeclarativeRectangle*>("rr3");
- QDeclarativeRectangle *rr4 = rect->findChild<QDeclarativeRectangle*>("rr4");
+ QSGRectangle *rr = rect->findChild<QSGRectangle*>("rr");
+ QSGRectangle *rr2 = rect->findChild<QSGRectangle*>("rr2");
+ QSGRectangle *rr3 = rect->findChild<QSGRectangle*>("rr3");
+ QSGRectangle *rr4 = rect->findChild<QSGRectangle*>("rr4");
- QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QSGItemPrivate::get(rect)->setState("state1");
QTest::qWait(800);
qreal r1 = rr->rotation();
qreal r2 = rr2->rotation();
@@ -759,10 +759,10 @@ void tst_qdeclarativeanimations::runningTrueBug()
//ensure we start correctly when "running: true" is explicitly set
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrueBug.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *cloud = rect->findChild<QDeclarativeRectangle*>("cloud");
+ QSGRectangle *cloud = rect->findChild<QSGRectangle*>("cloud");
QVERIFY(cloud);
QTest::qWait(1000);
QVERIFY(cloud->x() > qreal(0));
@@ -776,10 +776,10 @@ void tst_qdeclarativeanimations::nonTransitionBug()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/nonTransitionBug.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
- QDeclarativeRectangle *mover = rect->findChild<QDeclarativeRectangle*>("mover");
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
+ QSGRectangle *mover = rect->findChild<QSGRectangle*>("mover");
mover->setX(100);
QCOMPARE(mover->x(), qreal(100));
@@ -802,7 +802,7 @@ void tst_qdeclarativeanimations::registrationBug()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/registrationBug.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
QTRY_COMPARE(rect->property("value"), QVariant(int(100)));
}
@@ -812,7 +812,7 @@ void tst_qdeclarativeanimations::doubleRegistrationBug()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/doubleRegistrationBug.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation");
@@ -823,7 +823,7 @@ void tst_qdeclarativeanimations::doubleRegistrationBug()
//QTBUG-16736
void tst_qdeclarativeanimations::alwaysRunToEndRestartBug()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativePropertyAnimation animation;
animation.setTarget(&rect);
animation.setProperty("x");
diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
index c2cfcd89d6..264a95d8d6 100644
--- a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
+++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
@@ -43,9 +43,8 @@
#include "../../../shared/util.h"
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativeitem.h>
-#include <QtGui/qgraphicsview.h>
-#include <QtGui/qgraphicsscene.h>
+#include <QtDeclarative/qsgitem.h>
+#include <QtDeclarative/qsgview.h>
class tst_qdeclarativeapplication : public QObject
{
@@ -68,12 +67,11 @@ tst_qdeclarativeapplication::tst_qdeclarativeapplication()
void tst_qdeclarativeapplication::active()
{
QDeclarativeComponent component(&engine);
- component.setData("import QtQuick 1.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile(""));
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
+ component.setData("import QtQuick 2.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile(""));
+ QSGItem *item = qobject_cast<QSGItem *>(component.create());
QVERIFY(item);
- QGraphicsScene scene;
- QGraphicsView view(&scene);
- scene.addItem(item);
+ QSGView view;
+ item->setParentItem(view.rootObject());
// not active
QVERIFY(!item->property("active").toBool());
@@ -99,12 +97,11 @@ void tst_qdeclarativeapplication::active()
void tst_qdeclarativeapplication::layoutDirection()
{
QDeclarativeComponent component(&engine);
- component.setData("import QtQuick 1.0; Item { property bool layoutDirection: Qt.application.layoutDirection }", QUrl::fromLocalFile(""));
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
+ component.setData("import QtQuick 2.0; Item { property bool layoutDirection: Qt.application.layoutDirection }", QUrl::fromLocalFile(""));
+ QSGItem *item = qobject_cast<QSGItem *>(component.create());
QVERIFY(item);
- QGraphicsScene scene;
- QGraphicsView view(&scene);
- scene.addItem(item);
+ QSGView view;
+ item->setParentItem(view.rootObject());
// not mirrored
QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight);
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
index a452447f31..5aceefa743 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/color.qml b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
index c4b783a0f0..a318578a9b 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
index 88ddfaa1a7..f033ec5aeb 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml b/tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml
index aa384c335f..ed35a308f7 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: container
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
index f6cfa5e33d..20860d8dde 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
index e318dd2567..38e1ea9d9e 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: wrapper
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
index 6c78a84540..d8f115390a 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
index 3baa1ac23a..20875c30e3 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
index ddb5bbd40c..a05ab7d54b 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
index c0b71cdb04..2f3de5131c 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- Behavior on pos.x { NumberAnimation { duration: 500; } }
+ Behavior on border.width { NumberAnimation { duration: 500; } }
}
MouseArea {
id: clicker
@@ -17,7 +17,7 @@ Rectangle {
when: clicker.pressed
PropertyChanges {
target: rect
- pos.x: 200;
+ border.width: 4;
}
}
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml
index 8aa590bca1..6835902bc5 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 200
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
index 76379c00a2..3e8d88734d 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
index c5c78d1aa2..6357094cfe 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
index d19da298b2..f8c2731d86 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml b/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml
index 03b542164b..c6bef581a4 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 200
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
index 56ac216c5a..5731cb3efd 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml b/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml
index 25cdf10acf..4fd1136f3a 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: root
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
index c05cdaa940..ff71f2b1b0 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
index 6ba0118660..c64a6e1928 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
height: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/startup.qml b/tests/auto/declarative/qdeclarativebehaviors/data/startup.qml
index fca416c08c..9fa74ca39e 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/startup.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/startup.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml
index eb627613d4..0654ef3644 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 800;
diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
index 0861ab6286..e0720aa6fd 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
+++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative opengl
SOURCES += tst_qdeclarativebehaviors.cpp
macx:CONFIG -= app_bundle
@@ -13,4 +13,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private opengl-private
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index 01d0b321a1..191a96f81d 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -42,12 +42,12 @@
#include <qsignalspy.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativetext_p.h>
+#include <QtDeclarative/qsgview.h>
+#include <private/qsgrectangle_p.h>
+#include <private/qsgtext_p.h>
#include <private/qdeclarativebehavior_p.h>
#include <private/qdeclarativeanimation_p.h>
-#include <private/qdeclarativeitem_p.h>
+#include <private/qsgitem_p.h>
#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
@@ -88,13 +88,13 @@ void tst_qdeclarativebehaviors::simpleBehavior()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/simple.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
QTRY_VERIFY(qobject_cast<QDeclarativeBehavior*>(rect->findChild<QDeclarativeBehavior*>("MyBehavior"))->animation());
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ QSGItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200);
//i.e. the behavior has been triggered
delete rect;
@@ -104,12 +104,12 @@ void tst_qdeclarativebehaviors::scriptTriggered()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/scripttrigger.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
rect->setColor(QColor("red"));
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200);
//i.e. the behavior has been triggered
delete rect;
@@ -119,10 +119,10 @@ void tst_qdeclarativebehaviors::cppTriggered()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/cpptrigger.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QTRY_VERIFY(innerRect);
innerRect->setProperty("x", 200);
@@ -136,11 +136,11 @@ void tst_qdeclarativebehaviors::loop()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/loop.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
//don't crash
- QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QSGItemPrivate::get(rect)->setState("moved");
delete rect;
}
@@ -149,12 +149,12 @@ void tst_qdeclarativebehaviors::colorBehavior()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/color.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("red");
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->color() != QColor("red"));
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->color() != QColor("green"));
+ QSGItemPrivate::get(rect)->setState("red");
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->color() != QColor("red"));
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->color() != QColor("green"));
//i.e. the behavior has been triggered
delete rect;
@@ -164,12 +164,12 @@ void tst_qdeclarativebehaviors::parentBehavior()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/parent.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("reparented");
- QTRY_VERIFY(rect->findChild<QDeclarativeRectangle*>("MyRect")->parentItem() != rect->findChild<QDeclarativeItem*>("NewParent"));
- QTRY_VERIFY(rect->findChild<QDeclarativeRectangle*>("MyRect")->parentItem() == rect->findChild<QDeclarativeItem*>("NewParent"));
+ QSGItemPrivate::get(rect)->setState("reparented");
+ QTRY_VERIFY(rect->findChild<QSGRectangle*>("MyRect")->parentItem() != rect->findChild<QSGItem*>("NewParent"));
+ QTRY_VERIFY(rect->findChild<QSGRectangle*>("MyRect")->parentItem() == rect->findChild<QSGItem*>("NewParent"));
delete rect;
}
@@ -178,11 +178,11 @@ void tst_qdeclarativebehaviors::replaceBinding()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/binding.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGItemPrivate::get(rect)->setState("moved");
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QTRY_VERIFY(innerRect);
QTRY_VERIFY(innerRect->x() > 0);
QTRY_VERIFY(innerRect->x() < 200);
@@ -193,7 +193,7 @@ void tst_qdeclarativebehaviors::replaceBinding()
rect->setProperty("movedx", 210);
QTRY_COMPARE(innerRect->x(), (qreal)210);
- QDeclarativeItemPrivate::get(rect)->setState("");
+ QSGItemPrivate::get(rect)->setState("");
QTRY_VERIFY(innerRect->x() > 10);
QTRY_VERIFY(innerRect->x() < 210); //i.e. the behavior has been triggered
QTRY_COMPARE(innerRect->x(), (qreal)10);
@@ -207,30 +207,33 @@ void tst_qdeclarativebehaviors::replaceBinding()
void tst_qdeclarativebehaviors::group()
{
+ /* XXX TODO Create a test element for this case.
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupProperty.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
+ qDebug() << c.errorString();
QTRY_VERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QSGItemPrivate::get(rect)->setState("moved");
//QTest::qWait(200);
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200);
//i.e. the behavior has been triggered
delete rect;
}
+ */
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupProperty2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QTRY_VERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ QSGItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->border()->width() > 0);
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->border()->width() < 4);
//i.e. the behavior has been triggered
delete rect;
@@ -241,11 +244,11 @@ void tst_qdeclarativebehaviors::emptyBehavior()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/empty.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
+ QSGItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x();
QCOMPARE(x, qreal(200)); //should change immediately
delete rect;
@@ -255,12 +258,12 @@ void tst_qdeclarativebehaviors::explicitSelection()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/explicit.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
- QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ QSGItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200);
//i.e. the behavior has been triggered
delete rect;
@@ -270,11 +273,11 @@ void tst_qdeclarativebehaviors::nonSelectingBehavior()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/nonSelecting2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
+ QSGItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x();
QCOMPARE(x, qreal(200)); //should change immediately
delete rect;
@@ -286,7 +289,7 @@ void tst_qdeclarativebehaviors::reassignedAnimation()
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml"));
QString warning = QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:9: QML Behavior: Cannot change the animation assigned to a Behavior.";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QCOMPARE(qobject_cast<QDeclarativeNumberAnimation*>(
rect->findChild<QDeclarativeBehavior*>("MyBehavior")->animation())->duration(), 200);
@@ -298,12 +301,12 @@ void tst_qdeclarativebehaviors::disabled()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/disabled.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QCOMPARE(rect->findChild<QDeclarativeBehavior*>("MyBehavior")->enabled(), false);
- QDeclarativeItemPrivate::get(rect)->setState("moved");
- qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
+ QSGItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x();
QCOMPARE(x, qreal(200)); //should change immediately
delete rect;
@@ -317,7 +320,7 @@ void tst_qdeclarativebehaviors::dontStart()
QString warning = c.url().toString() + ":13:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
@@ -332,10 +335,10 @@ void tst_qdeclarativebehaviors::startup()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect");
+ QSGRectangle *innerRect = rect->findChild<QSGRectangle*>("innerRect");
QVERIFY(innerRect);
QCOMPARE(innerRect->x(), qreal(100)); //should be set immediately
@@ -346,13 +349,13 @@ void tst_qdeclarativebehaviors::startup()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect");
+ QSGRectangle *innerRect = rect->findChild<QSGRectangle*>("innerRect");
QVERIFY(innerRect);
- QDeclarativeText *text = rect->findChild<QDeclarativeText*>();
+ QSGText *text = rect->findChild<QSGText*>();
QVERIFY(text);
QCOMPARE(innerRect->x(), text->width()); //should be set immediately
@@ -366,7 +369,7 @@ void tst_qdeclarativebehaviors::groupedPropertyCrash()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupedPropertyCrash.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect); //don't crash
}
@@ -375,7 +378,7 @@ void tst_qdeclarativebehaviors::runningTrue()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrue.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
QDeclarativeAbstractAnimation *animation = rect->findChild<QDeclarativeAbstractAnimation*>("rotAnim");
@@ -391,16 +394,17 @@ void tst_qdeclarativebehaviors::sameValue()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/qtbug12295.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *target = rect->findChild<QDeclarativeRectangle*>("myRect");
+ QSGRectangle *target = rect->findChild<QSGRectangle*>("myRect");
QVERIFY(target);
target->setX(100);
QCOMPARE(target->x(), qreal(100));
target->setProperty("x", 0);
+ qDebug() << "x" << target->x();
QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
QTRY_VERIFY(target->x() == qreal(0)); //make sure Behavior has finished.
@@ -419,10 +423,10 @@ void tst_qdeclarativebehaviors::delayedRegistration()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/delayedRegistration.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItem *innerRect = rect->property("myItem").value<QDeclarativeItem*>();
+ QSGItem *innerRect = rect->property("myItem").value<QSGItem*>();
QVERIFY(innerRect != 0);
QCOMPARE(innerRect->property("x").toInt(), int(0));
diff --git a/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml b/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml
index 94497368a7..87aabe975a 100644
--- a/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml
+++ b/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: screen
diff --git a/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml b/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml
index 3e99e2b5e6..4a08141d11 100644
--- a/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml
+++ b/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: screen
diff --git a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
index 127309e1e4..7bfd0e07ff 100644
--- a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
+++ b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
@@ -42,7 +42,6 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativebind_p.h>
-#include <private/qdeclarativerectangle_p.h>
#include <private/qsgrectangle_p.h>
#include "../../../shared/util.h"
@@ -75,7 +74,7 @@ void tst_qdeclarativebinding::binding()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-binding.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
QDeclarativeBind *binding3 = qobject_cast<QDeclarativeBind*>(rect->findChild<QDeclarativeBind*>("binding3"));
@@ -103,7 +102,7 @@ void tst_qdeclarativebinding::whenAfterValue()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-binding2.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
QCOMPARE(rect->color(), QColor("yellow"));
diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
deleted file mode 100644
index aeb8a5dfcd..0000000000
--- a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui network
-macx:CONFIG -= app_bundle
-
-HEADERS += ../shared/testhttpserver.h
-SOURCES += tst_qdeclarativeborderimage.cpp ../shared/testhttpserver.cpp
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-
-CONFIG += parallel_test
-
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qdeclarativecomponent/data/createObject.qml b/tests/auto/declarative/qdeclarativecomponent/data/createObject.qml
index 4a067911df..da5db8e8e6 100644
--- a/tests/auto/declarative/qdeclarativecomponent/data/createObject.qml
+++ b/tests/auto/declarative/qdeclarativecomponent/data/createObject.qml
@@ -1,16 +1,13 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item{
id: root
property QtObject qobject : null
property QtObject declarativeitem : null
- property QtObject graphicswidget: null
Component{id: a; QtObject{} }
Component{id: b; Item{} }
- Component{id: c; QGraphicsWidget{} }
Component.onCompleted: {
root.qobject = a.createObject(root);
root.declarativeitem = b.createObject(root);
- root.graphicswidget = c.createObject(root);
}
}
diff --git a/tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml b/tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml
index 0da3bda50f..122c6a87c8 100644
--- a/tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml
+++ b/tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item{
id: root
diff --git a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
index 93dc567c6a..9cbc98d75a 100644
--- a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
+++ b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
@@ -41,10 +41,9 @@
#include <qtest.h>
#include <QDebug>
-#include <QtGui/qgraphicsitem.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtDeclarative/qsgitem.h>
#include <QtDeclarative/qdeclarativeproperty.h>
#include <qcolor.h>
@@ -111,21 +110,14 @@ void tst_qdeclarativecomponent::qmlCreateObject()
QObject *testObject2 = object->property("declarativeitem").value<QObject*>();
QVERIFY(testObject2);
QVERIFY(testObject2->parent() == object);
- QCOMPARE(testObject2->metaObject()->className(), "QDeclarativeItem");
-
- //Note that QGraphicsObjects are not exposed to QML for instantiation, and so can't be used in a component directly
- //Also this is actually the extended type QDeclarativeGraphicsWidget, but it still doesn't inherit QDeclarativeItem
- QGraphicsObject *testObject3 = qobject_cast<QGraphicsObject*>(object->property("graphicswidget").value<QObject*>());
- QVERIFY(testObject3);
- QVERIFY(testObject3->parent() == object);
- QVERIFY(testObject3->parentItem() == qobject_cast<QGraphicsObject*>(object));
- QCOMPARE(testObject3->metaObject()->className(), "QDeclarativeGraphicsWidget");
+ QCOMPARE(testObject2->metaObject()->className(), "QSGItem");
}
void tst_qdeclarativecomponent::qmlCreateObjectWithProperties()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/createObjectWithScript.qml"));
+ qDebug() << component.errorString();
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
QObject *object = component.create();
QVERIFY(object != 0);
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml
index dd92cb9c67..154c309c9c 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
Component {
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
index 459c34617b..05d06bda94 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: screen
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
index 8eddf43fe6..9d25cba649 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: screen
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
index 953347a3b2..bcd281256f 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: screen
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml
index 3702bdbe73..ad8d4d91a8 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: screen
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-object.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-object.qml
index 376a2182fe..256b2626a7 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/error-object.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-object.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
Connections {
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-property.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-property.qml
index 677af152ce..a602479783 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/error-property.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-property.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
Connections { fakeProperty: {} }
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml
index 127e58e657..8123afe707 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
Connections { onfakeProperty: {} }
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml
index 6a82528e1a..16c0534b68 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
Connections {
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml
index c5990830cd..ce851fc3db 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: screen; width: 50
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml
index f0dbaba5a6..b23d2fc145 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
Connections { id: connection; target: connection; onTargetChanged: 1 == 1 }
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml
index 94c9c7ca7f..9e88f0ff8f 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
Connections {}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml
index 00507d919c..6692050deb 100644
--- a/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml
+++ b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: screen; width: 50
diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
index 56bf59f851..564b088817 100644
--- a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
+++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private opengl-private
diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
index f0edf40b87..37cce5c578 100644
--- a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
+++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
@@ -42,7 +42,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativeconnections_p.h>
-#include <private/qdeclarativeitem_p.h>
+#include <private/qsgitem_p.h>
#include "../../../shared/util.h"
#include <QtDeclarative/qdeclarativescriptstring.h>
@@ -107,7 +107,7 @@ void tst_qdeclarativeconnection::connection()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection.qml"));
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QSGItem *item = qobject_cast<QSGItem*>(c.create());
QVERIFY(item != 0);
@@ -124,7 +124,7 @@ void tst_qdeclarativeconnection::trimming()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/trimming.qml"));
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QSGItem *item = qobject_cast<QSGItem*>(c.create());
QVERIFY(item != 0);
@@ -145,18 +145,18 @@ void tst_qdeclarativeconnection::targetChanged()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/connection-targetchange.qml"));
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QSGItem *item = qobject_cast<QSGItem*>(c.create());
QVERIFY(item != 0);
QDeclarativeConnections *connections = item->findChild<QDeclarativeConnections*>("connections");
QVERIFY(connections);
- QDeclarativeItem *item1 = item->findChild<QDeclarativeItem*>("item1");
+ QSGItem *item1 = item->findChild<QSGItem*>("item1");
QVERIFY(item1);
item1->setWidth(200);
- QDeclarativeItem *item2 = item->findChild<QDeclarativeItem*>("item2");
+ QSGItem *item2 = item->findChild<QSGItem*>("item2");
QVERIFY(item2);
QVERIFY(connections->target() == item2);
@@ -190,7 +190,7 @@ void tst_qdeclarativeconnection::unknownSignals()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, url);
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QSGItem *item = qobject_cast<QSGItem*>(c.create());
QVERIFY(item != 0);
// check that connection is created (they are all runtime errors)
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
index 8871e45f4f..ade51c43f6 100644
--- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -50,13 +50,13 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeexpression.h>
#include <QtDeclarative/qdeclarativeproperty.h>
+#include <QtDeclarative/qsgitem.h>
#include <private/qdeclarativebinding_p.h>
#include <private/qdeclarativedebug_p.h>
#include <private/qdeclarativeenginedebug_p.h>
#include <private/qdeclarativedebugclient_p.h>
#include <private/qdeclarativedebugservice_p.h>
-#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativemetatype_p.h>
#include <private/qdeclarativeproperty_p.h>
#include <private/qdeclarativedebughelper_p.h>
@@ -84,7 +84,7 @@ private:
QDeclarativeDebugConnection *m_conn;
QDeclarativeEngineDebug *m_dbg;
QDeclarativeEngine *m_engine;
- QDeclarativeItem *m_rootItem;
+ QSGItem *m_rootItem;
QObjectList m_components;
@@ -228,7 +228,7 @@ void tst_QDeclarativeDebug::recursiveObjectTest(QObject *o, const QDeclarativeDe
QCOMPARE(p.value(), pmeta.read(o));
if (p.name() == "parent")
- QVERIFY(p.valueTypeName() == "QGraphicsObject*" || p.valueTypeName() == "QDeclarativeItem*");
+ QVERIFY(p.valueTypeName() == "QGraphicsObject*" || p.valueTypeName() == "QSGItem*");
else
QCOMPARE(p.valueTypeName(), QString::fromUtf8(pmeta.typeName()));
@@ -303,7 +303,7 @@ void tst_QDeclarativeDebug::initTestCase()
m_engine = new QDeclarativeEngine(this);
QList<QByteArray> qml;
- qml << "import QtQuick 1.0\n"
+ qml << "import QtQuick 2.0\n"
"import Test 1.0\n"
"Item {"
"id: root\n"
@@ -326,11 +326,11 @@ void tst_QDeclarativeDebug::initTestCase()
"}";
// add second component to test multiple root contexts
- qml << "import QtQuick 1.0\n"
+ qml << "import QtQuick 2.0\n"
"Item {}";
// and a third to test methods
- qml << "import QtQuick 1.0\n"
+ qml << "import QtQuick 2.0\n"
"Item {"
"function myMethodNoArgs() { return 3; }\n"
"function myMethod(a) { return a + 9; }\n"
@@ -338,7 +338,7 @@ void tst_QDeclarativeDebug::initTestCase()
"}";
// and a fourth to test states
- qml << "import QtQuick 1.0\n"
+ qml << "import QtQuick 2.0\n"
"Rectangle {\n"
"id:rootRect\n"
"width:100\n"
@@ -369,9 +369,9 @@ void tst_QDeclarativeDebug::initTestCase()
QDeclarativeComponent component(m_engine);
component.setData(qml[i], QUrl::fromLocalFile(""));
QVERIFY(component.isReady()); // fails if bad syntax
- m_components << qobject_cast<QDeclarativeItem*>(component.create());
+ m_components << qobject_cast<QSGItem*>(component.create());
}
- m_rootItem = qobject_cast<QDeclarativeItem*>(m_components.first());
+ m_rootItem = qobject_cast<QSGItem*>(m_components.first());
// add an extra context to test for multiple contexts
QDeclarativeContext *context = new QDeclarativeContext(m_engine->rootContext(), this);
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml
index 0eda67d51a..e8e108fa44 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml
index f539fb62b4..062772106b 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyTypeObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml
index a4b0527436..823c0ef367 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml
index 4a42518575..aa1a1d6061 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string greeting: "hello world"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml
index 829d405c3c..eaca0a7f92 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
function testFunction() { return 19; }
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
index f542c64a91..3b3e84a900 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int b: obj.prop.a
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml
index df494af5a1..f341cce3c9 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int a: 3
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml
index 3427a3b27a..f6398d254d 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int children: root.children.length
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml
index f0808c4cb8..ff6c553c31 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml
index 4f07cbf616..bba9033235 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: me
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml
index 937ae91c9b..3e4cda6ba3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml
index a01dc5b0b2..de5f49ffc5 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: me
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml
index da6c795b12..f228b2c19f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml
index 5bf9f6a2ed..b5bc280d11 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: me
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml
index a23ad4a0dd..6c16ff5604 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: me
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml
index ac20371472..441098bd39 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: me
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml
index 9443c01d50..86ff6b6bb3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyTypeObject {
Component.onCompleted: {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml
index c66ef6939e..11fb7ccad2 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml
index 68dbcfad97..31f7c44fcc 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int a: 10
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml
index 0f23297570..3fbf931fca 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
objectProperty: MyQmlObject {}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.1.qml
index 3182d6b4ab..1e92aca825 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.1.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int changeCount: 0
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.2.qml
index 50ef0b34dd..3549d8c556 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int changeCount: 0
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.3.qml
index 343cf91720..d611e0fe30 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int changeCount: 0
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.4.qml
index b8459875df..a6862517c6 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.4.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int changeCount: 0
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlots.qml b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlots.qml
index d31c89382b..f91fb71f1f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlots.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlots.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int changeCount: 0
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
index 58b7adb841..7c46306772 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
//real
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml
index 1af77d5aff..e97b75c8d0 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property CustomObject myObject
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml
index 18a57ba625..308a01ce6f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyDeferredObject {
value: undefined // error is resolved before complete
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml
index 131fa6f2b8..2a9ce44b20 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
index 4de405dcce..97acddf5fc 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
function calculate() {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
index 7ba51ef068..24c12bf694 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
index 661cd5c4d9..a752b8c0d3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test1: false;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml
index 2102821aac..b8d5e5e60f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml
index c197ef8335..a4ce55e245 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml
index 9738d2cf24..2c382e871a 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property MyExtendedObject a;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
index b0e897efff..7734a11dd8 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyExtendedObject
{
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
index 6cd8751c93..af2da7023c 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test1: false;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
index c8c926aea8..0f78eaf1dc 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "functionAssignment.js" as Script
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
index 2ba02d1d76..230a626600 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
function myFunction() {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
index 6dcdefcbca..ece23269f1 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
objectProperty: if(1) otherObject
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
index 32b86110e4..650ed7c73e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
objectProperty: otherObject
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/in.qml b/tests/auto/declarative/qdeclarativeecmascript/data/in.qml
index f9cccb5a5c..f84c9a1481 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/in.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/in.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
index 61b0461833..5ce2ed78ec 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "include.js" as IncludeTest
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
index 1633ebaa25..fbebcdcd58 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "include_callback.js" as IncludeTest
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml
index a648969426..7b23c76baa 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "include_pragma_outer.js" as Script
Item {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
index 0dfc74ff20..fe020a55df 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "include_remote.js" as IncludeTest
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
index 05a7399601..e8ef609fed 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "include_remote_missing.js" as IncludeTest
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
index e9f1c89bd8..28b1003fd4 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "include_shared.js" as IncludeTest
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml
index 6ab25f272a..160a90b574 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml
index 87b2d7e4a0..4612273727 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml
index e93007ab9a..4223c25f31 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int test
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleOne.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleOne.qml
index 698b672259..97c72bd9a6 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleOne.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleOne.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "importPragmaLibrary.js" as TestPragmaLibraryImport
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleTwo.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleTwo.qml
index 581ae671e3..d006343782 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleTwo.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleTwo.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "importPragmaLibrary.js" as TestPragmaLibraryImport
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImport.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImport.qml
index 4a284ad886..456a10c7f0 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImport.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImport.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "testScriptImport.js" as TestScriptImport
import "testModuleImport.js" as TestModuleImport
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibrary.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibrary.qml
index 7add311326..29de15c197 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibrary.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibrary.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
// We use the components specified in SpecialRectangleOne.qml and SpecialRectangleTwo.qml
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportScoping.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportScoping.qml
index 0df841c78c..aff61cc436 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportScoping.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportScoping.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
// For backward compatibility, importing a script which has no imports,
// should run the script in the parent context. See QTBUG-17518.
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFive.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFive.qml
index 9bf969cc61..73193a35a5 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFive.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFive.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
// This should fail, since if the script does have imports
// of its own, it should run in its own context.
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFour.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFour.qml
index fe7e88a829..ef2fc591b3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFour.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFour.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "testModuleImport.js" as TestModuleImport
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failOne.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failOne.qml
index e7fb7656f0..d0c37ad9ba 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failOne.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failOne.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "testScriptImport.js" as TestScriptImport
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failThree.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failThree.qml
index fa720a64eb..edd103bd82 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failThree.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failThree.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "testModuleImport.js" as TestModuleImport
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failTwo.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failTwo.qml
index c2cbce9f80..28e2026f8d 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failTwo.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failTwo.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "testScriptImport.js" as TestScriptImport
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testImportPragmaLibrary.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testImportPragmaLibrary.qml
index 7e4a73ae42..f04ce007d8 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testImportPragmaLibrary.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testImportPragmaLibrary.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "importPragmaLibrary.js" as ImportPragmaLibrary
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
index c0789424de..5884e2719b 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "libraryScriptAssert.js" as Test
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
index 7b940758ea..bdb1265a21 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
index 7940ab8c3d..690024b928 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test: children
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml
index 81ea536651..6ebe4790bb 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml
@@ -1,5 +1,5 @@
import Qt.test 1.1
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant a
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml
index 44d421e8ee..8a7e24d788 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyRevisionedClass
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml
index 121642e0cf..43e87948cd 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyRevisionedSubclass
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml
index 123650e4e8..2f82d685fa 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.1
MyRevisionedSubclass
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml
index 1090b48f74..365780a560 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
function testFunction() { return 19; }
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml
index 34c50d6647..a3bd7bebf8 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
MethodsObject {
function testFunction2() { return 17; }
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml
index bebdf3d883..ede2759e2e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property alias blah: item.x
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApi.qml b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApi.qml
index 23c1eb0bb8..67e8c1b08a 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApi.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApi.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0 as QtTest // module API installed into existing uri
import Qt.test.scriptApi 1.0 as QtTestScriptApi // script module API installed into new uri
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiCaching.qml b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiCaching.qml
index 9cee8c3065..f6ce2058a7 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiCaching.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiCaching.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0 as QtTest // module API installed into existing uri
import Qt.test.scriptApi 1.0 as QtTestScriptApi // script module API installed into new uri
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMajorVersionFail.qml b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMajorVersionFail.qml
index eca29ab2cf..fb050f65bc 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMajorVersionFail.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMajorVersionFail.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
// this qml file attempts to import an invalid version of a qobject module API.
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMinorVersionFail.qml b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMinorVersionFail.qml
index e360bd1668..e06be667f7 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMinorVersionFail.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMinorVersionFail.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
// this qml file attempts to import an invalid version of a qobject module API.
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiWriting.qml b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiWriting.qml
index 90a674681c..500c35e211 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiWriting.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/moduleApiWriting.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0 as QtTest // module API installed into existing uri
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml
index d9c63e67bd..e349ced98f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string test: thing.stringProperty
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml
index 9e0bcf09bb..23276f778d 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml
index 7e7da8d7a8..b4a417e04e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml
index e86cc961af..e96df6b40e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
index cbd2d3e7e8..1aee7a1670 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property QtObject test
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml
index ca8c90d818..20b9ec2935 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
objectName: "hello"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
index ef0e304ac1..845f74b1aa 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
index 53427b76e5..855a264995 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Component.onCompleted: { var a = getObject(); a = null; }
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
index 0455271dac..34523ec1c7 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml
index 7deb84a1be..53711db3f4 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyDerivedObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
index 2e9e1736cb..3c1986d721 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int test: getObjects().length
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
index 02357d45f4..90263e5124 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string test: "aaaa"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
index 7fcf2bebd7..6c7e8806e6 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "qtbug_11600.js" as Test
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
index 05c482cae7..b1b062ed35 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
index e531efcd5a..90711c8d09 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml b/tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml
index cbbbbf921a..a9e7dd2a95 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/ScarceResourceSignalComponent.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/ScarceResourceSignalComponent.qml
index fb40bdc2de..e10fcfe36a 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/ScarceResourceSignalComponent.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/ScarceResourceSignalComponent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant scarceResourceCopy
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopy.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopy.qml
index 82184354d8..ee5b05b28a 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopy.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopy.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
// Here we import a scarce resource directly.
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyFromJs.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyFromJs.qml
index 60c26ac4f2..40f6d7bbd6 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyFromJs.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyFromJs.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
import "scarceResourceTest.js" as ScarceResourceProviderJs
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImport.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImport.qml
index 0513b0840e..08acc1b694 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImport.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImport.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
import "scarceResourceCopyImport.js" as ScarceResourceCopyImportJs
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportFail.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportFail.qml
index d3c4d4ed65..613d3a8ee8 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportFail.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportFail.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
import "scarceResourceCopyImportFail.js" as ScarceResourceCopyImportFailJs
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportNoBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportNoBinding.qml
index 72cd4dac8a..81deec0713 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportNoBinding.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportNoBinding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
// the following js import doesn't manually preserve or destroy any resources
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyNoBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyNoBinding.qml
index 681a382427..4adef39980 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyNoBinding.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyNoBinding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceDestroyedCopy.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceDestroyedCopy.qml
index 87ceda9d7a..e47c37aba3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceDestroyedCopy.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceDestroyedCopy.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
import "scarceResourceTest.js" as ScarceResourceProviderJs
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunction.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunction.qml
index e3e7aed9ee..fe3707b5d3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunction.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunction.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
// Here we import a scarce resource directly.
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunctionFail.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunctionFail.qml
index 9b07080054..38de0ae0aa 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunctionFail.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunctionFail.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
// In this example, a common syntax error will only be "caught"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceSignal.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceSignal.qml
index 9c920b1aa0..1d5a39c52d 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceSignal.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceSignal.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTest.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTest.qml
index 3775172c04..1d4e67055e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTest.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTest.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
// Here we import a scarce resource directly, and use it in a binding.
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestMultiple.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestMultiple.qml
index 3139382b05..9a6ee30ff1 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestMultiple.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestMultiple.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
import "scarceResourceTest.js" as ScarceResourceProviderJs
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestPreserve.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestPreserve.qml
index d810377a51..d7a40312ab 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestPreserve.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestPreserve.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
import "scarceResourceTest.js" as ScarceResourceProviderJs
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml
index 9555b7f95b..fe1c4c7931 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int a: 0
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
index 0b0770e6b9..9add81809c 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.5.qml
index 405746c459..6dbcbe2a40 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.5.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property bool test1: false;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.6.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.6.qml
index 1c81e4e945..5897b533d7 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.6.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.6.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: me
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml
index 63dba2fc9f..a00352b684 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml
index 65697d9382..ace473756e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "scriptConnect.1.js" as Script
MyQmlObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml
index 86ff7987d8..cdf2d6ad98 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "scriptConnect.2.js" as Script
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml
index db2f00578c..b0e40565c0 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml
index a2d90ff819..ef5331c94a 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml
index 21fac15d69..8dcacbcbb7 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml
index 4053091988..06b6f0fa62 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "scriptConnect.6.js" as Script
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml
index bbe70249ba..e546ee44d8 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "scriptDisconnect.1.js" as Script
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml
index 8a166f41ff..e70cd8b900 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "scriptDisconnect.1.js" as Script
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml
index 548f2a12f7..6f47776ea5 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "scriptDisconnect.1.js" as Script
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml
index 11b22d7216..b3887545fb 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "scriptDisconnect.1.js" as Script
MyQmlObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml
index 2d090b8f0d..b967f0984c 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml
index 7a6aba74be..b30aa8b4cd 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int test: myObject.object.a
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml
index 8410d33319..d98d7e9c81 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
property real base: 50
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml
index 2932c77826..e709e3a8bd 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test1: (a === true)
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
index 1e5afdf54a..c44acf4fd1 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
index 60d39fa171..451bb51996 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant obj: nested
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
index 849dfadd4f..6aa8480365 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool runTest: false
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
index 31bf69d33f..3854b069a0 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml
index 035f0374e8..a1ba5df071 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
deleted file mode 100644
index f0c95f071a..0000000000
--- a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui network
-macx:CONFIG -= app_bundle
-
-HEADERS += ../shared/testhttpserver.h
-SOURCES += tst_qdeclarativefontloader.cpp ../shared/testhttpserver.cpp
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-
-CONFIG += parallel_test
-
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
deleted file mode 100644
index 75837d7359..0000000000
--- a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui network
-macx:CONFIG -= app_bundle
-
-HEADERS += ../shared/testhttpserver.h
-SOURCES += tst_qdeclarativeimage.cpp ../shared/testhttpserver.cpp
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-
-CONFIG += parallel_test
-
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
index cc42aa06ca..6ddc3bcb58 100644
--- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
+++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
@@ -42,7 +42,7 @@
#include <QtTest/QtTest>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativeimageprovider.h>
-#include <private/qdeclarativeimage_p.h>
+#include <private/qsgimage_p.h>
#include <QImageReader>
#include <QWaitCondition>
#include "../../../shared/util.h"
@@ -229,24 +229,24 @@ void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvide
engine.addImageProvider("test", provider);
QVERIFY(engine.imageProvider("test") != 0);
- QString componentStr = "import QtQuick 1.0\nImage { source: \"" + source + "\"; "
+ QString componentStr = "import QtQuick 2.0\nImage { source: \"" + source + "\"; "
+ (async ? "asynchronous: true; " : "")
+ properties + " }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QSGImage *obj = qobject_cast<QSGImage*>(component.create());
QVERIFY(obj != 0);
if (async)
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->status() == QSGImage::Loading);
QCOMPARE(obj->source(), QUrl(source));
if (error.isEmpty()) {
if (async)
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QSGImage::Ready);
else
- QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QVERIFY(obj->status() == QSGImage::Ready);
if (QByteArray(QTest::currentDataTag()).startsWith("qimage"))
QCOMPARE(static_cast<TestQImageProvider*>(provider)->lastImageId, imageId);
else
@@ -254,15 +254,13 @@ void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvide
QCOMPARE(obj->width(), qreal(size.width()));
QCOMPARE(obj->height(), qreal(size.height()));
- QCOMPARE(obj->pixmap().width(), size.width());
- QCOMPARE(obj->pixmap().height(), size.height());
- QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->fillMode(), QSGImage::Stretch);
QCOMPARE(obj->progress(), 1.0);
} else {
if (async)
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Error);
+ QTRY_VERIFY(obj->status() == QSGImage::Error);
else
- QVERIFY(obj->status() == QDeclarativeImage::Error);
+ QVERIFY(obj->status() == QSGImage::Error);
}
delete obj;
@@ -313,10 +311,10 @@ void tst_qdeclarativeimageprovider::requestPixmap_async()
QVERIFY(engine.imageProvider("test") != 0);
// pixmaps are loaded synchronously regardless of 'asynchronous' value
- QString componentStr = "import QtQuick 1.0\nImage { asynchronous: true; source: \"image://test/pixmap-async-test.png\" }";
+ QString componentStr = "import QtQuick 2.0\nImage { asynchronous: true; source: \"image://test/pixmap-async-test.png\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QSGImage *obj = qobject_cast<QSGImage*>(component.create());
QVERIFY(obj != 0);
delete obj;
@@ -340,13 +338,13 @@ void tst_qdeclarativeimageprovider::removeProvider()
QVERIFY(engine.imageProvider("test") != 0);
// add provider, confirm it works
- QString componentStr = "import QtQuick 1.0\nImage { source: \"" + newImageFileName() + "\" }";
+ QString componentStr = "import QtQuick 2.0\nImage { source: \"" + newImageFileName() + "\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QSGImage *obj = qobject_cast<QSGImage*>(component.create());
QVERIFY(obj != 0);
- QCOMPARE(obj->status(), QDeclarativeImage::Ready);
+ QCOMPARE(obj->status(), QSGImage::Ready);
// remove the provider and confirm
QString fileName = newImageFileName();
@@ -356,7 +354,7 @@ void tst_qdeclarativeimageprovider::removeProvider()
engine.removeImageProvider("test");
obj->setSource(QUrl(fileName));
- QCOMPARE(obj->status(), QDeclarativeImage::Error);
+ QCOMPARE(obj->status(), QSGImage::Error);
delete obj;
}
@@ -401,7 +399,7 @@ void tst_qdeclarativeimageprovider::threadTest()
engine.addImageProvider("test_thread", provider);
QVERIFY(engine.imageProvider("test_thread") != 0);
- QString componentStr = "import QtQuick 1.0\nItem { \n"
+ QString componentStr = "import QtQuick 2.0\nItem { \n"
"Image { source: \"image://test_thread/blue\"; asynchronous: true; }\n"
"Image { source: \"image://test_thread/red\"; asynchronous: true; }\n"
"Image { source: \"image://test_thread/green\"; asynchronous: true; }\n"
@@ -412,17 +410,17 @@ void tst_qdeclarativeimageprovider::threadTest()
QObject *obj = component.create();
//MUST not deadlock
QVERIFY(obj != 0);
- QList<QDeclarativeImage *> images = obj->findChildren<QDeclarativeImage *>();
+ QList<QSGImage *> images = obj->findChildren<QSGImage *>();
QCOMPARE(images.count(), 4);
QTest::qWait(100);
- foreach(QDeclarativeImage *img, images) {
- QCOMPARE(img->status(), QDeclarativeImage::Loading);
+ foreach(QSGImage *img, images) {
+ QCOMPARE(img->status(), QSGImage::Loading);
}
provider->ok = true;
provider->cond.wakeAll();
QTest::qWait(250);
- foreach(QDeclarativeImage *img, images) {
- QTRY_VERIFY(img->status() == QDeclarativeImage::Ready);
+ foreach(QSGImage *img, images) {
+ QTRY_VERIFY(img->status() == QSGImage::Ready);
}
}
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/NestedComponent.qml b/tests/auto/declarative/qdeclarativeinfo/data/NestedComponent.qml
index d8ae8ae3ba..cfe47589df 100644
--- a/tests/auto/declarative/qdeclarativeinfo/data/NestedComponent.qml
+++ b/tests/auto/declarative/qdeclarativeinfo/data/NestedComponent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant nested
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml
index a2afb6102a..4b19b11699 100644
--- a/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml
+++ b/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant nested
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml
index f3516c606c..d199a612c4 100644
--- a/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml
+++ b/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant nested
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml
index 937cd641e6..6a8e2fbc90 100644
--- a/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml
+++ b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant nested
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml
index 6a33deffad..2cb7cbe2e0 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml
index 919f5d86a2..134e1440b5 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant other
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml
index 3f73538b24..54b548e049 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property alias obj : otherObj
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml
index 428790d83d..e09eca2ff3 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
Alias3 {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml
index 0bc2025414..9265ffb1df 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml b/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml
index 9349a93877..889450b565 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
QtObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml
index cf32b45687..addc4265a9 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml
index 0687ce3995..f48a77598c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml b/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml
index 5de8a4a76e..4667adda14 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int super_a: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml b/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml
index 3a7022bdcd..c2ab70ffd6 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant child
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml
index 4526cf043e..42513e463f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property InlineAssignmentsOverrideBindingsType2 nested: InlineAssignmentsOverrideBindingsType2 {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml
index 4127ca4375..4a45535a50 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int value
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml
index f63283e773..59df88216e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml
index 8aaddacec4..7d49b0ac98 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property QtObject o1
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml
index 0ba4bd6d6f..06a3212916 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
x: "You can't assign a string to a real!"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml b/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml
index c2ac5c8458..947f14811f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
property int a: Math.max(10, 9)
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml b/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml
index c3d0e1ef47..11fb9d9578 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
property int a: Math.max(10, 9)
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml
index 44167af178..dbb3f06d32 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml
index 7e5559a7b3..16a6d9d903 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant other
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml
index 0c839ee7b1..cee2a88cf7 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml
index 663e8d0efb..54d3c320e0 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property QtObject o;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml
index ec5536e7e8..0dc54d6787 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property QtObject object
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml
index d480611c62..3cb280ef47 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant other
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml
index 0a49ad51f2..01cf9142b2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant other
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml
index f04b1f6052..60e66921d2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml
index a15a718891..089130d14c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
AliasPropertyChangeSignalsType {
id: root
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml
index 7944deb44c..4e11b9174a 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml
index ed214ffe5a..717cd84536 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
index ab6f3df8cf..de476ae47f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: 1
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml
index aab7ed2c20..1f731c539c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant a;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml
index 3cde2e8269..54fef61ef0 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0 as Qt47
+import QtQuick 2.0 as Qt47
Qt47.QtObject {
Qt47: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml
index 1e932251df..3637ded26f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml
@@ -1,6 +1,6 @@
import Test 1.0
import Test 1.0 as Namespace
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
MyQmlObject.value: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml
index f4f66ddab4..a22772bd89 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml
index 7d677b5704..fbe315f771 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: myId
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml
index 1b9af8bd85..bac23ef903 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
Component {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml
index 806613c2a5..d07695477d 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
QtObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml
index e94022a145..9867377bb9 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
x: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml
index 8f81a5a9ce..010949a35f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
id: QtObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml
index 94bf189b5d..b1a31195eb 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
property int a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml
index 69990cae5b..fb7a079d39 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
signal a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml
index 5db98152d4..17824b4ede 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Component {
function a() {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml b/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml
index d04da62463..232b320fb0 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml b/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml
index 6ac71eea98..2b8d285348 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
objectName: "Hello" + "World"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml
index c1e47900b0..57241ffc28 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int on
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml
index 50bc2aeb69..c42173ddfb 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
ListModel {
ListElement { a: 10 }
ListElement { id: foo; a: 12 }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml
index 4cf68272ed..76a8a4773f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
ListModel {
ListElement { a: 10 }
ListElement { a: 12 }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml b/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml
index f15373f1dd..03f5c1ff7e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int a: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml
index d98dfdb5a5..66a78eb67f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyTypeObject {
grouped {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml b/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml
index 87dc3d3ea2..31d17fd55f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyContainer {
QtObject {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml
index ba65d78322..b5b29148a2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
onDestroyed: print("Hello World!")
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml b/tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml
index 0cdbdd73fe..905ee48e0b 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property QtObject object: DontDoubleCallClassBeginItem {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml
index 2b6dd5d584..3dbd5b0b2e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
default property QtObject a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml
index 7d11d990b5..5d4efeebb2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml
index b0f2828eda..f084947eaf 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
signal a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml
index e28cad3a68..3691529aa9 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
function a() {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml
index 8e4acc05aa..64ba907415 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property UnknownType a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml
index cdad72b5d2..2214bacda0 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyCustomParserType {
propa: a + 10
propb: Math.min(a, 10)
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml
index c03ec49278..6f822ba157 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml
@@ -1,5 +1,5 @@
-import QtQuick 1.0
-import QtQuick 1.0 as Qt47
+import QtQuick 2.0
+import QtQuick 2.0 as Qt47
Qt.QtObject {
property Qt47.QtObject objectProperty
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml
index ed25c4b8a9..5d072b160a 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml
@@ -1,6 +1,6 @@
import Test 1.0
-import QtQuick 1.0
-import QtQuick 1.0 as Qt47
+import QtQuick 2.0
+import QtQuick 2.0 as Qt47
QtObject {
property QtObject objectProperty
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml
index 782adefad9..cd403b3d46 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
default property int intProperty : 10
property bool boolProperty: false
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml
index 64848fe8b6..b86e89b5e7 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
DynamicPropertiesNestedType {
property int a: 13
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml
index 78978dbace..d80d94be09 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
signal signal1
function slot1() {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml
index 3eda6612c4..ff083250f0 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Font {
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml
index 247f527fed..804e76b932 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import com.Nokia.installedtest 1.0
QtObject {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml
index 39e384662b..45ad40501b 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml
@@ -1,4 +1,4 @@
import Test 1.0 as Rectangle
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml
index 9589692e66..5cbee0264b 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml
@@ -1,5 +1,5 @@
// imports...
import "will-not-be-found"
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml
index d11000be78..15b6dc3a6e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
IncorrectCaseType {
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml
index cf32b45687..addc4265a9 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml b/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml
index 8f3c5cef79..4390d22d45 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
InlineAssignmentsOverrideBindingsType {
property int test: nested.value
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml b/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml
index a52bd23df5..a6f277adb2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyContainer {
Component {
id: myComponent
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml
index 444e234825..f85e3e4e5b 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
interfaceProperty: MyQmlObject {}
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml
index 13bdb12196..8aab61e49e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property alias a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml
index b6378c39ef..b85b2584eb 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property alias a: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml
index c6dc44c4ef..20864b9a41 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
MyQmlObject.foo: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml
index 4942c21282..20906de606 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml
@@ -1,5 +1,5 @@
import Test 1.0 as Namespace
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Namespace.MadeUpClass.foo: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml
index e1fc8c15ef..95add15147 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml
@@ -1,5 +1,5 @@
import Test 1.0 as Namespace
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Namespace.madeUpClass.foo: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml
index 6938122171..050e619ff2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml
@@ -1,5 +1,5 @@
import Test 1.0 as Namespace
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Namespace.MyQmlObject.foo: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml
index 842600f014..24b09a53d5 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
MyQmlObject: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml
index 6f372a63b6..fb38ee9536 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml
@@ -1,5 +1,5 @@
import Test 1.0 as Namespace
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Namespace.MyQmlObject: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml
index 07eb6f3432..789e42f7ef 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
MyQmlObject: QtObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml
index b72567412d..9060a55d00 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Test.MyQmlObject: QtObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml
index 50004edf84..47b6cc37d8 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
MyTypeObject.foo: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml
index 7cdf5cde33..146934f7ac 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml
@@ -1,5 +1,5 @@
import Test 1.0 as Namespace
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Namespace.MyTypeObject.foo: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml
index 503e9fa793..73724aa6e7 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
MadeUpClass.foo: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml
index 94afb16cf2..fa46b8242a 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant o;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml
index d4fbf423b5..3e516738d6 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int o;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml
index 580a0f3975..37e7c5d4d0 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
-import QtQuick 1.0 as qt
+import QtQuick 2.0
+import QtQuick 2.0 as qt
QtObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml
index bd26bc59a5..f9b322e35c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int parseInt
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml
index 9985d3327b..56daa9c09a 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0 as Qt47
+import QtQuick 2.0 as Qt47
Qt47.Rectangle {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml
index f63283e773..59df88216e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml
index 7f491eb802..26a5d6bba9 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml
index 03bf25bc74..ed1b09e419 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Image {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml
index 9985d3327b..56daa9c09a 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0 as Qt47
+import QtQuick 2.0 as Qt47
Qt47.Rectangle {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml
index f63283e773..59df88216e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml
index c02dd33b38..1af190633d 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyContainer {
containerChildren: QtObject {}
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml b/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml
index 85abbdc511..74439c66d4 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
ListModel {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml
index 1f60951d30..dcfe37d6fc 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property list<QtObject> listProperty
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml
index 4b37ed3518..fbb37705a1 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml
@@ -1,5 +1,5 @@
// Check that a property in a later revision (prop2) cannot be assigned
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.0
MyRevisionedClass
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml
index a3f97f8d34..a888b1aaf4 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
function MyMethod() {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml
index e0e844234c..92aefef8c4 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
onClicked: console.log("Hello world!")
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml
index bbd05a1ffb..cc1df4d181 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
NestedErrorsType {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml
index 548b7b8637..28852f1a0c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Keys {
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml b/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml
index e75f9044e9..89e6777f8a 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyTypeObject {
// We set a and b to ensure that onCompleted is executed after bindings and
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml b/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml
index 77fe2ff3c1..7d6da260b4 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyTypeObject {
// We set a and b to ensure that onCompleted is executed after bindings and
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml
index 0b46ceb685..6b43e6cc89 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property blah a;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml
index 3ff16868bf..e6aa00e730 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property invalidmodifier<int> a;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml
index b219120af8..978c1aa80b 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property invalidmodifier<QtObject> a;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml
index bfadc9d496..bb94e84244 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
readonly property int a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml
index 1bb4850777..a1401d2fdc 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
readonly property int a: value
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml
index b5b3f423bb..88f493f9a9 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int Hello
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml
index f9ec68a40a..05eb319947 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int Hello: 10
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.1.qml
index a7ef16af68..7d6fea24db 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int test: { var _ = 1; _ }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.2.qml
index a165de8d16..fa690ba6bc 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/propertyInit.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int test: if (b == 1) 123; else 321;
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml
index dea52c98a8..55c507f67e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml
index 18c65c34d1..db8a3da2b2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
MyQmlObject.value: 10
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml
index c70a55c381..e3c56b701a 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant child
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml
index 4d3d7d2a44..823439acdd 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.1
MyRevisionedClass
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml
index 57d76b1c28..78ab51a4b7 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.1
MyRevisionedSubclass
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml
index f107356edf..d00758387e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.1
MyRevisionedSubclass
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml
index 7d1a9db2a7..1c27baa4e8 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
signal mySignal(nontype a)
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml
index e7780a0529..2b00ab80bb 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
signal mySignal(,)
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml
index 4289bce212..1bfcfff7b5 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
signal mySignal(a)
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml
index 6ce417db63..653c14e6aa 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
signal MySignal
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml
index 2fd7fd2be0..e2760cb418 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property QtObject a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml
index da56cb8243..ccbc6f0849 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant a
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml b/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml
index 0b054d0243..f789a905f2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml
index 0b054d0243..f789a905f2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml b/tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml
index cc3f1c25b9..169b245450 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int notifyCount: 0
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml b/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml
index 8c747157d4..3e8bca0368 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.1
MySubclass
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml
index 0699d67d91..973fdada24 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyQmlObject {
qmlobjectProperty: QtObject {}
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml
index 289cd216fa..4ce04c46d2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
Image { source: "pics/blue.png" }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml
index 0b054d0243..f789a905f2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml
index 289cd216fa..4ce04c46d2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
Image { source: "pics/blue.png" }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml
index 0b054d0243..f789a905f2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml
@@ -1,2 +1,2 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml
index 76d11dca0e..1480ae8683 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 3c6ce9da6d..adf78873a3 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -1389,7 +1389,7 @@ void tst_qdeclarativelanguage::reservedWords()
{
QFETCH(QByteArray, word);
QDeclarativeComponent component(&engine);
- component.setData("import QtQuick 1.0\nQtObject { property string " + word + " }", QUrl());
+ component.setData("import QtQuick 2.0\nQtObject { property string " + word + " }", QUrl());
QCOMPARE(component.errorString(), QLatin1String(":2 Expected token `identifier'\n"));
}
@@ -1568,17 +1568,17 @@ void tst_qdeclarativelanguage::importsLocal_data()
QTest::newRow("local import")
<< "import \"subdir\"\n" // QT-613
"Test {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("local import second")
- << "import QtQuick 1.0\nimport \"subdir\"\n"
+ << "import QtQuick 2.0\nimport \"subdir\"\n"
"Test {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("local import subsubdir")
- << "import QtQuick 1.0\nimport \"subdir/subsubdir\"\n"
+ << "import QtQuick 2.0\nimport \"subdir/subsubdir\"\n"
"SubTest {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("local import QTBUG-7721 A")
<< "subdir.Test {}" // no longer allowed (QTBUG-7721)
@@ -1592,7 +1592,7 @@ void tst_qdeclarativelanguage::importsLocal_data()
QTest::newRow("local import as")
<< "import \"subdir\" as T\n"
"T.Test {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("wrong local import as")
<< "import \"subdir\" as T\n"
@@ -1658,11 +1658,11 @@ void tst_qdeclarativelanguage::importsRemote_data()
QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage";
- QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QDeclarativeRectangle"
+ QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QSGRectangle"
<< "";
- QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QDeclarativeText"
+ QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QSGText"
<< "";
- QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QDeclarativeImage"
+ QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QSGImage"
<< "";
QTest::newRow("wrong remote import with undeclared local") << "import \""+serverdir+"\"\nWrongTestLocal {}" << ""
<< "WrongTestLocal is not a type";
@@ -1696,27 +1696,27 @@ void tst_qdeclarativelanguage::importsInstalled_data()
QTest::newRow("installed import 0")
<< "import com.nokia.installedtest0 0.0\n"
"InstalledTestTP {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("installed import 0 as TP")
<< "import com.nokia.installedtest0 0.0 as TP\n"
"TP.InstalledTestTP {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("installed import 1")
<< "import com.nokia.installedtest 1.0\n"
"InstalledTest {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("installed import 2")
<< "import com.nokia.installedtest 1.3\n"
"InstalledTest {}"
- << "QDeclarativeRectangle"
+ << "QSGRectangle"
<< "";
QTest::newRow("installed import 3")
<< "import com.nokia.installedtest 1.4\n"
"InstalledTest {}"
- << "QDeclarativeText"
+ << "QSGText"
<< "";
QTest::newRow("installed import minor version not available") // QTBUG-11936
<< "import com.nokia.installedtest 0.1\n"
@@ -1759,26 +1759,26 @@ void tst_qdeclarativelanguage::importsOrder_data()
"import com.nokia.installedtest 1.4\n"
"import com.nokia.installedtest 1.4\n"
"InstalledTest {}"
- << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"QSGText":"")
<< (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.4");
QTest::newRow("installed import overrides 1") <<
"import com.nokia.installedtest 1.0\n"
"import com.nokia.installedtest 1.4\n"
"InstalledTest {}"
- << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"QSGText":"")
<< (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0");
QTest::newRow("installed import overrides 2") <<
"import com.nokia.installedtest 1.4\n"
"import com.nokia.installedtest 1.0\n"
"InstalledTest {}"
- << (!qmlCheckTypes()?"QDeclarativeRectangle":"")
+ << (!qmlCheckTypes()?"QSGRectangle":"")
<< (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4");
QTest::newRow("installed import re-overrides 1") <<
"import com.nokia.installedtest 1.4\n"
"import com.nokia.installedtest 1.0\n"
"import com.nokia.installedtest 1.4\n"
"InstalledTest {}"
- << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"QSGText":"")
<< (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0");
QTest::newRow("installed import re-overrides 2") <<
"import com.nokia.installedtest 1.4\n"
@@ -1786,41 +1786,41 @@ void tst_qdeclarativelanguage::importsOrder_data()
"import com.nokia.installedtest 1.4\n"
"import com.nokia.installedtest 1.0\n"
"InstalledTest {}"
- << (!qmlCheckTypes()?"QDeclarativeRectangle":"")
+ << (!qmlCheckTypes()?"QSGRectangle":"")
<< (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4");
QTest::newRow("installed import versus builtin 1") <<
"import com.nokia.installedtest 1.5\n"
- "import QtQuick 1.0\n"
+ "import QtQuick 2.0\n"
"Rectangle {}"
- << (!qmlCheckTypes()?"QDeclarativeRectangle":"")
+ << (!qmlCheckTypes()?"QSGRectangle":"")
<< (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in Qt and in lib/com/nokia/installedtest");
QTest::newRow("installed import versus builtin 2") <<
- "import QtQuick 1.0\n"
+ "import QtQuick 2.0\n"
"import com.nokia.installedtest 1.5\n"
"Rectangle {}"
- << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"QSGText":"")
<< (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in lib/com/nokia/installedtest and in Qt");
QTest::newRow("namespaces cannot be overridden by types 1") <<
- "import QtQuick 1.0 as Rectangle\n"
+ "import QtQuick 2.0 as Rectangle\n"
"import com.nokia.installedtest 1.5\n"
"Rectangle {}"
<< ""
<< "Namespace Rectangle cannot be used as a type";
QTest::newRow("namespaces cannot be overridden by types 2") <<
- "import QtQuick 1.0 as Rectangle\n"
+ "import QtQuick 2.0 as Rectangle\n"
"import com.nokia.installedtest 1.5\n"
"Rectangle.Image {}"
- << "QDeclarativeImage"
+ << "QSGImage"
<< "";
QTest::newRow("local last 1") <<
"LocalLast {}"
- << "QDeclarativeText"
+ << "QSGText"
<< "";
QTest::newRow("local last 2") <<
"import com.nokia.installedtest 1.0\n"
"LocalLast {}"
- << (!qmlCheckTypes()?"QDeclarativeRectangle":"")// i.e. from com.nokia.installedtest, not data/LocalLast.qml
+ << (!qmlCheckTypes()?"QSGRectangle":"")// i.e. from com.nokia.installedtest, not data/LocalLast.qml
<< (!qmlCheckTypes()?"":"LocalLast is ambiguous. Found in lib/com/nokia/installedtest and in local directory");
}
@@ -1879,7 +1879,7 @@ void tst_qdeclarativelanguage::qmlAttachedPropertiesObjectMethod()
void tst_qdeclarativelanguage::crash1()
{
QDeclarativeComponent component(&engine);
- component.setData("import QtQuick 1.0\nComponent {}", QUrl());
+ component.setData("import QtQuick 2.0\nComponent {}", QUrl());
}
void tst_qdeclarativelanguage::crash2()
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml
index 93697f3307..f73d66b318 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property string result
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/model.qml b/tests/auto/declarative/qdeclarativelistmodel/data/model.qml
index a1a599c9a5..5973ea8adf 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/data/model.qml
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/model.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: item
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml b/tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml
index cc6d9de8a0..4a331e2b3e 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
ListView {
width: 100
height: 250
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml b/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml
index ffe417ae2a..58bf1ccd04 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
ListModel {
id: model
diff --git a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
index 902a0510cd..85340e70e6 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
+++ b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
@@ -15,4 +15,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private opengl-private
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 07a6d82752..cfd3981214 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
#include <qtest.h>
-#include <QtDeclarative/private/qdeclarativeitem_p.h>
-#include <QtDeclarative/private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qsgitem_p.h>
+#include <QtDeclarative/private/qsgtext_p.h>
#include <QtDeclarative/private/qdeclarativeengine_p.h>
#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
#include <QtDeclarative/private/qdeclarativeexpression_p.h>
@@ -69,8 +69,8 @@ public:
private:
int roleFromName(const QDeclarativeListModel *model, const QString &roleName);
- QDeclarativeItem *createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model);
- void waitForWorker(QDeclarativeItem *item);
+ QSGItem *createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model);
+ void waitForWorker(QSGItem *item);
private slots:
void static_types();
@@ -118,16 +118,16 @@ int tst_qdeclarativelistmodel::roleFromName(const QDeclarativeListModel *model,
return -1;
}
-QDeclarativeItem *tst_qdeclarativelistmodel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model)
+QSGItem *tst_qdeclarativelistmodel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model)
{
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component->create());
+ QSGItem *item = qobject_cast<QSGItem*>(component->create());
QDeclarativeEngine::setContextForObject(model, eng->rootContext());
if (item)
item->setProperty("model", qVariantFromValue(model));
return item;
}
-void tst_qdeclarativelistmodel::waitForWorker(QDeclarativeItem *item)
+void tst_qdeclarativelistmodel::waitForWorker(QSGItem *item)
{
QEventLoop loop;
QTimer timer;
@@ -169,7 +169,7 @@ void tst_qdeclarativelistmodel::static_types_data()
QTest::newRow("enum")
<< "ListElement { foo: Text.AlignHCenter }"
- << QVariant(double(QDeclarativeText::AlignHCenter));
+ << QVariant(double(QSGText::AlignHCenter));
}
void tst_qdeclarativelistmodel::static_types()
@@ -177,7 +177,7 @@ void tst_qdeclarativelistmodel::static_types()
QFETCH(QString, qml);
QFETCH(QVariant, value);
- qml = "import QtQuick 1.0\nItem { property variant test: model.get(0).foo; ListModel { id: model; " + qml + " } }";
+ qml = "import QtQuick 2.0\nItem { property variant test: model.get(0).foo; ListModel { id: model; " + qml + " } }";
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
@@ -201,7 +201,7 @@ void tst_qdeclarativelistmodel::static_i18n()
{
QString expect = QString::fromUtf8("na\303\257ve");
- QString componentStr = "import QtQuick 1.0\nItem { property string prop1: model.get(0).prop1; property string prop2: model.get(0).prop2; ListModel { id: model; ListElement { prop1: \""+expect+"\"; prop2: QT_TR_NOOP(\""+expect+"\") } } }";
+ QString componentStr = "import QtQuick 2.0\nItem { property string prop1: model.get(0).prop1; property string prop2: model.get(0).prop2; ListModel { id: model; ListElement { prop1: \""+expect+"\"; prop2: QT_TR_NOOP(\""+expect+"\") } } }";
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
component.setData(componentStr.toUtf8(), QUrl::fromLocalFile(""));
@@ -224,7 +224,7 @@ void tst_qdeclarativelistmodel::static_nestedElements()
QString elementsStr = elements.join(",\n") + "\n";
QString componentStr =
- "import QtQuick 1.0\n"
+ "import QtQuick 2.0\n"
"Item {\n"
" property variant count: model.get(0).attributes.count\n"
" ListModel {\n"
@@ -405,7 +405,7 @@ void tst_qdeclarativelistmodel::dynamic_worker()
QDeclarativeListModel model;
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
- QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QSGItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
QSignalSpy spyCount(&model, SIGNAL(countChanged()));
@@ -451,7 +451,7 @@ void tst_qdeclarativelistmodel::dynamic_worker_sync()
QDeclarativeListModel model;
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
- QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QSGItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}'))
@@ -505,7 +505,7 @@ void tst_qdeclarativelistmodel::convertNestedToFlat_fail()
QDeclarativeListModel model;
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
- QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QSGItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
RUNEVAL(item, "model.append({foo: 123})");
@@ -548,7 +548,7 @@ void tst_qdeclarativelistmodel::convertNestedToFlat_ok()
QDeclarativeListModel model;
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
- QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QSGItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
RUNEVAL(item, "model.append({foo: 123})");
@@ -592,7 +592,7 @@ void tst_qdeclarativelistmodel::enumerate()
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/enumerate.qml"));
QVERIFY(!component.isError());
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QSGItem *item = qobject_cast<QSGItem*>(component.create());
QVERIFY(item != 0);
QStringList r = item->property("result").toString().split(":");
QCOMPARE(r[0],QLatin1String("val1=1Y"));
@@ -609,47 +609,47 @@ void tst_qdeclarativelistmodel::error_data()
QTest::addColumn<QString>("error");
QTest::newRow("id not allowed in ListElement")
- << "import QtQuick 1.0\nListModel { ListElement { id: fred } }"
+ << "import QtQuick 2.0\nListModel { ListElement { id: fred } }"
<< "ListElement: cannot use reserved \"id\" property";
QTest::newRow("id allowed in ListModel")
- << "import QtQuick 1.0\nListModel { id:model }"
+ << "import QtQuick 2.0\nListModel { id:model }"
<< "";
QTest::newRow("random properties not allowed in ListModel")
- << "import QtQuick 1.0\nListModel { foo:123 }"
+ << "import QtQuick 2.0\nListModel { foo:123 }"
<< "ListModel: undefined property 'foo'";
QTest::newRow("random properties allowed in ListElement")
- << "import QtQuick 1.0\nListModel { ListElement { foo:123 } }"
+ << "import QtQuick 2.0\nListModel { ListElement { foo:123 } }"
<< "";
QTest::newRow("bindings not allowed in ListElement")
- << "import QtQuick 1.0\nRectangle { id: rect; ListModel { ListElement { foo: rect.color } } }"
+ << "import QtQuick 2.0\nRectangle { id: rect; ListModel { ListElement { foo: rect.color } } }"
<< "ListElement: cannot use script for property value";
QTest::newRow("random object list properties allowed in ListElement")
- << "import QtQuick 1.0\nListModel { ListElement { foo: [ ListElement { bar: 123 } ] } }"
+ << "import QtQuick 2.0\nListModel { ListElement { foo: [ ListElement { bar: 123 } ] } }"
<< "";
QTest::newRow("default properties not allowed in ListElement")
- << "import QtQuick 1.0\nListModel { ListElement { Item { } } }"
+ << "import QtQuick 2.0\nListModel { ListElement { Item { } } }"
<< "ListElement: cannot contain nested elements";
QTest::newRow("QML elements not allowed in ListElement")
- << "import QtQuick 1.0\nListModel { ListElement { a: Item { } } }"
+ << "import QtQuick 2.0\nListModel { ListElement { a: Item { } } }"
<< "ListElement: cannot contain nested elements";
QTest::newRow("qualified ListElement supported")
- << "import QtQuick 1.0 as Foo\nFoo.ListModel { Foo.ListElement { a: 123 } }"
+ << "import QtQuick 2.0 as Foo\nFoo.ListModel { Foo.ListElement { a: 123 } }"
<< "";
QTest::newRow("qualified ListElement required")
- << "import QtQuick 1.0 as Foo\nFoo.ListModel { ListElement { a: 123 } }"
+ << "import QtQuick 2.0 as Foo\nFoo.ListModel { ListElement { a: 123 } }"
<< "ListElement is not a type";
QTest::newRow("unknown qualified ListElement not allowed")
- << "import QtQuick 1.0\nListModel { Foo.ListElement { a: 123 } }"
+ << "import QtQuick 2.0\nListModel { Foo.ListElement { a: 123 } }"
<< "Foo.ListElement - Foo is not a namespace";
}
@@ -674,7 +674,7 @@ void tst_qdeclarativelistmodel::error()
void tst_qdeclarativelistmodel::syncError()
{
- QString qml = "import QtQuick 1.0\nListModel { id: lm; Component.onCompleted: lm.sync() }";
+ QString qml = "import QtQuick 2.0\nListModel { id: lm; Component.onCompleted: lm.sync() }";
QString error = "file:dummy.qml:2:1: QML ListModel: List sync() can only be called from a WorkerScript";
QDeclarativeEngine engine;
@@ -721,7 +721,7 @@ void tst_qdeclarativelistmodel::get()
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
component.setData(
- "import QtQuick 1.0\n"
+ "import QtQuick 2.0\n"
"ListModel { \n"
"ListElement { roleA: 100 }\n"
"ListElement { roleA: 200; roleB: 400 } \n"
@@ -779,7 +779,7 @@ void tst_qdeclarativelistmodel::get_worker()
QDeclarativeListModel model;
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
- QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QSGItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
// Add some values like get() test
@@ -833,7 +833,7 @@ void tst_qdeclarativelistmodel::get_nested()
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng);
component.setData(
- "import QtQuick 1.0\n"
+ "import QtQuick 2.0\n"
"ListModel { \n"
"ListElement {\n"
"listRoleA: [\n"
@@ -960,7 +960,7 @@ void tst_qdeclarativelistmodel::property_changes()
QVERIFY2(!expr.hasError(), QTest::toString(expr.error().toString()));
QString signalHandler = "on" + QString(roleName[0].toUpper()) + roleName.mid(1, roleName.length()) + "Changed:";
- QString qml = "import QtQuick 1.0\n"
+ QString qml = "import QtQuick 2.0\n"
"Connections {\n"
"property bool gotSignal: false\n"
"target: model.get(0)\n"
@@ -1055,7 +1055,7 @@ void tst_qdeclarativelistmodel::property_changes_worker()
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
- QDeclarativeItem *item = createWorkerTest(&engine, &component, &model);
+ QSGItem *item = createWorkerTest(&engine, &component, &model);
QVERIFY(item != 0);
QDeclarativeExpression expr(engine.rootContext(), &model, script_setup);
diff --git a/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml b/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml
index 0687ce3995..f48a77598c 100644
--- a/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml
+++ b/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int a
diff --git a/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml b/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml
index 9ddc763356..99a61a7680 100644
--- a/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml
+++ b/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property list<MyType> myList
diff --git a/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml b/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml
index 39a49e81fe..3728cd0311 100644
--- a/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml
+++ b/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property list<QtObject> myList;
diff --git a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
deleted file mode 100644
index d32535897e..0000000000
--- a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui network
-macx:CONFIG -= app_bundle
-
-INCLUDEPATH += ../shared/
-HEADERS += ../shared/testhttpserver.h
-SOURCES += tst_qdeclarativeloader.cpp \
- ../shared/testhttpserver.cpp
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-
-CONFIG += parallel_test
-
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/temptest.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/temptest.qml
index a45ac2dd8c..67fb18feb0 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/temptest.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/temptest.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
// this qml file uses a type which is meant to be defined
// in a plugin which is specified in the qmldir file.
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/Test.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/Test.qml
index 83c65538ba..ea9611691e 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/Test.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/Test.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: moduleRoot
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/temptest2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/temptest2.qml
index 3eb29f43da..0fa9f6e051 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/temptest2.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/temptest2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
// the type loader will implicitly search "." for a qmldir
// and the qmldir has various syntax errors in it.
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml
index 70b2bfd837..a0ac0c72c7 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml
@@ -1,5 +1,5 @@
import com.nokia.AutoTestQmlMixedPluginType 1.5
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml
index da6ff4656a..1346cbdb7b 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml
@@ -1,5 +1,5 @@
import com.nokia.AutoTestQmlMixedPluginType 1.0
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml
index 59fd084a49..bda59f0a32 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml
@@ -1,5 +1,5 @@
import com.nokia.AutoTestQmlVersionPluginType 1.9
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml
index 2065c0712f..2e556e76d6 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml
@@ -1,5 +1,5 @@
import com.nokia.AutoTestQmlVersionPluginType 1.1
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml
index 18dcd26f60..617bdaaf67 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
-Item {} \ No newline at end of file
+Item {}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml
index ce51cbd2ec..36d69e901f 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property int value: 89
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml
index 49613aab2d..617bdaaf67 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml
index f19a336d69..fac5d8f4b9 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {}
diff --git a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
deleted file mode 100644
index 0584c6120e..0000000000
--- a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui network
-macx:CONFIG -= app_bundle
-
-HEADERS += ../shared/testhttpserver.h
-SOURCES += tst_qdeclarativemousearea.cpp ../shared/testhttpserver.cpp
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-
-CONFIG += parallel_test
-
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml b/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml
index cef86b4f58..1fe150548a 100644
--- a/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml
+++ b/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int a: 10
diff --git a/tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml b/tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml
index a253a58da9..f101f38a2d 100644
--- a/tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml
+++ b/tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml b/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml
index a91d3ed9ad..55010b69a9 100644
--- a/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml
+++ b/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property TestType test
diff --git a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
index 180a24cc7e..5583701b12 100644
--- a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
+++ b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
@@ -43,7 +43,7 @@
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativepropertymap.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <private/qdeclarativetext_p.h>
+#include <private/qsgtext_p.h>
#include <QSignalSpy>
class tst_QDeclarativePropertyMap : public QObject
@@ -172,10 +172,10 @@ void tst_QDeclarativePropertyMap::changed()
QDeclarativeContext *ctxt = engine.rootContext();
ctxt->setContextProperty(QLatin1String("testdata"), &map);
QDeclarativeComponent component(&engine);
- component.setData("import QtQuick 1.0\nText { text: { testdata.key1 = 'Hello World'; 'X' } }",
+ component.setData("import QtQuick 2.0\nText { text: { testdata.key1 = 'Hello World'; 'X' } }",
QUrl::fromLocalFile(""));
QVERIFY(component.isReady());
- QDeclarativeText *txt = qobject_cast<QDeclarativeText*>(component.create());
+ QSGText *txt = qobject_cast<QSGText*>(component.create());
QVERIFY(txt);
QCOMPARE(txt->text(), QString('X'));
QCOMPARE(spy.count(), 1);
@@ -213,7 +213,7 @@ void tst_QDeclarativePropertyMap::crashBug()
context.setContextProperty("map", &map);
QDeclarativeComponent c(&engine);
- c.setData("import QtQuick 1.0\nBinding { target: map; property: \"myProp\"; value: 10 + 23 }",QUrl());
+ c.setData("import QtQuick 2.0\nBinding { target: map; property: \"myProp\"; value: 10 + 23 }",QUrl());
QObject *obj = c.create(&context);
delete obj;
}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/atob.qml b/tests/auto/declarative/qdeclarativeqt/data/atob.qml
index f74aae830a..0d684003a1 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/atob.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/atob.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string test1: Qt.atob()
diff --git a/tests/auto/declarative/qdeclarativeqt/data/btoa.qml b/tests/auto/declarative/qdeclarativeqt/data/btoa.qml
index 63b58c07b4..0ecd01d284 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/btoa.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/btoa.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string test1: Qt.btoa()
diff --git a/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml b/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml
index fe47f3ff7c..4c581cf245 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Component.onCompleted: {
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
index 9d0dd345ce..3ebc9f14f8 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool emptyArg: false
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml
index 6ac470ea8b..2a824e5362 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int test: 1913
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
index 5b8c1b1331..a52453e8fa 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "createComponent_lib.js" as Test
Item {
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml
index 8c35ebf1a5..87601b1cc8 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml
@@ -1,14 +1,14 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
// errors resulting in exceptions
property QtObject incorrectArgCount1: Qt.createQmlObject()
- property QtObject incorrectArgCount2: Qt.createQmlObject("import QtQuick 1.0\nQtObject{}", root, "main.qml", 10)
- property QtObject noParent: Qt.createQmlObject("import QtQuick 1.0\nQtObject{\nproperty int test: 13}", 0)
- property QtObject notAvailable: Qt.createQmlObject("import QtQuick 1.0\nQtObject{Blah{}}", root)
- property QtObject errors: Qt.createQmlObject("import QtQuick 1.0\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml")
+ property QtObject incorrectArgCount2: Qt.createQmlObject("import QtQuick 2.0\nQtObject{}", root, "main.qml", 10)
+ property QtObject noParent: Qt.createQmlObject("import QtQuick 2.0\nQtObject{\nproperty int test: 13}", 0)
+ property QtObject notAvailable: Qt.createQmlObject("import QtQuick 2.0\nQtObject{Blah{}}", root)
+ property QtObject errors: Qt.createQmlObject("import QtQuick 2.0\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml")
property bool emptyArg: false
@@ -18,14 +18,14 @@ Item {
// errors resulting in nulls
emptyArg = (Qt.createQmlObject("", root) == null);
try {
- Qt.createQmlObject("import QtQuick 1.0\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root)
+ Qt.createQmlObject("import QtQuick 2.0\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root)
} catch (error) {
console.log("RunTimeError: ",error.message);
}
- var o = Qt.createQmlObject("import QtQuick 1.0\nQtObject{\nproperty int test: 13\n}", root);
+ var o = Qt.createQmlObject("import QtQuick 2.0\nQtObject{\nproperty int test: 13\n}", root);
success = (o.test == 13);
- Qt.createQmlObject("import QtQuick 1.0\nItem {}\n", root);
+ Qt.createQmlObject("import QtQuick 2.0\nItem {}\n", root);
}
}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/darker.qml b/tests/auto/declarative/qdeclarativeqt/data/darker.qml
index d2ef866d59..ce6c705fb4 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/darker.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/darker.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: Qt.darker(Qt.rgba(1, 0.8, 0.3))
diff --git a/tests/auto/declarative/qdeclarativeqt/data/enums.qml b/tests/auto/declarative/qdeclarativeqt/data/enums.qml
index aec6f63c06..5a2ff534af 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/enums.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/enums.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int test1: Qt.Key_Escape
diff --git a/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml b/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml
index c9f50d4886..70245ab159 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: Qt.fontFamilies(10)
diff --git a/tests/auto/declarative/qdeclarativeqt/data/formatting.qml b/tests/auto/declarative/qdeclarativeqt/data/formatting.qml
index f520aeb40a..7a462c8eeb 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/formatting.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/formatting.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property date dateFromString: "2008-12-24"
diff --git a/tests/auto/declarative/qdeclarativeqt/data/hsla.qml b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml
index 3bcc7912b1..ff9622b339 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/hsla.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property color test1: Qt.hsla(1, 0, 0, 0.8);
diff --git a/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml b/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml
index 37b952d448..6829209518 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: root
diff --git a/tests/auto/declarative/qdeclarativeqt/data/lighter.qml b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
index 67f0d0f30d..7db5e1edeb 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: Qt.lighter(Qt.rgba(1, 0.8, 0.3))
diff --git a/tests/auto/declarative/qdeclarativeqt/data/md5.qml b/tests/auto/declarative/qdeclarativeqt/data/md5.qml
index 32e90c041e..bec1ed1fe7 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/md5.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/md5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string test1: Qt.md5()
diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml
index dc4049c9a3..37b9f513d9 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Component.onCompleted: Qt.openUrlExternally("test:url")
diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml
index 456653b81d..4bf584d134 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "openUrlExternally_lib.js" as Test
Item {
diff --git a/tests/auto/declarative/qdeclarativeqt/data/point.qml b/tests/auto/declarative/qdeclarativeqt/data/point.qml
index 8b0188eaa7..fe12ee6232 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/point.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/point.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: Qt.point(19, 34);
diff --git a/tests/auto/declarative/qdeclarativeqt/data/quit.qml b/tests/auto/declarative/qdeclarativeqt/data/quit.qml
index 62564a6492..e3b91660e7 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/quit.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/quit.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
Component.onCompleted: Qt.quit()
diff --git a/tests/auto/declarative/qdeclarativeqt/data/rect.qml b/tests/auto/declarative/qdeclarativeqt/data/rect.qml
index 872bf50eb7..b294b22c5b 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/rect.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/rect.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: Qt.rect(10, 13, 100, 109)
diff --git a/tests/auto/declarative/qdeclarativeqt/data/rgba.qml b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml
index bbafc6d98c..3b010f68cb 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/rgba.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property color test1: Qt.rgba(1, 0, 0, 0.8);
diff --git a/tests/auto/declarative/qdeclarativeqt/data/size.qml b/tests/auto/declarative/qdeclarativeqt/data/size.qml
index 8e102eb6cb..41051f4216 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/size.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/size.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: Qt.size(19, 34);
diff --git a/tests/auto/declarative/qdeclarativeqt/data/tint.qml b/tests/auto/declarative/qdeclarativeqt/data/tint.qml
index f8738865f2..816e6e9b08 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/tint.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/tint.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property color test1: Qt.tint("red", "blue");
diff --git a/tests/auto/declarative/qdeclarativeqt/data/vector.qml b/tests/auto/declarative/qdeclarativeqt/data/vector.qml
index f494fe0531..5a949515ed 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/vector.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/vector.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property variant test1: Qt.vector3d(1, 0, 0.9);
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
index 948307d955..4a9bb4513c 100644
--- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
+++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
@@ -50,7 +50,7 @@
#include <QDir>
#include <QVector3D>
#include <QCryptographicHash>
-#include <QDeclarativeItem>
+#include <QSGItem>
#include <QSignalSpy>
#ifdef Q_OS_SYMBIAN
@@ -434,7 +434,7 @@ void tst_qdeclarativeqt::createQmlObject()
QCOMPARE(object->property("emptyArg").toBool(), true);
QCOMPARE(object->property("success").toBool(), true);
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(object);
+ QSGItem *item = qobject_cast<QSGItem *>(object);
QVERIFY(item != 0);
QVERIFY(item->childItems().count() == 1);
diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml b/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml
index 9096c32a8e..8bba61ec15 100644
--- a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml
+++ b/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
import "backtrace1.js" as Script
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml
index 3a2c4e386b..3631f971f0 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml
@@ -1,3 +1,3 @@
-import QtQuick 1.0
+import QtQuick 2.0
SmoothedAnimation {}
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml
index 47935d48f0..b07120234a 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
SmoothedAnimation {
to: 10; duration: 300; reversingMode: SmoothedAnimation.Immediate
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml
index fe44cce14b..8d5dc4a92b 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
SmoothedAnimation {
to: 10; velocity: 250; reversingMode: SmoothedAnimation.Sync
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml
index 65611227d0..81d36bf015 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400; height: 400; color: "blue"
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml
index 5036d5f225..e136df84f6 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 300; height: 300;
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
index bab9045b9a..243f4e716b 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
@@ -42,7 +42,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativesmoothedanimation_p.h>
-#include <private/qdeclarativerectangle_p.h>
+#include <private/qsgrectangle_p.h>
#include <private/qdeclarativevaluetype_p.h>
#include "../../../shared/util.h"
@@ -125,7 +125,7 @@ void tst_qdeclarativesmoothedanimation::disabled()
void tst_qdeclarativesmoothedanimation::simpleAnimation()
{
- QDeclarativeRectangle rect;
+ QSGRectangle rect;
QDeclarativeSmoothedAnimation animation;
animation.setTarget(&rect);
animation.setProperty("x");
@@ -155,10 +155,10 @@ void tst_qdeclarativesmoothedanimation::valueSource()
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimationValueSource.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *theRect = rect->findChild<QDeclarativeRectangle*>("theRect");
+ QSGRectangle *theRect = rect->findChild<QSGRectangle*>("theRect");
QVERIFY(theRect);
QDeclarativeSmoothedAnimation *easeX = rect->findChild<QDeclarativeSmoothedAnimation*>("easeX");
@@ -187,10 +187,10 @@ void tst_qdeclarativesmoothedanimation::behavior()
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimationBehavior.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect);
- QDeclarativeRectangle *theRect = rect->findChild<QDeclarativeRectangle*>("theRect");
+ QSGRectangle *theRect = rect->findChild<QSGRectangle*>("theRect");
QVERIFY(theRect);
QDeclarativeSmoothedAnimation *easeX = rect->findChild<QDeclarativeSmoothedAnimation*>("easeX");
diff --git a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml
index 8890a78fdb..9f52aa56c1 100644
--- a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml
+++ b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
SpringAnimation {
}
diff --git a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml
index de75bb06cb..172cc57ca8 100644
--- a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml
+++ b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
SpringAnimation {
to: 1.44; velocity: 0.9
diff --git a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml
index b68d769f01..f4dc121eb8 100644
--- a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml
+++ b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
SpringAnimation {
to: 1.44; velocity: 0.9
diff --git a/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp b/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp
index 94b1cd630a..7517bd3498 100644
--- a/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp
+++ b/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp
@@ -42,7 +42,7 @@
#include "../../../shared/util.h"
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <private/qdeclarativetext_p.h>
+#include <private/qsgtext_p.h>
#include <private/qdeclarativeengine_p.h>
#include <QtCore/qcryptographichash.h>
/*
@@ -203,7 +203,7 @@ void tst_qdeclarativesqldatabase::testQml()
QFETCH(QString, jsfile);
QString qml=
- "import QtQuick 1.0\n"
+ "import QtQuick 2.0\n"
"import \""+jsfile+"\" as JS\n"
"Text { text: JS.test() }";
@@ -211,7 +211,7 @@ void tst_qdeclarativesqldatabase::testQml()
QDeclarativeComponent component(engine);
component.setData(qml.toUtf8(), QUrl::fromLocalFile(SRCDIR "/empty.qml")); // just a file for relative local imports
QVERIFY(!component.isError());
- QDeclarativeText *text = qobject_cast<QDeclarativeText*>(component.create());
+ QSGText *text = qobject_cast<QSGText*>(component.create());
QVERIFY(text != 0);
QCOMPARE(text->text(),QString("passed"));
}
diff --git a/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml b/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml
index d91f504455..1ea346b841 100644
--- a/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: extendedRect
objectName: "extendedRect"
diff --git a/tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml b/tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml
index 6ad3b4a6ba..01eb32cd4d 100644
--- a/tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
Column {
diff --git a/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml b/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml
index 7f9ddbfa2d..5ba7c3ad6f 100644
--- a/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 1024
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml
index fad27080fe..378f5390f9 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: container
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml
index e1d4d66abd..dc7f8ef0d1 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 200; height: 200
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml
index 116b844489..af49575854 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: container
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml
index eaff37345b..28b55818bd 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 200; height: 200
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml
index ea7b251151..b1ca968fb9 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 200; height: 200
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml
index ca96da8855..9af0e4645a 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: container
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
index 6277111e68..6512533b37 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: container
color: "red"
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml
index d8b02e9b32..574ef473ce 100644
--- a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: root
diff --git a/tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml b/tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml
index 2cad0504b2..413af2ee42 100644
--- a/tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: item
diff --git a/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml b/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml
index ccd126f6a7..6cbf524ec2 100644
--- a/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: root
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml
index 2060f03009..59b67d0863 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml
index a329da33dd..55f88120aa 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml
index cb054d214d..361ab0b091 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml
index 7a740e570c..b29f0fcf22 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml
index 08ce7875f0..3e2b73acde 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml
index ab97ba18b5..5ff46cc60c 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml
index 73ac34d7ff..e46e98f75e 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml
index b5df922190..7da1e0fb2e 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml
@@ -1,5 +1,5 @@
import Qt.test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyRectangle {
id: rect
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml b/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml
index 58c9fbe231..00f5fee287 100644
--- a/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/deleting.qml b/tests/auto/declarative/qdeclarativestates/data/deleting.qml
index d1b3fd3a10..b8e8d33c17 100644
--- a/tests/auto/declarative/qdeclarativestates/data/deleting.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/deleting.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/deletingState.qml b/tests/auto/declarative/qdeclarativestates/data/deletingState.qml
index 654e09cb2e..68a9c2a24d 100644
--- a/tests/auto/declarative/qdeclarativestates/data/deletingState.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/deletingState.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/editProperties.qml b/tests/auto/declarative/qdeclarativestates/data/editProperties.qml
index 08d0209615..9bff3657ba 100644
--- a/tests/auto/declarative/qdeclarativestates/data/editProperties.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/editProperties.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
diff --git a/tests/auto/declarative/qdeclarativestates/data/explicit.qml b/tests/auto/declarative/qdeclarativestates/data/explicit.qml
index 426731914f..d09893a1db 100644
--- a/tests/auto/declarative/qdeclarativestates/data/explicit.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/explicit.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
property color sourceColor: "blue"
diff --git a/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml
index a4b77b122e..573341520d 100644
--- a/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 200
diff --git a/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml b/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml
index a98c96bedc..6a5c7003f6 100644
--- a/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml b/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml
index e6444325a3..a2bbd5d32b 100644
--- a/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myItem
diff --git a/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml b/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml
index c04b03c94b..9cb39c0728 100644
--- a/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: card
diff --git a/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml b/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml
index 4d500d9e05..a93860f5cc 100644
--- a/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: card
diff --git a/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml b/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml
index 4973b82c3f..ce502699bb 100644
--- a/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml
index 2f7e80eb08..663ad1a264 100644
--- a/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400; height: 400
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml
index bdd0c6c282..ae290e961e 100644
--- a/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: newParent
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml
index 55f3ead7c6..46665cb4c8 100644
--- a/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400; height: 400
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml
index ae05b05072..22de72f8c9 100644
--- a/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400; height: 400
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml
index 32a0b91cd9..c353d2637f 100644
--- a/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400; height: 400
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml
index 70ad894ffc..b373dbba20 100644
--- a/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 400; height: 400
diff --git a/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
index 3ab3c3252e..ddd636493d 100644
--- a/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/reset.qml b/tests/auto/declarative/qdeclarativestates/data/reset.qml
index a140ffab4d..f0ecab0950 100644
--- a/tests/auto/declarative/qdeclarativestates/data/reset.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/reset.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
width: 640
diff --git a/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml b/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml
index dfd7c1794a..950a522841 100644
--- a/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/returnToBase.qml b/tests/auto/declarative/qdeclarativestates/data/returnToBase.qml
index a0d053cf03..9a0ee82397 100644
--- a/tests/auto/declarative/qdeclarativestates/data/returnToBase.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/returnToBase.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: theRect
diff --git a/tests/auto/declarative/qdeclarativestates/data/script.qml b/tests/auto/declarative/qdeclarativestates/data/script.qml
index 630aaf0ffa..218f0fae74 100644
--- a/tests/auto/declarative/qdeclarativestates/data/script.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/script.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRectangle
width: 100; height: 100
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml
index 0eaf547644..9ab8037e51 100644
--- a/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyRectangle {
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml
index ef26ff14e7..4e5e335b8b 100644
--- a/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyRectangle {
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml
index 8e9b698383..3e2ae1e93d 100644
--- a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Qt.test 1.0
MyRectangle {
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml
index 74df9430c3..3937874aa2 100644
--- a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: myRect
diff --git a/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml
index 4425b4dd49..35eacff07b 100644
--- a/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: theRect
diff --git a/tests/auto/declarative/qdeclarativestates/data/urlResolution.qml b/tests/auto/declarative/qdeclarativestates/data/urlResolution.qml
index 743f5404b0..516ac034d6 100644
--- a/tests/auto/declarative/qdeclarativestates/data/urlResolution.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/urlResolution.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import "Implementation"
Rectangle {
diff --git a/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml b/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml
index 48aef5a6ce..92025a2054 100644
--- a/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
property bool condition1: false
diff --git a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
index 2efefed56b..c34b8d8319 100644
--- a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
+++ b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
@@ -13,4 +13,4 @@ symbian: {
}
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private opengl-private
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 9fafa7d1fd..a59ca2607f 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -41,12 +41,13 @@
#include <qtest.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <private/qdeclarativeanchors_p_p.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativeimage_p.h>
+#include <private/qsgstateoperations_p.h>
+#include <private/qsganchors_p_p.h>
+#include <private/qsgrectangle_p.h>
+#include <private/qsgimage_p.h>
#include <private/qdeclarativepropertychanges_p.h>
#include <private/qdeclarativestategroup_p.h>
-#include <private/qdeclarativeitem_p.h>
+#include <private/qsgitem_p.h>
#include <private/qdeclarativeproperty_p.h>
#ifdef Q_OS_SYMBIAN
@@ -68,7 +69,7 @@ private:
int m_foo;
};
-class MyRect : public QDeclarativeRectangle
+class MyRect : public QSGRectangle
{
Q_OBJECT
Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
@@ -164,8 +165,8 @@ void tst_qdeclarativestates::basicChanges()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
@@ -179,8 +180,8 @@ void tst_qdeclarativestates::basicChanges()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges2.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
@@ -200,33 +201,33 @@ void tst_qdeclarativestates::basicChanges()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges3.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("red"));
- QCOMPARE(rect->border()->width(),2);
+ QCOMPARE(rect->border()->width(),2.0);
rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
//### we should be checking that this is an implicit rather than explicit 1 (which currently fails)
rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("red"));
- QCOMPARE(rect->border()->width(),2);
+ QCOMPARE(rect->border()->width(),2.0);
rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
}
@@ -260,7 +261,7 @@ void tst_qdeclarativestates::attachedPropertyChanges()
QDeclarativeComponent component(&engine, SRCDIR "/data/attachedPropertyChanges.qml");
QVERIFY(component.isReady());
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QSGItem *item = qobject_cast<QSGItem*>(component.create());
QVERIFY(item != 0);
QCOMPARE(item->width(), 50.0);
@@ -280,42 +281,42 @@ void tst_qdeclarativestates::basicExtension()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicExtension.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("blue"));
- QCOMPARE(rect->border()->width(),2);
+ QCOMPARE(rect->border()->width(),2.0);
rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("blue"));
- QCOMPARE(rect->border()->width(),2);
+ QCOMPARE(rect->border()->width(),2.0);
rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
- QCOMPARE(rect->border()->width(),1);
+ QCOMPARE(rect->border()->width(),1.0);
}
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/fakeExtension.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
@@ -346,8 +347,8 @@ void tst_qdeclarativestates::basicBinding()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
@@ -374,8 +375,8 @@ void tst_qdeclarativestates::basicBinding()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding2.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
@@ -405,8 +406,8 @@ void tst_qdeclarativestates::basicBinding()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding3.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
@@ -430,8 +431,8 @@ void tst_qdeclarativestates::basicBinding()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding4.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
@@ -470,7 +471,7 @@ void tst_qdeclarativestates::signalOverride()
rect->doSomething();
QCOMPARE(rect->color(),QColor("blue"));
- QDeclarativeItemPrivate::get(rect)->setState("green");
+ QSGItemPrivate::get(rect)->setState("green");
rect->doSomething();
QCOMPARE(rect->color(),QColor("green"));
}
@@ -484,8 +485,8 @@ void tst_qdeclarativestates::signalOverride()
rect->doSomething();
QCOMPARE(rect->color(),QColor("blue"));
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("extendedRect"));
- QDeclarativeItemPrivate::get(innerRect)->setState("green");
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("extendedRect"));
+ QSGItemPrivate::get(innerRect)->setState("green");
rect->doSomething();
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(innerRect->color(),QColor("green"));
@@ -501,7 +502,7 @@ void tst_qdeclarativestates::signalOverrideCrash()
MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate::get(rect)->setState("overridden");
+ QSGItemPrivate::get(rect)->setState("overridden");
rect->doSomething();
}
@@ -510,12 +511,12 @@ void tst_qdeclarativestates::signalOverrideCrash2()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash2.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate::get(rect)->setState("state1");
- QDeclarativeItemPrivate::get(rect)->setState("state2");
- QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QSGItemPrivate::get(rect)->setState("state1");
+ QSGItemPrivate::get(rect)->setState("state2");
+ QSGItemPrivate::get(rect)->setState("state1");
delete rect;
}
@@ -526,10 +527,10 @@ void tst_qdeclarativestates::parentChange()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange1.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
QDeclarativeListReference list(rect, "states");
@@ -537,14 +538,14 @@ void tst_qdeclarativestates::parentChange()
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QDeclarativeParentChange *pChange = qobject_cast<QDeclarativeParentChange*>(state->operationAt(0));
+ QSGParentChange *pChange = qobject_cast<QSGParentChange*>(state->operationAt(0));
QVERIFY(pChange != 0);
- QDeclarativeItem *nParent = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("NewParent"));
+ QSGItem *nParent = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("NewParent"));
QVERIFY(nParent != 0);
QCOMPARE(pChange->parent(), nParent);
- QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QSGItemPrivate::get(rect)->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(-133));
@@ -553,10 +554,10 @@ void tst_qdeclarativestates::parentChange()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange2.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
rectPrivate->setState("reparented");
@@ -568,10 +569,10 @@ void tst_qdeclarativestates::parentChange()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange3.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
rectPrivate->setState("reparented");
@@ -590,13 +591,13 @@ void tst_qdeclarativestates::parentChange()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange6.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QSGItemPrivate::get(rect)->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(180));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(-105));
@@ -610,14 +611,14 @@ void tst_qdeclarativestates::parentChangeErrors()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange4.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange4.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under non-uniform scale");
- QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QSGItemPrivate::get(rect)->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(5));
@@ -626,14 +627,14 @@ void tst_qdeclarativestates::parentChangeErrors()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange5.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange5.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under complex transform");
- QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QSGItemPrivate::get(rect)->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(5));
@@ -646,11 +647,11 @@ void tst_qdeclarativestates::anchorChanges()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
QDeclarativeListReference list(rect, "states");
@@ -658,15 +659,15 @@ void tst_qdeclarativestates::anchorChanges()
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rectPrivate->setState("right");
QCOMPARE(innerRect->x(), qreal(150));
- QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect));
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
rectPrivate->setState("");
QCOMPARE(innerRect->x(), qreal(5));
@@ -679,11 +680,11 @@ void tst_qdeclarativestates::anchorChanges2()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
rectPrivate->setState("right");
@@ -700,17 +701,17 @@ void tst_qdeclarativestates::anchorChanges3()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline"));
QVERIFY(leftGuideline != 0);
- QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline"));
QVERIFY(bottomGuideline != 0);
QDeclarativeListReference list(rect, "states");
@@ -718,19 +719,19 @@ void tst_qdeclarativestates::anchorChanges3()
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rectPrivate->setState("reanchored");
- QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+ QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect));
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().item, QSGItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().item, QSGItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QSGItemPrivate::get(bottomGuideline)->bottom().anchorLine);
QCOMPARE(innerRect->x(), qreal(10));
QCOMPARE(innerRect->y(), qreal(0));
@@ -751,16 +752,16 @@ void tst_qdeclarativestates::anchorChanges4()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges4.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline"));
QVERIFY(leftGuideline != 0);
- QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline"));
QVERIFY(bottomGuideline != 0);
QDeclarativeListReference list(rect, "states");
@@ -768,15 +769,15 @@ void tst_qdeclarativestates::anchorChanges4()
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
- QDeclarativeItemPrivate::get(rect)->setState("reanchored");
- QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().item, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().anchorLine);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().item, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().anchorLine);
+ QSGItemPrivate::get(rect)->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect));
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().item, QSGItemPrivate::get(bottomGuideline)->horizontalCenter().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().anchorLine, QSGItemPrivate::get(bottomGuideline)->horizontalCenter().anchorLine);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->verticalCenter().item, QSGItemPrivate::get(leftGuideline)->verticalCenter().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->verticalCenter().anchorLine, QSGItemPrivate::get(leftGuideline)->verticalCenter().anchorLine);
delete rect;
}
@@ -786,16 +787,16 @@ void tst_qdeclarativestates::anchorChanges5()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges5.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline"));
QVERIFY(leftGuideline != 0);
- QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline"));
QVERIFY(bottomGuideline != 0);
QDeclarativeListReference list(rect, "states");
@@ -803,11 +804,11 @@ void tst_qdeclarativestates::anchorChanges5()
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
- QDeclarativeItemPrivate::get(rect)->setState("reanchored");
- QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QSGItemPrivate::get(rect)->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect));
//QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item);
//QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine);
//QCOMPARE(aChanges->anchors()->baseline().item, leftGuideline->baseline().item);
@@ -816,12 +817,12 @@ void tst_qdeclarativestates::anchorChanges5()
delete rect;
}
-void mirrorAnchors(QDeclarativeItem *item) {
- QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+void mirrorAnchors(QSGItem *item) {
+ QSGItemPrivate *itemPrivate = QSGItemPrivate::get(item);
itemPrivate->setLayoutMirror(true);
}
-qreal offsetRTL(QDeclarativeItem *anchorItem, QDeclarativeItem *item) {
+qreal offsetRTL(QSGItem *anchorItem, QSGItem *item) {
return anchorItem->width()+2*anchorItem->x()-item->width();
}
@@ -830,11 +831,11 @@ void tst_qdeclarativestates::anchorChangesRTL()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
mirrorAnchors(innerRect);
@@ -843,15 +844,15 @@ void tst_qdeclarativestates::anchorChangesRTL()
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rectPrivate->setState("right");
QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
- QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect));
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
rectPrivate->setState("");
QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) -qreal(5));
@@ -864,11 +865,11 @@ void tst_qdeclarativestates::anchorChangesRTL2()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
mirrorAnchors(innerRect);
@@ -886,18 +887,18 @@ void tst_qdeclarativestates::anchorChangesRTL3()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
- QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
mirrorAnchors(innerRect);
- QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline"));
QVERIFY(leftGuideline != 0);
- QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline"));
QVERIFY(bottomGuideline != 0);
QDeclarativeListReference list(rect, "states");
@@ -905,19 +906,19 @@ void tst_qdeclarativestates::anchorChangesRTL3()
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rectPrivate->setState("reanchored");
- QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
- QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+ QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect));
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().item, QSGItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().item, QSGItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QSGItemPrivate::get(bottomGuideline)->bottom().anchorLine);
QCOMPARE(innerRect->x(), offsetRTL(leftGuideline, innerRect) - qreal(10));
QCOMPARE(innerRect->y(), qreal(0));
@@ -941,10 +942,10 @@ void tst_qdeclarativestates::anchorChangesCrash()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChangesCrash.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+ QSGItemPrivate::get(rect)->setState("reanchored");
delete rect;
}
@@ -955,29 +956,29 @@ void tst_qdeclarativestates::anchorRewindBug()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItem * column = rect->findChild<QDeclarativeItem*>("column");
+ QSGItem * column = rect->findChild<QSGItem*>("column");
QVERIFY(column != 0);
- QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
- QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QVERIFY(!QSGItemPrivate::get(column)->heightValid);
+ QVERIFY(!QSGItemPrivate::get(column)->widthValid);
QCOMPARE(column->height(), 200.0);
- QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+ QSGItemPrivate::get(rect)->setState("reanchored");
// column height and width should stay implicit
// and column's implicit resizing should still work
- QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
- QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QVERIFY(!QSGItemPrivate::get(column)->heightValid);
+ QVERIFY(!QSGItemPrivate::get(column)->widthValid);
QCOMPARE(column->height(), 100.0);
- QDeclarativeItemPrivate::get(rect)->setState("");
+ QSGItemPrivate::get(rect)->setState("");
// column height and width should stay implicit
// and column's implicit resizing should still work
- QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
- QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QVERIFY(!QSGItemPrivate::get(column)->heightValid);
+ QVERIFY(!QSGItemPrivate::get(column)->widthValid);
QCOMPARE(column->height(), 200.0);
delete rect;
@@ -989,20 +990,20 @@ void tst_qdeclarativestates::anchorRewindBug2()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug2.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeRectangle *mover = rect->findChild<QDeclarativeRectangle*>("mover");
+ QSGRectangle *mover = rect->findChild<QSGRectangle*>("mover");
QVERIFY(mover != 0);
QCOMPARE(mover->y(), qreal(0.0));
QCOMPARE(mover->width(), qreal(50.0));
- QDeclarativeItemPrivate::get(rect)->setState("anchored");
+ QSGItemPrivate::get(rect)->setState("anchored");
QCOMPARE(mover->y(), qreal(250.0));
QCOMPARE(mover->width(), qreal(200.0));
- QDeclarativeItemPrivate::get(rect)->setState("");
+ QSGItemPrivate::get(rect)->setState("");
QCOMPARE(mover->y(), qreal(0.0));
QCOMPARE(mover->width(), qreal(50.0));
@@ -1015,9 +1016,9 @@ void tst_qdeclarativestates::script()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/script.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QCOMPARE(rect->color(),QColor("red"));
rectPrivate->setState("blue");
@@ -1033,9 +1034,9 @@ void tst_qdeclarativestates::restoreEntryValues()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/restoreEntryValues.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QCOMPARE(rect->color(),QColor("red"));
rectPrivate->setState("blue");
@@ -1050,9 +1051,9 @@ void tst_qdeclarativestates::explicitChanges()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/explicit.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QDeclarativeListReference list(rect, "states");
QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
QVERIFY(state != 0);
@@ -1083,14 +1084,14 @@ void tst_qdeclarativestates::propertyErrors()
{
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/propertyErrors.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"activeFocus\"");
- QDeclarativeItemPrivate::get(rect)->setState("blue");
+ QSGItemPrivate::get(rect)->setState("blue");
}
void tst_qdeclarativestates::incorrectRestoreBug()
@@ -1098,9 +1099,9 @@ void tst_qdeclarativestates::incorrectRestoreBug()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QCOMPARE(rect->color(),QColor("red"));
rectPrivate->setState("blue");
@@ -1141,9 +1142,9 @@ void tst_qdeclarativestates::deletingChange()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/deleting.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->radius(),qreal(5));
@@ -1173,7 +1174,7 @@ void tst_qdeclarativestates::deletingState()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/deletingState.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
QDeclarativeStateGroup *sg = rect->findChild<QDeclarativeStateGroup*>();
@@ -1204,9 +1205,9 @@ void tst_qdeclarativestates::tempState()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/legalTempState.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QTest::ignoreMessage(QtDebugMsg, "entering placed");
QTest::ignoreMessage(QtDebugMsg, "entering idle");
rectPrivate->setState("placed");
@@ -1218,9 +1219,9 @@ void tst_qdeclarativestates::illegalTempState()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/illegalTempState.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition.");
rectPrivate->setState("placed");
QCOMPARE(rectPrivate->state(), QLatin1String("placed"));
@@ -1231,9 +1232,9 @@ void tst_qdeclarativestates::nonExistantProperty()
QDeclarativeEngine engine;
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/nonExistantProp.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/nonExistantProp.qml") + ":9:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
rectPrivate->setState("blue");
QCOMPARE(rectPrivate->state(), QLatin1String("blue"));
@@ -1244,15 +1245,15 @@ void tst_qdeclarativestates::reset()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/reset.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeImage *image = rect->findChild<QDeclarativeImage*>();
+ QSGImage *image = rect->findChild<QSGImage*>();
QVERIFY(image != 0);
QCOMPARE(image->width(), qreal(40.));
QCOMPARE(image->height(), qreal(20.));
- QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QSGItemPrivate::get(rect)->setState("state1");
QCOMPARE(image->width(), 20.0);
QCOMPARE(image->height(), qreal(20.));
@@ -1276,9 +1277,9 @@ void tst_qdeclarativestates::whenOrdering()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/whenOrdering.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QCOMPARE(rectPrivate->state(), QLatin1String(""));
rect->setProperty("condition2", true);
@@ -1299,16 +1300,16 @@ void tst_qdeclarativestates::urlResolution()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/urlResolution.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItem *myType = rect->findChild<QDeclarativeItem*>("MyType");
- QDeclarativeImage *image1 = rect->findChild<QDeclarativeImage*>("image1");
- QDeclarativeImage *image2 = rect->findChild<QDeclarativeImage*>("image2");
- QDeclarativeImage *image3 = rect->findChild<QDeclarativeImage*>("image3");
+ QSGItem *myType = rect->findChild<QSGItem*>("MyType");
+ QSGImage *image1 = rect->findChild<QSGImage*>("image1");
+ QSGImage *image2 = rect->findChild<QSGImage*>("image2");
+ QSGImage *image3 = rect->findChild<QSGImage*>("image3");
QVERIFY(myType != 0 && image1 != 0 && image2 != 0 && image3 != 0);
- QDeclarativeItemPrivate::get(myType)->setState("SetImageState");
+ QSGItemPrivate::get(myType)->setState("SetImageState");
QUrl resolved = QUrl::fromLocalFile(SRCDIR "/data/Implementation/images/qt-logo.png");
QCOMPARE(image1->source(), resolved);
QCOMPARE(image2->source(), resolved);
@@ -1320,9 +1321,9 @@ void tst_qdeclarativestates::unnamedWhen()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/unnamedWhen.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QCOMPARE(rectPrivate->state(), QLatin1String(""));
QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
@@ -1339,9 +1340,9 @@ void tst_qdeclarativestates::returnToBase()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/returnToBase.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QCOMPARE(rectPrivate->state(), QLatin1String(""));
QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
@@ -1359,10 +1360,10 @@ void tst_qdeclarativestates::extendsBug()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/extendsBug.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
- QDeclarativeRectangle *greenRect = rect->findChild<QDeclarativeRectangle*>("greenRect");
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
+ QSGRectangle *greenRect = rect->findChild<QSGRectangle*>("greenRect");
rectPrivate->setState("b");
QCOMPARE(greenRect->x(), qreal(100));
@@ -1374,10 +1375,10 @@ void tst_qdeclarativestates::editProperties()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/editProperties.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect);
QDeclarativeStateGroup *stateGroup = rectPrivate->_states();
QVERIFY(stateGroup != 0);
@@ -1397,7 +1398,7 @@ void tst_qdeclarativestates::editProperties()
QDeclarativePropertyChanges *propertyChangesGreen = qobject_cast<QDeclarativePropertyChanges*>(greenState->operationAt(0));
QVERIFY(propertyChangesGreen != 0);
- QDeclarativeRectangle *childRect = rect->findChild<QDeclarativeRectangle*>("rect2");
+ QSGRectangle *childRect = rect->findChild<QSGRectangle*>("rect2");
QVERIFY(childRect != 0);
QCOMPARE(childRect->width(), qreal(402));
QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
@@ -1502,9 +1503,9 @@ void tst_qdeclarativestates::QTBUG_14830()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, SRCDIR "/data/QTBUG-14830.qml");
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
QVERIFY(rect != 0);
- QDeclarativeItem *item = rect->findChild<QDeclarativeItem*>("area");
+ QSGItem *item = rect->findChild<QSGItem*>("area");
QCOMPARE(item->width(), qreal(171));
}
diff --git a/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp b/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp
index b95c1196ee..993536f8b6 100644
--- a/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp
+++ b/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp
@@ -43,7 +43,7 @@
#include <QDebug>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <private/qdeclarativesystempalette_p.h>
+#include <QtDeclarative/private/qdeclarativesystempalette_p.h>
#include <qpalette.h>
#include "../../../shared/util.h"
@@ -75,7 +75,7 @@ tst_qdeclarativesystempalette::tst_qdeclarativesystempalette()
void tst_qdeclarativesystempalette::activePalette()
{
- QString componentStr = "import QtQuick 1.0\nSystemPalette { }";
+ QString componentStr = "import QtQuick 2.0\nSystemPalette { }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
@@ -104,7 +104,7 @@ void tst_qdeclarativesystempalette::activePalette()
void tst_qdeclarativesystempalette::inactivePalette()
{
- QString componentStr = "import QtQuick 1.0\nSystemPalette { colorGroup: SystemPalette.Inactive }";
+ QString componentStr = "import QtQuick 2.0\nSystemPalette { colorGroup: SystemPalette.Inactive }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
@@ -134,7 +134,7 @@ void tst_qdeclarativesystempalette::inactivePalette()
void tst_qdeclarativesystempalette::disabledPalette()
{
- QString componentStr = "import QtQuick 1.0\nSystemPalette { colorGroup: SystemPalette.Disabled }";
+ QString componentStr = "import QtQuick 2.0\nSystemPalette { colorGroup: SystemPalette.Disabled }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
@@ -164,7 +164,7 @@ void tst_qdeclarativesystempalette::disabledPalette()
void tst_qdeclarativesystempalette::paletteChanged()
{
- QString componentStr = "import QtQuick 1.0\nSystemPalette { }";
+ QString componentStr = "import QtQuick 2.0\nSystemPalette { }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
deleted file mode 100644
index 2cc9a8c05b..0000000000
--- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui network
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp
-HEADERS += ../shared/testhttpserver.h
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp
index f1a3c8fbf9..537c055f00 100644
--- a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp
+++ b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp
@@ -43,7 +43,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativetimer_p.h>
-#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtDeclarative/qsgitem.h>
#include <QDebug>
#ifdef Q_OS_SYMBIAN
@@ -100,7 +100,7 @@ void tst_qdeclarativetimer::notRepeating()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true }"), QUrl::fromLocalFile(""));
+ component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; running: true }"), QUrl::fromLocalFile(""));
QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
QVERIFY(timer != 0);
QVERIFY(timer->isRunning());
@@ -121,7 +121,7 @@ void tst_qdeclarativetimer::notRepeatingStart()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100 }"), QUrl::fromLocalFile(""));
+ component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100 }"), QUrl::fromLocalFile(""));
QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
QVERIFY(timer != 0);
QVERIFY(!timer->isRunning());
@@ -146,7 +146,7 @@ void tst_qdeclarativetimer::repeat()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; repeat: true; running: true }"), QUrl::fromLocalFile(""));
QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
QVERIFY(timer != 0);
@@ -188,7 +188,7 @@ void tst_qdeclarativetimer::triggeredOnStart()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl::fromLocalFile(""));
+ component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl::fromLocalFile(""));
QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
QVERIFY(timer != 0);
QVERIFY(timer->triggeredOnStart());
@@ -223,7 +223,7 @@ void tst_qdeclarativetimer::triggeredOnStartRepeat()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl::fromLocalFile(""));
+ component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl::fromLocalFile(""));
QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
QVERIFY(timer != 0);
@@ -247,7 +247,7 @@ void tst_qdeclarativetimer::noTriggerIfNotRunning()
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
component.setData(QByteArray(
- "import QtQuick 1.0\n"
+ "import QtQuick 2.0\n"
"Item { property bool ok: true\n"
"Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }"
"Timer { interval: 10; running: true; onTriggered: t1.running=false }"
@@ -265,7 +265,7 @@ void tst_qdeclarativetimer::changeDuration()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 200; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 200; repeat: true; running: true }"), QUrl::fromLocalFile(""));
QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
QVERIFY(timer != 0);
@@ -301,7 +301,7 @@ void tst_qdeclarativetimer::restart()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ component.setData(QByteArray("import QtQuick 2.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile(""));
QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
QVERIFY(timer != 0);
@@ -328,8 +328,8 @@ void tst_qdeclarativetimer::parentProperty()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import QtQuick 1.0\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile(""));
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ component.setData(QByteArray("import QtQuick 2.0\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile(""));
+ QSGItem *item = qobject_cast<QSGItem*>(component.create());
QVERIFY(item != 0);
QDeclarativeTimer *timer = item->findChild<QDeclarativeTimer*>("timer");
QVERIFY(timer != 0);
diff --git a/tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml b/tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml
index e7fb82ca36..2eea73b573 100644
--- a/tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml
+++ b/tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
QtObject {
diff --git a/tests/auto/declarative/qdeclarativev4/data/fetchException.qml b/tests/auto/declarative/qdeclarativev4/data/fetchException.qml
index ece8e73199..6431fcfae8 100644
--- a/tests/auto/declarative/qdeclarativev4/data/fetchException.qml
+++ b/tests/auto/declarative/qdeclarativev4/data/fetchException.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property Item data
diff --git a/tests/auto/declarative/qdeclarativev4/data/nullQObject.qml b/tests/auto/declarative/qdeclarativev4/data/nullQObject.qml
index 283c1a199b..00185b3988 100644
--- a/tests/auto/declarative/qdeclarativev4/data/nullQObject.qml
+++ b/tests/auto/declarative/qdeclarativev4/data/nullQObject.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property QtObject obj
diff --git a/tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml b/tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml
index f961910f15..ee3d405073 100644
--- a/tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml
+++ b/tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int data: 1
diff --git a/tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml b/tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml
index 25483b207d..a8e05eeda1 100644
--- a/tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml
+++ b/tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: thisTest
diff --git a/tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml b/tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml
index 3cfa0492c0..01fa515d6f 100644
--- a/tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml
+++ b/tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Item {
property real test1: -i1.p2
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml
index 70121435d4..2a1b936da6 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
BindingsSpliceCorrectlyType {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml
index 69dbcab9f2..84b465c565 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
BindingsSpliceCorrectlyType {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml
index 669feb99b2..f1212f8039 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
BindingsSpliceCorrectlyType {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml
index f28584f426..9c5e950660 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
BindingsSpliceCorrectlyType4 {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml
index 1214c83991..7d87ba1782 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
BindingsSpliceCorrectlyType5 {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml
index e2e696271b..923922c55a 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: root
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml
index 0e09ff957b..9804af4df6 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: root
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml
index 1f6646ea89..b5bb7f8ccc 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: root
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml
index 391cabaf9c..4f7ad39db0 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
import "deletedObject.js" as JS
MyTypeObject {
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml
index 082aed1d41..cc7861a122 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyTypeObject {
font.capitalization: Font.AllUppercase
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml
index e5d9ab2b41..cf41c90b90 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0 as MyQt
+import QtQuick 2.0 as MyQt
MyTypeObject {
font.capitalization: MyQt.Font.AllUppercase
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml
index 8ec508c9e3..de279dba6c 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0 as MyQt
+import QtQuick 2.0 as MyQt
MyTypeObject {
MyQt.Component.onCompleted: {
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml
index 2fdfddb272..5297a8260d 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.0
Item {
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml
index f1c185589c..1f9816f666 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyTypeObject {
property bool test1: false;
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml
index 9299c8b7f2..cbecb4379a 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
import Test 1.0
MyTypeObject {
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml
index fc41ecf088..68b54b571e 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml
@@ -1,5 +1,5 @@
import Test 1.0
-import QtQuick 1.0
+import QtQuick 2.0
MyTypeObject {
Component.onCompleted: {
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml
index ff80ff8408..9b56abbbed 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int x;
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml
index b419c83073..0ac56d9b66 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
WorkerScript {
id: worker
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml
index 0c439c4916..b5a92bf1f5 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
BaseWorker {
source: "script.js"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml
index 90c4617f79..aa20783e76 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
BaseWorker {
source: "script_error_onCall.js"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml
index 0b9d21dc4b..8a33aeb44c 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
BaseWorker {
source: "script_error_onLoad.js"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml
index 595cb2b552..100b8d4551 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
BaseWorker {
source: "script_include.js"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml
index a8800ad0b5..7e313b3c42 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
BaseWorker {
source: "script_pragma.js"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
index 2c85040f5f..cbf152bf8b 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
+++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
@@ -47,7 +47,6 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativeitem.h>
#include <private/qdeclarativeworkerscript_p.h>
#include <private/qdeclarativeengine_p.h>
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
index 0196586bb7..9ba97fac4b 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string urlDummy
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
index aeea278967..d5bb84ddc0 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url: "testdocument.html"
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
index fffc3d9c09..4f58062a26 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url: "testdocument.html"
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml
index 5d5dd12f54..b1c081c5fd 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool xmlTest: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml
index ec6902dc45..ee1043f97f 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
id: obj
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml
index be60664e03..f558fdadc6 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool xmlTest: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml
index 0050f919d1..458066736e 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool calledAsConstructor
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml
index 77b2b94e29..913fe59f99 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int readyState
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml
index faf3af0acb..7695cd76a1 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool xmlTest: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml
index 0f32a64a94..092db3443d 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int index_size_err: DOMException.INDEX_SIZE_ERR
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml
index daec950343..9b190f3a43 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool xmlTest: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
index 686e7e5cf0..580688b835 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml
index e8b7b770c1..84a0bf3015 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool exceptionThrown: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml
index 1d4883ea7d..27edb4c4b7 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml
index 360286d3e4..3d57348cc5 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
index f37545e1e6..203967e539 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml
index 61ce9c6f67..dccc71dfc3 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool exceptionThrown: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml
index 7cd91a2a1f..cff7af79e2 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml
index 983ea1b82a..ad2ea0bd33 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml
index 79e06d483b..b3a54e9b53 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int unsent
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml
index 312292deaf..5a4093b9f1 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool readyState: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
index 4bb5b1d657..6e7681dfb4 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml
index da6eb14273..61ef76d488 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool exceptionThrown: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
index f003292703..677759ccf3 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool exceptionThrown: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
index b87823d54c..0f29031e42 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool exceptionThrown: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
index 9f8f30982f..eafdda761f 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool exceptionThrown: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
index 2bec344726..4eaef536b3 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml
index 70f2fa6227..b8ce5361f3 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml
index f009ab78c0..e5c7b74553 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml
index 86337c436c..0894573ecc 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml
index cd125adf86..003d1954e9 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
index da229f6216..4b216d9c85 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml
index 393ff09a01..e9265e09ef 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool xmlNull: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
index fd1c424786..4e0caa7171 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool dataOK: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
index 3dd851e591..6faac0242f 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
index fb1893627d..383a76e75e 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
index 9f2383e066..5cb8c926c2 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
index 410820e244..884661c8ce 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
index f56c51b8c3..c031b84418 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
index d44864ccee..42eb360d14 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
index 427d9f4312..5dc252f970 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
index 442932be26..336971c919 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string reqType
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml
index badd7296e8..ef56517bf5 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
index 5afab091a9..4229584af2 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml
index 4558f0e56a..1cef3e43da 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool exceptionThrown: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
index b15318c1e1..cd047cf8dd 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
index 3b9a91e257..49888fdac8 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml
index 327fa7fb43..f528aa912c 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool test: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml
index bc22d877f5..1b701e90ff 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property int unsent: XMLHttpRequest.UNSENT
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
index 7aa08743ff..51964570d6 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
index d42e0cca0a..e7f658fc29 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property string url
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml
index e8c8731240..b79e0bc7b1 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool xmlTest: false
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml
index 0f9da30963..7c024bfda6 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
QtObject {
property bool dataOK: false
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml
index fdacb6c445..bf47f43567 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
source: "model.xml"
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml
index ed674ce36f..cc05b7c665 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
source: "model.xml"
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml
index 6345101d9a..3834cccf1d 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
source: "recipes.xml"
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml
index 492dad920f..50b8c0db49 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
id: model
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml
index a0d846f188..c86a3720ad 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
source: "model.xml"
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml
index d90cd61096..74eca3edcf 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
query: "/data/item"
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml
index 4dbcc029e0..1f987e0781 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
query: "/data"
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml
index dab8ffa78e..e4ed533d4e 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
source: "model.xml"
diff --git a/tests/auto/declarative/qsgflickable/data/disabledcontent.qml b/tests/auto/declarative/qsgflickable/data/disabledcontent.qml
deleted file mode 100644
index f02f08e4ea..0000000000
--- a/tests/auto/declarative/qsgflickable/data/disabledcontent.qml
+++ /dev/null
@@ -1,8 +0,0 @@
-import QtQuick 2.0
-
-Flickable {
- width: 100; height: 100
- contentWidth: 200; contentHeight: 300
-
- QGraphicsWidget { width: 200; height: 300; enabled: false }
-}
diff --git a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
index bbddbfe749..d1007819a4 100644
--- a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
+++ b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
@@ -72,7 +72,6 @@ private slots:
void maximumFlickVelocity();
void flickDeceleration();
void pressDelay();
- void disabledContent();
void nestedPressDelay();
void flickableDirection();
void resizeContent();
@@ -260,44 +259,6 @@ void tst_qsgflickable::pressDelay()
QCOMPARE(spy.count(),1);
}
-// QT-4677
-void tst_qsgflickable::disabledContent()
-{
- QSGView *canvas = new QSGView;
- canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/disabledcontent.qml"));
- canvas->show();
- canvas->setFocus();
- QVERIFY(canvas->rootObject() != 0);
-
- QSGFlickable *flickable = qobject_cast<QSGFlickable*>(canvas->rootObject());
- QVERIFY(flickable != 0);
-
- QVERIFY(flickable->contentX() == 0);
- QVERIFY(flickable->contentY() == 0);
-
- QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(50, 50));
- {
- QMouseEvent mv(QEvent::MouseMove, QPoint(70,70), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QApplication::sendEvent(canvas, &mv);
- }
- {
- QMouseEvent mv(QEvent::MouseMove, QPoint(90,90), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QApplication::sendEvent(canvas, &mv);
- }
- {
- QMouseEvent mv(QEvent::MouseMove, QPoint(100,100), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QApplication::sendEvent(canvas, &mv);
- }
-
- QVERIFY(flickable->contentX() < 0);
- QVERIFY(flickable->contentY() < 0);
-
- QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(90, 90));
-
- delete canvas;
-}
-
-
// QTBUG-17361
void tst_qsgflickable::nestedPressDelay()
{
diff --git a/tests/auto/declarative/qsglistview/data/displaylist.qml b/tests/auto/declarative/qsglistview/data/displaylist.qml
index c083da5aa5..4e8fd32f6a 100644
--- a/tests/auto/declarative/qsglistview/data/displaylist.qml
+++ b/tests/auto/declarative/qsglistview/data/displaylist.qml
@@ -13,7 +13,7 @@ Rectangle {
id: wrapper
objectName: "wrapper"
height: root.delegateHeight
- Behavior on height { NumberAnimation {} }
+ Behavior on height { NumberAnimation { duration: 200} }
width: 240
Text {
text: index
diff --git a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp b/tests/auto/declarative/qsglistview/tst_qsglistview.cpp
index 22743b6f45..3abca71182 100644
--- a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp
+++ b/tests/auto/declarative/qsglistview/tst_qsglistview.cpp
@@ -1761,7 +1761,7 @@ void tst_QSGListView::modelChanges()
listView->setModel(QVariant());
QTRY_COMPARE(modelSpy.count(),2);
-// delete canvas;
+ delete canvas;
}
void tst_QSGListView::QTBUG_9791()
@@ -2232,12 +2232,12 @@ void tst_QSGListView::resizeDelegate()
qApp->processEvents();
QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list");
- QTRY_VERIFY(listview != 0);
+ QVERIFY(listview != 0);
QSGItem *contentItem = listview->contentItem();
- QTRY_VERIFY(contentItem != 0);
+ QVERIFY(contentItem != 0);
- QTRY_COMPARE(listview->count(), model.rowCount());
+ QCOMPARE(listview->count(), model.rowCount());
listview->setCurrentIndex(25);
listview->setContentY(0);
@@ -2252,7 +2252,7 @@ void tst_QSGListView::resizeDelegate()
QTRY_COMPARE(listview->highlightItem()->y(), 500.0);
canvas->rootObject()->setProperty("delegateHeight", 30);
- qApp->processEvents();
+ QTest::qWait(300);
for (int i = 0; i < 11; ++i) {
QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i);
@@ -2277,7 +2277,7 @@ void tst_QSGListView::resizeDelegate()
QTRY_COMPARE(listview->highlightItem()->y(), 30.0);
canvas->rootObject()->setProperty("delegateHeight", 20);
- qApp->processEvents();
+ QTest::qWait(300);
for (int i = 5; i < 11; ++i) {
QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i);
diff --git a/tests/auto/declarative/shared/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h
index 7e3e9e9eac..be8df86b90 100644
--- a/tests/auto/declarative/shared/debugutil_p.h
+++ b/tests/auto/declarative/shared/debugutil_p.h
@@ -49,7 +49,6 @@
#include <private/qdeclarativedebugclient_p.h>
#include <private/qdeclarativedebugservice_p.h>
-#include <private/qdeclarativeitem_p.h>
class QDeclarativeDebugTest
{
diff --git a/tests/auto/declarative/moduleqt47/data/importqt47.qml b/tests/auto/qtquick1/moduleqt47/data/importqt47.qml
index 0a1b533cba..0a1b533cba 100644
--- a/tests/auto/declarative/moduleqt47/data/importqt47.qml
+++ b/tests/auto/qtquick1/moduleqt47/data/importqt47.qml
diff --git a/tests/auto/declarative/moduleqt47/moduleqt47.pro b/tests/auto/qtquick1/moduleqt47/moduleqt47.pro
index 8c196d8097..2a3f08753d 100644
--- a/tests/auto/declarative/moduleqt47/moduleqt47.pro
+++ b/tests/auto/qtquick1/moduleqt47/moduleqt47.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_moduleqt47.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp b/tests/auto/qtquick1/moduleqt47/tst_moduleqt47.cpp
index 3b57a52638..cfacae2428 100644
--- a/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp
+++ b/tests/auto/qtquick1/moduleqt47/tst_moduleqt47.cpp
@@ -42,6 +42,7 @@
#include <QDir>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QDebug>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -69,7 +70,7 @@ private:
tst_moduleqt47::tst_moduleqt47()
{
- excludedFiles << "tests/auto/declarative/moduleqt47/data/importqt47.qml"
+ excludedFiles << "tests/auto/qtquick1/moduleqt47/data/importqt47.qml"
<< "doc/src/declarative/whatsnew.qdoc";
}
@@ -78,6 +79,8 @@ void tst_moduleqt47::create()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/importqt47.qml"));
QObject *obj = qobject_cast<QObject*>(c.create());
+ if (!obj)
+ qWarning() << c.errorString();
QVERIFY(obj != 0);
delete obj;
@@ -128,6 +131,8 @@ void tst_moduleqt47::accidentalImport()
return;
QByteArray data = f.readAll();
+ if (data.contains("import Qt 4"))
+ qDebug() << file;
QVERIFY(!data.contains("import Qt 4"));
}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/anchors.qml
index 9b7c805336..9b7c805336 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/anchors.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
index 82d0315aad..82d0315aad 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/centerin.qml
index d3bc8cb2bc..d3bc8cb2bc 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/centerin.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/crash1.qml
index de66067ce6..de66067ce6 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/crash1.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/fill.qml
index ff19675ef1..ff19675ef1 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/fill.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/hvCenter.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/hvCenter.qml
index 11b31ffdc0..11b31ffdc0 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/hvCenter.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/hvCenter.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/loop1.qml
index def48fae52..def48fae52 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/loop1.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/loop2.qml
index 21571e29ae..21571e29ae 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/loop2.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml b/tests/auto/qtquick1/qdeclarativeanchors/data/margins.qml
index 685346a879..685346a879 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
+++ b/tests/auto/qtquick1/qdeclarativeanchors/data/margins.qml
diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/qtquick1/qdeclarativeanchors/qdeclarativeanchors.pro
index ba2287d97c..12b545811d 100644
--- a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
+++ b/tests/auto/qtquick1/qdeclarativeanchors/qdeclarativeanchors.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
SOURCES += tst_qdeclarativeanchors.cpp
macx:CONFIG -= app_bundle
@@ -13,4 +13,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
index 388e115f00..795c91e9c4 100644
--- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
+++ b/tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -44,26 +44,25 @@
#include <private/qgraphicsitem_p.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativetext_p.h>
-#include <QtDeclarative/private/qdeclarativeanchors_p_p.h>
-#include <QtDeclarative/private/qdeclarativeitem_p.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativeanchors_p_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
#define SRCDIR "."
#endif
-Q_DECLARE_METATYPE(QDeclarativeAnchors::Anchor)
-Q_DECLARE_METATYPE(QDeclarativeAnchorLine::AnchorLine)
+Q_DECLARE_METATYPE(QDeclarative1Anchors::Anchor)
+Q_DECLARE_METATYPE(QDeclarative1AnchorLine::AnchorLine)
-
-class tst_qdeclarativeanchors : public QObject
+class tst_QDeclarative1Anchors : public QObject
{
Q_OBJECT
public:
- tst_qdeclarativeanchors() {}
+ tst_QDeclarative1Anchors() {}
private slots:
void basicAnchors();
@@ -130,7 +129,7 @@ QGraphicsObject *findObject(QGraphicsObject *parent, const QString &objectName)
}
-void tst_qdeclarativeanchors::basicAnchors()
+void tst_QDeclarative1Anchors::basicAnchors()
{
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml"));
@@ -138,66 +137,66 @@ void tst_qdeclarativeanchors::basicAnchors()
qApp->processEvents();
//sibling horizontal
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect1"))->x(), 26.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect2"))->x(), 122.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect3"))->x(), 74.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect4"))->x(), 16.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect5"))->x(), 112.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect6"))->x(), 64.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect1"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect2"))->x(), 122.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect3"))->x(), 74.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect4"))->x(), 16.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect5"))->x(), 112.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect6"))->x(), 64.0);
//parent horizontal
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect7"))->x(), 0.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect8"))->x(), 240.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect9"))->x(), 120.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect10"))->x(), -10.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect11"))->x(), 230.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect12"))->x(), 110.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect7"))->x(), 0.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect8"))->x(), 240.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect9"))->x(), 120.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect10"))->x(), -10.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect11"))->x(), 230.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect12"))->x(), 110.0);
//vertical
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect13"))->y(), 20.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect14"))->y(), 155.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect13"))->y(), 20.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect14"))->y(), 155.0);
//stretch
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect15"))->x(), 26.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect15"))->width(), 96.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect16"))->x(), 26.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect16"))->width(), 192.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect17"))->x(), -70.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect17"))->width(), 192.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect15"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect15"))->width(), 96.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect16"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect16"))->width(), 192.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect17"))->x(), -70.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect17"))->width(), 192.0);
//vertical stretch
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect18"))->y(), 20.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect18"))->height(), 40.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect18"))->y(), 20.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect18"))->height(), 40.0);
//more parent horizontal
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect19"))->x(), 115.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect20"))->x(), 235.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect21"))->x(), -5.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect19"))->x(), 115.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect20"))->x(), 235.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect21"))->x(), -5.0);
//centerIn
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect22"))->x(), 69.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect22"))->y(), 5.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect22"))->x(), 69.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect22"))->y(), 5.0);
//margins
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->x(), 31.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->y(), 5.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->width(), 86.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->height(), 10.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect23"))->x(), 31.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect23"))->y(), 5.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect23"))->width(), 86.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect23"))->height(), 10.0);
// offsets
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect24"))->x(), 26.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect25"))->y(), 60.0);
- QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect26"))->y(), 5.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect24"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect25"))->y(), 60.0);
+ QCOMPARE(findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("rect26"))->y(), 5.0);
//baseline
- QDeclarativeText *text1 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text1"));
- QDeclarativeText *text2 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text2"));
+ QDeclarative1Text *text1 = findItem<QDeclarative1Text>(view->rootObject(), QLatin1String("text1"));
+ QDeclarative1Text *text2 = findItem<QDeclarative1Text>(view->rootObject(), QLatin1String("text2"));
QCOMPARE(text1->y(), text2->y());
delete view;
}
-void tst_qdeclarativeanchors::basicAnchorsQGraphicsWidget()
+void tst_QDeclarative1Anchors::basicAnchorsQGraphicsWidget()
{
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchorsqgraphicswidget.qml"));
@@ -257,8 +256,8 @@ void tst_qdeclarativeanchors::basicAnchorsQGraphicsWidget()
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect26"))->y(), 5.0);
//baseline
- QDeclarativeText *text1 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text1"));
- QDeclarativeText *text2 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text2"));
+ QDeclarative1Text *text1 = findItem<QDeclarative1Text>(view->rootObject(), QLatin1String("text1"));
+ QDeclarative1Text *text2 = findItem<QDeclarative1Text>(view->rootObject(), QLatin1String("text2"));
QCOMPARE(text1->y(), text2->y());
delete view;
@@ -282,7 +281,7 @@ void mirrorAnchors(QDeclarativeItem *item) {
itemPrivate->setLayoutMirror(true);
}
-void tst_qdeclarativeanchors::basicAnchorsRTL()
+void tst_QDeclarative1Anchors::basicAnchorsRTL()
{
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml"));
@@ -356,15 +355,15 @@ void tst_qdeclarativeanchors::basicAnchorsRTL()
QCOMPARE(childItem(rootItem, "rect26")->y(), 5.0);
//baseline
- QDeclarativeText *text1 = findItem<QDeclarativeText>(rootItem, QLatin1String("text1"));
- QDeclarativeText *text2 = findItem<QDeclarativeText>(rootItem, QLatin1String("text2"));
+ QDeclarative1Text *text1 = findItem<QDeclarative1Text>(rootItem, QLatin1String("text1"));
+ QDeclarative1Text *text2 = findItem<QDeclarative1Text>(rootItem, QLatin1String("text2"));
QCOMPARE(text1->y(), text2->y());
delete view;
}
// mostly testing that we don't crash
-void tst_qdeclarativeanchors::loops()
+void tst_QDeclarative1Anchors::loops()
{
{
QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop1.qml"));
@@ -396,7 +395,7 @@ void tst_qdeclarativeanchors::loops()
}
}
-void tst_qdeclarativeanchors::illegalSets()
+void tst_QDeclarative1Anchors::illegalSets()
{
QFETCH(QString, qml);
QFETCH(QString, warning);
@@ -413,7 +412,7 @@ void tst_qdeclarativeanchors::illegalSets()
delete o;
}
-void tst_qdeclarativeanchors::illegalSets_data()
+void tst_QDeclarative1Anchors::illegalSets_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QString>("warning");
@@ -471,15 +470,15 @@ void tst_qdeclarativeanchors::illegalSets_data()
<< "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
}
-void tst_qdeclarativeanchors::reset()
+void tst_QDeclarative1Anchors::reset()
{
QFETCH(QString, side);
- QFETCH(QDeclarativeAnchorLine::AnchorLine, anchorLine);
- QFETCH(QDeclarativeAnchors::Anchor, usedAnchor);
+ QFETCH(QDeclarative1AnchorLine::AnchorLine, anchorLine);
+ QFETCH(QDeclarative1Anchors::Anchor, usedAnchor);
QDeclarativeItem *baseItem = new QDeclarativeItem;
- QDeclarativeAnchorLine anchor;
+ QDeclarative1AnchorLine anchor;
anchor.item = baseItem;
anchor.anchorLine = anchorLine;
@@ -499,23 +498,23 @@ void tst_qdeclarativeanchors::reset()
delete baseItem;
}
-void tst_qdeclarativeanchors::reset_data()
+void tst_QDeclarative1Anchors::reset_data()
{
QTest::addColumn<QString>("side");
- QTest::addColumn<QDeclarativeAnchorLine::AnchorLine>("anchorLine");
- QTest::addColumn<QDeclarativeAnchors::Anchor>("usedAnchor");
+ QTest::addColumn<QDeclarative1AnchorLine::AnchorLine>("anchorLine");
+ QTest::addColumn<QDeclarative1Anchors::Anchor>("usedAnchor");
- QTest::newRow("left") << "left" << QDeclarativeAnchorLine::Left << QDeclarativeAnchors::LeftAnchor;
- QTest::newRow("top") << "top" << QDeclarativeAnchorLine::Top << QDeclarativeAnchors::TopAnchor;
- QTest::newRow("right") << "right" << QDeclarativeAnchorLine::Right << QDeclarativeAnchors::RightAnchor;
- QTest::newRow("bottom") << "bottom" << QDeclarativeAnchorLine::Bottom << QDeclarativeAnchors::BottomAnchor;
+ QTest::newRow("left") << "left" << QDeclarative1AnchorLine::Left << QDeclarative1Anchors::LeftAnchor;
+ QTest::newRow("top") << "top" << QDeclarative1AnchorLine::Top << QDeclarative1Anchors::TopAnchor;
+ QTest::newRow("right") << "right" << QDeclarative1AnchorLine::Right << QDeclarative1Anchors::RightAnchor;
+ QTest::newRow("bottom") << "bottom" << QDeclarative1AnchorLine::Bottom << QDeclarative1Anchors::BottomAnchor;
- QTest::newRow("hcenter") << "horizontalCenter" << QDeclarativeAnchorLine::HCenter << QDeclarativeAnchors::HCenterAnchor;
- QTest::newRow("vcenter") << "verticalCenter" << QDeclarativeAnchorLine::VCenter << QDeclarativeAnchors::VCenterAnchor;
- QTest::newRow("baseline") << "baseline" << QDeclarativeAnchorLine::Baseline << QDeclarativeAnchors::BaselineAnchor;
+ QTest::newRow("hcenter") << "horizontalCenter" << QDeclarative1AnchorLine::HCenter << QDeclarative1Anchors::HCenterAnchor;
+ QTest::newRow("vcenter") << "verticalCenter" << QDeclarative1AnchorLine::VCenter << QDeclarative1Anchors::VCenterAnchor;
+ QTest::newRow("baseline") << "baseline" << QDeclarative1AnchorLine::Baseline << QDeclarative1Anchors::BaselineAnchor;
}
-void tst_qdeclarativeanchors::resetConvenience()
+void tst_QDeclarative1Anchors::resetConvenience()
{
QDeclarativeItem *baseItem = new QDeclarativeItem;
QDeclarativeItem *item = new QDeclarativeItem;
@@ -537,11 +536,11 @@ void tst_qdeclarativeanchors::resetConvenience()
delete baseItem;
}
-void tst_qdeclarativeanchors::nullItem()
+void tst_QDeclarative1Anchors::nullItem()
{
QFETCH(QString, side);
- QDeclarativeAnchorLine anchor;
+ QDeclarative1AnchorLine anchor;
QDeclarativeItem *item = new QDeclarativeItem;
QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
@@ -554,7 +553,7 @@ void tst_qdeclarativeanchors::nullItem()
delete item;
}
-void tst_qdeclarativeanchors::nullItem_data()
+void tst_QDeclarative1Anchors::nullItem_data()
{
QTest::addColumn<QString>("side");
@@ -568,7 +567,7 @@ void tst_qdeclarativeanchors::nullItem_data()
QTest::newRow("baseline") << "baseline";
}
-void tst_qdeclarativeanchors::crash1()
+void tst_QDeclarative1Anchors::crash1()
{
QUrl source(QUrl::fromLocalFile(SRCDIR "/data/crash1.qml"));
@@ -591,12 +590,12 @@ void tst_qdeclarativeanchors::crash1()
delete view;
}
-void tst_qdeclarativeanchors::fill()
+void tst_QDeclarative1Anchors::fill()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/fill.qml"));
qApp->processEvents();
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("filler"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->x(), 0.0 + 10.0);
QCOMPARE(rect->y(), 0.0 + 30.0);
@@ -615,12 +614,12 @@ void tst_qdeclarativeanchors::fill()
delete view;
}
-void tst_qdeclarativeanchors::fillRTL()
+void tst_QDeclarative1Anchors::fillRTL()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/fill.qml"));
qApp->processEvents();
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("filler"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
mirrorAnchors(rect);
@@ -640,12 +639,12 @@ void tst_qdeclarativeanchors::fillRTL()
delete view;
}
-void tst_qdeclarativeanchors::centerIn()
+void tst_QDeclarative1Anchors::centerIn()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
qApp->processEvents();
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->x(), 75.0 + 10);
@@ -660,12 +659,12 @@ void tst_qdeclarativeanchors::centerIn()
}
-void tst_qdeclarativeanchors::centerInRTL()
+void tst_QDeclarative1Anchors::centerInRTL()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
qApp->processEvents();
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
mirrorAnchors(rect);
@@ -680,12 +679,12 @@ void tst_qdeclarativeanchors::centerInRTL()
delete view;
}
-void tst_qdeclarativeanchors::hvCenter()
+void tst_QDeclarative1Anchors::hvCenter()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
qApp->processEvents();
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
// test QTBUG-10999
@@ -700,12 +699,12 @@ void tst_qdeclarativeanchors::hvCenter()
delete view;
}
-void tst_qdeclarativeanchors::hvCenterRTL()
+void tst_QDeclarative1Anchors::hvCenterRTL()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
qApp->processEvents();
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
mirrorAnchors(rect);
@@ -720,12 +719,12 @@ void tst_qdeclarativeanchors::hvCenterRTL()
delete view;
}
-void tst_qdeclarativeanchors::margins()
+void tst_QDeclarative1Anchors::margins()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
qApp->processEvents();
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("filler"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->x(), 5.0);
QCOMPARE(rect->y(), 6.0);
@@ -743,11 +742,11 @@ void tst_qdeclarativeanchors::margins()
delete view;
}
-void tst_qdeclarativeanchors::marginsRTL()
+void tst_QDeclarative1Anchors::marginsRTL()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
- QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarative1Rectangle* rect = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("filler"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
mirrorAnchors(rect);
@@ -768,6 +767,6 @@ void tst_qdeclarativeanchors::marginsRTL()
}
-QTEST_MAIN(tst_qdeclarativeanchors)
+QTEST_MAIN(tst_QDeclarative1Anchors)
#include "tst_qdeclarativeanchors.moc"
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.gif b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/colors.gif
index 1270bfaa79..1270bfaa79 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.gif
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/colors.gif
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/colors.qml
index 51deb56b18..51deb56b18 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/colors.qml
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/hearts.gif
index cfb55f27f5..cfb55f27f5 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/hearts.gif
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/hearts.qml
index 8729dd2ef2..8729dd2ef2 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/hearts.qml
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/qmldir b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/qmldir
index ef7c1f44f3..ef7c1f44f3 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/qmldir
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/qmldir
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/qtbug-16520.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/qtbug-16520.qml
index cf5b60110b..cf5b60110b 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/qtbug-16520.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/qtbug-16520.qml
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.gif b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickman.gif
index 7c4cd18687..7c4cd18687 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.gif
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickman.gif
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickman.qml
index d44937f913..d44937f913 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickman.qml
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanerror1.qml
index f08f74da56..f08f74da56 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanerror1.qml
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanpause.qml
index 1d7e25909f..1d7e25909f 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanpause.qml
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanscaled.qml
index 8b24d73715..8b24d73715 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanscaled.qml
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanstopped.qml
index c5b14137e3..c5b14137e3 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/data/stickmanstopped.qml
diff --git a/tests/auto/qtquick1/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/qtquick1/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
new file mode 100644
index 0000000000..a338a94ce1
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative network qtquick1
+HEADERS += ../../declarative/shared/testhttpserver.h
+SOURCES += tst_qdeclarativeanimatedimage.cpp ../../declarative/shared/testhttpserver.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/qtquick1/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
index e7121a58a6..1d2f5ad4de 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
+++ b/tests/auto/qtquick1/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
@@ -41,14 +41,14 @@
#include <qtest.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativeimage_p.h>
#include <private/qdeclarativeanimatedimage_p.h>
#include <QSignalSpy>
#include <QtDeclarative/qdeclarativecontext.h>
-#include "../shared/testhttpserver.h"
+#include "../../declarative/shared/testhttpserver.h"
#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
@@ -96,7 +96,7 @@ void tst_qdeclarativeanimatedimage::play()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickman.qml"));
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QVERIFY(anim->isPlaying());
@@ -107,7 +107,7 @@ void tst_qdeclarativeanimatedimage::pause()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml"));
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QVERIFY(anim->isPlaying());
QVERIFY(anim->isPaused());
@@ -119,7 +119,7 @@ void tst_qdeclarativeanimatedimage::stopped()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanstopped.qml"));
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QVERIFY(!anim->isPlaying());
QCOMPARE(anim->currentFrame(), 0);
@@ -131,7 +131,7 @@ void tst_qdeclarativeanimatedimage::setFrame()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml"));
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QVERIFY(anim->isPlaying());
QCOMPARE(anim->currentFrame(), 2);
@@ -143,7 +143,7 @@ void tst_qdeclarativeanimatedimage::frameCount()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/colors.qml"));
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QVERIFY(anim->isPlaying());
QCOMPARE(anim->frameCount(), 3);
@@ -157,7 +157,7 @@ void tst_qdeclarativeanimatedimage::mirror_running()
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/hearts.qml"));
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QGraphicsScene scene;
@@ -200,7 +200,7 @@ void tst_qdeclarativeanimatedimage::mirror_notRunning()
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, fileUrl);
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QGraphicsScene scene;
@@ -251,7 +251,7 @@ void tst_qdeclarativeanimatedimage::remote()
QDeclarativeComponent component(&engine, QUrl("http://127.0.0.1:14449/" + fileName));
QTRY_VERIFY(component.isReady());
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QTRY_VERIFY(anim->isPlaying());
@@ -259,7 +259,7 @@ void tst_qdeclarativeanimatedimage::remote()
QTRY_VERIFY(anim->isPaused());
QCOMPARE(anim->currentFrame(), 2);
}
- QVERIFY(anim->status() != QDeclarativeAnimatedImage::Error);
+ QVERIFY(anim->status() != QDeclarative1AnimatedImage::Error);
delete anim;
}
@@ -268,7 +268,7 @@ void tst_qdeclarativeanimatedimage::sourceSize()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanscaled.qml"));
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QCOMPARE(anim->width(),240.0);
QCOMPARE(anim->height(),180.0);
@@ -303,7 +303,7 @@ void tst_qdeclarativeanimatedimage::invalidSource()
QTest::ignoreMessage(QtWarningMsg, "file::2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif");
- QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QDeclarative1AnimatedImage *anim = qobject_cast<QDeclarative1AnimatedImage *>(component.create());
QVERIFY(anim);
QVERIFY(!anim->isPlaying());
@@ -323,9 +323,9 @@ void tst_qdeclarativeanimatedimage::qtbug_16520()
QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/qtbug-16520.qml"));
QTRY_VERIFY(component.isReady());
- QDeclarativeRectangle *root = qobject_cast<QDeclarativeRectangle *>(component.create());
+ QDeclarative1Rectangle *root = qobject_cast<QDeclarative1Rectangle *>(component.create());
QVERIFY(root);
- QDeclarativeAnimatedImage *anim = root->findChild<QDeclarativeAnimatedImage*>("anim");
+ QDeclarative1AnimatedImage *anim = root->findChild<QDeclarative1AnimatedImage*>("anim");
anim->setProperty("source", "http://127.0.0.1:14449/stickman.gif");
@@ -347,18 +347,18 @@ void tst_qdeclarativeanimatedimage::progressAndStatusChanges()
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/stickman.gif"));
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
- QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QVERIFY(obj->status() == QDeclarative1Image::Ready);
QTRY_VERIFY(obj->progress() == 1.0);
QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &)));
QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal)));
- QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarativeImageBase::Status)));
+ QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarative1ImageBase::Status)));
// Loading local file
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.gif"));
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
QTRY_VERIFY(obj->progress() == 1.0);
QTRY_COMPARE(sourceSpy.count(), 1);
QTRY_COMPARE(progressSpy.count(), 0);
@@ -366,16 +366,16 @@ void tst_qdeclarativeanimatedimage::progressAndStatusChanges()
// Loading remote file
ctxt->setContextProperty("srcImage", "http://127.0.0.1:14449/stickman.gif");
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Loading);
QTRY_VERIFY(obj->progress() == 0.0);
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
QTRY_VERIFY(obj->progress() == 1.0);
QTRY_COMPARE(sourceSpy.count(), 2);
QTRY_VERIFY(progressSpy.count() > 1);
QTRY_COMPARE(statusSpy.count(), 2);
ctxt->setContextProperty("srcImage", "");
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Null);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Null);
QTRY_VERIFY(obj->progress() == 0.0);
QTRY_COMPARE(sourceSpy.count(), 3);
QTRY_VERIFY(progressSpy.count() > 2);
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/Double.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/Double.qml
new file mode 100644
index 0000000000..b247fcee5f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/Double.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ property bool on: false
+ border.color: "#ffffff"
+ color: "green"
+ width: 50
+ height: 50
+ NumberAnimation on x {
+ objectName: "animation"
+ running: container.on; from: 0; to: 600; loops: Animation.Infinite; duration: 2000
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/attached.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/attached.qml
new file mode 100644
index 0000000000..c5d5535bb7
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/attached.qml
@@ -0,0 +1,34 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 180; height: 200;
+
+ Component {
+ id: delegate
+ Rectangle {
+ id: wrapper
+ width: 180; height: 200
+ color: "blue"
+
+ states: State {
+ name: "otherState"
+ PropertyChanges { target: wrapper; color: "green" }
+ }
+
+ transitions: Transition {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ ScriptAction { script: console.log(wrapper.ListView.delayRemove ? "on" : "off") }
+ }
+
+ Component.onCompleted: {
+ console.log(ListView.delayRemove ? "on" : "off");
+ wrapper.state = "otherState"
+ }
+ }
+ }
+
+ ListView {
+ model: 1
+ delegate: delegate
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/badproperty1.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/badproperty1.qml
new file mode 100644
index 0000000000..3e7ebe7440
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/badproperty1.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { target: myRect; to: "red"; property: "border.colr"; duration: 1000 }
+ }
+ Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/badproperty2.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/badproperty2.qml
new file mode 100644
index 0000000000..40235eee15
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/badproperty2.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { target: myRect; to: "red"; property: "border"; duration: 1000 }
+ }
+ Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/badtype1.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype1.qml
new file mode 100644
index 0000000000..0a8a7ea7f9
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype1.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ Rectangle {
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ PropertyAnimation on x { from: "blue"; to: "green"; }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/badtype2.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype2.qml
new file mode 100644
index 0000000000..118bbbc889
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype2.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ Rectangle {
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { from: "blue"; to: "green"; }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/badtype3.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype3.qml
new file mode 100644
index 0000000000..2599e70cc9
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype3.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ Rectangle {
+ color: "red"
+ ColorAnimation on color { from: 10; to: 15; }
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/badtype4.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype4.qml
new file mode 100644
index 0000000000..5dafb0e344
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/badtype4.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; x: 200; color: "blue" }
+ }
+ transitions: Transition {
+ //comment out each in turn to make sure each only animates the relevant property
+ ColorAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ NumberAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/dontAutoStart.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/dontAutoStart.qml
new file mode 100644
index 0000000000..e2ce07fbfc
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/dontAutoStart.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ Behavior on x {
+ NumberAnimation { id: myAnim; objectName: "MyAnim"; target: redRect; property: "y"; to: 300; loops: Animation.Infinite}
+ }
+
+ }
+
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/dontStart.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/dontStart.qml
new file mode 100644
index 0000000000..6b8031769f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/dontStart.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ SequentialAnimation on x {
+ running: false
+ NumberAnimation { objectName: "MyAnim"; running: true }
+ }
+
+ }
+
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/dontStart2.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/dontStart2.qml
new file mode 100644
index 0000000000..2563c01d4f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/dontStart2.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+
+ transitions: Transition {
+ SequentialAnimation {
+ NumberAnimation { id: myAnim; objectName: "MyAnim"; running: true }
+ }
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/dotproperty.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/dotproperty.qml
new file mode 100644
index 0000000000..aff69e5c12
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/dotproperty.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { properties: "border.color"; duration: 1000 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/doubleRegistrationBug.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/doubleRegistrationBug.qml
new file mode 100644
index 0000000000..f0fdf9cfb5
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/doubleRegistrationBug.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+
+ Double { id: dub; on: parent.width < 800 }
+ Component.onCompleted: dub.on = false
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype1.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype1.qml
new file mode 100644
index 0000000000..a97b3fd5bf
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype1.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; x: 200; border.width: 10 }
+ }
+ transitions: Transition {
+ PropertyAnimation { properties: "x,border.width"; duration: 1000 } //x is real, border.width is int
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype2.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype2.qml
new file mode 100644
index 0000000000..9a77467820
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/mixedtype2.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; x: 200; color: "blue" }
+ }
+ transitions: Transition {
+ PropertyAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/nonTransitionBug.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/nonTransitionBug.qml
new file mode 100644
index 0000000000..04741ff348
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/nonTransitionBug.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width: 200
+ height: 200
+
+ Rectangle {
+ id: mover
+ objectName: "mover"
+ }
+
+ states: [
+ State {
+ name: "free"
+ },
+ State {
+ name: "left"
+ PropertyChanges {
+ restoreEntryValues: false
+ target: mover
+ x: 0
+ }
+ }
+ ]
+
+ transitions: Transition {
+ PropertyAnimation { properties: "x"; duration: 50 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/properties.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/properties.qml
new file mode 100644
index 0000000000..e6af9acc93
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/properties.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { to: 200 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/properties2.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/properties2.qml
new file mode 100644
index 0000000000..60ec456c71
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/properties2.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { targets: theRect; properties: "x"; to: 200; }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/properties3.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/properties3.qml
new file mode 100644
index 0000000000..e86eca1316
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/properties3.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { target: theRect; property: "x"; to: 300; }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/properties4.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/properties4.qml
new file mode 100644
index 0000000000..04d41c64c1
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/properties4.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { target: theRect; property: "y"; to: 200; }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/properties5.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/properties5.qml
new file mode 100644
index 0000000000..e139f8c6c0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/properties5.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { targets: theRect; properties: "y"; to: 200; }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition.qml
new file mode 100644
index 0000000000..8e2b41db6c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theRect; properties: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition2.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition2.qml
new file mode 100644
index 0000000000..6b846852ff
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition2.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; property: "y"; to: 200 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition3.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition3.qml
new file mode 100644
index 0000000000..c9d8e95bd3
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition3.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theRect; properties: "y" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition4.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition4.qml
new file mode 100644
index 0000000000..61e8a96788
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition4.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; properties: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition5.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition5.qml
new file mode 100644
index 0000000000..b023943007
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition5.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theRect; property: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition6.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition6.qml
new file mode 100644
index 0000000000..7c88a7f038
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition6.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theItem; properties: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition7.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition7.qml
new file mode 100644
index 0000000000..fbef95e572
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/propertiesTransition7.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ SpringAnimation { targets: theRect; properties: "x"; velocity: 10000 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/registrationBug.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/registrationBug.qml
new file mode 100644
index 0000000000..7dc29f9315
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/registrationBug.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 200
+ height: 200
+
+ property bool animating: true
+ property int value: 0
+
+ NumberAnimation {
+ target: rect
+ property: "value"
+ running: rect.animating
+ to: 100
+ duration: 50
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/rotation.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/rotation.qml
new file mode 100644
index 0000000000..ac158df719
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/rotation.qml
@@ -0,0 +1,48 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 600; height: 200
+
+ Row {
+ spacing: 5
+ Rectangle {
+ id: rr
+ objectName: "rr"
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ id: rr2
+ objectName: "rr2"
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ id: rr3
+ objectName: "rr3"
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ id: rr4
+ objectName: "rr4"
+ color: "red"
+ width: 100; height: 100
+ }
+ }
+
+ states: State {
+ name: "state1"
+ PropertyChanges { target: rr; rotation: 370 }
+ PropertyChanges { target: rr2; rotation: 370 }
+ PropertyChanges { target: rr3; rotation: 370 }
+ PropertyChanges { target: rr4; rotation: 370 }
+ }
+
+ transitions: Transition {
+ RotationAnimation { target: rr; direction: RotationAnimation.Numerical; duration: 1000 }
+ RotationAnimation { target: rr2; direction: RotationAnimation.Clockwise; duration: 1000 }
+ RotationAnimation { target: rr3; direction: RotationAnimation.Counterclockwise; duration: 1000 }
+ RotationAnimation { target: rr4; direction: RotationAnimation.Shortest; duration: 1000 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/runningTrueBug.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/runningTrueBug.qml
new file mode 100644
index 0000000000..7d33ed7175
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/runningTrueBug.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+Rectangle {
+ color: "skyblue"
+ width: 500
+ height: 200
+ Rectangle {
+ objectName: "cloud"
+ color: "white"
+ y: 50
+ width: 100
+ height: 100
+
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ running: true
+ NumberAnimation {
+ id: firstAnimation
+ from: 0
+ to: 500
+ duration: 5000
+ }
+ NumberAnimation {
+ id: secondAnimation
+ from: -100
+ to: 0
+ duration: 1000
+ }
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/valuesource.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/valuesource.qml
new file mode 100644
index 0000000000..fa9cd400ac
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/valuesource.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { id: anim; objectName: "MyAnim"; to: 200 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/data/valuesource2.qml b/tests/auto/qtquick1/qdeclarativeanimations/data/valuesource2.qml
new file mode 100644
index 0000000000..f6343a1bff
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/data/valuesource2.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { id: anim; objectName: "MyAnim"; running: false; to: 200 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/qtquick1/qdeclarativeanimations/qdeclarativeanimations.pro
new file mode 100644
index 0000000000..2daebc7a54
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/qdeclarativeanimations.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
+SOURCES += tst_qdeclarativeanimations.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/qtquick1/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
new file mode 100644
index 0000000000..6f75ce3d31
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -0,0 +1,855 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativeanimation_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
+#include <QVariantAnimation>
+#include <QEasingCurve>
+
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeanimations : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeanimations() {}
+
+private slots:
+ void initTestCase() { QDeclarativeEngine engine; } // ensure types are registered
+
+ void simpleProperty();
+ void simpleNumber();
+ void simpleColor();
+ void simpleRotation();
+ void alwaysRunToEnd();
+ void complete();
+ void resume();
+ void dotProperty();
+ void badTypes();
+ void badProperties();
+ void mixedTypes();
+ void properties();
+ void propertiesTransition();
+ void invalidDuration();
+ void attached();
+ void propertyValueSourceDefaultStart();
+ void dontStart();
+ void easingProperties();
+ void rotation();
+ void runningTrueBug();
+ void nonTransitionBug();
+ void registrationBug();
+ void doubleRegistrationBug();
+ void alwaysRunToEndRestartBug();
+};
+
+#define QTIMED_COMPARE(lhs, rhs) do { \
+ for (int ii = 0; ii < 5; ++ii) { \
+ if (lhs == rhs) \
+ break; \
+ QTest::qWait(50); \
+ } \
+ QCOMPARE(lhs, rhs); \
+} while (false)
+
+void tst_qdeclarativeanimations::simpleProperty()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1PropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("pos");
+ animation.setTo(QPointF(200,200));
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "pos");
+ QVERIFY(animation.to().toPointF() == QPointF(200,200));
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.pos(), QPointF(200,200));
+
+ rect.setPos(0,0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.pos(), QPointF(100,100));
+}
+
+void tst_qdeclarativeanimations::simpleNumber()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1NumberAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "x");
+ QVERIFY(animation.to() == 200);
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.x(), qreal(200));
+
+ rect.setX(0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.x(), qreal(100));
+}
+
+void tst_qdeclarativeanimations::simpleColor()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1ColorAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("color");
+ animation.setTo(QColor("red"));
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "color");
+ QVERIFY(animation.to() == QColor("red"));
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.color(), QColor("red"));
+
+ rect.setColor(QColor("blue"));
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1));
+
+ rect.setColor(QColor("green"));
+ animation.setFrom(QColor("blue"));
+ QVERIFY(animation.from() == QColor("blue"));
+ animation.restart();
+ QCOMPARE(rect.color(), QColor("blue"));
+ QVERIFY(animation.isRunning());
+ animation.setCurrentTime(125);
+ QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1));
+}
+
+void tst_qdeclarativeanimations::simpleRotation()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1RotationAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("rotation");
+ animation.setTo(270);
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "rotation");
+ QVERIFY(animation.to() == 270);
+ QVERIFY(animation.direction() == QDeclarative1RotationAnimation::Numerical);
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.rotation(), qreal(270));
+
+ rect.setRotation(0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.rotation(), qreal(135));
+}
+
+void tst_qdeclarativeanimations::alwaysRunToEnd()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1PropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ animation.setDuration(1000);
+ animation.setLoops(-1);
+ animation.setAlwaysRunToEnd(true);
+ QVERIFY(animation.loops() == -1);
+ QVERIFY(animation.alwaysRunToEnd() == true);
+ animation.start();
+ QTest::qWait(1500);
+ animation.stop();
+ QVERIFY(rect.x() != qreal(200));
+ QTest::qWait(500);
+ QTIMED_COMPARE(rect.x(), qreal(200));
+}
+
+void tst_qdeclarativeanimations::complete()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1PropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setFrom(1);
+ animation.setTo(200);
+ animation.setDuration(500);
+ QVERIFY(animation.from() == 1);
+ animation.start();
+ QTest::qWait(50);
+ animation.stop();
+ QVERIFY(rect.x() != qreal(200));
+ animation.start();
+ QTest::qWait(50);
+ QVERIFY(animation.isRunning());
+ animation.complete();
+ QCOMPARE(rect.x(), qreal(200));
+}
+
+void tst_qdeclarativeanimations::resume()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1PropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setFrom(10);
+ animation.setTo(200);
+ animation.setDuration(1000);
+ QVERIFY(animation.from() == 10);
+
+ animation.start();
+ QTest::qWait(400);
+ animation.pause();
+ qreal x = rect.x();
+ QVERIFY(x != qreal(200) && x != qreal(10));
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+
+ animation.resume();
+ QVERIFY(animation.isRunning());
+ QVERIFY(!animation.isPaused());
+ QTest::qWait(400);
+ animation.stop();
+ QVERIFY(rect.x() > x);
+}
+
+void tst_qdeclarativeanimations::dotProperty()
+{
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nRectangle{ id: rect; NumberAnimation{ objectName: \"anim\"; target: rect; property: \"border.width\"; to: 10 }}";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(animationComponent.create());
+ QVERIFY(rect);
+ QDeclarative1NumberAnimation *animation = rect->findChild<QDeclarative1NumberAnimation*>("anim");
+ QVERIFY(animation);
+
+ animation->start();
+ QTest::qWait(animation->duration()+50);
+ QTIMED_COMPARE(rect->border()->width(), 10);
+
+ rect->border()->setWidth(0);
+ animation->start();
+ animation->pause();
+ animation->setCurrentTime(125);
+ QVERIFY(animation->currentTime() == 125);
+ QCOMPARE(rect->border()->width(), 5);
+
+ delete rect;
+}
+
+void tst_qdeclarativeanimations::badTypes()
+{
+ //don't crash
+ {
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/badtype1.qml"));
+
+ qApp->processEvents();
+
+ delete view;
+ }
+
+ //make sure we get a compiler error
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype2.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeComponent: Component is not ready");
+ c.create();
+
+ QVERIFY(c.errors().count() == 1);
+ QCOMPARE(c.errors().at(0).description(), QLatin1String("Invalid property assignment: number expected"));
+ }
+
+ //make sure we get a compiler error
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype3.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeComponent: Component is not ready");
+ c.create();
+
+ QVERIFY(c.errors().count() == 1);
+ QCOMPARE(c.errors().at(0).description(), QLatin1String("Invalid property assignment: color expected"));
+ }
+
+ //don't crash
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype4.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(1000 + 50);
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("MyRect");
+ QVERIFY(myRect);
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+}
+
+void tst_qdeclarativeanimations::badProperties()
+{
+ //make sure we get a runtime error
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c1(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml"));
+ QByteArray message = QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate non-existent property \"border.colr\"";
+ QTest::ignoreMessage(QtWarningMsg, message);
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c1.create());
+ QVERIFY(rect);
+
+ QDeclarativeComponent c2(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml"));
+ message = QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate read-only property \"border\"";
+ QTest::ignoreMessage(QtWarningMsg, message);
+ rect = qobject_cast<QDeclarative1Rectangle*>(c2.create());
+ QVERIFY(rect);
+
+ //### should we warn here are well?
+ //rect->setState("state1");
+ }
+}
+
+//test animating mixed types with property animation in a transition
+//for example, int + real; color + real; etc
+void tst_qdeclarativeanimations::mixedTypes()
+{
+ //assumes border.width stays a real -- not real robust
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype1.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(500);
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("MyRect");
+ QVERIFY(myRect);
+
+ //rather inexact -- is there a better way?
+ QVERIFY(myRect->x() > 100 && myRect->x() < 200);
+ QVERIFY(myRect->border()->width() > 1 && myRect->border()->width() < 10);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype2.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(500);
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("MyRect");
+ QVERIFY(myRect);
+
+ //rather inexact -- is there a better way?
+ QVERIFY(myRect->x() > 100 && myRect->x() < 200);
+ QVERIFY(myRect->color() != QColor("red") && myRect->color() != QColor("blue"));
+ }
+}
+
+void tst_qdeclarativeanimations::properties()
+{
+ const int waitDuration = 300;
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties2.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties3.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(300));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties4.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties5.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ }
+}
+
+void tst_qdeclarativeanimations::propertiesTransition()
+{
+ const int waitDuration = 300;
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition2.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ QCOMPARE(myRect->y(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition3.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ QCOMPARE(myRect->y(),qreal(100));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition4.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition5.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ /*{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition6.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ }*/
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition7.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QDeclarative1Rectangle *myRect = rect->findChild<QDeclarative1Rectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+}
+
+void tst_qdeclarativeanimations::invalidDuration()
+{
+ QDeclarative1PropertyAnimation *animation = new QDeclarative1PropertyAnimation;
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML PropertyAnimation: Cannot set a duration of < 0");
+ animation->setDuration(-1);
+ QCOMPARE(animation->duration(), 250);
+
+ QDeclarative1PauseAnimation *pauseAnimation = new QDeclarative1PauseAnimation;
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML PauseAnimation: Cannot set a duration of < 0");
+ pauseAnimation->setDuration(-1);
+ QCOMPARE(pauseAnimation->duration(), 250);
+}
+
+void tst_qdeclarativeanimations::attached()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/attached.qml"));
+ QTest::ignoreMessage(QtDebugMsg, "off");
+ QTest::ignoreMessage(QtDebugMsg, "on");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+}
+
+void tst_qdeclarativeanimations::propertyValueSourceDefaultStart()
+{
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource.qml"));
+
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1AbstractAnimation *myAnim = rect->findChild<QDeclarative1AbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim);
+ QVERIFY(myAnim->isRunning());
+ }
+
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource2.qml"));
+
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1AbstractAnimation *myAnim = rect->findChild<QDeclarative1AbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim);
+ QVERIFY(myAnim->isRunning() == false);
+ }
+
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontAutoStart.qml"));
+
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1AbstractAnimation *myAnim = rect->findChild<QDeclarative1AbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+ }
+}
+
+
+void tst_qdeclarativeanimations::dontStart()
+{
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart.qml"));
+
+ QString warning = c.url().toString() + ":14:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1AbstractAnimation *myAnim = rect->findChild<QDeclarative1AbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+ }
+
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart2.qml"));
+
+ QString warning = c.url().toString() + ":15:17: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1AbstractAnimation *myAnim = rect->findChild<QDeclarative1AbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+ }
+}
+
+void tst_qdeclarativeanimations::easingProperties()
+{
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nNumberAnimation { easing.type: \"InOutQuad\" }";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1PropertyAnimation *animObject = qobject_cast<QDeclarative1PropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::InOutQuad);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutBounce\"; easing.amplitude: 5.0 }";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1PropertyAnimation *animObject = qobject_cast<QDeclarative1PropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::OutBounce);
+ QCOMPARE(animObject->easing().amplitude(), 5.0);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutElastic\"; easing.amplitude: 5.0; easing.period: 3.0}";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1PropertyAnimation *animObject = qobject_cast<QDeclarative1PropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::OutElastic);
+ QCOMPARE(animObject->easing().amplitude(), 5.0);
+ QCOMPARE(animObject->easing().period(), 3.0);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"InOutBack\"; easing.overshoot: 2 }";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1PropertyAnimation *animObject = qobject_cast<QDeclarative1PropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::InOutBack);
+ QCOMPARE(animObject->easing().overshoot(), 2.0);
+ }
+}
+
+void tst_qdeclarativeanimations::rotation()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/rotation.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *rr = rect->findChild<QDeclarative1Rectangle*>("rr");
+ QDeclarative1Rectangle *rr2 = rect->findChild<QDeclarative1Rectangle*>("rr2");
+ QDeclarative1Rectangle *rr3 = rect->findChild<QDeclarative1Rectangle*>("rr3");
+ QDeclarative1Rectangle *rr4 = rect->findChild<QDeclarative1Rectangle*>("rr4");
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(800);
+ qreal r1 = rr->rotation();
+ qreal r2 = rr2->rotation();
+ qreal r3 = rr3->rotation();
+ qreal r4 = rr4->rotation();
+
+ QVERIFY(r1 > qreal(0) && r1 < qreal(370));
+ QVERIFY(r2 > qreal(0) && r2 < qreal(370));
+ QVERIFY(r3 < qreal(0) && r3 > qreal(-350));
+ QVERIFY(r4 > qreal(0) && r4 < qreal(10));
+ QCOMPARE(r1,r2);
+ QVERIFY(r4 < r2);
+
+ QTest::qWait(800);
+ QTIMED_COMPARE(rr->rotation() + rr2->rotation() + rr3->rotation() + rr4->rotation(), qreal(370*4));
+}
+
+void tst_qdeclarativeanimations::runningTrueBug()
+{
+ //ensure we start correctly when "running: true" is explicitly set
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrueBug.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *cloud = rect->findChild<QDeclarative1Rectangle*>("cloud");
+ QVERIFY(cloud);
+ QTest::qWait(1000);
+ QVERIFY(cloud->x() > qreal(0));
+}
+
+//QTBUG-12805
+void tst_qdeclarativeanimations::nonTransitionBug()
+{
+ //tests that the animation values from the previous transition are properly cleared
+ //in the case where an animation in the transition doesn't match anything (but previously did)
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/nonTransitionBug.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarative1Rectangle *mover = rect->findChild<QDeclarative1Rectangle*>("mover");
+
+ mover->setX(100);
+ QCOMPARE(mover->x(), qreal(100));
+
+ rectPrivate->setState("left");
+ QTRY_COMPARE(mover->x(), qreal(0));
+
+ mover->setX(100);
+ QCOMPARE(mover->x(), qreal(100));
+
+ //make sure we don't try to animate back to 0
+ rectPrivate->setState("free");
+ QTest::qWait(300);
+ QCOMPARE(mover->x(), qreal(100));
+}
+
+//QTBUG-14042
+void tst_qdeclarativeanimations::registrationBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/registrationBug.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QTRY_COMPARE(rect->property("value"), QVariant(int(100)));
+}
+
+void tst_qdeclarativeanimations::doubleRegistrationBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/doubleRegistrationBug.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1AbstractAnimation *anim = rect->findChild<QDeclarative1AbstractAnimation*>("animation");
+ QVERIFY(anim != 0);
+ QTRY_COMPARE(anim->qtAnimation()->state(), QAbstractAnimation::Stopped);
+}
+
+//QTBUG-16736
+void tst_qdeclarativeanimations::alwaysRunToEndRestartBug()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1PropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ animation.setDuration(1000);
+ animation.setLoops(-1);
+ animation.setAlwaysRunToEnd(true);
+ QVERIFY(animation.loops() == -1);
+ QVERIFY(animation.alwaysRunToEnd() == true);
+ animation.start();
+ animation.stop();
+ animation.start();
+ animation.stop();
+ QTest::qWait(500);
+ QVERIFY(rect.x() != qreal(200));
+ QTest::qWait(800);
+ QTIMED_COMPARE(rect.x(), qreal(200));
+ QCOMPARE(static_cast<QDeclarative1AbstractAnimation*>(&animation)->qtAnimation()->state(), QAbstractAnimation::Stopped);
+}
+
+QTEST_MAIN(tst_qdeclarativeanimations)
+
+#include "tst_qdeclarativeanimations.moc"
diff --git a/tests/auto/qtquick1/qdeclarativeapplication/qdeclarativeapplication.pro b/tests/auto/qtquick1/qdeclarativeapplication/qdeclarativeapplication.pro
new file mode 100644
index 0000000000..96b3c0bffb
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeapplication/qdeclarativeapplication.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeapplication.cpp
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/qtquick1/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
new file mode 100644
index 0000000000..dfb2329668
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include "../../../shared/util.h"
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtQuick1/qdeclarativeitem.h>
+#include <QtGui/qgraphicsview.h>
+#include <QtGui/qgraphicsscene.h>
+
+class tst_qdeclarativeapplication : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeapplication();
+
+private slots:
+ void active();
+ void layoutDirection();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativeapplication::tst_qdeclarativeapplication()
+{
+}
+
+void tst_qdeclarativeapplication::active()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
+ QVERIFY(item);
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.addItem(item);
+
+ // not active
+ QVERIFY(!item->property("active").toBool());
+ QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0);
+
+ // active
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0);
+
+ // not active again
+ // on mac, setActiveWindow(0) on mac does not deactivate the current application
+ // (you have to switch to a different app or hide the current app to trigger this)
+#if !defined(Q_WS_MAC)
+ QApplication::setActiveWindow(0);
+ QVERIFY(!item->property("active").toBool());
+ QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0);
+#endif
+}
+
+void tst_qdeclarativeapplication::layoutDirection()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Item { property bool layoutDirection: Qt.application.layoutDirection }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
+ QVERIFY(item);
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.addItem(item);
+
+ // not mirrored
+ QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight);
+
+ // mirrored
+ QApplication::setLayoutDirection(Qt::RightToLeft);
+ QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::RightToLeft);
+
+ // not mirrored again
+ QApplication::setLayoutDirection(Qt::LeftToRight);
+ QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight);
+}
+
+QTEST_MAIN(tst_qdeclarativeapplication)
+
+#include "tst_qdeclarativeapplication.moc"
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/binding.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/binding.qml
new file mode 100644
index 0000000000..a452447f31
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/binding.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ property real basex : 0
+ property real movedx: 200
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ x: basex
+ Behavior on x { NumberAnimation { duration: 800; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: movedx
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/color.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/color.qml
new file mode 100644
index 0000000000..c4b783a0f0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/color.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100;
+ color: "green"
+ Behavior on color { ColorAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "red"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ color: "red"
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/cpptrigger.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/cpptrigger.qml
new file mode 100644
index 0000000000..88ddfaa1a7
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/cpptrigger.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 500; } }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/delayedRegistration.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/delayedRegistration.qml
new file mode 100644
index 0000000000..aa384c335f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/delayedRegistration.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ width: 400; height: 400;
+ property Item myItem
+
+ function doCreate() {
+ myItem = myComponent.createObject(container)
+ myItem.x = 100
+ }
+
+ Component {
+ id: myComponent
+ Rectangle {
+ width: 100
+ height: 100
+ color: "green"
+ Behavior on x { NumberAnimation { duration: 500 } }
+ }
+ }
+
+ Component.onCompleted: doCreate()
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/disabled.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/disabled.qml
new file mode 100644
index 0000000000..f6cfa5e33d
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/disabled.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ enabled: false
+ NumberAnimation { duration: 200; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/dontStart.qml
new file mode 100644
index 0000000000..e318dd2567
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/dontStart.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ Behavior on x {
+ NumberAnimation {id: myAnim; objectName: "MyAnim"; running: true }
+ }
+
+ }
+
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/empty.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/empty.qml
new file mode 100644
index 0000000000..6c78a84540
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/empty.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {}
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/explicit.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/explicit.qml
new file mode 100644
index 0000000000..3baa1ac23a
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/explicit.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation { target: rect; property: "x"; duration: 500; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty.qml
new file mode 100644
index 0000000000..ddb5bbd40c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on pos { PropertyAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ pos: Qt.point(200,0);
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty2.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty2.qml
new file mode 100644
index 0000000000..c0b71cdb04
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupProperty2.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on pos.x { NumberAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ pos.x: 200;
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/groupedPropertyCrash.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupedPropertyCrash.qml
new file mode 100644
index 0000000000..8aa590bca1
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/groupedPropertyCrash.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+ Text {
+ Behavior on anchors.verticalCenterOffset { NumberAnimation { duration: 300; } }
+ text: "Hello World"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/loop.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/loop.qml
new file mode 100644
index 0000000000..76379c00a2
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/loop.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 200; } }
+ onXChanged: x = 100;
+ }
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/nonSelecting2.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/nonSelecting2.qml
new file mode 100644
index 0000000000..c5c78d1aa2
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/nonSelecting2.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation { targets: rect; properties: "y"; duration: 200; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/parent.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/parent.qml
new file mode 100644
index 0000000000..d19da298b2
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/parent.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on parent {
+ SequentialAnimation {
+ PauseAnimation { duration: 500 }
+ PropertyAction {}
+ }
+ }
+ }
+ Item {
+ id: newParent
+ objectName: "NewParent"
+ x: 100
+ }
+ states: State {
+ name: "reparented"
+ PropertyChanges {
+ target: rect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/qtbug12295.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/qtbug12295.qml
new file mode 100644
index 0000000000..03b542164b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/qtbug12295.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+ color: "blue"
+
+ Rectangle {
+ id: myRect
+ objectName: "myRect"
+ width: 100
+ height: 100
+ Behavior on x {
+ NumberAnimation { duration: 500 }
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/reassignedAnimation.qml
new file mode 100644
index 0000000000..56ac216c5a
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/reassignedAnimation.qml
@@ -0,0 +1,32 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ id: myBehavior
+ objectName: "MyBehavior"
+ NumberAnimation {id: na1; duration: 200 }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+
+ NumberAnimation {id: na2; duration: 1000 }
+ Component.onCompleted: {
+ myBehavior.animation = na2;
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/runningTrue.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/runningTrue.qml
new file mode 100644
index 0000000000..25cdf10acf
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/runningTrue.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width:200; height:200
+
+ property real myValue: 0
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 100
+ height: 100
+ color: "green"
+ smooth: true
+ rotation: myValue
+ Behavior on rotation {
+ RotationAnimation { id: rotAnim; objectName: "rotAnim"; direction: RotationAnimation.Shortest }
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/scripttrigger.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/scripttrigger.qml
new file mode 100644
index 0000000000..c05cdaa940
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/scripttrigger.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+
+ onColorChanged: {
+ rect.x = 200
+ }
+
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 800; } }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/simple.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/simple.qml
new file mode 100644
index 0000000000..6ba0118660
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/simple.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation {id: na; duration: 500; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/startup.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup.qml
new file mode 100644
index 0000000000..fca416c08c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ objectName: "innerRect"
+ height: 100; width: 100; color: "green"
+ property real targetX: 100
+
+ x: targetX
+ Behavior on x {
+ NumberAnimation {}
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/data/startup2.qml b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup2.qml
new file mode 100644
index 0000000000..eb627613d4
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/data/startup2.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 800;
+ height: 480;
+
+ Text { id:theText; text: "hello world" }
+
+ Rectangle {
+ objectName: "innerRect"
+ color: "red"
+ x: theText.width
+ Behavior on x { NumberAnimation {} }
+ width: 100; height: 100
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/qtquick1/qdeclarativebehaviors/qdeclarativebehaviors.pro
new file mode 100644
index 0000000000..4fd4ddd8b0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/qdeclarativebehaviors.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
+SOURCES += tst_qdeclarativebehaviors.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/qtquick1/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
new file mode 100644
index 0000000000..773fc24148
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -0,0 +1,435 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <qsignalspy.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativebehavior_p.h>
+#include <QtQuick1/private/qdeclarativeanimation_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativebehaviors : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativebehaviors() {}
+
+private slots:
+ void simpleBehavior();
+ void scriptTriggered();
+ void cppTriggered();
+ void loop();
+ void colorBehavior();
+ void parentBehavior();
+ void replaceBinding();
+ //void transitionOverrides();
+ void group();
+ void emptyBehavior();
+ void explicitSelection();
+ void nonSelectingBehavior();
+ void reassignedAnimation();
+ void disabled();
+ void dontStart();
+ void startup();
+ void groupedPropertyCrash();
+ void runningTrue();
+ void sameValue();
+ void delayedRegistration();
+};
+
+void tst_qdeclarativebehaviors::simpleBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/simple.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+ QTRY_VERIFY(qobject_cast<QDeclarative1Behavior*>(rect->findChild<QDeclarative1Behavior*>("MyBehavior"))->animation());
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::scriptTriggered()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/scripttrigger.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ rect->setColor(QColor("red"));
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::cppTriggered()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/cpptrigger.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QTRY_VERIFY(innerRect);
+
+ innerRect->setProperty("x", 200);
+ QTRY_VERIFY(innerRect->x() > 0);
+ QTRY_VERIFY(innerRect->x() < 200); //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::loop()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/loop.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ //don't crash
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::colorBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/color.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("red");
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->color() != QColor("red"));
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->color() != QColor("green"));
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::parentBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/parent.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QTRY_VERIFY(rect->findChild<QDeclarative1Rectangle*>("MyRect")->parentItem() != rect->findChild<QDeclarativeItem*>("NewParent"));
+ QTRY_VERIFY(rect->findChild<QDeclarative1Rectangle*>("MyRect")->parentItem() == rect->findChild<QDeclarativeItem*>("NewParent"));
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::replaceBinding()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/binding.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QTRY_VERIFY(innerRect);
+ QTRY_VERIFY(innerRect->x() > 0);
+ QTRY_VERIFY(innerRect->x() < 200);
+ //i.e. the behavior has been triggered
+ QTRY_COMPARE(innerRect->x(), (qreal)200);
+ rect->setProperty("basex", 10);
+ QTRY_COMPARE(innerRect->x(), (qreal)200);
+ rect->setProperty("movedx", 210);
+ QTRY_COMPARE(innerRect->x(), (qreal)210);
+
+ QDeclarativeItemPrivate::get(rect)->setState("");
+ QTRY_VERIFY(innerRect->x() > 10);
+ QTRY_VERIFY(innerRect->x() < 210); //i.e. the behavior has been triggered
+ QTRY_COMPARE(innerRect->x(), (qreal)10);
+ rect->setProperty("movedx", 200);
+ QTRY_COMPARE(innerRect->x(), (qreal)10);
+ rect->setProperty("basex", 20);
+ QTRY_COMPARE(innerRect->x(), (qreal)20);
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::group()
+{
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupProperty.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ //QTest::qWait(200);
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupProperty2.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+ }
+}
+
+void tst_qdeclarativebehaviors::emptyBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/empty.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::explicitSelection()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/explicit.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::nonSelectingBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/nonSelecting2.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::reassignedAnimation()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml"));
+ QString warning = QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:9: QML Behavior: Cannot change the animation assigned to a Behavior.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+ QCOMPARE(qobject_cast<QDeclarative1NumberAnimation*>(
+ rect->findChild<QDeclarative1Behavior*>("MyBehavior")->animation())->duration(), 200);
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::disabled()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/disabled.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+ QCOMPARE(rect->findChild<QDeclarative1Behavior*>("MyBehavior")->enabled(), false);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::dontStart()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart.qml"));
+
+ QString warning = c.url().toString() + ":13:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1AbstractAnimation *myAnim = rect->findChild<QDeclarative1AbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::startup()
+{
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *innerRect = rect->findChild<QDeclarative1Rectangle*>("innerRect");
+ QVERIFY(innerRect);
+
+ QCOMPARE(innerRect->x(), qreal(100)); //should be set immediately
+
+ delete rect;
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup2.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *innerRect = rect->findChild<QDeclarative1Rectangle*>("innerRect");
+ QVERIFY(innerRect);
+
+ QDeclarative1Text *text = rect->findChild<QDeclarative1Text*>();
+ QVERIFY(text);
+
+ QCOMPARE(innerRect->x(), text->width()); //should be set immediately
+
+ delete rect;
+ }
+}
+
+//QTBUG-10799
+void tst_qdeclarativebehaviors::groupedPropertyCrash()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupedPropertyCrash.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect); //don't crash
+}
+
+//QTBUG-5491
+void tst_qdeclarativebehaviors::runningTrue()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrue.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1AbstractAnimation *animation = rect->findChild<QDeclarative1AbstractAnimation*>("rotAnim");
+ QVERIFY(animation);
+
+ QSignalSpy runningSpy(animation, SIGNAL(runningChanged(bool)));
+ rect->setProperty("myValue", 180);
+ QTRY_VERIFY(runningSpy.count() > 0);
+}
+
+//QTBUG-12295
+void tst_qdeclarativebehaviors::sameValue()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/qtbug12295.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *target = rect->findChild<QDeclarative1Rectangle*>("myRect");
+ QVERIFY(target);
+
+ target->setX(100);
+ QCOMPARE(target->x(), qreal(100));
+
+ target->setProperty("x", 0);
+ QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
+ QTRY_VERIFY(target->x() == qreal(0)); //make sure Behavior has finished.
+
+ target->setX(100);
+ QCOMPARE(target->x(), qreal(100));
+
+ //this is the main point of the test -- the behavior needs to be triggered again
+ //even though we set 0 twice in a row.
+ target->setProperty("x", 0);
+ QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
+}
+
+//QTBUG-18362
+void tst_qdeclarativebehaviors::delayedRegistration()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/delayedRegistration.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItem *innerRect = rect->property("myItem").value<QDeclarativeItem*>();
+ QVERIFY(innerRect != 0);
+
+ QCOMPARE(innerRect->property("x").toInt(), int(0));
+
+ QTRY_COMPARE(innerRect->property("x").toInt(), int(100));
+}
+
+QTEST_MAIN(tst_qdeclarativebehaviors)
+
+#include "tst_qdeclarativebehaviors.moc"
diff --git a/tests/auto/qtquick1/qdeclarativebinding/data/test-binding.qml b/tests/auto/qtquick1/qdeclarativebinding/data/test-binding.qml
new file mode 100644
index 0000000000..94497368a7
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebinding/data/test-binding.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+ width: 320; height: 240
+ property string text
+ property bool changeColor: false
+
+ Text { id: s1; text: "Hello" }
+ Rectangle { id: r1; width: 1; height: 1; color: "yellow" }
+ Rectangle { id: r2; width: 1; height: 1; color: "red" }
+
+ Binding { target: screen; property: "text"; value: s1.text; objectName: "binding1" }
+ Binding { target: screen; property: "color"; value: r1.color }
+ Binding { target: screen; property: "color"; when: screen.changeColor == true; value: r2.color; objectName: "binding3" }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebinding/data/test-binding2.qml b/tests/auto/qtquick1/qdeclarativebinding/data/test-binding2.qml
new file mode 100644
index 0000000000..3e99e2b5e6
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebinding/data/test-binding2.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+ width: 320; height: 240
+ property string text
+ property bool changeColor: false
+
+ Text { id: s1; text: "Hello" }
+ Rectangle { id: r1; width: 1; height: 1; color: "yellow" }
+ Rectangle { id: r2; width: 1; height: 1; color: "red" }
+
+ Binding { target: screen; property: "text"; value: s1.text }
+ Binding { target: screen; property: "color"; value: r1.color }
+ Binding { target: screen; property: "color"; value: r2.color; when: screen.changeColor == true }
+}
diff --git a/tests/auto/qtquick1/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/qtquick1/qdeclarativebinding/qdeclarativebinding.pro
new file mode 100644
index 0000000000..b335e1105c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebinding/qdeclarativebinding.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativebinding.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/qtquick1/qdeclarativebinding/tst_qdeclarativebinding.cpp
new file mode 100644
index 0000000000..776fa528cf
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativebinding/tst_qdeclarativebinding.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativebind_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativebinding : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativebinding();
+
+private slots:
+ void binding();
+ void whenAfterValue();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativebinding::tst_qdeclarativebinding()
+{
+}
+
+void tst_qdeclarativebinding::binding()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-binding.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Bind *binding3 = qobject_cast<QDeclarative1Bind*>(rect->findChild<QDeclarative1Bind*>("binding3"));
+ QVERIFY(binding3 != 0);
+
+ QCOMPARE(rect->color(), QColor("yellow"));
+ QCOMPARE(rect->property("text").toString(), QString("Hello"));
+ QCOMPARE(binding3->when(), false);
+
+ rect->setProperty("changeColor", true);
+ QCOMPARE(rect->color(), QColor("red"));
+
+ QCOMPARE(binding3->when(), true);
+
+ QDeclarative1Bind *binding = qobject_cast<QDeclarative1Bind*>(rect->findChild<QDeclarative1Bind*>("binding1"));
+ QVERIFY(binding != 0);
+ QCOMPARE(binding->object(), qobject_cast<QObject*>(rect));
+ QCOMPARE(binding->property(), QLatin1String("text"));
+ QCOMPARE(binding->value().toString(), QLatin1String("Hello"));
+
+ delete rect;
+}
+
+void tst_qdeclarativebinding::whenAfterValue()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-binding2.qml"));
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+
+ QVERIFY(rect != 0);
+ QCOMPARE(rect->color(), QColor("yellow"));
+ QCOMPARE(rect->property("text").toString(), QString("Hello"));
+
+ rect->setProperty("changeColor", true);
+ QCOMPARE(rect->color(), QColor("red"));
+
+ delete rect;
+}
+
+QTEST_MAIN(tst_qdeclarativebinding)
+
+#include "tst_qdeclarativebinding.moc"
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/colors-round-remote.sci b/tests/auto/qtquick1/qdeclarativeborderimage/data/colors-round-remote.sci
index c673bed598..c673bed598 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/data/colors-round-remote.sci
+++ b/tests/auto/qtquick1/qdeclarativeborderimage/data/colors-round-remote.sci
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/colors-round.sci b/tests/auto/qtquick1/qdeclarativeborderimage/data/colors-round.sci
index 5d2f49f0e1..5d2f49f0e1 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/data/colors-round.sci
+++ b/tests/auto/qtquick1/qdeclarativeborderimage/data/colors-round.sci
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/colors.png b/tests/auto/qtquick1/qdeclarativeborderimage/data/colors.png
index dfb62f3d64..dfb62f3d64 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/data/colors.png
+++ b/tests/auto/qtquick1/qdeclarativeborderimage/data/colors.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png b/tests/auto/qtquick1/qdeclarativeborderimage/data/heart200.png
index 5a31ae8f4d..5a31ae8f4d 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png
+++ b/tests/auto/qtquick1/qdeclarativeborderimage/data/heart200.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/invalid.sci b/tests/auto/qtquick1/qdeclarativeborderimage/data/invalid.sci
index 98c72c9bf1..98c72c9bf1 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/data/invalid.sci
+++ b/tests/auto/qtquick1/qdeclarativeborderimage/data/invalid.sci
diff --git a/tests/auto/qtquick1/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/qtquick1/qdeclarativeborderimage/qdeclarativeborderimage.pro
new file mode 100644
index 0000000000..a6701ba8f9
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeborderimage/qdeclarativeborderimage.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network qtquick1
+macx:CONFIG -= app_bundle
+
+HEADERS += ../../declarative/shared/testhttpserver.h
+SOURCES += tst_qdeclarativeborderimage.cpp ../../declarative/shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/qtquick1/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
index 444781801c..d5631469a5 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
+++ b/tests/auto/qtquick1/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
@@ -54,7 +54,7 @@
#include <private/qdeclarativeloader_p.h>
#include <QtDeclarative/qdeclarativecontext.h>
-#include "../shared/testhttpserver.h"
+#include "../../declarative/shared/testhttpserver.h"
#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
@@ -102,13 +102,13 @@ void tst_qdeclarativeborderimage::noSource()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->source(), QUrl());
QCOMPARE(obj->width(), 0.);
QCOMPARE(obj->height(), 0.);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Stretch);
delete obj;
}
@@ -146,24 +146,24 @@ void tst_qdeclarativeborderimage::imageSource()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
if (remote)
- QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Loading);
+ QTRY_VERIFY(obj->status() == QDeclarative1BorderImage::Loading);
QCOMPARE(obj->source(), remote ? source : QUrl(source));
if (error.isEmpty()) {
- QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1BorderImage::Ready);
QCOMPARE(obj->width(), 120.);
QCOMPARE(obj->height(), 120.);
QCOMPARE(obj->sourceSize().width(), 120);
QCOMPARE(obj->sourceSize().height(), 120);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Stretch);
} else {
- QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Error);
+ QTRY_VERIFY(obj->status() == QDeclarative1BorderImage::Error);
}
delete obj;
@@ -177,15 +177,15 @@ void tst_qdeclarativeborderimage::clearSource()
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
- QVERIFY(obj->status() == QDeclarativeBorderImage::Ready);
+ QVERIFY(obj->status() == QDeclarative1BorderImage::Ready);
QCOMPARE(obj->width(), 120.);
QCOMPARE(obj->height(), 120.);
ctxt->setContextProperty("srcImage", "");
QVERIFY(obj->source().isEmpty());
- QVERIFY(obj->status() == QDeclarativeBorderImage::Null);
+ QVERIFY(obj->status() == QDeclarative1BorderImage::Null);
QCOMPARE(obj->width(), 0.);
QCOMPARE(obj->height(), 0.);
}
@@ -195,14 +195,14 @@ void tst_qdeclarativeborderimage::resized()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() + "\"; width: 300; height: 300 }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 300.);
QCOMPARE(obj->height(), 300.);
QCOMPARE(obj->sourceSize().width(), 120);
QCOMPARE(obj->sourceSize().height(), 120);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Stretch);
delete obj;
}
@@ -212,13 +212,13 @@ void tst_qdeclarativeborderimage::smooth()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 300.);
QCOMPARE(obj->height(), 300.);
QCOMPARE(obj->smooth(), true);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Stretch);
delete obj;
}
@@ -228,7 +228,7 @@ void tst_qdeclarativeborderimage::mirror()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/heart200.png\"; smooth: true; width: 300; height: 300; border { top: 50; right: 50; bottom: 50; left: 50 } }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
int width = obj->property("width").toInt();
@@ -261,12 +261,12 @@ void tst_qdeclarativeborderimage::tileModes()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 100; height: 300; horizontalTileMode: BorderImage.Repeat; verticalTileMode: BorderImage.Repeat }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 100.);
QCOMPARE(obj->height(), 300.);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Repeat);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Repeat);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Repeat);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Repeat);
delete obj;
}
@@ -274,12 +274,12 @@ void tst_qdeclarativeborderimage::tileModes()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 150; horizontalTileMode: BorderImage.Round; verticalTileMode: BorderImage.Round }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 300.);
QCOMPARE(obj->height(), 150.);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Round);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Round);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Round);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Round);
delete obj;
}
@@ -301,26 +301,26 @@ void tst_qdeclarativeborderimage::sciSource()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\"; width: 300; height: 300 }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
if (remote)
- QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Loading);
+ QTRY_VERIFY(obj->status() == QDeclarative1BorderImage::Loading);
QCOMPARE(obj->source(), remote ? source : QUrl(source));
QCOMPARE(obj->width(), 300.);
QCOMPARE(obj->height(), 300.);
if (valid) {
- QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1BorderImage::Ready);
QCOMPARE(obj->border()->left(), 10);
QCOMPARE(obj->border()->top(), 20);
QCOMPARE(obj->border()->right(), 30);
QCOMPARE(obj->border()->bottom(), 40);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Round);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Repeat);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Round);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Repeat);
} else {
- QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Error);
+ QTRY_VERIFY(obj->status() == QDeclarative1BorderImage::Error);
}
delete obj;
@@ -341,19 +341,19 @@ void tst_qdeclarativeborderimage::sciSource_data()
void tst_qdeclarativeborderimage::invalidSciFile()
{
- QTest::ignoreMessage(QtWarningMsg, "QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Roun"
- QTest::ignoreMessage(QtWarningMsg, "QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Repea"
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarative1GridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Roun"
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarative1GridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Repea"
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/invalid.sci").toString() +"\"; width: 300; height: 300 }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 300.);
QCOMPARE(obj->height(), 300.);
- QCOMPARE(obj->status(), QDeclarativeImageBase::Error);
- QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
- QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->status(), QDeclarative1ImageBase::Error);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarative1BorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarative1BorderImage::Stretch);
delete obj;
}
@@ -365,9 +365,9 @@ void tst_qdeclarativeborderimage::pendingRemoteRequest()
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QDeclarative1BorderImage *obj = qobject_cast<QDeclarative1BorderImage*>(component.create());
QVERIFY(obj != 0);
- QCOMPARE(obj->status(), QDeclarativeBorderImage::Loading);
+ QCOMPARE(obj->status(), QDeclarative1BorderImage::Loading);
// verify no crash
// This will cause a delayed "QThread: Destroyed while thread is still running" warning
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/connection-targetchange.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-targetchange.qml
new file mode 100644
index 0000000000..dd92cb9c67
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-targetchange.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Item {
+ Component {
+ id: item1
+ Item {
+ objectName: "item1"
+ }
+ }
+ Component {
+ id: item2
+ Item {
+ objectName: "item2"
+ }
+ }
+ Loader {
+ id: loader
+ sourceComponent: item1
+ }
+ Connections {
+ objectName: "connections"
+ target: loader.item
+ onWidthChanged: loader.sourceComponent = item2
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
new file mode 100644
index 0000000000..459c34617b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { target: screen; onNotFooBar1: {} ignoreUnknownSignals: true }
+ Connections { objectName: "connections"; onNotFooBar2: {} ignoreUnknownSignals: true }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
new file mode 100644
index 0000000000..8eddf43fe6
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: null; onNotFooBar: {} }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-parent.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
new file mode 100644
index 0000000000..953347a3b2
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; onFooBar: {} }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals.qml
new file mode 100644
index 0000000000..3702bdbe73
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/connection-unknownsignals.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: screen; onFooBar: {} }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/error-object.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/error-object.qml
new file mode 100644
index 0000000000..376a2182fe
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/error-object.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ Connections {
+ onClicked: Item {}
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/error-property.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/error-property.qml
new file mode 100644
index 0000000000..677af152ce
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/error-property.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ Connections { fakeProperty: {} }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/error-property2.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/error-property2.qml
new file mode 100644
index 0000000000..127e58e657
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/error-property2.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ Connections { onfakeProperty: {} }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/error-syntax.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/error-syntax.qml
new file mode 100644
index 0000000000..6a82528e1a
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/error-syntax.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ Connections {
+ onClicked {
+ onPressed: {}
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection.qml
new file mode 100644
index 0000000000..c5990830cd
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Item {
+ id: screen; width: 50
+
+ property bool tested: false
+ signal testMe
+
+ Connections { target: screen; onWidthChanged: screen.tested = true }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection2.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection2.qml
new file mode 100644
index 0000000000..f0dbaba5a6
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection2.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Connections { id: connection; target: connection; onTargetChanged: 1 == 1 }
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection3.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection3.qml
new file mode 100644
index 0000000000..94c9c7ca7f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/test-connection3.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Connections {}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/data/trimming.qml b/tests/auto/qtquick1/qdeclarativeconnection/data/trimming.qml
new file mode 100644
index 0000000000..00507d919c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/data/trimming.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Item {
+ id: screen; width: 50
+
+ property string tested
+ signal testMe(int param1, string param2)
+
+ Connections { target: screen; onTestMe: screen.tested = param2 + param1 }
+}
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/qtquick1/qdeclarativeconnection/qdeclarativeconnection.pro
new file mode 100644
index 0000000000..fb1ef04ee1
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/qdeclarativeconnection.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeconnection.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/qtquick1/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
new file mode 100644
index 0000000000..96e2957fbe
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
@@ -0,0 +1,234 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativeconnections_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
+#include "../../../shared/util.h"
+#include <QtDeclarative/qdeclarativescriptstring.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeconnection : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeconnection();
+
+private slots:
+ void defaultValues();
+ void properties();
+ void connection();
+ void trimming();
+ void targetChanged();
+ void unknownSignals_data();
+ void unknownSignals();
+ void errors_data();
+ void errors();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativeconnection::tst_qdeclarativeconnection()
+{
+}
+
+void tst_qdeclarativeconnection::defaultValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection3.qml"));
+ QDeclarative1Connections *item = qobject_cast<QDeclarative1Connections*>(c.create());
+
+ QVERIFY(item != 0);
+ QVERIFY(item->target() == 0);
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::properties()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection2.qml"));
+ QDeclarative1Connections *item = qobject_cast<QDeclarative1Connections*>(c.create());
+
+ QVERIFY(item != 0);
+
+ QVERIFY(item != 0);
+ QVERIFY(item->target() == item);
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::connection()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+
+ QVERIFY(item != 0);
+
+ QCOMPARE(item->property("tested").toBool(), false);
+ QCOMPARE(item->width(), 50.);
+ emit item->setWidth(100.);
+ QCOMPARE(item->width(), 100.);
+ QCOMPARE(item->property("tested").toBool(), true);
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::trimming()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/trimming.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+
+ QVERIFY(item != 0);
+
+ QCOMPARE(item->property("tested").toString(), QString(""));
+ int index = item->metaObject()->indexOfSignal("testMe(int,QString)");
+ QMetaMethod method = item->metaObject()->method(index);
+ method.invoke(item,
+ Qt::DirectConnection,
+ Q_ARG(int, 5),
+ Q_ARG(QString, "worked"));
+ QCOMPARE(item->property("tested").toString(), QString("worked5"));
+
+ delete item;
+}
+
+// Confirm that target can be changed by one of our signal handlers
+void tst_qdeclarativeconnection::targetChanged()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/connection-targetchange.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QVERIFY(item != 0);
+
+ QDeclarative1Connections *connections = item->findChild<QDeclarative1Connections*>("connections");
+ QVERIFY(connections);
+
+ QDeclarativeItem *item1 = item->findChild<QDeclarativeItem*>("item1");
+ QVERIFY(item1);
+
+ item1->setWidth(200);
+
+ QDeclarativeItem *item2 = item->findChild<QDeclarativeItem*>("item2");
+ QVERIFY(item2);
+ QVERIFY(connections->target() == item2);
+
+ // If we don't crash then we're OK
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::unknownSignals_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("basic") << "connection-unknownsignals.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+ QTest::newRow("parent") << "connection-unknownsignals-parent.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+ QTest::newRow("ignored") << "connection-unknownsignals-ignored.qml" << ""; // should be NO error
+ QTest::newRow("notarget") << "connection-unknownsignals-notarget.qml" << ""; // should be NO error
+}
+
+void tst_qdeclarativeconnection::unknownSignals()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, error);
+
+ QUrl url = QUrl::fromLocalFile(SRCDIR "/data/" + file);
+ if (!error.isEmpty()) {
+ QTest::ignoreMessage(QtWarningMsg, (url.toString() + error).toLatin1());
+ } else {
+ // QTest has no way to insist no message (i.e. fail)
+ }
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, url);
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QVERIFY(item != 0);
+
+ // check that connection is created (they are all runtime errors)
+ QDeclarative1Connections *connections = item->findChild<QDeclarative1Connections*>("connections");
+ QVERIFY(connections);
+
+ if (file == "connection-unknownsignals-ignored.qml")
+ QVERIFY(connections->ignoreUnknownSignals());
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::errors_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("no \"on\"") << "error-property.qml" << "Cannot assign to non-existent property \"fakeProperty\"";
+ QTest::newRow("3rd letter lowercase") << "error-property2.qml" << "Cannot assign to non-existent property \"onfakeProperty\"";
+ QTest::newRow("child object") << "error-object.qml" << "Connections: nested objects not allowed";
+ QTest::newRow("grouped object") << "error-syntax.qml" << "Connections: syntax error";
+}
+
+void tst_qdeclarativeconnection::errors()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, error);
+
+ QUrl url = QUrl::fromLocalFile(SRCDIR "/data/" + file);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, url);
+ QVERIFY(c.isError() == true);
+ QList<QDeclarativeError> errors = c.errors();
+ QVERIFY(errors.count() == 1);
+ QCOMPARE(errors.at(0).description(), error);
+}
+
+QTEST_MAIN(tst_qdeclarativeconnection)
+
+#include "tst_qdeclarativeconnection.moc"
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/disabledcontent.qml
index dcbb20bdd5..dcbb20bdd5 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/disabledcontent.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable01.qml
index c53ae3f98a..c53ae3f98a 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable01.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable02.qml
index 98925ae3c6..98925ae3c6 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable02.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable03.qml
index a3e92fe6a6..a3e92fe6a6 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable03.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable04.qml
index fcc683ae4d..fcc683ae4d 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/flickable04.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickableqgraphicswidget.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/flickableqgraphicswidget.qml
index 6cbf12c1ee..6cbf12c1ee 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickableqgraphicswidget.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/flickableqgraphicswidget.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/nestedPressDelay.qml
index d0ee545f97..d0ee545f97 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/nestedPressDelay.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/resize.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/resize.qml
index e2abb99f2a..e2abb99f2a 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/resize.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/resize.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/wheel.qml b/tests/auto/qtquick1/qdeclarativeflickable/data/wheel.qml
index 6ea81b2d9e..6ea81b2d9e 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/wheel.qml
+++ b/tests/auto/qtquick1/qdeclarativeflickable/data/wheel.qml
diff --git a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro b/tests/auto/qtquick1/qdeclarativeflickable/qdeclarativeflickable.pro
index 83036f8347..79b61d81c4 100644
--- a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
+++ b/tests/auto/qtquick1/qdeclarativeflickable/qdeclarativeflickable.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeflickable.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
index b077fdc7ab..f74f02c8ff 100644
--- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
+++ b/tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -42,7 +42,7 @@
#include <QtTest/QSignalSpy>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <private/qdeclarativeflickable_p.h>
#include <private/qdeclarativevaluetype_p.h>
#include <QtGui/qgraphicswidget.h>
@@ -94,7 +94,7 @@ void tst_qdeclarativeflickable::create()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable01.qml"));
- QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+ QDeclarative1Flickable *obj = qobject_cast<QDeclarative1Flickable*>(c.create());
QVERIFY(obj != 0);
QCOMPARE(obj->isAtXBeginning(), true);
@@ -108,7 +108,7 @@ void tst_qdeclarativeflickable::create()
QCOMPARE(obj->verticalVelocity(), 0.);
QCOMPARE(obj->isInteractive(), true);
- QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::DragAndOvershootBounds);
+ QCOMPARE(obj->boundsBehavior(), QDeclarative1Flickable::DragAndOvershootBounds);
QCOMPARE(obj->pressDelay(), 0);
QCOMPARE(obj->maximumFlickVelocity(), 2500.);
@@ -119,7 +119,7 @@ void tst_qdeclarativeflickable::horizontalViewportSize()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable02.qml"));
- QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+ QDeclarative1Flickable *obj = qobject_cast<QDeclarative1Flickable*>(c.create());
QVERIFY(obj != 0);
QCOMPARE(obj->contentWidth(), 800.);
@@ -136,7 +136,7 @@ void tst_qdeclarativeflickable::verticalViewportSize()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable03.qml"));
- QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+ QDeclarative1Flickable *obj = qobject_cast<QDeclarative1Flickable*>(c.create());
QVERIFY(obj != 0);
QCOMPARE(obj->contentWidth(), 200.);
@@ -153,11 +153,11 @@ void tst_qdeclarativeflickable::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable04.qml"));
- QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+ QDeclarative1Flickable *obj = qobject_cast<QDeclarative1Flickable*>(c.create());
QVERIFY(obj != 0);
QCOMPARE(obj->isInteractive(), false);
- QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::StopAtBounds);
+ QCOMPARE(obj->boundsBehavior(), QDeclarative1Flickable::StopAtBounds);
QCOMPARE(obj->pressDelay(), 200);
QCOMPARE(obj->maximumFlickVelocity(), 2000.);
@@ -172,28 +172,28 @@ void tst_qdeclarativeflickable::boundsBehavior()
{
QDeclarativeComponent component(&engine);
component.setData("import QtQuick 1.0; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile(""));
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(component.create());
QSignalSpy spy(flickable, SIGNAL(boundsBehaviorChanged()));
QVERIFY(flickable);
- QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarative1Flickable::StopAtBounds);
- flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds);
- QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragAndOvershootBounds);
+ flickable->setBoundsBehavior(QDeclarative1Flickable::DragAndOvershootBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarative1Flickable::DragAndOvershootBounds);
QCOMPARE(spy.count(),1);
- flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds);
+ flickable->setBoundsBehavior(QDeclarative1Flickable::DragAndOvershootBounds);
QCOMPARE(spy.count(),1);
- flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds);
- QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragOverBounds);
+ flickable->setBoundsBehavior(QDeclarative1Flickable::DragOverBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarative1Flickable::DragOverBounds);
QCOMPARE(spy.count(),2);
- flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds);
+ flickable->setBoundsBehavior(QDeclarative1Flickable::DragOverBounds);
QCOMPARE(spy.count(),2);
- flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds);
- QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds);
+ flickable->setBoundsBehavior(QDeclarative1Flickable::StopAtBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarative1Flickable::StopAtBounds);
QCOMPARE(spy.count(),3);
- flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds);
+ flickable->setBoundsBehavior(QDeclarative1Flickable::StopAtBounds);
QCOMPARE(spy.count(),3);
}
@@ -201,7 +201,7 @@ void tst_qdeclarativeflickable::maximumFlickVelocity()
{
QDeclarativeComponent component(&engine);
component.setData("import QtQuick 1.0; Flickable { maximumFlickVelocity: 1.0; }", QUrl::fromLocalFile(""));
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(component.create());
QSignalSpy spy(flickable, SIGNAL(maximumFlickVelocityChanged()));
QVERIFY(flickable);
@@ -218,7 +218,7 @@ void tst_qdeclarativeflickable::flickDeceleration()
{
QDeclarativeComponent component(&engine);
component.setData("import QtQuick 1.0; Flickable { flickDeceleration: 1.0; }", QUrl::fromLocalFile(""));
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(component.create());
QSignalSpy spy(flickable, SIGNAL(flickDecelerationChanged()));
QVERIFY(flickable);
@@ -235,7 +235,7 @@ void tst_qdeclarativeflickable::pressDelay()
{
QDeclarativeComponent component(&engine);
component.setData("import QtQuick 1.0; Flickable { pressDelay: 100; }", QUrl::fromLocalFile(""));
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(component.create());
QSignalSpy spy(flickable, SIGNAL(pressDelayChanged()));
QVERIFY(flickable);
@@ -257,7 +257,7 @@ void tst_qdeclarativeflickable::disabledContent()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(canvas->rootObject());
QVERIFY(flickable != 0);
QVERIFY(flickable->contentX() == 0);
@@ -295,10 +295,10 @@ void tst_qdeclarativeflickable::nestedPressDelay()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeFlickable *outer = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QDeclarative1Flickable *outer = qobject_cast<QDeclarative1Flickable*>(canvas->rootObject());
QVERIFY(outer != 0);
- QDeclarativeFlickable *inner = canvas->rootObject()->findChild<QDeclarativeFlickable*>("innerFlickable");
+ QDeclarative1Flickable *inner = canvas->rootObject()->findChild<QDeclarative1Flickable*>("innerFlickable");
QVERIFY(inner != 0);
QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(150, 150)));
@@ -318,26 +318,26 @@ void tst_qdeclarativeflickable::flickableDirection()
{
QDeclarativeComponent component(&engine);
component.setData("import QtQuick 1.0; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile(""));
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(component.create());
QSignalSpy spy(flickable, SIGNAL(flickableDirectionChanged()));
QVERIFY(flickable);
- QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::VerticalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarative1Flickable::VerticalFlick);
- flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalAndVerticalFlick);
- QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalAndVerticalFlick);
+ flickable->setFlickableDirection(QDeclarative1Flickable::HorizontalAndVerticalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarative1Flickable::HorizontalAndVerticalFlick);
QCOMPARE(spy.count(),1);
- flickable->setFlickableDirection(QDeclarativeFlickable::AutoFlickDirection);
- QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::AutoFlickDirection);
+ flickable->setFlickableDirection(QDeclarative1Flickable::AutoFlickDirection);
+ QCOMPARE(flickable->flickableDirection(), QDeclarative1Flickable::AutoFlickDirection);
QCOMPARE(spy.count(),2);
- flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
- QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ flickable->setFlickableDirection(QDeclarative1Flickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarative1Flickable::HorizontalFlick);
QCOMPARE(spy.count(),3);
- flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
- QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ flickable->setFlickableDirection(QDeclarative1Flickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarative1Flickable::HorizontalFlick);
QCOMPARE(spy.count(),3);
}
@@ -345,7 +345,7 @@ void tst_qdeclarativeflickable::qgraphicswidget()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickableqgraphicswidget.qml"));
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(c.create());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(c.create());
QVERIFY(flickable != 0);
QGraphicsWidget *widget = findItem<QGraphicsWidget>(flickable->contentItem(), "widget1");
@@ -358,7 +358,7 @@ void tst_qdeclarativeflickable::resizeContent()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/resize.qml"));
QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(c.create());
- QDeclarativeFlickable *obj = findItem<QDeclarativeFlickable>(root, "flick");
+ QDeclarative1Flickable *obj = findItem<QDeclarative1Flickable>(root, "flick");
QVERIFY(obj != 0);
QCOMPARE(obj->contentX(), 0.);
@@ -382,7 +382,7 @@ void tst_qdeclarativeflickable::returnToBounds()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/resize.qml"));
QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(c.create());
- QDeclarativeFlickable *obj = findItem<QDeclarativeFlickable>(root, "flick");
+ QDeclarative1Flickable *obj = findItem<QDeclarative1Flickable>(root, "flick");
QVERIFY(obj != 0);
QCOMPARE(obj->contentX(), 0.);
@@ -451,7 +451,7 @@ void tst_qdeclarativeflickable::wheel()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeFlickable *flick = canvas->rootObject()->findChild<QDeclarativeFlickable*>("flick");
+ QDeclarative1Flickable *flick = canvas->rootObject()->findChild<QDeclarative1Flickable*>("flick");
QVERIFY(flick != 0);
QGraphicsScene *scene = canvas->scene();
diff --git a/tests/auto/declarative/qdeclarativeflipable/data/crash.qml b/tests/auto/qtquick1/qdeclarativeflipable/data/crash.qml
index bc5229b529..bc5229b529 100644
--- a/tests/auto/declarative/qdeclarativeflipable/data/crash.qml
+++ b/tests/auto/qtquick1/qdeclarativeflipable/data/crash.qml
diff --git a/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml b/tests/auto/qtquick1/qdeclarativeflipable/data/flipable-abort.qml
index 69ff4a2228..69ff4a2228 100644
--- a/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml
+++ b/tests/auto/qtquick1/qdeclarativeflipable/data/flipable-abort.qml
diff --git a/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml b/tests/auto/qtquick1/qdeclarativeflipable/data/test-flipable.qml
index 02b69e0799..02b69e0799 100644
--- a/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml
+++ b/tests/auto/qtquick1/qdeclarativeflipable/data/test-flipable.qml
diff --git a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro b/tests/auto/qtquick1/qdeclarativeflipable/qdeclarativeflipable.pro
index b5b10e73c0..e08611cbbd 100644
--- a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
+++ b/tests/auto/qtquick1/qdeclarativeflipable/qdeclarativeflipable.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeflipable.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp b/tests/auto/qtquick1/qdeclarativeflipable/tst_qdeclarativeflipable.cpp
index 1b3d818dd6..60d71253a5 100644
--- a/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp
+++ b/tests/auto/qtquick1/qdeclarativeflipable/tst_qdeclarativeflipable.cpp
@@ -41,11 +41,11 @@
#include <qtest.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativeflipable_p.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativeflipable_p.h>
#include <private/qdeclarativevaluetype_p.h>
#include <QFontMetrics>
-#include <private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
#include <math.h>
#ifdef Q_OS_SYMBIAN
@@ -80,7 +80,7 @@ void tst_qdeclarativeflipable::create()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-flipable.qml"));
- QDeclarativeFlipable *obj = qobject_cast<QDeclarativeFlipable*>(c.create());
+ QDeclarative1Flipable *obj = qobject_cast<QDeclarative1Flipable*>(c.create());
QVERIFY(obj != 0);
delete obj;
@@ -90,7 +90,7 @@ void tst_qdeclarativeflipable::checkFrontAndBack()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-flipable.qml"));
- QDeclarativeFlipable *obj = qobject_cast<QDeclarativeFlipable*>(c.create());
+ QDeclarative1Flipable *obj = qobject_cast<QDeclarative1Flipable*>(c.create());
QVERIFY(obj != 0);
QVERIFY(obj->front() != 0);
@@ -102,7 +102,7 @@ void tst_qdeclarativeflipable::setFrontAndBack()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-flipable.qml"));
- QDeclarativeFlipable *obj = qobject_cast<QDeclarativeFlipable*>(c.create());
+ QDeclarative1Flipable *obj = qobject_cast<QDeclarative1Flipable*>(c.create());
QVERIFY(obj != 0);
QVERIFY(obj->front() != 0);
@@ -110,11 +110,11 @@ void tst_qdeclarativeflipable::setFrontAndBack()
QString message = c.url().toString() + ":3:1: QML Flipable: front is a write-once property";
QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
- obj->setFront(new QDeclarativeRectangle());
+ obj->setFront(new QDeclarative1Rectangle());
message = c.url().toString() + ":3:1: QML Flipable: back is a write-once property";
QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
- obj->setBack(new QDeclarativeRectangle());
+ obj->setBack(new QDeclarative1Rectangle());
delete obj;
}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/chain.qml
index a40bc2cdd6..a40bc2cdd6 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/chain.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forceActiveFocus.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/forceActiveFocus.qml
index 6c39d4a432..6c39d4a432 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/forceActiveFocus.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/forceActiveFocus.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/forcefocus.qml
index 708e899146..708e899146 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/forcefocus.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/qtBug13380.qml
index 1784202e77..1784202e77 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/qtBug13380.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/signalEmission.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/signalEmission.qml
index 5850791704..5850791704 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/signalEmission.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/signalEmission.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/test.qml
index 5983c19015..5983c19015 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/test.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/test2.qml
index 8c0b3b4267..8c0b3b4267 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/test2.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/test3.qml
index 2e025cb6cc..2e025cb6cc 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/test3.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/test4.qml
index 7192dee6db..7192dee6db 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/test4.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml b/tests/auto/qtquick1/qdeclarativefocusscope/data/test5.qml
index 01dada5d37..01dada5d37 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/data/test5.qml
diff --git a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro b/tests/auto/qtquick1/qdeclarativefocusscope/qdeclarativefocusscope.pro
index f63f339e79..f532585b89 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/qdeclarativefocusscope.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
SOURCES += tst_qdeclarativefocusscope.cpp
macx:CONFIG -= app_bundle
@@ -11,4 +11,4 @@ symbian: {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/qtquick1/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
index ab1e1940b9..50cca1d53d 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
+++ b/tests/auto/qtquick1/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
@@ -42,11 +42,11 @@
#include <QSignalSpy>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativetextedit_p.h>
-#include <private/qdeclarativetext_p.h>
-#include <QtDeclarative/private/qdeclarativefocusscope_p.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativetextedit_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativefocusscope_p.h>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -101,10 +101,10 @@ void tst_qdeclarativefocusscope::basic()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test.qml"));
- QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
- QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
- QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
- QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
+ QDeclarative1FocusScope *item0 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item0"));
+ QDeclarative1Rectangle *item1 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarative1Rectangle *item2 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarative1Rectangle *item3 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item3"));
QVERIFY(item0 != 0);
QVERIFY(item1 != 0);
QVERIFY(item2 != 0);
@@ -146,11 +146,11 @@ void tst_qdeclarativefocusscope::nested()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test2.qml"));
- QDeclarativeFocusScope *item1 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item1"));
- QDeclarativeFocusScope *item2 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item2"));
- QDeclarativeFocusScope *item3 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item3"));
- QDeclarativeFocusScope *item4 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item4"));
- QDeclarativeFocusScope *item5 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item5"));
+ QDeclarative1FocusScope *item1 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item1"));
+ QDeclarative1FocusScope *item2 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item2"));
+ QDeclarative1FocusScope *item3 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item3"));
+ QDeclarative1FocusScope *item4 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item4"));
+ QDeclarative1FocusScope *item5 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item5"));
QVERIFY(item1 != 0);
QVERIFY(item2 != 0);
QVERIFY(item3 != 0);
@@ -182,10 +182,10 @@ void tst_qdeclarativefocusscope::noFocus()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test4.qml"));
- QDeclarativeRectangle *item0 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item0"));
- QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
- QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
- QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
+ QDeclarative1Rectangle *item0 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item0"));
+ QDeclarative1Rectangle *item1 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarative1Rectangle *item2 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarative1Rectangle *item3 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item3"));
QVERIFY(item0 != 0);
QVERIFY(item1 != 0);
QVERIFY(item2 != 0);
@@ -227,10 +227,10 @@ void tst_qdeclarativefocusscope::textEdit()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test5.qml"));
- QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
- QDeclarativeTextEdit *item1 = findItem<QDeclarativeTextEdit>(view->rootObject(), QLatin1String("item1"));
- QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
- QDeclarativeTextEdit *item3 = findItem<QDeclarativeTextEdit>(view->rootObject(), QLatin1String("item3"));
+ QDeclarative1FocusScope *item0 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item0"));
+ QDeclarative1TextEdit *item1 = findItem<QDeclarative1TextEdit>(view->rootObject(), QLatin1String("item1"));
+ QDeclarative1Rectangle *item2 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarative1TextEdit *item3 = findItem<QDeclarative1TextEdit>(view->rootObject(), QLatin1String("item3"));
QVERIFY(item0 != 0);
QVERIFY(item1 != 0);
QVERIFY(item2 != 0);
@@ -282,12 +282,12 @@ void tst_qdeclarativefocusscope::forceFocus()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/forcefocus.qml"));
- QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
- QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
- QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
- QDeclarativeFocusScope *item3 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item3"));
- QDeclarativeRectangle *item4 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item4"));
- QDeclarativeRectangle *item5 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item5"));
+ QDeclarative1FocusScope *item0 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item0"));
+ QDeclarative1Rectangle *item1 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarative1Rectangle *item2 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarative1FocusScope *item3 = findItem<QDeclarative1FocusScope>(view->rootObject(), QLatin1String("item3"));
+ QDeclarative1Rectangle *item4 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item4"));
+ QDeclarative1Rectangle *item5 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item5"));
QVERIFY(item0 != 0);
QVERIFY(item1 != 0);
QVERIFY(item2 != 0);
@@ -352,10 +352,10 @@ void tst_qdeclarativefocusscope::signalEmission()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/signalEmission.qml"));
- QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
- QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
- QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
- QDeclarativeRectangle *item4 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item4"));
+ QDeclarative1Rectangle *item1 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarative1Rectangle *item2 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarative1Rectangle *item3 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item3"));
+ QDeclarative1Rectangle *item4 = findItem<QDeclarative1Rectangle>(view->rootObject(), QLatin1String("item4"));
QVERIFY(item1 != 0);
QVERIFY(item2 != 0);
QVERIFY(item3 != 0);
diff --git a/tests/auto/declarative/qdeclarativefontloader/data/daniel.ttf b/tests/auto/qtquick1/qdeclarativefontloader/data/daniel.ttf
index aae50d5035..aae50d5035 100644
--- a/tests/auto/declarative/qdeclarativefontloader/data/daniel.ttf
+++ b/tests/auto/qtquick1/qdeclarativefontloader/data/daniel.ttf
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativefontloader/data/dummy.ttf b/tests/auto/qtquick1/qdeclarativefontloader/data/dummy.ttf
index e69de29bb2..e69de29bb2 100644
--- a/tests/auto/declarative/qdeclarativefontloader/data/dummy.ttf
+++ b/tests/auto/qtquick1/qdeclarativefontloader/data/dummy.ttf
diff --git a/tests/auto/declarative/qdeclarativefontloader/data/tarzeau_ocr_a.ttf b/tests/auto/qtquick1/qdeclarativefontloader/data/tarzeau_ocr_a.ttf
index cf93f9651f..cf93f9651f 100644
--- a/tests/auto/declarative/qdeclarativefontloader/data/tarzeau_ocr_a.ttf
+++ b/tests/auto/qtquick1/qdeclarativefontloader/data/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/tests/auto/qtquick1/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/qtquick1/qdeclarativefontloader/qdeclarativefontloader.pro
new file mode 100644
index 0000000000..9bb0c8e3f2
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativefontloader/qdeclarativefontloader.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network qtquick1
+macx:CONFIG -= app_bundle
+
+HEADERS += ../../declarative/shared/testhttpserver.h
+SOURCES += tst_qdeclarativefontloader.cpp ../../declarative/shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/qtquick1/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
index 9b2704b076..cfd3087f77 100644
--- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
+++ b/tests/auto/qtquick1/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
@@ -43,9 +43,9 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
-#include <private/qdeclarativefontloader_p.h>
+#include <QtQuick1/private/qdeclarativefontloader_p.h>
#include "../../../shared/util.h"
-#include "../shared/testhttpserver.h"
+#include "../../declarative/shared/testhttpserver.h"
#define SERVER_PORT 14448
@@ -92,12 +92,12 @@ void tst_qdeclarativefontloader::noFont()
QString componentStr = "import QtQuick 1.0\nFontLoader { }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QCOMPARE(fontObject->name(), QString(""));
QCOMPARE(fontObject->source(), QUrl(""));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Null);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Null);
delete fontObject;
}
@@ -107,12 +107,12 @@ void tst_qdeclarativefontloader::namedFont()
QString componentStr = "import QtQuick 1.0\nFontLoader { name: \"Helvetica\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QCOMPARE(fontObject->source(), QUrl(""));
QCOMPARE(fontObject->name(), QString("Helvetica"));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
}
void tst_qdeclarativefontloader::localFont()
@@ -120,12 +120,12 @@ void tst_qdeclarativefontloader::localFont()
QString componentStr = "import QtQuick 1.0\nFontLoader { source: \"" SRCDIR "/data/tarzeau_ocr_a.ttf\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QVERIFY(fontObject->source() != QUrl(""));
QTRY_COMPARE(fontObject->name(), QString("OCRA"));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
}
void tst_qdeclarativefontloader::failLocalFont()
@@ -134,12 +134,12 @@ void tst_qdeclarativefontloader::failLocalFont()
QTest::ignoreMessage(QtWarningMsg, QString("file::2:1: QML FontLoader: Cannot load font: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\"").toUtf8().constData());
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QVERIFY(fontObject->source() != QUrl(""));
QTRY_COMPARE(fontObject->name(), QString(""));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Error);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Error);
}
void tst_qdeclarativefontloader::webFont()
@@ -148,12 +148,12 @@ void tst_qdeclarativefontloader::webFont()
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QVERIFY(fontObject->source() != QUrl(""));
QTRY_COMPARE(fontObject->name(), QString("OCRA"));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
}
void tst_qdeclarativefontloader::redirWebFont()
@@ -164,12 +164,12 @@ void tst_qdeclarativefontloader::redirWebFont()
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QVERIFY(fontObject->source() != QUrl(""));
QTRY_COMPARE(fontObject->name(), QString("OCRA"));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
}
void tst_qdeclarativefontloader::failWebFont()
@@ -178,12 +178,12 @@ void tst_qdeclarativefontloader::failWebFont()
QTest::ignoreMessage(QtWarningMsg, "file::2:1: QML FontLoader: Cannot load font: \"http://localhost:14448/nonexist.ttf\"");
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QVERIFY(fontObject->source() != QUrl(""));
QTRY_COMPARE(fontObject->name(), QString(""));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Error);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Error);
}
void tst_qdeclarativefontloader::changeFont()
@@ -193,33 +193,33 @@ void tst_qdeclarativefontloader::changeFont()
ctxt->setContextProperty("font", QUrl::fromLocalFile(SRCDIR "/data/tarzeau_ocr_a.ttf"));
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+ QDeclarative1FontLoader *fontObject = qobject_cast<QDeclarative1FontLoader*>(component.create());
QVERIFY(fontObject != 0);
QSignalSpy nameSpy(fontObject, SIGNAL(nameChanged()));
QSignalSpy statusSpy(fontObject, SIGNAL(statusChanged()));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
QCOMPARE(nameSpy.count(), 0);
QCOMPARE(statusSpy.count(), 0);
QTRY_COMPARE(fontObject->name(), QString("OCRA"));
ctxt->setContextProperty("font", "http://localhost:14448/daniel.ttf");
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Loading);
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Loading);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
QCOMPARE(nameSpy.count(), 1);
QCOMPARE(statusSpy.count(), 2);
QTRY_COMPARE(fontObject->name(), QString("Daniel"));
ctxt->setContextProperty("font", QUrl::fromLocalFile(SRCDIR "/data/tarzeau_ocr_a.ttf"));
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
QCOMPARE(nameSpy.count(), 2);
QCOMPARE(statusSpy.count(), 2);
QTRY_COMPARE(fontObject->name(), QString("OCRA"));
ctxt->setContextProperty("font", "http://localhost:14448/daniel.ttf");
- QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QTRY_VERIFY(fontObject->status() == QDeclarative1FontLoader::Ready);
QCOMPARE(nameSpy.count(), 3);
QCOMPARE(statusSpy.count(), 2);
QTRY_COMPARE(fontObject->name(), QString("Daniel"));
diff --git a/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml b/tests/auto/qtquick1/qdeclarativegridview/data/attachedSignals.qml
index d527e9d256..d527e9d256 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/attachedSignals.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml b/tests/auto/qtquick1/qdeclarativegridview/data/displaygrid.qml
index 93f39ffd96..93f39ffd96 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/displaygrid.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/footer.qml b/tests/auto/qtquick1/qdeclarativegridview/data/footer.qml
index b41e2ac0b2..b41e2ac0b2 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/footer.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/footer.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml b/tests/auto/qtquick1/qdeclarativegridview/data/gridview-enforcerange.qml
index 69eaa4774c..69eaa4774c 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/gridview-enforcerange.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml b/tests/auto/qtquick1/qdeclarativegridview/data/gridview-initCurrent.qml
index 421f810f2c..421f810f2c 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/gridview-initCurrent.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-noCurrent.qml b/tests/auto/qtquick1/qdeclarativegridview/data/gridview-noCurrent.qml
index 1189649ea1..1189649ea1 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview-noCurrent.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/gridview-noCurrent.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml b/tests/auto/qtquick1/qdeclarativegridview/data/gridview1.qml
index a2b0a915d9..a2b0a915d9 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/gridview1.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml b/tests/auto/qtquick1/qdeclarativegridview/data/gridview2.qml
index 7559a7ff36..7559a7ff36 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/gridview2.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml b/tests/auto/qtquick1/qdeclarativegridview/data/gridview3.qml
index ab4ceeb76d..ab4ceeb76d 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/gridview3.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/header.qml b/tests/auto/qtquick1/qdeclarativegridview/data/header.qml
index f39da55dda..f39da55dda 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/header.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/header.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/manual-highlight.qml b/tests/auto/qtquick1/qdeclarativegridview/data/manual-highlight.qml
index d08284792e..d08284792e 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/manual-highlight.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/manual-highlight.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml b/tests/auto/qtquick1/qdeclarativegridview/data/mirroring.qml
index 54de16bc41..54de16bc41 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/mirroring.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml b/tests/auto/qtquick1/qdeclarativegridview/data/propertychangestest.qml
index 10df234261..10df234261 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/propertychangestest.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/data/setindex.qml b/tests/auto/qtquick1/qdeclarativegridview/data/setindex.qml
index 36bf67de15..36bf67de15 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/setindex.qml
+++ b/tests/auto/qtquick1/qdeclarativegridview/data/setindex.qml
diff --git a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro b/tests/auto/qtquick1/qdeclarativegridview/qdeclarativegridview.pro
index 2a5fcffc85..bdff620e95 100644
--- a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
+++ b/tests/auto/qtquick1/qdeclarativegridview/qdeclarativegridview.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativegridview.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/qtquick1/qdeclarativegridview/tst_qdeclarativegridview.cpp
index 0bc964f206..606b5fcab8 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/qtquick1/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -41,16 +41,14 @@
#include <QtTest/QtTest>
#include <QtGui/qstringlistmodel.h>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
-#include <QtDeclarative/private/qdeclarativeitem_p.h>
-#include <QtDeclarative/private/qlistmodelinterface_p.h>
-#include <QtDeclarative/private/qdeclarativegridview_p.h>
-#include <QtDeclarative/private/qdeclarativetext_p.h>
-#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
+#include <QtQuick1/private/qdeclarativegridview_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
@@ -58,11 +56,11 @@
#define SRCDIR "."
#endif
-class tst_QDeclarativeGridView : public QObject
+class tst_QDeclarative1GridView : public QObject
{
Q_OBJECT
public:
- tst_QDeclarativeGridView();
+ tst_QDeclarative1GridView();
private slots:
void items();
@@ -190,11 +188,11 @@ private:
QList<QPair<QString,QString> > list;
};
-tst_QDeclarativeGridView::tst_QDeclarativeGridView()
+tst_QDeclarative1GridView::tst_QDeclarative1GridView()
{
}
-void tst_QDeclarativeGridView::items()
+void tst_QDeclarative1GridView::items()
{
QDeclarativeView *canvas = createView();
@@ -215,7 +213,7 @@ void tst_QDeclarativeGridView::items()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -226,10 +224,10 @@ void tst_QDeclarativeGridView::items()
QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
for (int i = 0; i < model.count(); ++i) {
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -244,7 +242,7 @@ void tst_QDeclarativeGridView::items()
delete canvas;
}
-void tst_QDeclarativeGridView::changed()
+void tst_QDeclarative1GridView::changed()
{
QDeclarativeView *canvas = createView();
@@ -265,24 +263,24 @@ void tst_QDeclarativeGridView::changed()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeFlickable *gridview = findItem<QDeclarativeFlickable>(canvas->rootObject(), "grid");
+ QDeclarative1Flickable *gridview = findItem<QDeclarative1Flickable>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
QTRY_VERIFY(contentItem != 0);
model.modifyItem(1, "Will", "9876");
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
delete canvas;
}
-void tst_QDeclarativeGridView::inserted()
+void tst_QDeclarative1GridView::inserted()
{
QDeclarativeView *canvas = createView();
@@ -299,7 +297,7 @@ void tst_QDeclarativeGridView::inserted()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -310,10 +308,10 @@ void tst_QDeclarativeGridView::inserted()
QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
@@ -332,10 +330,10 @@ void tst_QDeclarativeGridView::inserted()
QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
- name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", 0);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(0));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", 0);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(0));
@@ -361,7 +359,7 @@ void tst_QDeclarativeGridView::inserted()
delete canvas;
}
-void tst_QDeclarativeGridView::removed()
+void tst_QDeclarative1GridView::removed()
{
QDeclarativeView *canvas = createView();
@@ -377,7 +375,7 @@ void tst_QDeclarativeGridView::removed()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -386,10 +384,10 @@ void tst_QDeclarativeGridView::removed()
model.removeItem(1);
QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
@@ -410,10 +408,10 @@ void tst_QDeclarativeGridView::removed()
// Remove first item (which is the current item);
model.removeItem(0);
- name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", 0);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(0));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", 0);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(0));
@@ -506,7 +504,7 @@ void tst_QDeclarativeGridView::removed()
delete canvas;
}
-void tst_QDeclarativeGridView::clear()
+void tst_QDeclarative1GridView::clear()
{
QDeclarativeView *canvas = createView();
@@ -522,7 +520,7 @@ void tst_QDeclarativeGridView::clear()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QVERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -544,7 +542,7 @@ void tst_QDeclarativeGridView::clear()
delete canvas;
}
-void tst_QDeclarativeGridView::moved()
+void tst_QDeclarative1GridView::moved()
{
QDeclarativeView *canvas = createView();
@@ -560,7 +558,7 @@ void tst_QDeclarativeGridView::moved()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -568,17 +566,17 @@ void tst_QDeclarativeGridView::moved()
model.moveItem(1, 8);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
- name = findItem<QDeclarativeText>(contentItem, "textName", 8);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", 8);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(8));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", 8);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", 8);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(8));
@@ -605,10 +603,10 @@ void tst_QDeclarativeGridView::moved()
QTRY_VERIFY(item);
QTRY_COMPARE(item->x(), qreal((i%3)*80));
QTRY_COMPARE(item->y(), qreal((i/3)*60));
- name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -623,10 +621,10 @@ void tst_QDeclarativeGridView::moved()
QTRY_VERIFY(item);
QTRY_VERIFY(item->x() == (i%3)*80);
QTRY_VERIFY(item->y() == (i/3)*60);
- name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -639,7 +637,7 @@ void tst_QDeclarativeGridView::moved()
delete canvas;
}
-void tst_QDeclarativeGridView::currentIndex()
+void tst_QDeclarative1GridView::currentIndex()
{
TestModel model;
for (int i = 0; i < 60; i++)
@@ -656,7 +654,7 @@ void tst_QDeclarativeGridView::currentIndex()
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QVERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -731,7 +729,7 @@ void tst_QDeclarativeGridView::currentIndex()
QTest::keyClick(canvas, Qt::Key_Up);
QCOMPARE(gridview->currentIndex(), 0);
- gridview->setFlow(QDeclarativeGridView::TopToBottom);
+ gridview->setFlow(QDeclarative1GridView::TopToBottom);
qApp->setActiveWindow(canvas);
#ifdef Q_WS_X11
@@ -780,7 +778,7 @@ void tst_QDeclarativeGridView::currentIndex()
gridview->setHighlightFollowsCurrentItem(true);
- gridview->setFlow(QDeclarativeGridView::LeftToRight);
+ gridview->setFlow(QDeclarative1GridView::LeftToRight);
gridview->setLayoutDirection(Qt::RightToLeft);
qApp->setActiveWindow(canvas);
@@ -833,7 +831,7 @@ void tst_QDeclarativeGridView::currentIndex()
delete canvas;
}
-void tst_QDeclarativeGridView::noCurrentIndex()
+void tst_QDeclarative1GridView::noCurrentIndex()
{
TestModel model;
for (int i = 0; i < 60; i++)
@@ -850,7 +848,7 @@ void tst_QDeclarativeGridView::noCurrentIndex()
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QVERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -870,7 +868,7 @@ void tst_QDeclarativeGridView::noCurrentIndex()
delete canvas;
}
-void tst_QDeclarativeGridView::changeFlow()
+void tst_QDeclarative1GridView::changeFlow()
{
QDeclarativeView *canvas = createView();
@@ -886,7 +884,7 @@ void tst_QDeclarativeGridView::changeFlow()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -900,10 +898,10 @@ void tst_QDeclarativeGridView::changeFlow()
QTRY_VERIFY(item);
QTRY_COMPARE(item->x(), qreal((i%3)*80));
QTRY_COMPARE(item->y(), qreal((i/3)*60));
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -918,10 +916,10 @@ void tst_QDeclarativeGridView::changeFlow()
QTRY_VERIFY(item);
QTRY_COMPARE(item->x(), qreal((i/5)*80));
QTRY_COMPARE(item->y(), qreal((i%5)*60));
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -936,10 +934,10 @@ void tst_QDeclarativeGridView::changeFlow()
QTRY_VERIFY(item);
QTRY_COMPARE(item->x(), qreal(-(i/5)*80 - item->width()));
QTRY_COMPARE(item->y(), qreal((i%5)*60));
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -956,10 +954,10 @@ void tst_QDeclarativeGridView::changeFlow()
QTRY_VERIFY(item);
QTRY_COMPARE(item->x(), qreal(240 - (i%3+1)*80));
QTRY_COMPARE(item->y(), qreal((i/3)*60));
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -967,11 +965,11 @@ void tst_QDeclarativeGridView::changeFlow()
delete canvas;
}
-void tst_QDeclarativeGridView::defaultValues()
+void tst_QDeclarative1GridView::defaultValues()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/gridview3.qml"));
- QDeclarativeGridView *obj = qobject_cast<QDeclarativeGridView*>(c.create());
+ QDeclarative1GridView *obj = qobject_cast<QDeclarative1GridView*>(c.create());
QTRY_VERIFY(obj != 0);
QTRY_VERIFY(obj->model() == QVariant());
@@ -990,11 +988,11 @@ void tst_QDeclarativeGridView::defaultValues()
delete obj;
}
-void tst_QDeclarativeGridView::properties()
+void tst_QDeclarative1GridView::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/gridview2.qml"));
- QDeclarativeGridView *obj = qobject_cast<QDeclarativeGridView*>(c.create());
+ QDeclarative1GridView *obj = qobject_cast<QDeclarative1GridView*>(c.create());
QTRY_VERIFY(obj != 0);
QTRY_VERIFY(obj->model() != QVariant());
@@ -1013,13 +1011,13 @@ void tst_QDeclarativeGridView::properties()
delete obj;
}
-void tst_QDeclarativeGridView::propertyChanges()
+void tst_QDeclarative1GridView::propertyChanges()
{
QDeclarativeView *canvas = createView();
QTRY_VERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
- QDeclarativeGridView *gridView = canvas->rootObject()->findChild<QDeclarativeGridView*>("gridView");
+ QDeclarative1GridView *gridView = canvas->rootObject()->findChild<QDeclarative1GridView*>("gridView");
QTRY_VERIFY(gridView);
QSignalSpy keyNavigationWrapsSpy(gridView, SIGNAL(keyNavigationWrapsChanged()));
@@ -1029,15 +1027,15 @@ void tst_QDeclarativeGridView::propertyChanges()
QTRY_COMPARE(gridView->isWrapEnabled(), true);
QTRY_COMPARE(gridView->cacheBuffer(), 10);
- QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::LeftToRight);
+ QTRY_COMPARE(gridView->flow(), QDeclarative1GridView::LeftToRight);
gridView->setWrapEnabled(false);
gridView->setCacheBuffer(3);
- gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ gridView->setFlow(QDeclarative1GridView::TopToBottom);
QTRY_COMPARE(gridView->isWrapEnabled(), false);
QTRY_COMPARE(gridView->cacheBuffer(), 3);
- QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(gridView->flow(), QDeclarative1GridView::TopToBottom);
QTRY_COMPARE(keyNavigationWrapsSpy.count(),1);
QTRY_COMPARE(cacheBufferSpy.count(),1);
@@ -1045,14 +1043,14 @@ void tst_QDeclarativeGridView::propertyChanges()
gridView->setWrapEnabled(false);
gridView->setCacheBuffer(3);
- gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ gridView->setFlow(QDeclarative1GridView::TopToBottom);
QTRY_COMPARE(keyNavigationWrapsSpy.count(),1);
QTRY_COMPARE(cacheBufferSpy.count(),1);
QTRY_COMPARE(flowSpy.count(),1);
- gridView->setFlow(QDeclarativeGridView::LeftToRight);
- QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::LeftToRight);
+ gridView->setFlow(QDeclarative1GridView::LeftToRight);
+ QTRY_COMPARE(gridView->flow(), QDeclarative1GridView::LeftToRight);
gridView->setWrapEnabled(true);
gridView->setCacheBuffer(5);
@@ -1076,23 +1074,23 @@ void tst_QDeclarativeGridView::propertyChanges()
QTRY_COMPARE(layoutSpy.count(),1);
QTRY_COMPARE(flowSpy.count(),2);
- gridView->setFlow(QDeclarativeGridView::TopToBottom);
- QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::TopToBottom);
+ gridView->setFlow(QDeclarative1GridView::TopToBottom);
+ QTRY_COMPARE(gridView->flow(), QDeclarative1GridView::TopToBottom);
QTRY_COMPARE(flowSpy.count(),3);
- gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ gridView->setFlow(QDeclarative1GridView::TopToBottom);
QTRY_COMPARE(flowSpy.count(),3);
delete canvas;
}
-void tst_QDeclarativeGridView::componentChanges()
+void tst_QDeclarative1GridView::componentChanges()
{
QDeclarativeView *canvas = createView();
QTRY_VERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
- QDeclarativeGridView *gridView = canvas->rootObject()->findChild<QDeclarativeGridView*>("gridView");
+ QDeclarative1GridView *gridView = canvas->rootObject()->findChild<QDeclarative1GridView*>("gridView");
QTRY_VERIFY(gridView);
QDeclarativeComponent component(canvas->engine());
@@ -1134,16 +1132,16 @@ void tst_QDeclarativeGridView::componentChanges()
delete canvas;
}
-void tst_QDeclarativeGridView::modelChanges()
+void tst_QDeclarative1GridView::modelChanges()
{
QDeclarativeView *canvas = createView();
QTRY_VERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
- QDeclarativeGridView *gridView = canvas->rootObject()->findChild<QDeclarativeGridView*>("gridView");
+ QDeclarative1GridView *gridView = canvas->rootObject()->findChild<QDeclarative1GridView*>("gridView");
QTRY_VERIFY(gridView);
- QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel");
+ QObject *alternateModel = canvas->rootObject()->findChild<QObject*>("alternateModel");
QTRY_VERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue(alternateModel);
QSignalSpy modelSpy(gridView, SIGNAL(modelChanged()));
@@ -1160,7 +1158,7 @@ void tst_QDeclarativeGridView::modelChanges()
delete canvas;
}
-void tst_QDeclarativeGridView::positionViewAtIndex()
+void tst_QDeclarative1GridView::positionViewAtIndex()
{
QDeclarativeView *canvas = createView();
@@ -1176,7 +1174,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -1193,7 +1191,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position on a currently visible item
- gridview->positionViewAtIndex(4, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(4, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->indexAt(120, 90), 4);
QTRY_COMPARE(gridview->contentY(), 60.);
@@ -1208,7 +1206,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position on an item beyond the visible items
- gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(21, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->indexAt(40, 450), 21);
QTRY_COMPARE(gridview->contentY(), 420.);
@@ -1223,7 +1221,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position on an item that would leave empty space if positioned at the top
- gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(31, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->indexAt(120, 630), 31);
QTRY_COMPARE(gridview->contentY(), 520.);
@@ -1238,7 +1236,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position at the beginning again
- gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(0, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->indexAt(0, 0), 0);
QTRY_COMPARE(gridview->indexAt(40, 30), 0);
QTRY_COMPARE(gridview->indexAt(80, 60), 4);
@@ -1255,44 +1253,44 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position at End
- gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ gridview->positionViewAtIndex(30, QDeclarative1GridView::End);
QTRY_COMPARE(gridview->contentY(), 340.);
// Position in Center
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Center);
QTRY_COMPARE(gridview->contentY(), 170.);
// Ensure at least partially visible
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentY(), 170.);
gridview->setContentY(302);
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentY(), 302.);
gridview->setContentY(360);
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentY(), 300.);
gridview->setContentY(60);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentY(), 60.);
gridview->setContentY(20);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentY(), 100.);
// Ensure completely visible
gridview->setContentY(120);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->contentY(), 120.);
gridview->setContentY(302);
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->contentY(), 300.);
gridview->setContentY(60);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->contentY(), 100.);
// Test for Top To Bottom layout
@@ -1309,27 +1307,27 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position at End
- gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ gridview->positionViewAtIndex(30, QDeclarative1GridView::End);
QTRY_COMPARE(gridview->contentX(), 320.);
QTRY_COMPARE(gridview->contentY(), 0.);
// Position in Center
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Center);
QTRY_COMPARE(gridview->contentX(), 160.);
// Ensure at least partially visible
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), 160.);
gridview->setContentX(170);
- gridview->positionViewAtIndex(25, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(25, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), 170.);
- gridview->positionViewAtIndex(30, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(30, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), 320.);
gridview->setContentX(170);
- gridview->positionViewAtIndex(25, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(25, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->contentX(), 240.);
// positionViewAtBeginning
@@ -1353,7 +1351,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
delete canvas;
}
-void tst_QDeclarativeGridView::snapping()
+void tst_QDeclarative1GridView::snapping()
{
QDeclarativeView *canvas = createView();
@@ -1369,41 +1367,41 @@ void tst_QDeclarativeGridView::snapping()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
gridview->setHeight(220);
QCOMPARE(gridview->height(), 220.);
- gridview->positionViewAtIndex(12, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(12, QDeclarative1GridView::Visible);
QCOMPARE(gridview->contentY(), 80.);
gridview->setContentY(0);
QCOMPARE(gridview->contentY(), 0.);
- gridview->setSnapMode(QDeclarativeGridView::SnapToRow);
- QCOMPARE(gridview->snapMode(), QDeclarativeGridView::SnapToRow);
+ gridview->setSnapMode(QDeclarative1GridView::SnapToRow);
+ QCOMPARE(gridview->snapMode(), QDeclarative1GridView::SnapToRow);
- gridview->positionViewAtIndex(12, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(12, QDeclarative1GridView::Visible);
QCOMPARE(gridview->contentY(), 60.);
- gridview->positionViewAtIndex(15, QDeclarativeGridView::End);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::End);
QCOMPARE(gridview->contentY(), 120.);
delete canvas;
}
-void tst_QDeclarativeGridView::mirroring()
+void tst_QDeclarative1GridView::mirroring()
{
QDeclarativeView *canvasA = createView();
canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
- QDeclarativeGridView *gridviewA = findItem<QDeclarativeGridView>(canvasA->rootObject(), "view");
+ QDeclarative1GridView *gridviewA = findItem<QDeclarative1GridView>(canvasA->rootObject(), "view");
QTRY_VERIFY(gridviewA != 0);
QDeclarativeView *canvasB = createView();
canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
- QDeclarativeGridView *gridviewB = findItem<QDeclarativeGridView>(canvasB->rootObject(), "view");
+ QDeclarative1GridView *gridviewB = findItem<QDeclarative1GridView>(canvasB->rootObject(), "view");
QTRY_VERIFY(gridviewA != 0);
qApp->processEvents();
@@ -1455,7 +1453,7 @@ void tst_QDeclarativeGridView::mirroring()
delete canvasB;
}
-void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
+void tst_QDeclarative1GridView::positionViewAtIndex_rightToLeft()
{
QDeclarativeView *canvas = createView();
@@ -1471,7 +1469,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -1488,7 +1486,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
}
// Position on a currently visible item
- gridview->positionViewAtIndex(6, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(6, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->contentX(), -320.);
// Confirm items positioned correctly
@@ -1502,7 +1500,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
}
// Position on an item beyond the visible items
- gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(21, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->contentX(), -560.);
// Confirm items positioned correctly
@@ -1516,7 +1514,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
}
// Position on an item that would leave empty space if positioned at the top
- gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(31, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->contentX(), -639.);
// Confirm items positioned correctly
@@ -1530,7 +1528,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
}
// Position at the beginning again
- gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning);
+ gridview->positionViewAtIndex(0, QDeclarative1GridView::Beginning);
QTRY_COMPARE(gridview->contentX(), -240.);
// Confirm items positioned correctly
@@ -1544,50 +1542,50 @@ void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
}
// Position at End
- gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ gridview->positionViewAtIndex(30, QDeclarative1GridView::End);
QTRY_COMPARE(gridview->contentX(), -560.);
// Position in Center
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Center);
QTRY_COMPARE(gridview->contentX(), -400.);
// Ensure at least partially visible
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), -400.);
gridview->setContentX(-555.);
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), -555.);
gridview->setContentX(-239);
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), -320.);
gridview->setContentX(-239);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), -400.);
gridview->setContentX(-640);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Visible);
QTRY_COMPARE(gridview->contentX(), -560.);
// Ensure completely visible
gridview->setContentX(-400);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->contentX(), -400.);
gridview->setContentX(-315);
- gridview->positionViewAtIndex(15, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(15, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->contentX(), -320.);
gridview->setContentX(-640);
- gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(20, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->contentX(), -560.);
delete canvas;
}
-void tst_QDeclarativeGridView::resetModel()
+void tst_QDeclarative1GridView::resetModel()
{
QDeclarativeView *canvas = createView();
@@ -1601,7 +1599,7 @@ void tst_QDeclarativeGridView::resetModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaygrid.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -1610,7 +1608,7 @@ void tst_QDeclarativeGridView::resetModel()
QTRY_COMPARE(gridview->count(), model.rowCount());
for (int i = 0; i < model.rowCount(); ++i) {
- QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QDeclarative1Text *display = findItem<QDeclarative1Text>(contentItem, "displayText", i);
QTRY_VERIFY(display != 0);
QTRY_COMPARE(display->text(), strings.at(i));
}
@@ -1622,7 +1620,7 @@ void tst_QDeclarativeGridView::resetModel()
QTRY_COMPARE(gridview->count(), model.rowCount());
for (int i = 0; i < model.rowCount(); ++i) {
- QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QDeclarative1Text *display = findItem<QDeclarative1Text>(contentItem, "displayText", i);
QTRY_VERIFY(display != 0);
QTRY_COMPARE(display->text(), strings.at(i));
}
@@ -1630,7 +1628,7 @@ void tst_QDeclarativeGridView::resetModel()
delete canvas;
}
-void tst_QDeclarativeGridView::enforceRange()
+void tst_QDeclarative1GridView::enforceRange()
{
QDeclarativeView *canvas = createView();
@@ -1647,12 +1645,12 @@ void tst_QDeclarativeGridView::enforceRange()
qApp->processEvents();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0);
QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0);
- QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarativeGridView::StrictlyEnforceRange);
+ QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarative1GridView::StrictlyEnforceRange);
QDeclarativeItem *contentItem = gridview->contentItem();
QTRY_VERIFY(contentItem != 0);
@@ -1662,10 +1660,10 @@ void tst_QDeclarativeGridView::enforceRange()
QTRY_VERIFY(item);
QTRY_COMPARE(gridview->contentY(), -100.0);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 0);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(0));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 0);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(0));
@@ -1686,7 +1684,7 @@ void tst_QDeclarativeGridView::enforceRange()
delete canvas;
}
-void tst_QDeclarativeGridView::enforceRange_rightToLeft()
+void tst_QDeclarative1GridView::enforceRange_rightToLeft()
{
QDeclarativeView *canvas = createView();
@@ -1703,12 +1701,12 @@ void tst_QDeclarativeGridView::enforceRange_rightToLeft()
qApp->processEvents();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0);
QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0);
- QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarativeGridView::StrictlyEnforceRange);
+ QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarative1GridView::StrictlyEnforceRange);
QDeclarativeItem *contentItem = gridview->contentItem();
QTRY_VERIFY(contentItem != 0);
@@ -1719,10 +1717,10 @@ void tst_QDeclarativeGridView::enforceRange_rightToLeft()
QTRY_COMPARE(gridview->contentX(), -100.);
QTRY_COMPARE(gridview->contentY(), 0.0);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 0);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(0));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 0);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(0));
@@ -1744,14 +1742,14 @@ void tst_QDeclarativeGridView::enforceRange_rightToLeft()
delete canvas;
}
-void tst_QDeclarativeGridView::QTBUG_8456()
+void tst_QDeclarative1GridView::QTBUG_8456()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/setindex.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QTRY_COMPARE(gridview->currentIndex(), 0);
@@ -1759,7 +1757,7 @@ void tst_QDeclarativeGridView::QTBUG_8456()
delete canvas;
}
-void tst_QDeclarativeGridView::manualHighlight()
+void tst_QDeclarative1GridView::manualHighlight()
{
QDeclarativeView *canvas = createView();
@@ -1768,7 +1766,7 @@ void tst_QDeclarativeGridView::manualHighlight()
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -1786,15 +1784,15 @@ void tst_QDeclarativeGridView::manualHighlight()
QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y());
QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x());
- gridview->positionViewAtIndex(8, QDeclarativeGridView::Contain);
+ gridview->positionViewAtIndex(8, QDeclarative1GridView::Contain);
QTRY_COMPARE(gridview->currentIndex(), 2);
QTRY_COMPARE(gridview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 2));
QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y());
QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x());
- gridview->setFlow(QDeclarativeGridView::TopToBottom);
- QTRY_COMPARE(gridview->flow(), QDeclarativeGridView::TopToBottom);
+ gridview->setFlow(QDeclarative1GridView::TopToBottom);
+ QTRY_COMPARE(gridview->flow(), QDeclarative1GridView::TopToBottom);
gridview->setCurrentIndex(0);
QTRY_COMPARE(gridview->currentIndex(), 0);
@@ -1805,7 +1803,7 @@ void tst_QDeclarativeGridView::manualHighlight()
delete canvas;
}
-void tst_QDeclarativeGridView::footer()
+void tst_QDeclarative1GridView::footer()
{
QDeclarativeView *canvas = createView();
@@ -1819,13 +1817,13 @@ void tst_QDeclarativeGridView::footer()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/footer.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QDeclarativeText *footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QDeclarative1Text *footer = findItem<QDeclarative1Text>(contentItem, "footer");
QVERIFY(footer);
QCOMPARE(footer->y(), 180.0);
@@ -1842,9 +1840,9 @@ void tst_QDeclarativeGridView::footer()
QMetaObject::invokeMethod(canvas->rootObject(), "changeFooter");
- footer = findItem<QDeclarativeText>(contentItem, "footer");
+ footer = findItem<QDeclarative1Text>(contentItem, "footer");
QVERIFY(!footer);
- footer = findItem<QDeclarativeText>(contentItem, "footer2");
+ footer = findItem<QDeclarative1Text>(contentItem, "footer2");
QVERIFY(footer);
QCOMPARE(footer->y(), 600.0);
@@ -1854,7 +1852,7 @@ void tst_QDeclarativeGridView::footer()
delete canvas;
}
-void tst_QDeclarativeGridView::header()
+void tst_QDeclarative1GridView::header()
{
QDeclarativeView *canvas = createView();
@@ -1868,13 +1866,13 @@ void tst_QDeclarativeGridView::header()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QDeclarative1Text *header = findItem<QDeclarative1Text>(contentItem, "header");
QVERIFY(header);
QCOMPARE(header->y(), 0.0);
@@ -1893,9 +1891,9 @@ void tst_QDeclarativeGridView::header()
QMetaObject::invokeMethod(canvas->rootObject(), "changeHeader");
- header = findItem<QDeclarativeText>(contentItem, "header");
+ header = findItem<QDeclarative1Text>(contentItem, "header");
QVERIFY(!header);
- header = findItem<QDeclarativeText>(contentItem, "header2");
+ header = findItem<QDeclarative1Text>(contentItem, "header2");
QVERIFY(header);
QCOMPARE(header->y(), 10.0);
@@ -1905,7 +1903,7 @@ void tst_QDeclarativeGridView::header()
delete canvas;
}
-void tst_QDeclarativeGridView::indexAt()
+void tst_QDeclarative1GridView::indexAt()
{
QDeclarativeView *canvas = createView();
@@ -1926,7 +1924,7 @@ void tst_QDeclarativeGridView::indexAt()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -1943,7 +1941,7 @@ void tst_QDeclarativeGridView::indexAt()
delete canvas;
}
-void tst_QDeclarativeGridView::onAdd()
+void tst_QDeclarative1GridView::onAdd()
{
QFETCH(int, initialItemCount);
QFETCH(int, itemsToAdd);
@@ -1984,7 +1982,7 @@ void tst_QDeclarativeGridView::onAdd()
delete canvas;
}
-void tst_QDeclarativeGridView::onAdd_data()
+void tst_QDeclarative1GridView::onAdd_data()
{
QTest::addColumn<int>("initialItemCount");
QTest::addColumn<int>("itemsToAdd");
@@ -2002,7 +2000,7 @@ void tst_QDeclarativeGridView::onAdd_data()
QTest::newRow("5, add 10") << 5 << 10;
}
-void tst_QDeclarativeGridView::onRemove()
+void tst_QDeclarative1GridView::onRemove()
{
QFETCH(int, initialItemCount);
QFETCH(int, indexToRemove);
@@ -2031,7 +2029,7 @@ void tst_QDeclarativeGridView::onRemove()
delete canvas;
}
-void tst_QDeclarativeGridView::onRemove_data()
+void tst_QDeclarative1GridView::onRemove_data()
{
QTest::addColumn<int>("initialItemCount");
QTest::addColumn<int>("indexToRemove");
@@ -2054,7 +2052,7 @@ void tst_QDeclarativeGridView::onRemove_data()
QTest::newRow("ten items, remove 4-10") << 10 << 4 << 6;
}
-void tst_QDeclarativeGridView::testQtQuick11Attributes()
+void tst_QDeclarative1GridView::testQtQuick11Attributes()
{
QFETCH(QString, code);
QFETCH(QString, warning);
@@ -2078,7 +2076,7 @@ void tst_QDeclarativeGridView::testQtQuick11Attributes()
delete obj;
}
-void tst_QDeclarativeGridView::testQtQuick11Attributes_data()
+void tst_QDeclarative1GridView::testQtQuick11Attributes_data()
{
QTest::addColumn<QString>("code");
QTest::addColumn<QString>("warning");
@@ -2093,7 +2091,7 @@ void tst_QDeclarativeGridView::testQtQuick11Attributes_data()
<< "";
}
-void tst_QDeclarativeGridView::contentPosJump()
+void tst_QDeclarative1GridView::contentPosJump()
{
QDeclarativeView *canvas = createView();
@@ -2109,7 +2107,7 @@ void tst_QDeclarativeGridView::contentPosJump()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
- QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QDeclarative1GridView *gridview = findItem<QDeclarative1GridView>(canvas->rootObject(), "grid");
QVERIFY(gridview != 0);
QDeclarativeItem *contentItem = gridview->contentItem();
@@ -2143,7 +2141,7 @@ void tst_QDeclarativeGridView::contentPosJump()
delete canvas;
}
-QDeclarativeView *tst_QDeclarativeGridView::createView()
+QDeclarativeView *tst_QDeclarative1GridView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
@@ -2156,7 +2154,7 @@ QDeclarativeView *tst_QDeclarativeGridView::createView()
item must also evaluate the {index} expression equal to index
*/
template<typename T>
-T *tst_QDeclarativeGridView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+T *tst_QDeclarative1GridView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
{
const QMetaObject &mo = T::staticMetaObject;
//qDebug() << parent->childItems().count() << "children";
@@ -2186,7 +2184,7 @@ T *tst_QDeclarativeGridView::findItem(QGraphicsObject *parent, const QString &ob
}
template<typename T>
-QList<T*> tst_QDeclarativeGridView::findItems(QGraphicsObject *parent, const QString &objectName)
+QList<T*> tst_QDeclarative1GridView::findItems(QGraphicsObject *parent, const QString &objectName)
{
QList<T*> items;
const QMetaObject &mo = T::staticMetaObject;
@@ -2206,7 +2204,7 @@ QList<T*> tst_QDeclarativeGridView::findItems(QGraphicsObject *parent, const QSt
return items;
}
-void tst_QDeclarativeGridView::dumpTree(QDeclarativeItem *parent, int depth)
+void tst_QDeclarative1GridView::dumpTree(QDeclarativeItem *parent, int depth)
{
static QString padding(" ");
for (int i = 0; i < parent->childItems().count(); ++i) {
@@ -2220,6 +2218,6 @@ void tst_QDeclarativeGridView::dumpTree(QDeclarativeItem *parent, int depth)
}
-QTEST_MAIN(tst_QDeclarativeGridView)
+QTEST_MAIN(tst_QDeclarative1GridView)
#include "tst_qdeclarativegridview.moc"
diff --git a/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml b/tests/auto/qtquick1/qdeclarativeimage/data/aspectratio.qml
index cd092bc760..cd092bc760 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/aspectratio.qml
diff --git a/tests/auto/declarative/qdeclarativeimage/data/big.jpeg b/tests/auto/qtquick1/qdeclarativeimage/data/big.jpeg
index bed7bd65c3..bed7bd65c3 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/big.jpeg
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/big.jpeg
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/big256.png b/tests/auto/qtquick1/qdeclarativeimage/data/big256.png
index 1dc1596d03..1dc1596d03 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/big256.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/big256.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/colors.png b/tests/auto/qtquick1/qdeclarativeimage/data/colors.png
index dfb62f3d64..dfb62f3d64 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/colors.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/colors.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/colors1.png b/tests/auto/qtquick1/qdeclarativeimage/data/colors1.png
index dfb62f3d64..dfb62f3d64 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/colors1.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/colors1.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/green.png b/tests/auto/qtquick1/qdeclarativeimage/data/green.png
index 0a2e153ba1..0a2e153ba1 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/green.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/green.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png b/tests/auto/qtquick1/qdeclarativeimage/data/heart-win32.png
index 351da13772..351da13772 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/heart-win32.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart.png b/tests/auto/qtquick1/qdeclarativeimage/data/heart.png
index abe97fee4b..abe97fee4b 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/heart.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/heart.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart.svg b/tests/auto/qtquick1/qdeclarativeimage/data/heart.svg
index 8c982cd93c..8c982cd93c 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/heart.svg
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/heart.svg
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png b/tests/auto/qtquick1/qdeclarativeimage/data/heart200-win32.png
index 4976ff98ba..4976ff98ba 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/heart200-win32.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200.png b/tests/auto/qtquick1/qdeclarativeimage/data/heart200.png
index 7fbb13c5bb..7fbb13c5bb 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/heart200.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/heart200.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml b/tests/auto/qtquick1/qdeclarativeimage/data/qtbug_16389.qml
index 29fba400ef..29fba400ef 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/qtbug_16389.qml
diff --git a/tests/auto/declarative/qdeclarativeimage/data/rect.png b/tests/auto/qtquick1/qdeclarativeimage/data/rect.png
index d564a2d5a5..d564a2d5a5 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/rect.png
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/rect.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/tiling.qml b/tests/auto/qtquick1/qdeclarativeimage/data/tiling.qml
index 49715ab3e7..49715ab3e7 100644
--- a/tests/auto/declarative/qdeclarativeimage/data/tiling.qml
+++ b/tests/auto/qtquick1/qdeclarativeimage/data/tiling.qml
diff --git a/tests/auto/qtquick1/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/qtquick1/qdeclarativeimage/qdeclarativeimage.pro
new file mode 100644
index 0000000000..dde8ed91b3
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeimage/qdeclarativeimage.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network qtquick1
+macx:CONFIG -= app_bundle
+
+HEADERS += ../../declarative/shared/testhttpserver.h
+SOURCES += tst_qdeclarativeimage.cpp ../../declarative/shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/qtquick1/qdeclarativeimage/tst_qdeclarativeimage.cpp
index b5aaa007e9..cd07b00d5d 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/qtquick1/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -46,16 +46,16 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativeimage_p.h>
-#include <private/qdeclarativeimagebase_p.h>
-#include <private/qdeclarativeloader_p.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativeimage_p.h>
+#include <QtQuick1/private/qdeclarativeimagebase_p.h>
+#include <QtQuick1/private/qdeclarativeloader_p.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
#include <QtTest/QSignalSpy>
#include "../../../shared/util.h"
-#include "../shared/testhttpserver.h"
+#include "../../declarative/shared/testhttpserver.h"
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -111,13 +111,13 @@ void tst_qdeclarativeimage::noSource()
QString componentStr = "import QtQuick 1.0\nImage { source: \"\" }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->source(), QUrl());
- QVERIFY(obj->status() == QDeclarativeImage::Null);
+ QVERIFY(obj->status() == QDeclarative1Image::Null);
QCOMPARE(obj->width(), 0.);
QCOMPARE(obj->height(), 0.);
- QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->fillMode(), QDeclarative1Image::Stretch);
QCOMPARE(obj->progress(), 0.0);
delete obj;
@@ -173,7 +173,7 @@ void tst_qdeclarativeimage::imageSource()
+ (cache ? QLatin1String("true") : QLatin1String("false")) + " }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
if (async)
@@ -187,18 +187,18 @@ void tst_qdeclarativeimage::imageSource()
QVERIFY(obj->cache() == false);
if (remote || async)
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Loading);
QCOMPARE(obj->source(), remote ? source : QUrl(source));
if (error.isEmpty()) {
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
QCOMPARE(obj->width(), qreal(width));
QCOMPARE(obj->height(), qreal(height));
- QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->fillMode(), QDeclarative1Image::Stretch);
QCOMPARE(obj->progress(), 1.0);
} else {
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Error);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Error);
}
delete obj;
@@ -211,16 +211,16 @@ void tst_qdeclarativeimage::clearSource()
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
- QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QVERIFY(obj->status() == QDeclarative1Image::Ready);
QCOMPARE(obj->width(), 120.);
QCOMPARE(obj->height(), 120.);
QCOMPARE(obj->progress(), 1.0);
ctxt->setContextProperty("srcImage", "");
QVERIFY(obj->source().isEmpty());
- QVERIFY(obj->status() == QDeclarativeImage::Null);
+ QVERIFY(obj->status() == QDeclarative1Image::Null);
QCOMPARE(obj->width(), 0.);
QCOMPARE(obj->height(), 0.);
QCOMPARE(obj->progress(), 0.0);
@@ -233,11 +233,11 @@ void tst_qdeclarativeimage::resized()
QString componentStr = "import QtQuick 1.0\nImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 300 }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 300.);
QCOMPARE(obj->height(), 300.);
- QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->fillMode(), QDeclarative1Image::Stretch);
delete obj;
}
@@ -248,7 +248,7 @@ void tst_qdeclarativeimage::preserveAspectRatio()
canvas->show();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/aspectratio.qml"));
- QDeclarativeImage *image = qobject_cast<QDeclarativeImage*>(canvas->rootObject());
+ QDeclarative1Image *image = qobject_cast<QDeclarative1Image*>(canvas->rootObject());
QVERIFY(image != 0);
QCOMPARE(image->property("widthChange").toInt(), 1);
QCOMPARE(image->property("heightChange").toInt(), 1);
@@ -259,7 +259,7 @@ void tst_qdeclarativeimage::preserveAspectRatio()
QCOMPARE(image->height(), 80.);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/aspectratio.qml"));
- image = qobject_cast<QDeclarativeImage*>(canvas->rootObject());
+ image = qobject_cast<QDeclarative1Image*>(canvas->rootObject());
QVERIFY(image != 0);
QCOMPARE(image->property("widthChange").toInt(), 1);
QCOMPARE(image->property("heightChange").toInt(), 1);
@@ -276,12 +276,12 @@ void tst_qdeclarativeimage::smooth()
QString componentStr = "import QtQuick 1.0\nImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 300.);
QCOMPARE(obj->height(), 300.);
QCOMPARE(obj->smooth(), true);
- QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->fillMode(), QDeclarative1Image::Stretch);
delete obj;
}
@@ -298,12 +298,12 @@ void tst_qdeclarativeimage::mirror()
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
obj->setProperty("width", width);
obj->setProperty("height", height);
- obj->setFillMode((QDeclarativeImage::FillMode)fillMode);
+ obj->setFillMode((QDeclarative1Image::FillMode)fillMode);
obj->setProperty("mirror", true);
QGraphicsScene scene;
@@ -324,13 +324,14 @@ void tst_qdeclarativeimage::mirror()
p_e.setTransform(transform);
switch (fillMode) {
- case QDeclarativeImage::Stretch:
+ case QDeclarative1Image::Stretch:
p_e.drawPixmap(QRect(0, 0, width, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
break;
- case QDeclarativeImage::PreserveAspectFit:
+ case QDeclarative1Image::PreserveAspectFit:
+ QEXPECT_FAIL("", "QTBUG-19538", Continue);
p_e.drawPixmap(QRect(25, 0, width / (width/height), height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
break;
- case QDeclarativeImage::PreserveAspectCrop:
+ case QDeclarative1Image::PreserveAspectCrop:
{
qreal ratio = width/srcPixmap.width(); // width is the longer side
QRect rect(0, 0, srcPixmap.width()*ratio, srcPixmap.height()*ratio);
@@ -338,15 +339,15 @@ void tst_qdeclarativeimage::mirror()
p_e.drawPixmap(rect, srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
break;
}
- case QDeclarativeImage::Tile:
+ case QDeclarative1Image::Tile:
p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap);
break;
- case QDeclarativeImage::TileVertically:
+ case QDeclarative1Image::TileVertically:
transform.scale(width / srcPixmap.width(), 1.0);
p_e.setTransform(transform);
p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap);
break;
- case QDeclarativeImage::TileHorizontally:
+ case QDeclarative1Image::TileHorizontally:
transform.scale(1.0, height / srcPixmap.height());
p_e.setTransform(transform);
p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap);
@@ -362,12 +363,12 @@ void tst_qdeclarativeimage::mirror_data()
{
QTest::addColumn<int>("fillMode");
- QTest::newRow("Stretch") << int(QDeclarativeImage::Stretch);
- QTest::newRow("PreserveAspectFit") << int(QDeclarativeImage::PreserveAspectFit);
- QTest::newRow("PreserveAspectCrop") << int(QDeclarativeImage::PreserveAspectCrop);
- QTest::newRow("Tile") << int(QDeclarativeImage::Tile);
- QTest::newRow("TileVertically") << int(QDeclarativeImage::TileVertically);
- QTest::newRow("TileHorizontally") << int(QDeclarativeImage::TileHorizontally);
+ QTest::newRow("Stretch") << int(QDeclarative1Image::Stretch);
+ QTest::newRow("PreserveAspectFit") << int(QDeclarative1Image::PreserveAspectFit);
+ QTest::newRow("PreserveAspectCrop") << int(QDeclarative1Image::PreserveAspectCrop);
+ QTest::newRow("Tile") << int(QDeclarative1Image::Tile);
+ QTest::newRow("TileVertically") << int(QDeclarative1Image::TileVertically);
+ QTest::newRow("TileHorizontally") << int(QDeclarative1Image::TileHorizontally);
}
void tst_qdeclarativeimage::svg()
@@ -376,7 +377,7 @@ void tst_qdeclarativeimage::svg()
QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->pixmap().width(), 300);
QCOMPARE(obj->pixmap().height(), 300);
@@ -461,7 +462,7 @@ void tst_qdeclarativeimage::geometry()
componentStr.append("}");
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), itemWidth);
@@ -484,7 +485,7 @@ void tst_qdeclarativeimage::big()
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->pixmap().width(), 256);
QCOMPARE(obj->pixmap().height(), 256);
@@ -502,8 +503,8 @@ void tst_qdeclarativeimage::tiling_QTBUG_6716()
canvas->show();
qApp->processEvents();
- QDeclarativeImage *vTiling = findItem<QDeclarativeImage>(canvas->rootObject(), "vTiling");
- QDeclarativeImage *hTiling = findItem<QDeclarativeImage>(canvas->rootObject(), "hTiling");
+ QDeclarative1Image *vTiling = findItem<QDeclarative1Image>(canvas->rootObject(), "vTiling");
+ QDeclarative1Image *hTiling = findItem<QDeclarative1Image>(canvas->rootObject(), "hTiling");
QVERIFY(vTiling != 0);
QVERIFY(hTiling != 0);
@@ -549,17 +550,17 @@ void tst_qdeclarativeimage::noLoading()
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart.png"));
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
- QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QVERIFY(obj->status() == QDeclarative1Image::Ready);
QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &)));
QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal)));
- QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarativeImageBase::Status)));
+ QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarative1ImageBase::Status)));
// Loading local file
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/green.png"));
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
QTRY_VERIFY(obj->progress() == 1.0);
QTRY_COMPARE(sourceSpy.count(), 1);
QTRY_COMPARE(progressSpy.count(), 0);
@@ -567,9 +568,9 @@ void tst_qdeclarativeimage::noLoading()
// Loading remote file
ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/rect.png");
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Loading);
QTRY_VERIFY(obj->progress() == 0.0);
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
QTRY_VERIFY(obj->progress() == 1.0);
QTRY_COMPARE(sourceSpy.count(), 2);
QTRY_COMPARE(progressSpy.count(), 2);
@@ -578,7 +579,7 @@ void tst_qdeclarativeimage::noLoading()
// Loading remote file again - should not go through 'Loading' state.
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/green.png"));
ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/rect.png");
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
QTRY_VERIFY(obj->progress() == 1.0);
QTRY_COMPARE(sourceSpy.count(), 4);
QTRY_COMPARE(progressSpy.count(), 2);
@@ -595,7 +596,7 @@ void tst_qdeclarativeimage::paintedWidthHeight()
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->pixmap().width(), 300);
QCOMPARE(obj->pixmap().height(), 300);
@@ -613,7 +614,7 @@ void tst_qdeclarativeimage::paintedWidthHeight()
QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 26; height: 175; fillMode: Image.PreserveAspectFit }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->pixmap().width(), 300);
QCOMPARE(obj->pixmap().height(), 300);
@@ -634,12 +635,12 @@ void tst_qdeclarativeimage::sourceSize_QTBUG_14303()
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png"));
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QSignalSpy sourceSizeSpy(obj, SIGNAL(sourceSizeChanged()));
QTRY_VERIFY(obj != 0);
- QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
QTRY_COMPARE(obj->sourceSize().width(), 200);
QTRY_COMPARE(obj->sourceSize().height(), 200);
@@ -665,7 +666,7 @@ void tst_qdeclarativeimage::sourceSize_QTBUG_16389()
canvas->show();
qApp->processEvents();
- QDeclarativeImage *image = findItem<QDeclarativeImage>(canvas->rootObject(), "iconImage");
+ QDeclarative1Image *image = findItem<QDeclarative1Image>(canvas->rootObject(), "iconImage");
QDeclarativeItem *handle = findItem<QDeclarativeItem>(canvas->rootObject(), "blueHandle");
QCOMPARE(image->sourceSize().width(), 200);
@@ -694,7 +695,7 @@ void tst_qdeclarativeimage::nullPixmapPaint()
+ SERVER_ADDR + QString("/no-such-file.png\" }");
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *image = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *image = qobject_cast<QDeclarative1Image*>(component.create());
QTRY_VERIFY(image != 0);
@@ -717,7 +718,7 @@ void tst_qdeclarativeimage::resetSourceSize()
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->pixmap().width(), 100);
QCOMPARE(obj->pixmap().height(), 100);
diff --git a/tests/auto/qtquick1/qdeclarativeimageprovider/qdeclarativeimageprovider.pro b/tests/auto/qtquick1/qdeclarativeimageprovider/qdeclarativeimageprovider.pro
new file mode 100644
index 0000000000..1de026ea37
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeimageprovider/qdeclarativeimageprovider.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
+QT += network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeimageprovider.cpp
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/qtquick1/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
new file mode 100644
index 0000000000..3190579949
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
@@ -0,0 +1,432 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeimageprovider.h>
+#include <QtQuick1/private/qdeclarativeimage_p.h>
+#include <QImageReader>
+#include <QWaitCondition>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+Q_DECLARE_METATYPE(QDeclarativeImageProvider*);
+
+class tst_qdeclarativeimageprovider : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeimageprovider()
+ {
+ }
+
+private slots:
+ void requestImage_sync_data();
+ void requestImage_sync();
+ void requestImage_async_data();
+ void requestImage_async();
+
+ void requestPixmap_sync_data();
+ void requestPixmap_sync();
+ void requestPixmap_async();
+
+ void removeProvider_data();
+ void removeProvider();
+
+ void threadTest();
+
+private:
+ QString newImageFileName() const;
+ void fillRequestTestsData(const QString &id);
+ void runTest(bool async, QDeclarativeImageProvider *provider);
+};
+
+
+class TestQImageProvider : public QDeclarativeImageProvider
+{
+public:
+ TestQImageProvider(bool *deleteWatch = 0)
+ : QDeclarativeImageProvider(Image), deleteWatch(deleteWatch)
+ {
+ }
+
+ ~TestQImageProvider()
+ {
+ if (deleteWatch)
+ *deleteWatch = true;
+ }
+
+ QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize)
+ {
+ lastImageId = id;
+
+ if (id == QLatin1String("no-such-file.png"))
+ return QImage();
+
+ int width = 100;
+ int height = 100;
+ QImage image(width, height, QImage::Format_RGB32);
+ if (size)
+ *size = QSize(width, height);
+ if (requestedSize.isValid())
+ image = image.scaled(requestedSize);
+ return image;
+ }
+
+ bool *deleteWatch;
+ QString lastImageId;
+};
+Q_DECLARE_METATYPE(TestQImageProvider*);
+
+
+class TestQPixmapProvider : public QDeclarativeImageProvider
+{
+public:
+ TestQPixmapProvider(bool *deleteWatch = 0)
+ : QDeclarativeImageProvider(Pixmap), deleteWatch(deleteWatch)
+ {
+ }
+
+ ~TestQPixmapProvider()
+ {
+ if (deleteWatch)
+ *deleteWatch = true;
+ }
+
+ QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)
+ {
+ lastImageId = id;
+
+ if (id == QLatin1String("no-such-file.png"))
+ return QPixmap();
+
+ int width = 100;
+ int height = 100;
+ QPixmap image(width, height);
+ if (size)
+ *size = QSize(width, height);
+ if (requestedSize.isValid())
+ image = image.scaled(requestedSize);
+ return image;
+ }
+
+ bool *deleteWatch;
+ QString lastImageId;
+};
+Q_DECLARE_METATYPE(TestQPixmapProvider*);
+
+
+QString tst_qdeclarativeimageprovider::newImageFileName() const
+{
+ // need to generate new filenames each time or else images are loaded
+ // from cache and we won't get loading status changes when testing
+ // async loading
+ static int count = 0;
+ return QString("image://test/image-%1.png").arg(count++);
+}
+
+void tst_qdeclarativeimageprovider::fillRequestTestsData(const QString &id)
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<QString>("imageId");
+ QTest::addColumn<QString>("properties");
+ QTest::addColumn<QSize>("size");
+ QTest::addColumn<QString>("error");
+
+ QString fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " simple test"))
+ << "image://test/" + fileName << fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " simple test with capitalization"))//As it's a URL, should make no difference
+ << "image://Test/" + fileName << fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with no id"))
+ << "image://test/" + fileName << "" + fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with path"))
+ << "image://test/test/path" + fileName << "test/path" + fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with fragment"))
+ << "image://test/faq.html?#question13" + fileName << "faq.html?#question13" + fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with query"))
+ << "image://test/cgi-bin/drawgraph.cgi?type=pie&color=green" + fileName << "cgi-bin/drawgraph.cgi?type=pie&color=green" + fileName
+ << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " scaled image"))
+ << "image://test/" + fileName << fileName << "sourceSize: \"80x30\"" << QSize(80,30) << "";
+
+ QTest::newRow(QTest::toString(id + " missing"))
+ << "image://test/no-such-file.png" << "no-such-file.png" << "" << QSize(100,100)
+ << "file::2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png";
+
+ QTest::newRow(QTest::toString(id + " unknown provider"))
+ << "image://bogus/exists.png" << "" << "" << QSize()
+ << "file::2:1: QML Image: Failed to get image from provider: image://bogus/exists.png";
+}
+
+void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvider *provider)
+{
+ QFETCH(QString, source);
+ QFETCH(QString, imageId);
+ QFETCH(QString, properties);
+ QFETCH(QSize, size);
+ QFETCH(QString, error);
+
+ if (!error.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
+ QDeclarativeEngine engine;
+
+ engine.addImageProvider("test", provider);
+ QVERIFY(engine.imageProvider("test") != 0);
+
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + source + "\"; "
+ + (async ? "asynchronous: true; " : "")
+ + properties + " }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
+ QVERIFY(obj != 0);
+
+ if (async)
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Loading);
+
+ QCOMPARE(obj->source(), QUrl(source));
+
+ if (error.isEmpty()) {
+ if (async)
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Ready);
+ else
+ QVERIFY(obj->status() == QDeclarative1Image::Ready);
+ if (QByteArray(QTest::currentDataTag()).startsWith("qimage"))
+ QCOMPARE(static_cast<TestQImageProvider*>(provider)->lastImageId, imageId);
+ else
+ QCOMPARE(static_cast<TestQPixmapProvider*>(provider)->lastImageId, imageId);
+
+ QCOMPARE(obj->width(), qreal(size.width()));
+ QCOMPARE(obj->height(), qreal(size.height()));
+ QCOMPARE(obj->pixmap().width(), size.width());
+ QCOMPARE(obj->pixmap().height(), size.height());
+ QCOMPARE(obj->fillMode(), QDeclarative1Image::Stretch);
+ QCOMPARE(obj->progress(), 1.0);
+ } else {
+ if (async)
+ QTRY_VERIFY(obj->status() == QDeclarative1Image::Error);
+ else
+ QVERIFY(obj->status() == QDeclarative1Image::Error);
+ }
+
+ delete obj;
+}
+
+void tst_qdeclarativeimageprovider::requestImage_sync_data()
+{
+ fillRequestTestsData("qimage|sync");
+}
+
+void tst_qdeclarativeimageprovider::requestImage_sync()
+{
+ bool deleteWatch = false;
+ runTest(false, new TestQImageProvider(&deleteWatch));
+ QVERIFY(deleteWatch);
+}
+
+void tst_qdeclarativeimageprovider::requestImage_async_data()
+{
+ fillRequestTestsData("qimage|async");
+}
+
+void tst_qdeclarativeimageprovider::requestImage_async()
+{
+ bool deleteWatch = false;
+ runTest(true, new TestQImageProvider(&deleteWatch));
+ QVERIFY(deleteWatch);
+}
+
+void tst_qdeclarativeimageprovider::requestPixmap_sync_data()
+{
+ fillRequestTestsData("qpixmap");
+}
+
+void tst_qdeclarativeimageprovider::requestPixmap_sync()
+{
+ bool deleteWatch = false;
+ runTest(false, new TestQPixmapProvider(&deleteWatch));
+ QVERIFY(deleteWatch);
+}
+
+void tst_qdeclarativeimageprovider::requestPixmap_async()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeImageProvider *provider = new TestQPixmapProvider();
+
+ engine.addImageProvider("test", provider);
+ QVERIFY(engine.imageProvider("test") != 0);
+
+ // pixmaps are loaded synchronously regardless of 'asynchronous' value
+ QString componentStr = "import QtQuick 1.0\nImage { asynchronous: true; source: \"image://test/pixmap-async-test.png\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
+ QVERIFY(obj != 0);
+
+ delete obj;
+}
+
+void tst_qdeclarativeimageprovider::removeProvider_data()
+{
+ QTest::addColumn<QDeclarativeImageProvider*>("provider");
+
+ QTest::newRow("qimage") << static_cast<QDeclarativeImageProvider*>(new TestQImageProvider);
+ QTest::newRow("qpixmap") << static_cast<QDeclarativeImageProvider*>(new TestQPixmapProvider);
+}
+
+void tst_qdeclarativeimageprovider::removeProvider()
+{
+ QFETCH(QDeclarativeImageProvider*, provider);
+
+ QDeclarativeEngine engine;
+
+ engine.addImageProvider("test", provider);
+ QVERIFY(engine.imageProvider("test") != 0);
+
+ // add provider, confirm it works
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + newImageFileName() + "\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1Image *obj = qobject_cast<QDeclarative1Image*>(component.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->status(), QDeclarative1Image::Ready);
+
+ // remove the provider and confirm
+ QString fileName = newImageFileName();
+ QString error("file::2:1: QML Image: Failed to get image from provider: " + fileName);
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
+ engine.removeImageProvider("test");
+
+ obj->setSource(QUrl(fileName));
+ QCOMPARE(obj->status(), QDeclarative1Image::Error);
+
+ delete obj;
+}
+
+class TestThreadProvider : public QDeclarativeImageProvider
+{
+ public:
+ TestThreadProvider() : QDeclarativeImageProvider(Image), ok(false) {}
+
+ ~TestThreadProvider() {}
+
+ QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize)
+ {
+ mutex.lock();
+ if (!ok)
+ cond.wait(&mutex);
+ mutex.unlock();
+ QVector<int> v;
+ for (int i = 0; i < 10000; i++)
+ v.prepend(i); //do some computation
+ QImage image(50,50, QImage::Format_RGB32);
+ image.fill(QColor(id).rgb());
+ if (size)
+ *size = image.size();
+ if (requestedSize.isValid())
+ image = image.scaled(requestedSize);
+ return image;
+ }
+
+ QWaitCondition cond;
+ QMutex mutex;
+ bool ok;
+};
+
+
+void tst_qdeclarativeimageprovider::threadTest()
+{
+ QDeclarativeEngine engine;
+
+ TestThreadProvider *provider = new TestThreadProvider;
+
+ engine.addImageProvider("test_thread", provider);
+ QVERIFY(engine.imageProvider("test_thread") != 0);
+
+ QString componentStr = "import QtQuick 1.0\nItem { \n"
+ "Image { source: \"image://test_thread/blue\"; asynchronous: true; }\n"
+ "Image { source: \"image://test_thread/red\"; asynchronous: true; }\n"
+ "Image { source: \"image://test_thread/green\"; asynchronous: true; }\n"
+ "Image { source: \"image://test_thread/yellow\"; asynchronous: true; }\n"
+ " }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QObject *obj = component.create();
+ //MUST not deadlock
+ QVERIFY(obj != 0);
+ QList<QDeclarative1Image *> images = obj->findChildren<QDeclarative1Image *>();
+ QCOMPARE(images.count(), 4);
+ QTest::qWait(100);
+ foreach(QDeclarative1Image *img, images) {
+ QCOMPARE(img->status(), QDeclarative1Image::Loading);
+ }
+ provider->ok = true;
+ provider->cond.wakeAll();
+ QTest::qWait(250);
+ foreach(QDeclarative1Image *img, images) {
+ QTRY_VERIFY(img->status() == QDeclarative1Image::Ready);
+ }
+}
+
+
+QTEST_MAIN(tst_qdeclarativeimageprovider)
+
+#include "tst_qdeclarativeimageprovider.moc"
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml b/tests/auto/qtquick1/qdeclarativeitem/data/childrenProperty.qml
index fab2367504..fab2367504 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/childrenProperty.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRect.qml
index 84f362fe16..84f362fe16 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRect.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug.qml
index 2ab73a1ff6..2ab73a1ff6 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug2.qml
index d67ad0e3d8..d67ad0e3d8 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug2.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug3.qml b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug3.qml
index 9d8e1e863a..9d8e1e863a 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug3.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/childrenRectBug3.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/implicitsize.qml b/tests/auto/qtquick1/qdeclarativeitem/data/implicitsize.qml
index 869c0fcec6..869c0fcec6 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/implicitsize.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/implicitsize.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml b/tests/auto/qtquick1/qdeclarativeitem/data/keynavigationtest.qml
index f614a12e30..f614a12e30 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/keynavigationtest.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest_implicit.qml b/tests/auto/qtquick1/qdeclarativeitem/data/keynavigationtest_implicit.qml
index 52ffaea0ec..52ffaea0ec 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest_implicit.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/keynavigationtest_implicit.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml b/tests/auto/qtquick1/qdeclarativeitem/data/keyspriority.qml
index 375a6b61a5..375a6b61a5 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/keyspriority.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/qtquick1/qdeclarativeitem/data/keystest.qml
index 9af6e9fb43..9af6e9fb43 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/keystest.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml b/tests/auto/qtquick1/qdeclarativeitem/data/layoutmirroring.qml
index 866b615310..866b615310 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/layoutmirroring.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml b/tests/auto/qtquick1/qdeclarativeitem/data/mapCoordinates.qml
index 48fb38da2b..48fb38da2b 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/mapCoordinates.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml b/tests/auto/qtquick1/qdeclarativeitem/data/mouseFocus.qml
index afa5397a33..afa5397a33 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/mouseFocus.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml b/tests/auto/qtquick1/qdeclarativeitem/data/propertychanges.qml
index f1ea93349d..f1ea93349d 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/propertychanges.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml b/tests/auto/qtquick1/qdeclarativeitem/data/qtbug_16871.qml
index 8102df165c..8102df165c 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/qtbug_16871.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml b/tests/auto/qtquick1/qdeclarativeitem/data/resourcesProperty.qml
index e82cd029ad..e82cd029ad 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/resourcesProperty.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml b/tests/auto/qtquick1/qdeclarativeitem/data/transformCrash.qml
index 35c1a9ab42..35c1a9ab42 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml
+++ b/tests/auto/qtquick1/qdeclarativeitem/data/transformCrash.qml
diff --git a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro b/tests/auto/qtquick1/qdeclarativeitem/qdeclarativeitem.pro
index 67133f65b2..0b87e3c9e7 100644
--- a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
+++ b/tests/auto/qtquick1/qdeclarativeitem/qdeclarativeitem.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeitem.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/qtquick1/qdeclarativeitem/tst_qdeclarativeitem.cpp
index c53e2c66fb..b244a24613 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/qtquick1/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -43,9 +43,9 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativeitem_p.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
@@ -1244,7 +1244,7 @@ void tst_QDeclarativeItem::childrenRectBug2()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRectBug2.qml"));
canvas->show();
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(canvas->rootObject());
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(canvas->rootObject());
QVERIFY(rect);
QDeclarativeItem *item = rect->findChild<QDeclarativeItem*>("theItem");
QCOMPARE(item->width(), qreal(100));
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml b/tests/auto/qtquick1/qdeclarativelayoutitem/data/layoutItem.qml
index 349713397c..349713397c 100644
--- a/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml
+++ b/tests/auto/qtquick1/qdeclarativelayoutitem/data/layoutItem.qml
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/qtquick1/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
index 6c38af4da1..b248ee03b4 100644
--- a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
+++ b/tests/auto/qtquick1/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativelayoutitem.cpp
@@ -11,4 +11,4 @@ symbian: {
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp b/tests/auto/qtquick1/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp
index 0db1f4398e..095ad2ba38 100644
--- a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp
+++ b/tests/auto/qtquick1/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp
@@ -41,8 +41,8 @@
#include <QtTest/QtTest>
#include <qdeclarativecomponent.h>
#include <qdeclarativeengine.h>
-#include <qdeclarativeitem.h>
-#include <private/qdeclarativelayoutitem_p.h>
+#include <QtQuick1/qdeclarativeitem.h>
+#include <QtQuick1/private/qdeclarativelayoutitem_p.h>
#include <qgraphicsview.h>
#include <qgraphicsscene.h>
#include <qgraphicswidget.h>
@@ -81,7 +81,7 @@ void tst_qdeclarativelayoutitem::test_resizing()
//Add the QML snippet into the layout
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/layoutItem.qml"));
- QDeclarativeLayoutItem* obj = static_cast<QDeclarativeLayoutItem*>(c.create());
+ QDeclarative1LayoutItem* obj = static_cast<QDeclarative1LayoutItem*>(c.create());
QVERIFY(obj);
QCOMPARE(obj->minimumSize(), QSizeF(100,100));
QCOMPARE(obj->preferredSize(), QSizeF(200,200));
diff --git a/tests/auto/qtquick1/qdeclarativelistmodel/data/enumerate.qml b/tests/auto/qtquick1/qdeclarativelistmodel/data/enumerate.qml
new file mode 100644
index 0000000000..93697f3307
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativelistmodel/data/enumerate.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Item {
+ property string result
+
+ ListModel {
+ id: model
+
+ ListElement {
+ val1: 1
+ val2: 2
+ val3: "str"
+ val4: false
+ val5: true
+ }
+ }
+
+ Component.onCompleted: {
+ var element = model.get(0);
+
+ for (var i in element)
+ result += i+"="+element[i]+(element[i] ? "Y" : "N")+":";
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativelistmodel/data/model.qml b/tests/auto/qtquick1/qdeclarativelistmodel/data/model.qml
new file mode 100644
index 0000000000..bfd547ed32
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativelistmodel/data/model.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Item {
+ id: item
+ property variant model
+ property bool done: false
+ property variant result
+
+ function evalExpressionViaWorker(commands) {
+ done = false
+ worker.sendMessage({'commands': commands, 'model': model})
+ }
+
+ WorkerScript {
+ id: worker
+ source: "script.js"
+ onMessage: {
+ item.result = messageObject.result
+ item.done = true
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativelistmodel/data/multipleroles.qml b/tests/auto/qtquick1/qdeclarativelistmodel/data/multipleroles.qml
new file mode 100644
index 0000000000..cc6d9de8a0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativelistmodel/data/multipleroles.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+ListView {
+ width: 100
+ height: 250
+ delegate: Rectangle {
+ width: 100
+ height: 50
+ color: black ? "black": "white"
+ }
+ model: ListModel {
+ objectName: "listModel"
+ ListElement {
+ black: false
+ rounded: false
+ }
+ ListElement {
+ black: true
+ rounded: false
+ }
+ ListElement {
+ black: true
+ rounded: false
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativelistmodel/data/script.js b/tests/auto/qtquick1/qdeclarativelistmodel/data/script.js
new file mode 100644
index 0000000000..66a4acb8a8
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativelistmodel/data/script.js
@@ -0,0 +1,13 @@
+WorkerScript.onMessage = function(msg) {
+ var result = null
+ try {
+ for (var i=0; i<msg.commands.length; i++) {
+ var c = 'msg.model.' + msg.commands[i]
+ result = eval(c)
+ }
+ msg.model.sync()
+ } catch(e) { }
+ WorkerScript.sendMessage({'done': true, 'result': result})
+}
+
+
diff --git a/tests/auto/qtquick1/qdeclarativelistmodel/data/setmodelcachelist.qml b/tests/auto/qtquick1/qdeclarativelistmodel/data/setmodelcachelist.qml
new file mode 100644
index 0000000000..ffe417ae2a
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativelistmodel/data/setmodelcachelist.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+ListModel {
+ id: model
+ property bool ok : false
+
+ Component.onCompleted: {
+ model.append({"attrs": []})
+ model.get(0)
+ model.set(0, {"attrs": [{'abc': 123, 'def': 456}] } )
+ ok = ( model.get(0).attrs.get(0).abc == 123
+ && model.get(0).attrs.get(0).def == 456 )
+
+ model.set(0, {"attrs": [{'abc': 789, 'def': 101}] } )
+ ok = ( model.get(0).attrs.get(0).abc == 789
+ && model.get(0).attrs.get(0).def == 101 )
+
+ }
+}
+
diff --git a/tests/auto/qtquick1/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/qtquick1/qdeclarativelistmodel/qdeclarativelistmodel.pro
new file mode 100644
index 0000000000..b1e51f28bf
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativelistmodel/qdeclarativelistmodel.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
+QT += script
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativelistmodel.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/qtquick1/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
new file mode 100644
index 0000000000..a67c7c3916
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -0,0 +1,1125 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativelistmodel_p.h>
+#include <QtDeclarative/private/qdeclarativeengine_p.h>
+#include <QtDeclarative/private/qdeclarativeexpression_p.h>
+#include <QDeclarativeComponent>
+
+#include <QtCore/qtimer.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qtranslator.h>
+#include <QSignalSpy>
+
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+Q_DECLARE_METATYPE(QList<int>)
+Q_DECLARE_METATYPE(QList<QVariantHash>)
+
+class tst_qdeclarativelistmodel : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativelistmodel() {}
+
+private:
+ int roleFromName(const QDeclarative1ListModel *model, const QString &roleName);
+ QDeclarativeItem *createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarative1ListModel *model);
+ void waitForWorker(QDeclarativeItem *item);
+
+private slots:
+ void static_types();
+ void static_types_data();
+ void static_i18n();
+ void static_nestedElements();
+ void static_nestedElements_data();
+ void dynamic_data();
+ void dynamic();
+ void dynamic_worker_data();
+ void dynamic_worker();
+ void dynamic_worker_sync_data();
+ void dynamic_worker_sync();
+ void convertNestedToFlat_fail();
+ void convertNestedToFlat_fail_data();
+ void convertNestedToFlat_ok();
+ void convertNestedToFlat_ok_data();
+ void enumerate();
+ void error_data();
+ void error();
+ void syncError();
+ void set();
+ void get();
+ void get_data();
+ void get_worker();
+ void get_worker_data();
+ void get_nested();
+ void get_nested_data();
+ void crash_model_with_multiple_roles();
+ void set_model_cache();
+ void property_changes();
+ void property_changes_data();
+ void property_changes_worker();
+ void property_changes_worker_data();
+ void clear();
+};
+
+int tst_qdeclarativelistmodel::roleFromName(const QDeclarative1ListModel *model, const QString &roleName)
+{
+ QList<int> roles = model->roles();
+ for (int i=0; i<roles.count(); i++) {
+ if (model->toString(roles[i]) == roleName)
+ return roles[i];
+ }
+ return -1;
+}
+
+QDeclarativeItem *tst_qdeclarativelistmodel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarative1ListModel *model)
+{
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component->create());
+ QDeclarativeEngine::setContextForObject(model, eng->rootContext());
+ if (item)
+ item->setProperty("model", qVariantFromValue(model));
+ return item;
+}
+
+void tst_qdeclarativelistmodel::waitForWorker(QDeclarativeItem *item)
+{
+ QEventLoop loop;
+ QTimer timer;
+ timer.setSingleShot(true);
+ connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+
+ QDeclarativeProperty prop(item, "done");
+ QVERIFY(prop.isValid());
+ QVERIFY(prop.connectNotifySignal(&loop, SLOT(quit())));
+ timer.start(10000);
+ loop.exec();
+ QVERIFY(timer.isActive());
+}
+
+void tst_qdeclarativelistmodel::static_types_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QVariant>("value");
+
+ QTest::newRow("string")
+ << "ListElement { foo: \"bar\" }"
+ << QVariant(QString("bar"));
+
+ QTest::newRow("real")
+ << "ListElement { foo: 10.5 }"
+ << QVariant(10.5);
+
+ QTest::newRow("real0")
+ << "ListElement { foo: 0 }"
+ << QVariant(double(0));
+
+ QTest::newRow("bool")
+ << "ListElement { foo: false }"
+ << QVariant(false);
+
+ QTest::newRow("bool")
+ << "ListElement { foo: true }"
+ << QVariant(true);
+
+ QTest::newRow("enum")
+ << "ListElement { foo: Text.AlignHCenter }"
+ << QVariant(double(QDeclarativeText::AlignHCenter));
+}
+
+void tst_qdeclarativelistmodel::static_types()
+{
+ QFETCH(QString, qml);
+ QFETCH(QVariant, value);
+
+ qml = "import QtQuick 1.0\nItem { property variant test: model.get(0).foo; ListModel { id: model; " + qml + " } }";
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(),
+ QUrl::fromLocalFile(QString("dummy.qml")));
+
+ QVERIFY(!component.isError());
+
+ QObject *obj = component.create();
+ QVERIFY(obj != 0);
+
+ QVariant actual = obj->property("test");
+
+ QCOMPARE(actual, value);
+ QCOMPARE(actual.toString(), value.toString());
+
+ delete obj;
+}
+
+void tst_qdeclarativelistmodel::static_i18n()
+{
+ QString expect = QString::fromUtf8("na\303\257ve");
+
+ QString componentStr = "import QtQuick 1.0\nItem { property string prop1: model.get(0).prop1; property string prop2: model.get(0).prop2; ListModel { id: model; ListElement { prop1: \""+expect+"\"; prop2: QT_TR_NOOP(\""+expect+"\") } } }";
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toUtf8(), QUrl::fromLocalFile(""));
+ QObject *obj = component.create();
+ QVERIFY(obj != 0);
+ QString prop1 = obj->property("prop1").toString();
+ QCOMPARE(prop1,expect);
+ QString prop2 = obj->property("prop2").toString();
+ QCOMPARE(prop2,expect); // (no, not translated, QT_TR_NOOP is a no-op)
+ delete obj;
+}
+
+void tst_qdeclarativelistmodel::static_nestedElements()
+{
+ QFETCH(int, elementCount);
+
+ QStringList elements;
+ for (int i=0; i<elementCount; i++)
+ elements.append("ListElement { a: 1; b: 2 }");
+ QString elementsStr = elements.join(",\n") + "\n";
+
+ QString componentStr =
+ "import QtQuick 1.0\n"
+ "Item {\n"
+ " property variant count: model.get(0).attributes.count\n"
+ " ListModel {\n"
+ " id: model\n"
+ " ListElement {\n"
+ " attributes: [\n";
+ componentStr += elementsStr.toUtf8().constData();
+ componentStr +=
+ " ]\n"
+ " }\n"
+ " }\n"
+ "}";
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toUtf8(), QUrl::fromLocalFile(""));
+
+ QDeclarativeListModel *obj = qobject_cast<QDeclarativeListModel*>(component.create());
+ QVERIFY(obj != 0);
+
+ QVariant count = obj->property("count");
+ QCOMPARE(count.type(), QVariant::Int);
+ QCOMPARE(count.toInt(), elementCount);
+
+ delete obj;
+}
+
+void tst_qdeclarativelistmodel::static_nestedElements_data()
+{
+ QTest::addColumn<int>("elementCount");
+
+ QTest::newRow("0 items") << 0;
+ QTest::newRow("1 item") << 1;
+ QTest::newRow("2 items") << 2;
+ QTest::newRow("many items") << 5;
+}
+
+void tst_qdeclarativelistmodel::dynamic_data()
+{
+ QTest::addColumn<QString>("script");
+ QTest::addColumn<int>("result");
+ QTest::addColumn<QString>("warning");
+
+ // Simple flat model
+
+ QTest::newRow("count") << "count" << 0 << "";
+
+ QTest::newRow("get1") << "{get(0) === undefined}" << 1 << "";
+ QTest::newRow("get2") << "{get(-1) === undefined}" << 1 << "";
+ QTest::newRow("get3") << "{append({'foo':123});get(0) != undefined}" << 1 << "";
+ QTest::newRow("get4") << "{append({'foo':123});get(0).foo}" << 123 << "";
+
+ QTest::newRow("get-modify1") << "{append({'foo':123,'bar':456});get(0).foo = 333;get(0).foo}" << 333 << "";
+ QTest::newRow("get-modify2") << "{append({'z':1});append({'foo':123,'bar':456});get(1).bar = 999;get(1).bar}" << 999 << "";
+
+ QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << "";
+ QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << "";
+ QTest::newRow("append3a") << "{append({'foo':123});append({'foo':456});get(0).foo}" << 123 << "";
+ QTest::newRow("append3b") << "{append({'foo':123});append({'foo':456});get(1).foo}" << 456 << "";
+ QTest::newRow("append4a") << "{append(123)}" << 0 << "<Unknown File>: QML ListModel: append: value is not an object";
+ QTest::newRow("append4b") << "{append([1,2,3])}" << 0 << "<Unknown File>: QML ListModel: append: value is not an object";
+
+ QTest::newRow("clear1") << "{append({'foo':456});clear();count}" << 0 << "";
+ QTest::newRow("clear2") << "{append({'foo':123});append({'foo':456});clear();count}" << 0 << "";
+ QTest::newRow("clear3") << "{append({'foo':123});clear()}" << 0 << "";
+
+ QTest::newRow("remove1") << "{append({'foo':123});remove(0);count}" << 0 << "";
+ QTest::newRow("remove2a") << "{append({'foo':123});append({'foo':456});remove(0);count}" << 1 << "";
+ QTest::newRow("remove2b") << "{append({'foo':123});append({'foo':456});remove(0);get(0).foo}" << 456 << "";
+ QTest::newRow("remove2c") << "{append({'foo':123});append({'foo':456});remove(1);get(0).foo}" << 123 << "";
+ QTest::newRow("remove3") << "{append({'foo':123});remove(0)}" << 0 << "";
+ QTest::newRow("remove3a") << "{append({'foo':123});remove(-1);count}" << 1 << "<Unknown File>: QML ListModel: remove: index -1 out of range";
+ QTest::newRow("remove4a") << "{remove(0)}" << 0 << "<Unknown File>: QML ListModel: remove: index 0 out of range";
+ QTest::newRow("remove4b") << "{append({'foo':123});remove(0);remove(0);count}" << 0 << "<Unknown File>: QML ListModel: remove: index 0 out of range";
+ QTest::newRow("remove4c") << "{append({'foo':123});remove(1);count}" << 1 << "<Unknown File>: QML ListModel: remove: index 1 out of range";
+
+ QTest::newRow("insert1") << "{insert(0,{'foo':123});count}" << 1 << "";
+ QTest::newRow("insert2") << "{insert(1,{'foo':123});count}" << 0 << "<Unknown File>: QML ListModel: insert: index 1 out of range";
+ QTest::newRow("insert3a") << "{append({'foo':123});insert(1,{'foo':456});count}" << 2 << "";
+ QTest::newRow("insert3b") << "{append({'foo':123});insert(1,{'foo':456});get(0).foo}" << 123 << "";
+ QTest::newRow("insert3c") << "{append({'foo':123});insert(1,{'foo':456});get(1).foo}" << 456 << "";
+ QTest::newRow("insert3d") << "{append({'foo':123});insert(0,{'foo':456});get(0).foo}" << 456 << "";
+ QTest::newRow("insert3e") << "{append({'foo':123});insert(0,{'foo':456});get(1).foo}" << 123 << "";
+ QTest::newRow("insert4") << "{append({'foo':123});insert(-1,{'foo':456});count}" << 1 << "<Unknown File>: QML ListModel: insert: index -1 out of range";
+ QTest::newRow("insert5a") << "{insert(0,123)}" << 0 << "<Unknown File>: QML ListModel: insert: value is not an object";
+ QTest::newRow("insert5b") << "{insert(0,[1,2,3])}" << 0 << "<Unknown File>: QML ListModel: insert: value is not an object";
+
+ QTest::newRow("set1") << "{append({'foo':123});set(0,{'foo':456});count}" << 1 << "";
+ QTest::newRow("set2") << "{append({'foo':123});set(0,{'foo':456});get(0).foo}" << 456 << "";
+ QTest::newRow("set3a") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).foo}" << 999 << "";
+ QTest::newRow("set3b") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).bar}" << 456 << "";
+ QTest::newRow("set4a") << "{set(0,{'foo':456});count}" << 1 << "";
+ QTest::newRow("set4c") << "{set(-1,{'foo':456})}" << 0 << "<Unknown File>: QML ListModel: set: index -1 out of range";
+ QTest::newRow("set5a") << "{append({'foo':123,'bar':456});set(0,123);count}" << 1 << "<Unknown File>: QML ListModel: set: value is not an object";
+ QTest::newRow("set5b") << "{append({'foo':123,'bar':456});set(0,[1,2,3]);count}" << 1 << "<Unknown File>: QML ListModel: set: value is not an object";
+ QTest::newRow("set6") << "{append({'foo':123});set(1,{'foo':456});count}" << 2 << "";
+
+ QTest::newRow("setprop1") << "{append({'foo':123});setProperty(0,'foo',456);count}" << 1 << "";
+ QTest::newRow("setprop2") << "{append({'foo':123});setProperty(0,'foo',456);get(0).foo}" << 456 << "";
+ QTest::newRow("setprop3a") << "{append({'foo':123,'bar':456});setProperty(0,'foo',999);get(0).foo}" << 999 << "";
+ QTest::newRow("setprop3b") << "{append({'foo':123,'bar':456});setProperty(0,'foo',999);get(0).bar}" << 456 << "";
+ QTest::newRow("setprop4a") << "{setProperty(0,'foo',456)}" << 0 << "<Unknown File>: QML ListModel: set: index 0 out of range";
+ QTest::newRow("setprop4b") << "{setProperty(-1,'foo',456)}" << 0 << "<Unknown File>: QML ListModel: set: index -1 out of range";
+ QTest::newRow("setprop4c") << "{append({'foo':123,'bar':456});setProperty(1,'foo',456);count}" << 1 << "<Unknown File>: QML ListModel: set: index 1 out of range";
+ QTest::newRow("setprop5") << "{append({'foo':123,'bar':456});append({'foo':111});setProperty(1,'bar',222);get(1).bar}" << 222 << "";
+
+ QTest::newRow("move1a") << "{append({'foo':123});append({'foo':456});move(0,1,1);count}" << 2 << "";
+ QTest::newRow("move1b") << "{append({'foo':123});append({'foo':456});move(0,1,1);get(0).foo}" << 456 << "";
+ QTest::newRow("move1c") << "{append({'foo':123});append({'foo':456});move(0,1,1);get(1).foo}" << 123 << "";
+ QTest::newRow("move1d") << "{append({'foo':123});append({'foo':456});move(1,0,1);get(0).foo}" << 456 << "";
+ QTest::newRow("move1e") << "{append({'foo':123});append({'foo':456});move(1,0,1);get(1).foo}" << 123 << "";
+ QTest::newRow("move2a") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);count}" << 3 << "";
+ QTest::newRow("move2b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(0).foo}" << 789 << "";
+ QTest::newRow("move2c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(1).foo}" << 123 << "";
+ QTest::newRow("move2d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(2).foo}" << 456 << "";
+ QTest::newRow("move3a") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,3);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+ QTest::newRow("move3b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,-1,1);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+ QTest::newRow("move3c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,-1);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+ QTest::newRow("move3d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,3,1);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+
+ // Nested models
+
+ QTest::newRow("nested-append1") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]});count}" << 1 << "";
+ QTest::newRow("nested-append2") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]});get(0).bars.get(1).a}" << 2 << "";
+ QTest::newRow("nested-append3") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]});get(0).bars.append({'a':4});get(0).bars.get(3).a}" << 4 << "";
+
+ QTest::newRow("nested-insert") << "{append({'foo':123});insert(0,{'bars':[{'a':1},{'b':2},{'c':3}]});get(0).bars.get(0).a}" << 1 << "";
+ QTest::newRow("nested-set") << "{append({'foo':[{'x':1}]});set(0,{'foo':[{'x':123}]});get(0).foo.get(0).x}" << 123 << "";
+
+ QTest::newRow("nested-count") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.count}" << 3 << "";
+ QTest::newRow("nested-clear") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.clear(); get(0).bars.count}" << 0 << "";
+}
+
+void tst_qdeclarativelistmodel::dynamic()
+{
+ QFETCH(QString, script);
+ QFETCH(int, result);
+ QFETCH(QString, warning);
+
+ QDeclarativeEngine engine;
+ QDeclarative1ListModel model;
+ QDeclarativeEngine::setContextForObject(&model,engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
+ QDeclarativeExpression e(engine.rootContext(), &model, script);
+ if (!warning.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
+
+ QSignalSpy spyCount(&model, SIGNAL(countChanged()));
+
+ int actual = e.evaluate().toInt();
+ if (e.hasError())
+ qDebug() << e.error(); // errors not expected
+
+ QCOMPARE(actual,result);
+
+ if (model.count() > 0)
+ QVERIFY(spyCount.count() > 0);
+}
+
+void tst_qdeclarativelistmodel::dynamic_worker_data()
+{
+ dynamic_data();
+}
+
+void tst_qdeclarativelistmodel::dynamic_worker()
+{
+ QFETCH(QString, script);
+ QFETCH(int, result);
+ QFETCH(QString, warning);
+
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested"))
+ return;
+
+ // This is same as dynamic() except it applies the test to a ListModel called
+ // from a WorkerScript (i.e. testing the internal FlatListModel that is created
+ // by the WorkerListModelAgent)
+
+ QDeclarative1ListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ QSignalSpy spyCount(&model, SIGNAL(countChanged()));
+
+ if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}'))
+ script = script.mid(1, script.length() - 2);
+ QVariantList operations;
+ foreach (const QString &s, script.split(';')) {
+ if (!s.isEmpty())
+ operations << s;
+ }
+
+ if (!warning.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, operations)));
+ waitForWorker(item);
+ QCOMPARE(QDeclarativeProperty(item, "result").read().toInt(), result);
+
+ if (model.count() > 0)
+ QVERIFY(spyCount.count() > 0);
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::dynamic_worker_sync_data()
+{
+ dynamic_data();
+}
+
+void tst_qdeclarativelistmodel::dynamic_worker_sync()
+{
+ QFETCH(QString, script);
+ QFETCH(int, result);
+ QFETCH(QString, warning);
+
+ // This is the same as dynamic_worker() except that it executes a set of list operations
+ // from the worker script, calls sync(), and tests the changes are reflected in the
+ // list in the main thread
+
+ QDeclarative1ListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}'))
+ script = script.mid(1, script.length() - 2);
+ QVariantList operations;
+ foreach (const QString &s, script.split(';')) {
+ if (!s.isEmpty())
+ operations << s;
+ }
+
+ if (!warning.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
+
+ // execute a set of commands on the worker list model, then check the
+ // changes are reflected in the list model in the main thread
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested"))
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script");
+
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested-set"))
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script");
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, operations.mid(0, operations.length()-1))));
+ waitForWorker(item);
+
+ QDeclarativeExpression e(eng.rootContext(), &model, operations.last().toString());
+ if (!QByteArray(QTest::currentDataTag()).startsWith("nested"))
+ QCOMPARE(e.evaluate().toInt(), result);
+
+ delete item;
+ qApp->processEvents();
+}
+
+#define RUNEVAL(object, string) \
+ QVERIFY(QMetaObject::invokeMethod(object, "runEval", Q_ARG(QVariant, QString(string))));
+
+inline QVariant runexpr(QDeclarativeEngine *engine, const QString &str)
+{
+ QDeclarativeExpression expr(engine->rootContext(), 0, str);
+ return expr.evaluate();
+}
+
+#define RUNEXPR(string) runexpr(&engine, QString(string))
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_fail()
+{
+ // If a model has nested data, it cannot be used at all from a worker script
+
+ QFETCH(QString, script);
+
+ QDeclarative1ListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ RUNEVAL(item, "model.append({foo: 123})");
+ RUNEVAL(item, "model.append({foo: [{}, {}]})");
+
+ QCOMPARE(model.count(), 2);
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: List contains list-type data and cannot be used from a worker script");
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, script)));
+ waitForWorker(item);
+
+ QCOMPARE(model.count(), 2);
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_fail_data()
+{
+ QTest::addColumn<QString>("script");
+
+ QTest::newRow("clear") << "clear()";
+ QTest::newRow("remove") << "remove(0)";
+ QTest::newRow("append") << "append({'x':1})";
+ QTest::newRow("insert") << "insert(0, {'x':1})";
+ QTest::newRow("set") << "set(0, {'foo':1})";
+ QTest::newRow("setProperty") << "setProperty(0, 'foo', 1})";
+ QTest::newRow("move") << "move(0, 1, 1})";
+ QTest::newRow("get") << "get(0)";
+}
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_ok()
+
+{
+ // If a model only has plain data, it can be modified from a worker script. However,
+ // once the model is used from a worker script, it no longer accepts nested data
+
+ QFETCH(QString, script);
+
+ QDeclarative1ListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ RUNEVAL(item, "model.append({foo: 123})");
+
+ QCOMPARE(model.count(), 1);
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, script)));
+ waitForWorker(item);
+
+ // can still add plain data
+ int count = model.count();
+
+ RUNEVAL(item, "model.append({foo: 123})");
+
+ QCOMPARE(model.count(), count+1);
+
+ const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script";
+
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ RUNEVAL(item, "model.append({foo: [{}, {}]})");
+
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ RUNEVAL(item, "model.insert(0, {foo: [{}, {}]})");
+
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ RUNEVAL(item, "model.set(0, {foo: [{}, {}]})");
+
+ QCOMPARE(model.count(), count+1);
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_ok_data()
+{
+ convertNestedToFlat_fail_data();
+}
+
+void tst_qdeclarativelistmodel::enumerate()
+{
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/enumerate.qml"));
+ QVERIFY(!component.isError());
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QStringList r = item->property("result").toString().split(":");
+ QCOMPARE(r[0],QLatin1String("val1=1Y"));
+ QCOMPARE(r[1],QLatin1String("val2=2Y"));
+ QCOMPARE(r[2],QLatin1String("val3=strY"));
+ QCOMPARE(r[3],QLatin1String("val4=falseN"));
+ QCOMPARE(r[4],QLatin1String("val5=trueY"));
+ delete item;
+}
+
+void tst_qdeclarativelistmodel::error_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("id not allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { id: fred } }"
+ << "ListElement: cannot use reserved \"id\" property";
+
+ QTest::newRow("id allowed in ListModel")
+ << "import QtQuick 1.0\nListModel { id:model }"
+ << "";
+
+ QTest::newRow("random properties not allowed in ListModel")
+ << "import QtQuick 1.0\nListModel { foo:123 }"
+ << "ListModel: undefined property 'foo'";
+
+ QTest::newRow("random properties allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { foo:123 } }"
+ << "";
+
+ QTest::newRow("bindings not allowed in ListElement")
+ << "import QtQuick 1.0\nRectangle { id: rect; ListModel { ListElement { foo: rect.color } } }"
+ << "ListElement: cannot use script for property value";
+
+ QTest::newRow("random object list properties allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { foo: [ ListElement { bar: 123 } ] } }"
+ << "";
+
+ QTest::newRow("default properties not allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { Item { } } }"
+ << "ListElement: cannot contain nested elements";
+
+ QTest::newRow("QML elements not allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { a: Item { } } }"
+ << "ListElement: cannot contain nested elements";
+
+ QTest::newRow("qualified ListElement supported")
+ << "import QtQuick 1.0 as Foo\nFoo.ListModel { Foo.ListElement { a: 123 } }"
+ << "";
+
+ QTest::newRow("qualified ListElement required")
+ << "import QtQuick 1.0 as Foo\nFoo.ListModel { ListElement { a: 123 } }"
+ << "ListElement is not a type";
+
+ QTest::newRow("unknown qualified ListElement not allowed")
+ << "import QtQuick 1.0\nListModel { Foo.ListElement { a: 123 } }"
+ << "Foo.ListElement - Foo is not a namespace";
+}
+
+void tst_qdeclarativelistmodel::error()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(),
+ QUrl::fromLocalFile(QString("dummy.qml")));
+ if (error.isEmpty()) {
+ QVERIFY(!component.isError());
+ } else {
+ QVERIFY(component.isError());
+ QList<QDeclarativeError> errors = component.errors();
+ QCOMPARE(errors.count(),1);
+ QCOMPARE(errors.at(0).description(),error);
+ }
+}
+
+void tst_qdeclarativelistmodel::syncError()
+{
+ QString qml = "import QtQuick 1.0\nListModel { id: lm; Component.onCompleted: lm.sync() }";
+ QString error = "file:dummy.qml:2:1: QML ListModel: List sync() can only be called from a WorkerScript";
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(),
+ QUrl::fromLocalFile(QString("dummy.qml")));
+ QTest::ignoreMessage(QtWarningMsg,error.toUtf8());
+ QObject *obj = component.create();
+ QVERIFY(obj);
+ delete obj;
+}
+
+/*
+ Test model changes from set() are available to the view
+*/
+void tst_qdeclarativelistmodel::set()
+{
+ QDeclarativeEngine engine;
+ QDeclarative1ListModel model;
+ QDeclarativeEngine::setContextForObject(&model,engine.rootContext());
+ engine.rootContext()->setContextProperty("model", &model);
+
+ RUNEXPR("model.append({test:false})");
+ RUNEXPR("model.set(0, {test:true})");
+
+ QCOMPARE(RUNEXPR("model.get(0).test").toBool(), true); // triggers creation of model cache
+ QCOMPARE(model.data(0, model.roles()[0]), qVariantFromValue(true));
+
+ RUNEXPR("model.set(0, {test:false})");
+ QCOMPARE(RUNEXPR("model.get(0).test").toBool(), false); // tests model cache is updated
+ QCOMPARE(model.data(0, model.roles()[0]), qVariantFromValue(false));
+}
+
+/*
+ Test model changes on values returned by get() are available to the view
+*/
+void tst_qdeclarativelistmodel::get()
+{
+ QFETCH(QString, expression);
+ QFETCH(int, index);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, roleValue);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(
+ "import QtQuick 1.0\n"
+ "ListModel { \n"
+ "ListElement { roleA: 100 }\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "}", QUrl());
+ QDeclarative1ListModel *model = qobject_cast<QDeclarative1ListModel*>(component.create());
+ int role = roleFromName(model, roleName);
+ QVERIFY(role >= 0);
+
+ QSignalSpy spy(model, SIGNAL(itemsChanged(int, int, QList<int>)));
+ QDeclarativeExpression expr(engine.rootContext(), model, expression);
+ expr.evaluate();
+ QVERIFY(!expr.hasError());
+
+ QCOMPARE(model->data(index, role), roleValue);
+ QCOMPARE(spy.count(), 1);
+
+ QList<QVariant> spyResult = spy.takeFirst();
+ QCOMPARE(spyResult.at(0).toInt(), index);
+ QCOMPARE(spyResult.at(1).toInt(), 1); // only 1 item is modified at a time
+ QCOMPARE(spyResult.at(2).value<QList<int> >(), (QList<int>() << role));
+
+ delete model;
+}
+
+void tst_qdeclarativelistmodel::get_data()
+{
+ QTest::addColumn<QString>("expression");
+ QTest::addColumn<int>("index");
+ QTest::addColumn<QString>("roleName");
+ QTest::addColumn<QVariant>("roleValue");
+
+ QTest::newRow("simple value") << "get(0).roleA = 500" << 0 << "roleA" << QVariant(500);
+ QTest::newRow("simple value 2") << "get(1).roleB = 500" << 1 << "roleB" << QVariant(500);
+
+ QVariantMap map;
+ map["zzz"] = 123;
+ QTest::newRow("object value") << "get(1).roleB = {'zzz':123}" << 1 << "roleB" << QVariant::fromValue(map);
+
+ QVariantList list;
+ map.clear(); map["a"] = 50; map["b"] = 500;
+ list << map;
+ map.clear(); map["c"] = 1000;
+ list << map;
+ QTest::newRow("list of objects") << "get(2).roleB = [{'a': 50, 'b': 500}, {'c': 1000}]" << 2 << "roleB" << QVariant::fromValue(list);
+}
+
+void tst_qdeclarativelistmodel::get_worker()
+{
+ QFETCH(QString, expression);
+ QFETCH(int, index);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, roleValue);
+
+ QDeclarative1ListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ // Add some values like get() test
+ RUNEVAL(item, "model.append({roleA: 100})");
+ RUNEVAL(item, "model.append({roleA: 200, roleB: 400})");
+ RUNEVAL(item, "model.append({roleA: 200, roleB: 400})");
+
+ int role = roleFromName(&model, roleName);
+ QVERIFY(role >= 0);
+
+ const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script";
+ if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map)
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ QSignalSpy spy(&model, SIGNAL(itemsChanged(int, int, QList<int>)));
+
+ // in the worker thread, change the model data and call sync()
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, QStringList(expression))));
+ waitForWorker(item);
+
+ // see if we receive the model changes in the main thread's model
+ if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map) {
+ QVERIFY(model.data(index, role) != roleValue);
+ QCOMPARE(spy.count(), 0);
+ } else {
+ QCOMPARE(model.data(index, role), roleValue);
+ QCOMPARE(spy.count(), 1);
+
+ QList<QVariant> spyResult = spy.takeFirst();
+ QCOMPARE(spyResult.at(0).toInt(), index);
+ QCOMPARE(spyResult.at(1).toInt(), 1); // only 1 item is modified at a time
+ QVERIFY(spyResult.at(2).value<QList<int> >().contains(role));
+ }
+}
+
+void tst_qdeclarativelistmodel::get_worker_data()
+{
+ get_data();
+}
+
+/*
+ Test that the tests run in get() also work for nested list data
+*/
+void tst_qdeclarativelistmodel::get_nested()
+{
+ QFETCH(QString, expression);
+ QFETCH(int, index);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, roleValue);
+
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng);
+ component.setData(
+ "import QtQuick 1.0\n"
+ "ListModel { \n"
+ "ListElement {\n"
+ "listRoleA: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "}\n"
+ "ListElement {\n"
+ "listRoleA: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "listRoleB: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "listRoleC: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "}\n"
+ "}", QUrl());
+ QDeclarative1ListModel *model = qobject_cast<QDeclarative1ListModel*>(component.create());
+ QVERIFY(component.errorString().isEmpty());
+ QDeclarative1ListModel *childModel;
+
+ // Test setting the inner list data for:
+ // get(0).listRoleA
+ // get(1).listRoleA
+ // get(1).listRoleB
+ // get(1).listRoleC
+
+ QList<QPair<int, QString> > testData;
+ testData << qMakePair(0, QString("listRoleA"));
+ testData << qMakePair(1, QString("listRoleA"));
+ testData << qMakePair(1, QString("listRoleB"));
+ testData << qMakePair(1, QString("listRoleC"));
+
+ for (int i=0; i<testData.count(); i++) {
+ int outerListIndex = testData[i].first;
+ QString outerListRoleName = testData[i].second;
+ int outerListRole = roleFromName(model, outerListRoleName);
+ QVERIFY(outerListRole >= 0);
+
+ childModel = qobject_cast<QDeclarative1ListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
+ QVERIFY(childModel);
+
+ QString extendedExpression = QString("get(%1).%2.%3").arg(outerListIndex).arg(outerListRoleName).arg(expression);
+ QDeclarativeExpression expr(eng.rootContext(), model, extendedExpression);
+
+ QSignalSpy spy(childModel, SIGNAL(itemsChanged(int, int, QList<int>)));
+ expr.evaluate();
+ QVERIFY(!expr.hasError());
+
+ int role = roleFromName(childModel, roleName);
+ QVERIFY(role >= 0);
+ QCOMPARE(childModel->data(index, role), roleValue);
+ QCOMPARE(spy.count(), 1);
+
+ QList<QVariant> spyResult = spy.takeFirst();
+ QCOMPARE(spyResult.at(0).toInt(), index);
+ QCOMPARE(spyResult.at(1).toInt(), 1); // only 1 item is modified at a time
+ QCOMPARE(spyResult.at(2).value<QList<int> >(), (QList<int>() << role));
+ }
+
+ delete model;
+}
+
+void tst_qdeclarativelistmodel::get_nested_data()
+{
+ get_data();
+}
+
+//QTBUG-13754
+void tst_qdeclarativelistmodel::crash_model_with_multiple_roles()
+{
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/multipleroles.qml"));
+ QObject *rootItem = component.create();
+ QVERIFY(component.errorString().isEmpty());
+ QVERIFY(rootItem != 0);
+ QDeclarative1ListModel *model = rootItem->findChild<QDeclarative1ListModel*>("listModel");
+ QVERIFY(model != 0);
+
+ // used to cause a crash in QDeclarativeVisualDataModel
+ model->setProperty(0, "black", true);
+
+ delete rootItem;
+}
+
+//QTBUG-15190
+void tst_qdeclarativelistmodel::set_model_cache()
+{
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/setmodelcachelist.qml"));
+ QObject *model = component.create();
+ QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
+ QVERIFY(model != 0);
+ QVERIFY(model->property("ok").toBool());
+
+ delete model;
+}
+
+void tst_qdeclarativelistmodel::property_changes()
+{
+ QFETCH(QString, script_setup);
+ QFETCH(QString, script_change);
+ QFETCH(QString, roleName);
+ QFETCH(int, listIndex);
+ QFETCH(bool, itemsChanged);
+ QFETCH(QString, testExpression);
+
+ QDeclarativeEngine engine;
+ QDeclarative1ListModel model;
+ QDeclarativeEngine::setContextForObject(&model, engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
+
+ QDeclarativeExpression expr(engine.rootContext(), &model, script_setup);
+ expr.evaluate();
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error().toString()));
+
+ QString signalHandler = "on" + QString(roleName[0].toUpper()) + roleName.mid(1, roleName.length()) + "Changed:";
+ QString qml = "import QtQuick 1.0\n"
+ "Connections {\n"
+ "property bool gotSignal: false\n"
+ "target: model.get(0)\n"
+ + signalHandler + " gotSignal = true\n"
+ "}\n";
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(), QUrl::fromLocalFile(""));
+ engine.rootContext()->setContextProperty("model", &model);
+ QObject *connectionsObject = component.create();
+ QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
+
+ QSignalSpy spyItemsChanged(&model, SIGNAL(itemsChanged(int, int, QList<int>)));
+
+ expr.setExpression(script_change);
+ expr.evaluate();
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error()));
+
+ // test the object returned by get() emits the correct signals
+ QCOMPARE(connectionsObject->property("gotSignal").toBool(), itemsChanged);
+
+ // test itemsChanged() is emitted correctly
+ if (itemsChanged) {
+ QCOMPARE(spyItemsChanged.count(), 1);
+ QCOMPARE(spyItemsChanged.at(0).at(0).toInt(), listIndex);
+ QCOMPARE(spyItemsChanged.at(0).at(1).toInt(), 1);
+ } else {
+ QCOMPARE(spyItemsChanged.count(), 0);
+ }
+
+ expr.setExpression(testExpression);
+ QCOMPARE(expr.evaluate().toBool(), true);
+
+ delete connectionsObject;
+}
+
+void tst_qdeclarativelistmodel::property_changes_data()
+{
+ QTest::addColumn<QString>("script_setup");
+ QTest::addColumn<QString>("script_change");
+ QTest::addColumn<QString>("roleName");
+ QTest::addColumn<int>("listIndex");
+ QTest::addColumn<bool>("itemsChanged");
+ QTest::addColumn<QString>("testExpression");
+
+ QTest::newRow("set: plain") << "append({'a':123, 'b':456, 'c':789});" << "set(0,{'b':123});"
+ << "b" << 0 << true << "get(0).b == 123";
+ QTest::newRow("setProperty: plain") << "append({'a':123, 'b':456, 'c':789});" << "setProperty(0, 'b', 123);"
+ << "b" << 0 << true << "get(0).b == 123";
+
+ QTest::newRow("set: plain, no changes") << "append({'a':123, 'b':456, 'c':789});" << "set(0,{'b':456});"
+ << "b" << 0 << false << "get(0).b == 456";
+ QTest::newRow("setProperty: plain, no changes") << "append({'a':123, 'b':456, 'c':789});" << "setProperty(0, 'b', 456);"
+ << "b" << 0 << false << "get(0).b == 456";
+
+ // Following tests only call set() since setProperty() only allows plain
+ // values, not lists, as the argument.
+ // Note that when a list is changed, itemsChanged() is currently always
+ // emitted regardless of whether it actually changed or not.
+
+ QTest::newRow("nested-set: list, new size") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[{'a':1},{'a':2}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 2";
+
+ QTest::newRow("nested-set: list, empty -> non-empty") << "append({'a':123, 'b':[], 'c':789});" << "set(0,{'b':[{'a':1},{'a':2},{'a':3}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 2 && get(0).b.get(2).a == 3";
+
+ QTest::newRow("nested-set: list, non-empty -> empty") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[]});"
+ << "b" << 0 << true << "get(0).b.count == 0";
+
+ QTest::newRow("nested-set: list, same size, different values") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[{'a':1},{'a':222},{'a':3}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 222 && get(0).b.get(2).a == 3";
+
+ QTest::newRow("nested-set: list, no changes") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[{'a':1},{'a':2},{'a':3}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 2 && get(0).b.get(2).a == 3";
+
+ QTest::newRow("nested-set: list, no changes, empty") << "append({'a':123, 'b':[], 'c':789});" << "set(0,{'b':[]});"
+ << "b" << 0 << true << "get(0).b.count == 0";
+}
+
+void tst_qdeclarativelistmodel::property_changes_worker()
+{
+ // nested models are not supported when WorkerScript is involved
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested-"))
+ return;
+
+ QFETCH(QString, script_setup);
+ QFETCH(QString, script_change);
+ QFETCH(QString, roleName);
+ QFETCH(int, listIndex);
+ QFETCH(bool, itemsChanged);
+
+ QDeclarative1ListModel model;
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
+ QDeclarativeItem *item = createWorkerTest(&engine, &component, &model);
+ QVERIFY(item != 0);
+
+ QDeclarativeExpression expr(engine.rootContext(), &model, script_setup);
+ expr.evaluate();
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error().toString()));
+
+ QSignalSpy spyItemsChanged(&model, SIGNAL(itemsChanged(int, int, QList<int>)));
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, QStringList(script_change))));
+ waitForWorker(item);
+
+ // test itemsChanged() is emitted correctly
+ if (itemsChanged) {
+ QCOMPARE(spyItemsChanged.count(), 1);
+ QCOMPARE(spyItemsChanged.at(0).at(0).toInt(), listIndex);
+ QCOMPARE(spyItemsChanged.at(0).at(1).toInt(), 1);
+ } else {
+ QCOMPARE(spyItemsChanged.count(), 0);
+ }
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::property_changes_worker_data()
+{
+ property_changes_data();
+}
+
+void tst_qdeclarativelistmodel::clear()
+{
+ QDeclarativeEngine engine;
+ QDeclarative1ListModel model;
+ QDeclarativeEngine::setContextForObject(&model, engine.rootContext());
+ engine.rootContext()->setContextProperty("model", &model);
+
+ model.clear();
+ QCOMPARE(model.count(), 0);
+
+ RUNEXPR("model.append({propertyA: \"value a\", propertyB: \"value b\"})");
+ QCOMPARE(model.count(), 1);
+
+ model.clear();
+ QCOMPARE(model.count(), 0);
+
+ RUNEXPR("model.append({propertyA: \"value a\", propertyB: \"value b\"})");
+ RUNEXPR("model.append({propertyA: \"value a\", propertyB: \"value b\"})");
+ QCOMPARE(model.count(), 2);
+
+ model.clear();
+ QCOMPARE(model.count(), 0);
+
+ // clearing does not remove the roles
+ RUNEXPR("model.append({propertyA: \"value a\", propertyB: \"value b\", propertyC: \"value c\"})");
+ QList<int> roles = model.roles();
+ model.clear();
+ QCOMPARE(model.count(), 0);
+ QCOMPARE(model.roles(), roles);
+ QCOMPARE(model.toString(roles[0]), QString("propertyA"));
+ QCOMPARE(model.toString(roles[1]), QString("propertyB"));
+ QCOMPARE(model.toString(roles[2]), QString("propertyC"));
+}
+
+QTEST_MAIN(tst_qdeclarativelistmodel)
+
+#include "tst_qdeclarativelistmodel.moc"
diff --git a/tests/auto/declarative/qdeclarativelistview/data/attachedSignals.qml b/tests/auto/qtquick1/qdeclarativelistview/data/attachedSignals.qml
index 5ca1a45839..5ca1a45839 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/attachedSignals.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/attachedSignals.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml b/tests/auto/qtquick1/qdeclarativelistview/data/displaylist.qml
index 9d58530252..9d58530252 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/displaylist.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/footer.qml b/tests/auto/qtquick1/qdeclarativelistview/data/footer.qml
index 33e04f1b0a..33e04f1b0a 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/footer.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/footer.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/header.qml b/tests/auto/qtquick1/qdeclarativelistview/data/header.qml
index 38cdd6e0c4..38cdd6e0c4 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/header.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/header.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/header1.qml b/tests/auto/qtquick1/qdeclarativelistview/data/header1.qml
index f2ab4c1257..f2ab4c1257 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/header1.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/header1.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml b/tests/auto/qtquick1/qdeclarativelistview/data/headerfooter.qml
index 5633831925..5633831925 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/headerfooter.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml b/tests/auto/qtquick1/qdeclarativelistview/data/itemlist.qml
index fca2901e97..fca2901e97 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/itemlist.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml b/tests/auto/qtquick1/qdeclarativelistview/data/listview-enforcerange.qml
index 49dbcb38ea..49dbcb38ea 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/listview-enforcerange.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml b/tests/auto/qtquick1/qdeclarativelistview/data/listview-initCurrent.qml
index 2c4cfab217..2c4cfab217 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/listview-initCurrent.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-noCurrent.qml b/tests/auto/qtquick1/qdeclarativelistview/data/listview-noCurrent.qml
index 19970100f7..19970100f7 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-noCurrent.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/listview-noCurrent.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml b/tests/auto/qtquick1/qdeclarativelistview/data/listview-sections.qml
index 283678b6f1..283678b6f1 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/listview-sections.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml b/tests/auto/qtquick1/qdeclarativelistview/data/listview-sections_delegate.qml
index b2d9213c3d..b2d9213c3d 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/listview-sections_delegate.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml b/tests/auto/qtquick1/qdeclarativelistview/data/listviewtest.qml
index 75ddabbb86..75ddabbb86 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/listviewtest.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/manual-highlight.qml b/tests/auto/qtquick1/qdeclarativelistview/data/manual-highlight.qml
index a32a19492c..a32a19492c 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/manual-highlight.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/manual-highlight.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/orientchange.qml b/tests/auto/qtquick1/qdeclarativelistview/data/orientchange.qml
index c7aa0cd1d3..c7aa0cd1d3 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/orientchange.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/orientchange.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml b/tests/auto/qtquick1/qdeclarativelistview/data/propertychangestest.qml
index 04bec59abf..04bec59abf 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/propertychangestest.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/qtbug14821.qml b/tests/auto/qtquick1/qdeclarativelistview/data/qtbug14821.qml
index e0303ecaa3..e0303ecaa3 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/qtbug14821.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/qtbug14821.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml b/tests/auto/qtquick1/qdeclarativelistview/data/qtbug16037.qml
index 0756618a60..0756618a60 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/qtbug16037.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml b/tests/auto/qtquick1/qdeclarativelistview/data/rightToLeft.qml
index 1e92bb3cbd..1e92bb3cbd 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/rightToLeft.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/sizelessthan1.qml b/tests/auto/qtquick1/qdeclarativelistview/data/sizelessthan1.qml
index 77bfef8e57..77bfef8e57 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/sizelessthan1.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/sizelessthan1.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/data/strictlyenforcerange.qml b/tests/auto/qtquick1/qdeclarativelistview/data/strictlyenforcerange.qml
index bb77a77cf3..bb77a77cf3 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/strictlyenforcerange.qml
+++ b/tests/auto/qtquick1/qdeclarativelistview/data/strictlyenforcerange.qml
diff --git a/tests/auto/declarative/qdeclarativelistview/incrementalmodel.cpp b/tests/auto/qtquick1/qdeclarativelistview/incrementalmodel.cpp
index 4b8e3cf6fa..4b8e3cf6fa 100644
--- a/tests/auto/declarative/qdeclarativelistview/incrementalmodel.cpp
+++ b/tests/auto/qtquick1/qdeclarativelistview/incrementalmodel.cpp
diff --git a/tests/auto/declarative/qdeclarativelistview/incrementalmodel.h b/tests/auto/qtquick1/qdeclarativelistview/incrementalmodel.h
index a6cddb6b07..a6cddb6b07 100644
--- a/tests/auto/declarative/qdeclarativelistview/incrementalmodel.h
+++ b/tests/auto/qtquick1/qdeclarativelistview/incrementalmodel.h
diff --git a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro b/tests/auto/qtquick1/qdeclarativelistview/qdeclarativelistview.pro
index 77e6261c2a..0454d4476a 100644
--- a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
+++ b/tests/auto/qtquick1/qdeclarativelistview/qdeclarativelistview.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
macx:CONFIG -= app_bundle
HEADERS += incrementalmodel.h
@@ -14,4 +14,4 @@ symbian: {
}
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/qtquick1/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 7bb15c5ce8..d55a851ede 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/qtquick1/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -41,15 +41,14 @@
#include <QtTest/QtTest>
#include <QtGui/QStringListModel>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
-#include <QtDeclarative/private/qdeclarativeitem_p.h>
-#include <QtDeclarative/private/qdeclarativelistview_p.h>
-#include <QtDeclarative/private/qdeclarativetext_p.h>
-#include <QtDeclarative/private/qdeclarativevisualitemmodel_p.h>
-#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
+#include <QtQuick1/private/qdeclarativelistview_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativevisualitemmodel_p.h>
#include <QtDeclarative/private/qlistmodelinterface_p.h>
#include "../../../shared/util.h"
#include "incrementalmodel.h"
@@ -59,11 +58,11 @@
#define SRCDIR "."
#endif
-class tst_QDeclarativeListView : public QObject
+class tst_QDeclarative1ListView : public QObject
{
Q_OBJECT
public:
- tst_QDeclarativeListView();
+ tst_QDeclarative1ListView();
private slots:
// Test both QListModelInterface and QAbstractItemModel model types
@@ -355,12 +354,12 @@ private:
QList<QPair<QString,QString> > list;
};
-tst_QDeclarativeListView::tst_QDeclarativeListView()
+tst_QDeclarative1ListView::tst_QDeclarative1ListView()
{
}
template <class T>
-void tst_QDeclarativeListView::items()
+void tst_QDeclarative1ListView::items()
{
QDeclarativeView *canvas = createView();
@@ -378,7 +377,7 @@ void tst_QDeclarativeListView::items()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -396,10 +395,10 @@ void tst_QDeclarativeListView::items()
QTRY_COMPARE(listview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 0));
for (int i = 0; i < model.count(); ++i) {
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -440,7 +439,7 @@ void tst_QDeclarativeListView::items()
template <class T>
-void tst_QDeclarativeListView::changed()
+void tst_QDeclarative1ListView::changed()
{
QDeclarativeView *canvas = createView();
@@ -458,17 +457,17 @@ void tst_QDeclarativeListView::changed()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeFlickable *listview = findItem<QDeclarativeFlickable>(canvas->rootObject(), "list");
+ QDeclarative1Flickable *listview = findItem<QDeclarative1Flickable>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
model.modifyItem(1, "Will", "9876");
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
@@ -477,7 +476,7 @@ void tst_QDeclarativeListView::changed()
}
template <class T>
-void tst_QDeclarativeListView::inserted()
+void tst_QDeclarative1ListView::inserted()
{
QDeclarativeView *canvas = createView();
@@ -495,7 +494,7 @@ void tst_QDeclarativeListView::inserted()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -505,10 +504,10 @@ void tst_QDeclarativeListView::inserted()
QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
@@ -523,10 +522,10 @@ void tst_QDeclarativeListView::inserted()
QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
- name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", 0);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(0));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", 0);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(0));
@@ -563,7 +562,7 @@ void tst_QDeclarativeListView::inserted()
}
template <class T>
-void tst_QDeclarativeListView::removed(bool animated)
+void tst_QDeclarative1ListView::removed(bool animated)
{
QDeclarativeView *canvas = createView();
@@ -581,7 +580,7 @@ void tst_QDeclarativeListView::removed(bool animated)
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -590,10 +589,10 @@ void tst_QDeclarativeListView::removed(bool animated)
model.removeItem(1);
QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
@@ -611,10 +610,10 @@ void tst_QDeclarativeListView::removed(bool animated)
QTest::qWait(300);
- name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", 0);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(0));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", 0);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(0));
@@ -714,7 +713,7 @@ void tst_QDeclarativeListView::removed(bool animated)
model.removeItems(2, 1);
model.addItem("New", "1");
- QTRY_VERIFY(name = findItem<QDeclarativeText>(contentItem, "textName", model.count()-1));
+ QTRY_VERIFY(name = findItem<QDeclarative1Text>(contentItem, "textName", model.count()-1));
QCOMPARE(name->text(), QString("New"));
// Add some more items so that we don't run out
@@ -732,7 +731,7 @@ void tst_QDeclarativeListView::removed(bool animated)
}
template <class T>
-void tst_QDeclarativeListView::clear()
+void tst_QDeclarative1ListView::clear()
{
QDeclarativeView *canvas = createView();
@@ -749,7 +748,7 @@ void tst_QDeclarativeListView::clear()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -774,7 +773,7 @@ void tst_QDeclarativeListView::clear()
template <class T>
-void tst_QDeclarativeListView::moved()
+void tst_QDeclarative1ListView::moved()
{
QDeclarativeView *canvas = createView();
@@ -791,7 +790,7 @@ void tst_QDeclarativeListView::moved()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -799,17 +798,17 @@ void tst_QDeclarativeListView::moved()
model.moveItem(1, 4);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 1);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(1));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 1);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(1));
- name = findItem<QDeclarativeText>(contentItem, "textName", 4);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", 4);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(4));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", 4);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", 4);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(4));
@@ -833,10 +832,10 @@ void tst_QDeclarativeListView::moved()
if (!item) qWarning() << "Item" << i << "not found";
QTRY_VERIFY(item);
QTRY_COMPARE(item->y(), i*20.0 + 20);
- name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -850,10 +849,10 @@ void tst_QDeclarativeListView::moved()
if (!item) qWarning() << "Item" << i << "not found";
QTRY_VERIFY(item);
QTRY_COMPARE(item->y(), i*20.0 + 20);
- name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ name = findItem<QDeclarative1Text>(contentItem, "textName", i);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
- number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ number = findItem<QDeclarative1Text>(contentItem, "textNumber", i);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(i));
}
@@ -862,7 +861,7 @@ void tst_QDeclarativeListView::moved()
delete testObject;
}
-void tst_QDeclarativeListView::enforceRange()
+void tst_QDeclarative1ListView::enforceRange()
{
QDeclarativeView *canvas = createView();
@@ -876,12 +875,12 @@ void tst_QDeclarativeListView::enforceRange()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview-enforcerange.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QTRY_COMPARE(listview->preferredHighlightBegin(), 100.0);
QTRY_COMPARE(listview->preferredHighlightEnd(), 100.0);
- QTRY_COMPARE(listview->highlightRangeMode(), QDeclarativeListView::StrictlyEnforceRange);
+ QTRY_COMPARE(listview->highlightRangeMode(), QDeclarative1ListView::StrictlyEnforceRange);
QDeclarativeItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
@@ -891,10 +890,10 @@ void tst_QDeclarativeListView::enforceRange()
QTRY_VERIFY(item);
QTRY_COMPARE(listview->contentY(), -100.0);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "textName", 0);
QTRY_VERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(0));
- QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(contentItem, "textNumber", 0);
QTRY_VERIFY(number != 0);
QTRY_COMPARE(number->text(), model.number(0));
@@ -914,7 +913,7 @@ void tst_QDeclarativeListView::enforceRange()
delete canvas;
}
-void tst_QDeclarativeListView::spacing()
+void tst_QDeclarative1ListView::spacing()
{
QDeclarativeView *canvas = createView();
@@ -931,7 +930,7 @@ void tst_QDeclarativeListView::spacing()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -973,7 +972,7 @@ void tst_QDeclarativeListView::spacing()
delete testObject;
}
-void tst_QDeclarativeListView::sections()
+void tst_QDeclarative1ListView::sections()
{
QDeclarativeView *canvas = createView();
@@ -987,7 +986,7 @@ void tst_QDeclarativeListView::sections()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview-sections.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -999,7 +998,7 @@ void tst_QDeclarativeListView::sections()
QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
QTRY_VERIFY(item);
QTRY_COMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20));
- QDeclarativeText *next = findItem<QDeclarativeText>(item, "nextSection");
+ QDeclarative1Text *next = findItem<QDeclarative1Text>(item, "nextSection");
QCOMPARE(next->text().toInt(), (i+1)/5);
}
@@ -1062,7 +1061,7 @@ void tst_QDeclarativeListView::sections()
delete canvas;
}
-void tst_QDeclarativeListView::sectionsDelegate()
+void tst_QDeclarative1ListView::sectionsDelegate()
{
QDeclarativeView *canvas = createView();
@@ -1076,7 +1075,7 @@ void tst_QDeclarativeListView::sectionsDelegate()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview-sections_delegate.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1088,7 +1087,7 @@ void tst_QDeclarativeListView::sectionsDelegate()
QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
QTRY_VERIFY(item);
QTRY_COMPARE(item->y(), qreal(i*20 + ((i+5)/5) * 20));
- QDeclarativeText *next = findItem<QDeclarativeText>(item, "nextSection");
+ QDeclarative1Text *next = findItem<QDeclarative1Text>(item, "nextSection");
QCOMPARE(next->text().toInt(), (i+1)/5);
}
@@ -1173,7 +1172,7 @@ void tst_QDeclarativeListView::sectionsDelegate()
delete canvas;
}
-void tst_QDeclarativeListView::currentIndex()
+void tst_QDeclarative1ListView::currentIndex()
{
TestModel model;
for (int i = 0; i < 30; i++)
@@ -1191,7 +1190,7 @@ void tst_QDeclarativeListView::currentIndex()
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1274,7 +1273,7 @@ void tst_QDeclarativeListView::currentIndex()
delete canvas;
}
-void tst_QDeclarativeListView::noCurrentIndex()
+void tst_QDeclarative1ListView::noCurrentIndex()
{
TestModel model;
for (int i = 0; i < 30; i++)
@@ -1291,7 +1290,7 @@ void tst_QDeclarativeListView::noCurrentIndex()
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1312,20 +1311,20 @@ void tst_QDeclarativeListView::noCurrentIndex()
delete canvas;
}
-void tst_QDeclarativeListView::itemList()
+void tst_QDeclarative1ListView::itemList()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/itemlist.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "view");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "view");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QDeclarativeVisualItemModel *model = canvas->rootObject()->findChild<QDeclarativeVisualItemModel*>("itemModel");
+ QDeclarative1VisualItemModel *model = canvas->rootObject()->findChild<QDeclarative1VisualItemModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
@@ -1336,7 +1335,7 @@ void tst_QDeclarativeListView::itemList()
QTRY_COMPARE(item->x(), 0.0);
QCOMPARE(item->height(), listview->height());
- QDeclarativeText *text = findItem<QDeclarativeText>(contentItem, "text1");
+ QDeclarative1Text *text = findItem<QDeclarative1Text>(contentItem, "text1");
QTRY_VERIFY(text);
QTRY_COMPARE(text->text(), QLatin1String("index: 0"));
@@ -1346,14 +1345,14 @@ void tst_QDeclarativeListView::itemList()
QTRY_VERIFY(item);
QTRY_COMPARE(item->x(), 480.0);
- text = findItem<QDeclarativeText>(contentItem, "text3");
+ text = findItem<QDeclarative1Text>(contentItem, "text3");
QTRY_VERIFY(text);
QTRY_COMPARE(text->text(), QLatin1String("index: 2"));
delete canvas;
}
-void tst_QDeclarativeListView::cacheBuffer()
+void tst_QDeclarative1ListView::cacheBuffer()
{
QDeclarativeView *canvas = createView();
@@ -1370,7 +1369,7 @@ void tst_QDeclarativeListView::cacheBuffer()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1406,7 +1405,7 @@ void tst_QDeclarativeListView::cacheBuffer()
delete testObject;
}
-void tst_QDeclarativeListView::positionViewAtIndex()
+void tst_QDeclarative1ListView::positionViewAtIndex()
{
QDeclarativeView *canvas = createView();
@@ -1423,7 +1422,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1439,7 +1438,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position on a currently visible item
- listview->positionViewAtIndex(3, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(3, QDeclarative1ListView::Beginning);
QTRY_COMPARE(listview->contentY(), 60.);
// Confirm items positioned correctly
@@ -1452,7 +1451,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position on an item beyond the visible items
- listview->positionViewAtIndex(22, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(22, QDeclarative1ListView::Beginning);
QTRY_COMPARE(listview->contentY(), 440.);
// Confirm items positioned correctly
@@ -1465,7 +1464,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position on an item that would leave empty space if positioned at the top
- listview->positionViewAtIndex(28, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(28, QDeclarative1ListView::Beginning);
QTRY_COMPARE(listview->contentY(), 480.);
// Confirm items positioned correctly
@@ -1478,7 +1477,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position at the beginning again
- listview->positionViewAtIndex(0, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(0, QDeclarative1ListView::Beginning);
QTRY_COMPARE(listview->contentY(), 0.);
// Confirm items positioned correctly
@@ -1491,7 +1490,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position at End using last index
- listview->positionViewAtIndex(model.count()-1, QDeclarativeListView::End);
+ listview->positionViewAtIndex(model.count()-1, QDeclarative1ListView::End);
QTRY_COMPARE(listview->contentY(), 480.);
// Confirm items positioned correctly
@@ -1504,44 +1503,44 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position at End
- listview->positionViewAtIndex(20, QDeclarativeListView::End);
+ listview->positionViewAtIndex(20, QDeclarative1ListView::End);
QTRY_COMPARE(listview->contentY(), 100.);
// Position in Center
- listview->positionViewAtIndex(15, QDeclarativeListView::Center);
+ listview->positionViewAtIndex(15, QDeclarative1ListView::Center);
QTRY_COMPARE(listview->contentY(), 150.);
// Ensure at least partially visible
- listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ listview->positionViewAtIndex(15, QDeclarative1ListView::Visible);
QTRY_COMPARE(listview->contentY(), 150.);
listview->setContentY(302);
- listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ listview->positionViewAtIndex(15, QDeclarative1ListView::Visible);
QTRY_COMPARE(listview->contentY(), 302.);
listview->setContentY(320);
- listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ listview->positionViewAtIndex(15, QDeclarative1ListView::Visible);
QTRY_COMPARE(listview->contentY(), 300.);
listview->setContentY(85);
- listview->positionViewAtIndex(20, QDeclarativeListView::Visible);
+ listview->positionViewAtIndex(20, QDeclarative1ListView::Visible);
QTRY_COMPARE(listview->contentY(), 85.);
listview->setContentY(75);
- listview->positionViewAtIndex(20, QDeclarativeListView::Visible);
+ listview->positionViewAtIndex(20, QDeclarative1ListView::Visible);
QTRY_COMPARE(listview->contentY(), 100.);
// Ensure completely visible
listview->setContentY(120);
- listview->positionViewAtIndex(20, QDeclarativeListView::Contain);
+ listview->positionViewAtIndex(20, QDeclarative1ListView::Contain);
QTRY_COMPARE(listview->contentY(), 120.);
listview->setContentY(302);
- listview->positionViewAtIndex(15, QDeclarativeListView::Contain);
+ listview->positionViewAtIndex(15, QDeclarative1ListView::Contain);
QTRY_COMPARE(listview->contentY(), 300.);
listview->setContentY(85);
- listview->positionViewAtIndex(20, QDeclarativeListView::Contain);
+ listview->positionViewAtIndex(20, QDeclarative1ListView::Contain);
QTRY_COMPARE(listview->contentY(), 100.);
// positionAtBeginnging
@@ -1566,7 +1565,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
delete testObject;
}
-void tst_QDeclarativeListView::resetModel()
+void tst_QDeclarative1ListView::resetModel()
{
QDeclarativeView *canvas = createView();
@@ -1580,7 +1579,7 @@ void tst_QDeclarativeListView::resetModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaylist.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1589,7 +1588,7 @@ void tst_QDeclarativeListView::resetModel()
QTRY_COMPARE(listview->count(), model.rowCount());
for (int i = 0; i < model.rowCount(); ++i) {
- QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QDeclarative1Text *display = findItem<QDeclarative1Text>(contentItem, "displayText", i);
QTRY_VERIFY(display != 0);
QTRY_COMPARE(display->text(), strings.at(i));
}
@@ -1601,7 +1600,7 @@ void tst_QDeclarativeListView::resetModel()
QTRY_COMPARE(listview->count(), model.rowCount());
for (int i = 0; i < model.rowCount(); ++i) {
- QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QDeclarative1Text *display = findItem<QDeclarative1Text>(contentItem, "displayText", i);
QTRY_VERIFY(display != 0);
QTRY_COMPARE(display->text(), strings.at(i));
}
@@ -1609,13 +1608,13 @@ void tst_QDeclarativeListView::resetModel()
delete canvas;
}
-void tst_QDeclarativeListView::propertyChanges()
+void tst_QDeclarative1ListView::propertyChanges()
{
QDeclarativeView *canvas = createView();
QTRY_VERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
- QDeclarativeListView *listView = canvas->rootObject()->findChild<QDeclarativeListView*>("listView");
+ QDeclarative1ListView *listView = canvas->rootObject()->findChild<QDeclarative1ListView*>("listView");
QTRY_VERIFY(listView);
QSignalSpy highlightFollowsCurrentItemSpy(listView, SIGNAL(highlightFollowsCurrentItemChanged()));
@@ -1629,26 +1628,26 @@ void tst_QDeclarativeListView::propertyChanges()
QTRY_COMPARE(listView->highlightFollowsCurrentItem(), true);
QTRY_COMPARE(listView->preferredHighlightBegin(), 0.0);
QTRY_COMPARE(listView->preferredHighlightEnd(), 0.0);
- QTRY_COMPARE(listView->highlightRangeMode(), QDeclarativeListView::ApplyRange);
+ QTRY_COMPARE(listView->highlightRangeMode(), QDeclarative1ListView::ApplyRange);
QTRY_COMPARE(listView->isWrapEnabled(), true);
QTRY_COMPARE(listView->cacheBuffer(), 10);
- QTRY_COMPARE(listView->snapMode(), QDeclarativeListView::SnapToItem);
+ QTRY_COMPARE(listView->snapMode(), QDeclarative1ListView::SnapToItem);
listView->setHighlightFollowsCurrentItem(false);
listView->setPreferredHighlightBegin(1.0);
listView->setPreferredHighlightEnd(1.0);
- listView->setHighlightRangeMode(QDeclarativeListView::StrictlyEnforceRange);
+ listView->setHighlightRangeMode(QDeclarative1ListView::StrictlyEnforceRange);
listView->setWrapEnabled(false);
listView->setCacheBuffer(3);
- listView->setSnapMode(QDeclarativeListView::SnapOneItem);
+ listView->setSnapMode(QDeclarative1ListView::SnapOneItem);
QTRY_COMPARE(listView->highlightFollowsCurrentItem(), false);
QTRY_COMPARE(listView->preferredHighlightBegin(), 1.0);
QTRY_COMPARE(listView->preferredHighlightEnd(), 1.0);
- QTRY_COMPARE(listView->highlightRangeMode(), QDeclarativeListView::StrictlyEnforceRange);
+ QTRY_COMPARE(listView->highlightRangeMode(), QDeclarative1ListView::StrictlyEnforceRange);
QTRY_COMPARE(listView->isWrapEnabled(), false);
QTRY_COMPARE(listView->cacheBuffer(), 3);
- QTRY_COMPARE(listView->snapMode(), QDeclarativeListView::SnapOneItem);
+ QTRY_COMPARE(listView->snapMode(), QDeclarative1ListView::SnapOneItem);
QTRY_COMPARE(highlightFollowsCurrentItemSpy.count(),1);
QTRY_COMPARE(preferredHighlightBeginSpy.count(),1);
@@ -1661,10 +1660,10 @@ void tst_QDeclarativeListView::propertyChanges()
listView->setHighlightFollowsCurrentItem(false);
listView->setPreferredHighlightBegin(1.0);
listView->setPreferredHighlightEnd(1.0);
- listView->setHighlightRangeMode(QDeclarativeListView::StrictlyEnforceRange);
+ listView->setHighlightRangeMode(QDeclarative1ListView::StrictlyEnforceRange);
listView->setWrapEnabled(false);
listView->setCacheBuffer(3);
- listView->setSnapMode(QDeclarativeListView::SnapOneItem);
+ listView->setSnapMode(QDeclarative1ListView::SnapOneItem);
QTRY_COMPARE(highlightFollowsCurrentItemSpy.count(),1);
QTRY_COMPARE(preferredHighlightBeginSpy.count(),1);
@@ -1677,13 +1676,13 @@ void tst_QDeclarativeListView::propertyChanges()
delete canvas;
}
-void tst_QDeclarativeListView::componentChanges()
+void tst_QDeclarative1ListView::componentChanges()
{
QDeclarativeView *canvas = createView();
QTRY_VERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
- QDeclarativeListView *listView = canvas->rootObject()->findChild<QDeclarativeListView*>("listView");
+ QDeclarative1ListView *listView = canvas->rootObject()->findChild<QDeclarative1ListView*>("listView");
QTRY_VERIFY(listView);
QDeclarativeComponent component(canvas->engine());
@@ -1725,16 +1724,16 @@ void tst_QDeclarativeListView::componentChanges()
delete canvas;
}
-void tst_QDeclarativeListView::modelChanges()
+void tst_QDeclarative1ListView::modelChanges()
{
QDeclarativeView *canvas = createView();
QTRY_VERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
- QDeclarativeListView *listView = canvas->rootObject()->findChild<QDeclarativeListView*>("listView");
+ QDeclarative1ListView *listView = canvas->rootObject()->findChild<QDeclarative1ListView*>("listView");
QTRY_VERIFY(listView);
- QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel");
+ QObject *alternateModel = canvas->rootObject()->findChild<QObject*>("alternateModel");
QTRY_VERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue(alternateModel);
QSignalSpy modelSpy(listView, SIGNAL(modelChanged()));
@@ -1752,14 +1751,14 @@ void tst_QDeclarativeListView::modelChanges()
delete canvas;
}
-void tst_QDeclarativeListView::QTBUG_9791()
+void tst_QDeclarative1ListView::QTBUG_9791()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/strictlyenforcerange.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(canvas->rootObject());
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1787,7 +1786,7 @@ void tst_QDeclarativeListView::QTBUG_9791()
delete canvas;
}
-void tst_QDeclarativeListView::manualHighlight()
+void tst_QDeclarative1ListView::manualHighlight()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
@@ -1797,7 +1796,7 @@ void tst_QDeclarativeListView::manualHighlight()
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1814,7 +1813,7 @@ void tst_QDeclarativeListView::manualHighlight()
QTRY_COMPARE(listview->highlightItem()->y() - 5, listview->currentItem()->y());
// QTBUG-15972
- listview->positionViewAtIndex(3, QDeclarativeListView::Contain);
+ listview->positionViewAtIndex(3, QDeclarative1ListView::Contain);
QTRY_COMPARE(listview->currentIndex(), 2);
QTRY_COMPARE(listview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 2));
@@ -1823,7 +1822,7 @@ void tst_QDeclarativeListView::manualHighlight()
delete canvas;
}
-void tst_QDeclarativeListView::QTBUG_11105()
+void tst_QDeclarative1ListView::QTBUG_11105()
{
QDeclarativeView *canvas = createView();
@@ -1840,7 +1839,7 @@ void tst_QDeclarativeListView::QTBUG_11105()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -1855,7 +1854,7 @@ void tst_QDeclarativeListView::QTBUG_11105()
QTRY_VERIFY(item->y() == i*20);
}
- listview->positionViewAtIndex(20, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(20, QDeclarative1ListView::Beginning);
QCOMPARE(listview->contentY(), 280.);
TestModel model2;
@@ -1871,7 +1870,7 @@ void tst_QDeclarativeListView::QTBUG_11105()
delete testObject;
}
-void tst_QDeclarativeListView::header()
+void tst_QDeclarative1ListView::header()
{
{
QDeclarativeView *canvas = createView();
@@ -1886,13 +1885,13 @@ void tst_QDeclarativeListView::header()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QDeclarative1Text *header = findItem<QDeclarative1Text>(contentItem, "header");
QVERIFY(header);
QCOMPARE(header->y(), 0.0);
QCOMPARE(header->height(), 20.0);
@@ -1907,9 +1906,9 @@ void tst_QDeclarativeListView::header()
QMetaObject::invokeMethod(canvas->rootObject(), "changeHeader");
- header = findItem<QDeclarativeText>(contentItem, "header");
+ header = findItem<QDeclarative1Text>(contentItem, "header");
QVERIFY(!header);
- header = findItem<QDeclarativeText>(contentItem, "header2");
+ header = findItem<QDeclarative1Text>(contentItem, "header2");
QVERIFY(header);
QCOMPARE(header->y(), 10.0);
@@ -1926,13 +1925,13 @@ void tst_QDeclarativeListView::header()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header1.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QDeclarative1Text *header = findItem<QDeclarative1Text>(contentItem, "header");
QVERIFY(header);
QCOMPARE(header->y(), 0.0);
@@ -1945,7 +1944,7 @@ void tst_QDeclarativeListView::header()
}
}
-void tst_QDeclarativeListView::footer()
+void tst_QDeclarative1ListView::footer()
{
QDeclarativeView *canvas = createView();
@@ -1959,13 +1958,13 @@ void tst_QDeclarativeListView::footer()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/footer.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QDeclarativeText *footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QDeclarative1Text *footer = findItem<QDeclarative1Text>(contentItem, "footer");
QVERIFY(footer);
QCOMPARE(footer->y(), 60.0);
QCOMPARE(footer->height(), 30.0);
@@ -1981,9 +1980,9 @@ void tst_QDeclarativeListView::footer()
QMetaObject::invokeMethod(canvas->rootObject(), "changeFooter");
- footer = findItem<QDeclarativeText>(contentItem, "footer");
+ footer = findItem<QDeclarative1Text>(contentItem, "footer");
QVERIFY(!footer);
- footer = findItem<QDeclarativeText>(contentItem, "footer2");
+ footer = findItem<QDeclarative1Text>(contentItem, "footer2");
QVERIFY(footer);
QCOMPARE(footer->y(), 600.0);
@@ -1993,7 +1992,7 @@ void tst_QDeclarativeListView::footer()
delete canvas;
}
-class LVAccessor : public QDeclarativeListView
+class LVAccessor : public QDeclarative1ListView
{
public:
qreal minY() const { return minYExtent(); }
@@ -2002,7 +2001,7 @@ public:
qreal maxX() const { return maxXExtent(); }
};
-void tst_QDeclarativeListView::headerFooter()
+void tst_QDeclarative1ListView::headerFooter()
{
{
// Vertical
@@ -2015,7 +2014,7 @@ void tst_QDeclarativeListView::headerFooter()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(canvas->rootObject());
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2046,7 +2045,7 @@ void tst_QDeclarativeListView::headerFooter()
canvas->rootObject()->setProperty("horizontal", true);
qApp->processEvents();
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(canvas->rootObject());
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2078,7 +2077,7 @@ void tst_QDeclarativeListView::headerFooter()
canvas->rootObject()->setProperty("rtl", true);
qApp->processEvents();
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(canvas->rootObject());
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2099,7 +2098,7 @@ void tst_QDeclarativeListView::headerFooter()
}
}
-void tst_QDeclarativeListView::resizeView()
+void tst_QDeclarative1ListView::resizeView()
{
QDeclarativeView *canvas = createView();
@@ -2116,7 +2115,7 @@ void tst_QDeclarativeListView::resizeView()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2144,7 +2143,7 @@ void tst_QDeclarativeListView::resizeView()
delete testObject;
}
-void tst_QDeclarativeListView::sizeLessThan1()
+void tst_QDeclarative1ListView::sizeLessThan1()
{
QDeclarativeView *canvas = createView();
@@ -2161,7 +2160,7 @@ void tst_QDeclarativeListView::sizeLessThan1()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/sizelessthan1.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2180,14 +2179,14 @@ void tst_QDeclarativeListView::sizeLessThan1()
delete testObject;
}
-void tst_QDeclarativeListView::QTBUG_14821()
+void tst_QDeclarative1ListView::QTBUG_14821()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtbug14821.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(canvas->rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2202,7 +2201,7 @@ void tst_QDeclarativeListView::QTBUG_14821()
delete canvas;
}
-void tst_QDeclarativeListView::resizeDelegate()
+void tst_QDeclarative1ListView::resizeDelegate()
{
QDeclarativeView *canvas = createView();
@@ -2217,7 +2216,7 @@ void tst_QDeclarativeListView::resizeDelegate()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaylist.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2250,8 +2249,8 @@ void tst_QDeclarativeListView::resizeDelegate()
QTRY_COMPARE(listview->highlightItem()->y(), 750.0);
listview->setCurrentIndex(1);
- listview->positionViewAtIndex(25, QDeclarativeListView::Beginning);
- listview->positionViewAtIndex(5, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(25, QDeclarative1ListView::Beginning);
+ listview->positionViewAtIndex(5, QDeclarative1ListView::Beginning);
for (int i = 5; i < 16; ++i) {
QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
@@ -2277,14 +2276,14 @@ void tst_QDeclarativeListView::resizeDelegate()
delete canvas;
}
-void tst_QDeclarativeListView::QTBUG_16037()
+void tst_QDeclarative1ListView::QTBUG_16037()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtbug16037.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "listview");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "listview");
QTRY_VERIFY(listview != 0);
QVERIFY(listview->contentHeight() <= 0.0);
@@ -2296,7 +2295,7 @@ void tst_QDeclarativeListView::QTBUG_16037()
delete canvas;
}
-void tst_QDeclarativeListView::indexAt()
+void tst_QDeclarative1ListView::indexAt()
{
QDeclarativeView *canvas = createView();
@@ -2313,7 +2312,7 @@ void tst_QDeclarativeListView::indexAt()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2329,7 +2328,7 @@ void tst_QDeclarativeListView::indexAt()
delete testObject;
}
-void tst_QDeclarativeListView::incrementalModel()
+void tst_QDeclarative1ListView::incrementalModel()
{
QDeclarativeView *canvas = createView();
@@ -2340,7 +2339,7 @@ void tst_QDeclarativeListView::incrementalModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaylist.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2348,14 +2347,14 @@ void tst_QDeclarativeListView::incrementalModel()
QTRY_COMPARE(listview->count(), 20);
- listview->positionViewAtIndex(10, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(10, QDeclarative1ListView::Beginning);
QTRY_COMPARE(listview->count(), 25);
delete canvas;
}
-void tst_QDeclarativeListView::onAdd()
+void tst_QDeclarative1ListView::onAdd()
{
QFETCH(int, initialItemCount);
QFETCH(int, itemsToAdd);
@@ -2394,7 +2393,7 @@ void tst_QDeclarativeListView::onAdd()
delete canvas;
}
-void tst_QDeclarativeListView::onAdd_data()
+void tst_QDeclarative1ListView::onAdd_data()
{
QTest::addColumn<int>("initialItemCount");
QTest::addColumn<int>("itemsToAdd");
@@ -2412,7 +2411,7 @@ void tst_QDeclarativeListView::onAdd_data()
QTest::newRow("5, add 10") << 5 << 10;
}
-void tst_QDeclarativeListView::onRemove()
+void tst_QDeclarative1ListView::onRemove()
{
QFETCH(int, initialItemCount);
QFETCH(int, indexToRemove);
@@ -2439,7 +2438,7 @@ void tst_QDeclarativeListView::onRemove()
delete canvas;
}
-void tst_QDeclarativeListView::onRemove_data()
+void tst_QDeclarative1ListView::onRemove_data()
{
QTest::addColumn<int>("initialItemCount");
QTest::addColumn<int>("indexToRemove");
@@ -2462,7 +2461,7 @@ void tst_QDeclarativeListView::onRemove_data()
QTest::newRow("ten items, remove 4-10") << 10 << 4 << 6;
}
-void tst_QDeclarativeListView::testQtQuick11Attributes()
+void tst_QDeclarative1ListView::testQtQuick11Attributes()
{
QFETCH(QString, code);
QFETCH(QString, warning);
@@ -2486,7 +2485,7 @@ void tst_QDeclarativeListView::testQtQuick11Attributes()
delete obj;
}
-void tst_QDeclarativeListView::testQtQuick11Attributes_data()
+void tst_QDeclarative1ListView::testQtQuick11Attributes_data()
{
QTest::addColumn<QString>("code");
QTest::addColumn<QString>("warning");
@@ -2501,7 +2500,7 @@ void tst_QDeclarativeListView::testQtQuick11Attributes_data()
<< "";
}
-void tst_QDeclarativeListView::rightToLeft()
+void tst_QDeclarative1ListView::rightToLeft()
{
QDeclarativeView *canvas = createView();
canvas->setFixedSize(640,320);
@@ -2509,13 +2508,13 @@ void tst_QDeclarativeListView::rightToLeft()
qApp->processEvents();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "view");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "view");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QDeclarativeVisualItemModel *model = canvas->rootObject()->findChild<QDeclarativeVisualItemModel*>("itemModel");
+ QDeclarative1VisualItemModel *model = canvas->rootObject()->findChild<QDeclarative1VisualItemModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
@@ -2529,7 +2528,7 @@ void tst_QDeclarativeListView::rightToLeft()
QTRY_COMPARE(item->x(), -100.0);
QCOMPARE(item->height(), listview->height());
- QDeclarativeText *text = findItem<QDeclarativeText>(contentItem, "text1");
+ QDeclarative1Text *text = findItem<QDeclarative1Text>(contentItem, "text1");
QTRY_VERIFY(text);
QTRY_COMPARE(text->text(), QLatin1String("index: 0"));
@@ -2539,7 +2538,7 @@ void tst_QDeclarativeListView::rightToLeft()
QTRY_VERIFY(item);
QTRY_COMPARE(item->x(), -540.0);
- text = findItem<QDeclarativeText>(contentItem, "text3");
+ text = findItem<QDeclarative1Text>(contentItem, "text3");
QTRY_VERIFY(text);
QTRY_COMPARE(text->text(), QLatin1String("index: 2"));
@@ -2552,16 +2551,16 @@ void tst_QDeclarativeListView::rightToLeft()
delete canvas;
}
-void tst_QDeclarativeListView::test_mirroring()
+void tst_QDeclarative1ListView::test_mirroring()
{
QDeclarativeView *canvasA = createView();
canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
- QDeclarativeListView *listviewA = findItem<QDeclarativeListView>(canvasA->rootObject(), "view");
+ QDeclarative1ListView *listviewA = findItem<QDeclarative1ListView>(canvasA->rootObject(), "view");
QTRY_VERIFY(listviewA != 0);
QDeclarativeView *canvasB = createView();
canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
- QDeclarativeListView *listviewB = findItem<QDeclarativeListView>(canvasB->rootObject(), "view");
+ QDeclarative1ListView *listviewB = findItem<QDeclarative1ListView>(canvasB->rootObject(), "view");
QTRY_VERIFY(listviewA != 0);
qApp->processEvents();
@@ -2613,20 +2612,20 @@ void tst_QDeclarativeListView::test_mirroring()
delete canvasB;
}
-void tst_QDeclarativeListView::orientationChange()
+void tst_QDeclarative1ListView::orientationChange()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/orientchange.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(canvas->rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- listview->positionViewAtIndex(50, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(50, QDeclarative1ListView::Beginning);
// Confirm items positioned correctly
for (int i = 50; i < 54; ++i) {
@@ -2635,7 +2634,7 @@ void tst_QDeclarativeListView::orientationChange()
QCOMPARE(item->y(), i*80.0);
}
- listview->setOrientation(QDeclarativeListView::Horizontal);
+ listview->setOrientation(QDeclarative1ListView::Horizontal);
QCOMPARE(listview->contentY(), 0.);
// Confirm items positioned correctly
@@ -2645,8 +2644,8 @@ void tst_QDeclarativeListView::orientationChange()
QCOMPARE(item->x(), i*80.0);
}
- listview->positionViewAtIndex(50, QDeclarativeListView::Beginning);
- listview->setOrientation(QDeclarativeListView::Vertical);
+ listview->positionViewAtIndex(50, QDeclarative1ListView::Beginning);
+ listview->setOrientation(QDeclarative1ListView::Vertical);
QCOMPARE(listview->contentX(), 0.);
//
// Confirm items positioned correctly
@@ -2659,7 +2658,7 @@ void tst_QDeclarativeListView::orientationChange()
delete canvas;
}
-void tst_QDeclarativeListView::contentPosJump()
+void tst_QDeclarative1ListView::contentPosJump()
{
QDeclarativeView *canvas = createView();
@@ -2676,7 +2675,7 @@ void tst_QDeclarativeListView::contentPosJump()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QDeclarative1ListView *listview = findItem<QDeclarative1ListView>(canvas->rootObject(), "list");
QTRY_VERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -2714,69 +2713,69 @@ void tst_QDeclarativeListView::contentPosJump()
delete canvas;
}
-void tst_QDeclarativeListView::qListModelInterface_items()
+void tst_QDeclarative1ListView::qListModelInterface_items()
{
items<TestModel>();
}
-void tst_QDeclarativeListView::qAbstractItemModel_items()
+void tst_QDeclarative1ListView::qAbstractItemModel_items()
{
items<TestModel2>();
}
-void tst_QDeclarativeListView::qListModelInterface_changed()
+void tst_QDeclarative1ListView::qListModelInterface_changed()
{
changed<TestModel>();
}
-void tst_QDeclarativeListView::qAbstractItemModel_changed()
+void tst_QDeclarative1ListView::qAbstractItemModel_changed()
{
changed<TestModel2>();
}
-void tst_QDeclarativeListView::qListModelInterface_inserted()
+void tst_QDeclarative1ListView::qListModelInterface_inserted()
{
inserted<TestModel>();
}
-void tst_QDeclarativeListView::qAbstractItemModel_inserted()
+void tst_QDeclarative1ListView::qAbstractItemModel_inserted()
{
inserted<TestModel2>();
}
-void tst_QDeclarativeListView::qListModelInterface_removed()
+void tst_QDeclarative1ListView::qListModelInterface_removed()
{
removed<TestModel>(false);
removed<TestModel>(true);
}
-void tst_QDeclarativeListView::qAbstractItemModel_removed()
+void tst_QDeclarative1ListView::qAbstractItemModel_removed()
{
removed<TestModel2>(false);
removed<TestModel2>(true);
}
-void tst_QDeclarativeListView::qListModelInterface_moved()
+void tst_QDeclarative1ListView::qListModelInterface_moved()
{
moved<TestModel>();
}
-void tst_QDeclarativeListView::qAbstractItemModel_moved()
+void tst_QDeclarative1ListView::qAbstractItemModel_moved()
{
moved<TestModel2>();
}
-void tst_QDeclarativeListView::qListModelInterface_clear()
+void tst_QDeclarative1ListView::qListModelInterface_clear()
{
clear<TestModel>();
}
-void tst_QDeclarativeListView::qAbstractItemModel_clear()
+void tst_QDeclarative1ListView::qAbstractItemModel_clear()
{
clear<TestModel2>();
}
-QDeclarativeView *tst_QDeclarativeListView::createView()
+QDeclarativeView *tst_QDeclarative1ListView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
@@ -2789,7 +2788,7 @@ QDeclarativeView *tst_QDeclarativeListView::createView()
item must also evaluate the {index} expression equal to index
*/
template<typename T>
-T *tst_QDeclarativeListView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+T *tst_QDeclarative1ListView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
{
const QMetaObject &mo = T::staticMetaObject;
//qDebug() << parent->childItems().count() << "children";
@@ -2816,7 +2815,7 @@ T *tst_QDeclarativeListView::findItem(QGraphicsObject *parent, const QString &ob
}
template<typename T>
-QList<T*> tst_QDeclarativeListView::findItems(QGraphicsObject *parent, const QString &objectName)
+QList<T*> tst_QDeclarative1ListView::findItems(QGraphicsObject *parent, const QString &objectName)
{
QList<T*> items;
const QMetaObject &mo = T::staticMetaObject;
@@ -2834,7 +2833,7 @@ QList<T*> tst_QDeclarativeListView::findItems(QGraphicsObject *parent, const QSt
return items;
}
-void tst_QDeclarativeListView::dumpTree(QDeclarativeItem *parent, int depth)
+void tst_QDeclarative1ListView::dumpTree(QDeclarativeItem *parent, int depth)
{
static QString padding(" ");
for (int i = 0; i < parent->childItems().count(); ++i) {
@@ -2847,6 +2846,6 @@ void tst_QDeclarativeListView::dumpTree(QDeclarativeItem *parent, int depth)
}
-QTEST_MAIN(tst_QDeclarativeListView)
+QTEST_MAIN(tst_QDeclarative1ListView)
#include "tst_qdeclarativelistview.moc"
diff --git a/tests/auto/declarative/qdeclarativeloader/data/AnchoredLoader.qml b/tests/auto/qtquick1/qdeclarativeloader/data/AnchoredLoader.qml
index 7654c07408..7654c07408 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/AnchoredLoader.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/AnchoredLoader.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml b/tests/auto/qtquick1/qdeclarativeloader/data/BlueRect.qml
index d2da64d263..d2da64d263 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/BlueRect.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml b/tests/auto/qtquick1/qdeclarativeloader/data/CreationContextLoader.qml
index bfc9a8dd8a..bfc9a8dd8a 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/CreationContextLoader.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml b/tests/auto/qtquick1/qdeclarativeloader/data/GraphicsWidget250x250.qml
index 139657bf2c..139657bf2c 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/GraphicsWidget250x250.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml b/tests/auto/qtquick1/qdeclarativeloader/data/GreenRect.qml
index 5aeb81e918..5aeb81e918 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/GreenRect.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml b/tests/auto/qtquick1/qdeclarativeloader/data/NoResize.qml
index bb1030ef9d..bb1030ef9d 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/NoResize.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml b/tests/auto/qtquick1/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
index 5a31eff545..5a31eff545 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/QTBUG_16928.qml b/tests/auto/qtquick1/qdeclarativeloader/data/QTBUG_16928.qml
index 9949e346f9..9949e346f9 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/QTBUG_16928.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/QTBUG_16928.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/QTBUG_17114.qml b/tests/auto/qtquick1/qdeclarativeloader/data/QTBUG_17114.qml
index 8a49733a8c..8a49733a8c 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/QTBUG_17114.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/QTBUG_17114.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml b/tests/auto/qtquick1/qdeclarativeloader/data/Rect120x60.qml
index 5a352844c3..5a352844c3 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/Rect120x60.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml b/tests/auto/qtquick1/qdeclarativeloader/data/SetSourceComponent.qml
index fa2d3cb325..fa2d3cb325 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/SetSourceComponent.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml b/tests/auto/qtquick1/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
index a855947c59..a855947c59 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml b/tests/auto/qtquick1/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
index b6fd57f590..b6fd57f590 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml b/tests/auto/qtquick1/qdeclarativeloader/data/SizeToItem.qml
index 36ce9912f1..36ce9912f1 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/SizeToItem.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml b/tests/auto/qtquick1/qdeclarativeloader/data/SizeToLoader.qml
index 4fa945b300..4fa945b300 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/SizeToLoader.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml b/tests/auto/qtquick1/qdeclarativeloader/data/VmeError.qml
index a36c246260..a36c246260 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/VmeError.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/crash.qml b/tests/auto/qtquick1/qdeclarativeloader/data/crash.qml
index c7a4407add..c7a4407add 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/crash.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/crash.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml b/tests/auto/qtquick1/qdeclarativeloader/data/creationContext.qml
index 529797867f..529797867f 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/creationContext.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml b/tests/auto/qtquick1/qdeclarativeloader/data/differentorigin.qml
index 043ce5555e..043ce5555e 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/differentorigin.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/implicitSize.qml b/tests/auto/qtquick1/qdeclarativeloader/data/implicitSize.qml
index 53aad97ae1..53aad97ae1 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/implicitSize.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/implicitSize.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml b/tests/auto/qtquick1/qdeclarativeloader/data/nonItem.qml
index 1d0ab5c10d..1d0ab5c10d 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/nonItem.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/qmldir b/tests/auto/qtquick1/qdeclarativeloader/data/qmldir
index bf42b507c0..bf42b507c0 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/qmldir
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/qmldir
diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml b/tests/auto/qtquick1/qdeclarativeloader/data/sameorigin-load.qml
index dbea969395..dbea969395 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/sameorigin-load.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml b/tests/auto/qtquick1/qdeclarativeloader/data/sameorigin.qml
index 8ba13a0493..8ba13a0493 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/sameorigin.qml
diff --git a/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml b/tests/auto/qtquick1/qdeclarativeloader/data/vmeErrors.qml
index cfced31da5..cfced31da5 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml
+++ b/tests/auto/qtquick1/qdeclarativeloader/data/vmeErrors.qml
diff --git a/tests/auto/qtquick1/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/qtquick1/qdeclarativeloader/qdeclarativeloader.pro
new file mode 100644
index 0000000000..980e58461c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativeloader/qdeclarativeloader.pro
@@ -0,0 +1,20 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network qtquick1
+macx:CONFIG -= app_bundle
+
+INCLUDEPATH += ../../declarative/shared/
+HEADERS += ../../declarative/shared/testhttpserver.h
+SOURCES += tst_qdeclarativeloader.cpp \
+ ../../declarative/shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/qtquick1/qdeclarativeloader/tst_qdeclarativeloader.cpp
index 0d96efebbd..baed4973dc 100644
--- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
+++ b/tests/auto/qtquick1/qdeclarativeloader/tst_qdeclarativeloader.cpp
@@ -45,7 +45,7 @@
#include <QSignalSpy>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <private/qdeclarativeloader_p.h>
+#include <QtQuick1/private/qdeclarativeloader_p.h>
#include "testhttpserver.h"
#include "../../../shared/util.h"
@@ -61,12 +61,12 @@ inline QUrl TEST_FILE(const QString &filename)
return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
}
-class tst_QDeclarativeLoader : public QObject
+class tst_QDeclarative1Loader : public QObject
{
Q_OBJECT
public:
- tst_QDeclarativeLoader();
+ tst_QDeclarative1Loader();
private slots:
void sourceOrComponent();
@@ -98,11 +98,11 @@ private:
};
-tst_QDeclarativeLoader::tst_QDeclarativeLoader()
+tst_QDeclarative1Loader::tst_QDeclarative1Loader()
{
}
-void tst_QDeclarativeLoader::sourceOrComponent()
+void tst_QDeclarative1Loader::sourceOrComponent()
{
QFETCH(QString, sourceDefinition);
QFETCH(QUrl, sourceUrl);
@@ -131,13 +131,13 @@ void tst_QDeclarativeLoader::sourceOrComponent()
"}")
, TEST_FILE(""));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader != 0);
QCOMPARE(loader->item() == 0, error);
QCOMPARE(loader->source(), sourceUrl);
QCOMPARE(loader->progress(), 1.0);
- QCOMPARE(loader->status(), error ? QDeclarativeLoader::Error : QDeclarativeLoader::Ready);
+ QCOMPARE(loader->status(), error ? QDeclarative1Loader::Error : QDeclarative1Loader::Ready);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), error ? 0: 1);
if (!error) {
@@ -156,7 +156,7 @@ void tst_QDeclarativeLoader::sourceOrComponent()
delete loader;
}
-void tst_QDeclarativeLoader::sourceOrComponent_data()
+void tst_QDeclarative1Loader::sourceOrComponent_data()
{
QTest::addColumn<QString>("sourceDefinition");
QTest::addColumn<QUrl>("sourceUrl");
@@ -169,7 +169,7 @@ void tst_QDeclarativeLoader::sourceOrComponent_data()
<< QString(QUrl::fromLocalFile(SRCDIR "/data/IDontExist.qml").toString() + ": File not found");
}
-void tst_QDeclarativeLoader::clear()
+void tst_QDeclarative1Loader::clear()
{
{
QDeclarativeComponent component(&engine);
@@ -180,7 +180,7 @@ void tst_QDeclarativeLoader::clear()
" Timer { interval: 200; running: true; onTriggered: loader.source = '' }\n"
" }")
, TEST_FILE(""));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader != 0);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
@@ -188,7 +188,7 @@ void tst_QDeclarativeLoader::clear()
QTRY_VERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
- QCOMPARE(loader->status(), QDeclarativeLoader::Null);
+ QCOMPARE(loader->status(), QDeclarative1Loader::Null);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
delete loader;
@@ -198,7 +198,7 @@ void tst_QDeclarativeLoader::clear()
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
QVERIFY(item);
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(item->QGraphicsObject::children().at(1));
QVERIFY(loader);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
@@ -208,7 +208,7 @@ void tst_QDeclarativeLoader::clear()
QVERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
- QCOMPARE(loader->status(), QDeclarativeLoader::Null);
+ QCOMPARE(loader->status(), QDeclarative1Loader::Null);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
delete item;
@@ -218,7 +218,7 @@ void tst_QDeclarativeLoader::clear()
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
QVERIFY(item);
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(item->QGraphicsObject::children().at(1));
QVERIFY(loader);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
@@ -228,14 +228,14 @@ void tst_QDeclarativeLoader::clear()
QVERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
- QCOMPARE(loader->status(), QDeclarativeLoader::Null);
+ QCOMPARE(loader->status(), QDeclarative1Loader::Null);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
delete item;
}
}
-void tst_QDeclarativeLoader::urlToComponent()
+void tst_QDeclarative1Loader::urlToComponent()
{
QDeclarativeComponent component(&engine);
component.setData(QByteArray("import QtQuick 1.0\n"
@@ -246,7 +246,7 @@ void tst_QDeclarativeLoader::urlToComponent()
" Timer { interval: 100; running: true; onTriggered: loader.sourceComponent = myComp }\n"
"}" )
, TEST_FILE(""));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QTest::qWait(200);
QTRY_VERIFY(loader != 0);
QVERIFY(loader->item());
@@ -258,13 +258,13 @@ void tst_QDeclarativeLoader::urlToComponent()
delete loader;
}
-void tst_QDeclarativeLoader::componentToUrl()
+void tst_QDeclarative1Loader::componentToUrl()
{
QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml"));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
QVERIFY(item);
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(item->QGraphicsObject::children().at(1));
QVERIFY(loader);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
@@ -280,7 +280,7 @@ void tst_QDeclarativeLoader::componentToUrl()
delete item;
}
-void tst_QDeclarativeLoader::anchoredLoader()
+void tst_QDeclarative1Loader::anchoredLoader()
{
QDeclarativeComponent component(&engine, TEST_FILE("/AnchoredLoader.qml"));
QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(component.create());
@@ -301,10 +301,10 @@ void tst_QDeclarativeLoader::anchoredLoader()
QCOMPARE(sourceElement->height(), 200.0);
}
-void tst_QDeclarativeLoader::sizeLoaderToItem()
+void tst_QDeclarative1Loader::sizeLoaderToItem()
{
QDeclarativeComponent component(&engine, TEST_FILE("/SizeToItem.qml"));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader != 0);
QCOMPARE(loader->width(), 120.0);
QCOMPARE(loader->height(), 60.0);
@@ -342,10 +342,10 @@ void tst_QDeclarativeLoader::sizeLoaderToItem()
delete loader;
}
-void tst_QDeclarativeLoader::sizeItemToLoader()
+void tst_QDeclarative1Loader::sizeItemToLoader()
{
QDeclarativeComponent component(&engine, TEST_FILE("/SizeToLoader.qml"));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader != 0);
QCOMPARE(loader->width(), 200.0);
QCOMPARE(loader->height(), 80.0);
@@ -372,7 +372,7 @@ void tst_QDeclarativeLoader::sizeItemToLoader()
delete loader;
}
-void tst_QDeclarativeLoader::noResize()
+void tst_QDeclarative1Loader::noResize()
{
QDeclarativeComponent component(&engine, TEST_FILE("/NoResize.qml"));
QDeclarativeItem* item = qobject_cast<QDeclarativeItem*>(component.create());
@@ -383,10 +383,10 @@ void tst_QDeclarativeLoader::noResize()
delete item;
}
-void tst_QDeclarativeLoader::sizeLoaderToGraphicsWidget()
+void tst_QDeclarative1Loader::sizeLoaderToGraphicsWidget()
{
QDeclarativeComponent component(&engine, TEST_FILE("/SizeLoaderToGraphicsWidget.qml"));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QGraphicsScene scene;
scene.addItem(loader);
@@ -410,10 +410,10 @@ void tst_QDeclarativeLoader::sizeLoaderToGraphicsWidget()
delete loader;
}
-void tst_QDeclarativeLoader::sizeGraphicsWidgetToLoader()
+void tst_QDeclarative1Loader::sizeGraphicsWidgetToLoader()
{
QDeclarativeComponent component(&engine, TEST_FILE("/SizeGraphicsWidgetToLoader.qml"));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QGraphicsScene scene;
scene.addItem(loader);
@@ -442,7 +442,7 @@ void tst_QDeclarativeLoader::sizeGraphicsWidgetToLoader()
delete loader;
}
-void tst_QDeclarativeLoader::noResizeGraphicsWidget()
+void tst_QDeclarative1Loader::noResizeGraphicsWidget()
{
QDeclarativeComponent component(&engine, TEST_FILE("/NoResizeGraphicsWidget.qml"));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
@@ -456,7 +456,7 @@ void tst_QDeclarativeLoader::noResizeGraphicsWidget()
delete item;
}
-void tst_QDeclarativeLoader::networkRequestUrl()
+void tst_QDeclarative1Loader::networkRequestUrl()
{
TestHTTPServer server(SERVER_PORT);
QVERIFY(server.isValid());
@@ -466,10 +466,10 @@ void tst_QDeclarativeLoader::networkRequestUrl()
component.setData(QByteArray("import QtQuick 1.0\nLoader { property int signalCount : 0; source: \"http://127.0.0.1:14450/Rect120x60.qml\"; onLoaded: signalCount += 1 }"), QUrl::fromLocalFile(SRCDIR "/dummy.qml"));
if (component.isError())
qDebug() << component.errors();
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader != 0);
- QTRY_VERIFY(loader->status() == QDeclarativeLoader::Ready);
+ QTRY_VERIFY(loader->status() == QDeclarative1Loader::Ready);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
@@ -480,7 +480,7 @@ void tst_QDeclarativeLoader::networkRequestUrl()
}
/* XXX Component waits until all dependencies are loaded. Is this actually possible?
-void tst_QDeclarativeLoader::networkComponent()
+void tst_QDeclarative1Loader::networkComponent()
{
TestHTTPServer server(SERVER_PORT);
QVERIFY(server.isValid());
@@ -498,20 +498,20 @@ void tst_QDeclarativeLoader::networkComponent()
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
QVERIFY(item);
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(item->QGraphicsObject::children().at(1));
QVERIFY(loader);
- QTRY_VERIFY(loader->status() == QDeclarativeLoader::Ready);
+ QTRY_VERIFY(loader->status() == QDeclarative1Loader::Ready);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
- QCOMPARE(loader->status(), QDeclarativeLoader::Ready);
+ QCOMPARE(loader->status(), QDeclarative1Loader::Ready);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
delete loader;
}
*/
-void tst_QDeclarativeLoader::failNetworkRequest()
+void tst_QDeclarative1Loader::failNetworkRequest()
{
TestHTTPServer server(SERVER_PORT);
QVERIFY(server.isValid());
@@ -521,10 +521,10 @@ void tst_QDeclarativeLoader::failNetworkRequest()
QDeclarativeComponent component(&engine);
component.setData(QByteArray("import QtQuick 1.0\nLoader { property int did_load: 123; source: \"http://127.0.0.1:14450/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml"));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader != 0);
- QTRY_VERIFY(loader->status() == QDeclarativeLoader::Error);
+ QTRY_VERIFY(loader->status() == QDeclarative1Loader::Error);
QVERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
@@ -535,7 +535,7 @@ void tst_QDeclarativeLoader::failNetworkRequest()
}
// QTBUG-9241
-void tst_QDeclarativeLoader::deleteComponentCrash()
+void tst_QDeclarative1Loader::deleteComponentCrash()
{
QDeclarativeComponent component(&engine, TEST_FILE("crash.qml"));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
@@ -543,37 +543,37 @@ void tst_QDeclarativeLoader::deleteComponentCrash()
item->metaObject()->invokeMethod(item, "setLoaderSource");
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(0));
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(item->QGraphicsObject::children().at(0));
QVERIFY(loader);
QVERIFY(loader->item());
QCOMPARE(loader->item()->objectName(), QLatin1String("blue"));
QCOMPARE(loader->progress(), 1.0);
- QCOMPARE(loader->status(), QDeclarativeLoader::Ready);
+ QCOMPARE(loader->status(), QDeclarative1Loader::Ready);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
QVERIFY(loader->source() == QUrl::fromLocalFile(SRCDIR "/data/BlueRect.qml"));
delete item;
}
-void tst_QDeclarativeLoader::nonItem()
+void tst_QDeclarative1Loader::nonItem()
{
QDeclarativeComponent component(&engine, TEST_FILE("nonItem.qml"));
QString err = QUrl::fromLocalFile(SRCDIR).toString() + "/data/nonItem.qml:3:1: QML Loader: Loader does not support loading non-visual elements.";
QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData());
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader);
QVERIFY(loader->item() == 0);
delete loader;
}
-void tst_QDeclarativeLoader::vmeErrors()
+void tst_QDeclarative1Loader::vmeErrors()
{
QDeclarativeComponent component(&engine, TEST_FILE("vmeErrors.qml"));
QString err = QUrl::fromLocalFile(SRCDIR).toString() + "/data/VmeError.qml:6: Cannot assign object type QObject with no default method";
QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData());
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarative1Loader *loader = qobject_cast<QDeclarative1Loader*>(component.create());
QVERIFY(loader);
QVERIFY(loader->item() == 0);
@@ -581,7 +581,7 @@ void tst_QDeclarativeLoader::vmeErrors()
}
// QTBUG-13481
-void tst_QDeclarativeLoader::creationContext()
+void tst_QDeclarative1Loader::creationContext()
{
QDeclarativeComponent component(&engine, TEST_FILE("creationContext.qml"));
@@ -593,7 +593,7 @@ void tst_QDeclarativeLoader::creationContext()
delete o;
}
-void tst_QDeclarativeLoader::QTBUG_16928()
+void tst_QDeclarative1Loader::QTBUG_16928()
{
QDeclarativeComponent component(&engine, TEST_FILE("QTBUG_16928.qml"));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
@@ -605,7 +605,7 @@ void tst_QDeclarativeLoader::QTBUG_16928()
delete item;
}
-void tst_QDeclarativeLoader::implicitSize()
+void tst_QDeclarative1Loader::implicitSize()
{
QDeclarativeComponent component(&engine, TEST_FILE("implicitSize.qml"));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
@@ -620,7 +620,7 @@ void tst_QDeclarativeLoader::implicitSize()
delete item;
}
-void tst_QDeclarativeLoader::QTBUG_17114()
+void tst_QDeclarative1Loader::QTBUG_17114()
{
QDeclarativeComponent component(&engine, TEST_FILE("QTBUG_17114.qml"));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
@@ -632,6 +632,6 @@ void tst_QDeclarativeLoader::QTBUG_17114()
delete item;
}
-QTEST_MAIN(tst_QDeclarativeLoader)
+QTEST_MAIN(tst_QDeclarative1Loader)
#include "tst_qdeclarativeloader.moc"
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/clickandhold.qml
index a6409e2e31..a6409e2e31 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/clickandhold.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/clicktwice.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/clicktwice.qml
index c6b1f8992a..c6b1f8992a 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/clicktwice.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/clicktwice.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/doubleclick.qml
index 55b0812e48..55b0812e48 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/doubleclick.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/dragging.qml
index dd89efb5ab..dd89efb5ab 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/dragging.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/dragproperties.qml
index 7baefd5ded..7baefd5ded 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/dragproperties.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/dragreset.qml
index c6d2e204b2..c6d2e204b2 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/dragreset.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/pressedOrdering.qml
index 4a80e83465..4a80e83465 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/pressedOrdering.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/preventContextMenu.qml
index dcbb5d766e..dcbb5d766e 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/preventContextMenu.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/preventstealing.qml
index 11553fadaf..11553fadaf 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/preventstealing.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/rejectEvent.qml
index fc8292d703..fc8292d703 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/rejectEvent.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/updateMousePosOnClick.qml
index b77f7431c6..b77f7431c6 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/updateMousePosOnClick.qml
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml b/tests/auto/qtquick1/qdeclarativemousearea/data/updateMousePosOnResize.qml
index 6571d8b12d..6571d8b12d 100644
--- a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml
+++ b/tests/auto/qtquick1/qdeclarativemousearea/data/updateMousePosOnResize.qml
diff --git a/tests/auto/qtquick1/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/qtquick1/qdeclarativemousearea/qdeclarativemousearea.pro
new file mode 100644
index 0000000000..bc717ee521
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativemousearea/qdeclarativemousearea.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network qtquick1
+macx:CONFIG -= app_bundle
+
+HEADERS += ../../declarative/shared/testhttpserver.h
+SOURCES += tst_qdeclarativemousearea.cpp ../../declarative/shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/qtquick1/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
index 7548ee0e9c..a84071045a 100644
--- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
+++ b/tests/auto/qtquick1/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
@@ -41,10 +41,10 @@
#include <QtTest/QtTest>
#include <QtTest/QSignalSpy>
-#include <private/qdeclarativemousearea_p.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativeflickable_p.h>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativemousearea_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativeflickable_p.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativeproperty.h>
@@ -54,7 +54,7 @@
#define SRCDIR "."
#endif
-class tst_QDeclarativeMouseArea: public QObject
+class tst_QDeclarative1MouseArea: public QObject
{
Q_OBJECT
private slots:
@@ -79,7 +79,7 @@ private:
QDeclarativeView *createView();
};
-void tst_QDeclarativeMouseArea::dragProperties()
+void tst_QDeclarative1MouseArea::dragProperties()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragproperties.qml"));
@@ -87,8 +87,8 @@ void tst_QDeclarativeMouseArea::dragProperties()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
- QDeclarativeDrag *drag = mouseRegion->drag();
+ QDeclarative1MouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarative1MouseArea*>("mouseregion");
+ QDeclarative1Drag *drag = mouseRegion->drag();
QVERIFY(mouseRegion != 0);
QVERIFY(drag != 0);
@@ -105,12 +105,12 @@ void tst_QDeclarativeMouseArea::dragProperties()
QCOMPARE(targetSpy.count(),1);
// axis
- QCOMPARE(drag->axis(), QDeclarativeDrag::XandYAxis);
+ QCOMPARE(drag->axis(), QDeclarative1Drag::XandYAxis);
QSignalSpy axisSpy(drag, SIGNAL(axisChanged()));
- drag->setAxis(QDeclarativeDrag::XAxis);
- QCOMPARE(drag->axis(), QDeclarativeDrag::XAxis);
+ drag->setAxis(QDeclarative1Drag::XAxis);
+ QCOMPARE(drag->axis(), QDeclarative1Drag::XAxis);
QCOMPARE(axisSpy.count(),1);
- drag->setAxis(QDeclarativeDrag::XAxis);
+ drag->setAxis(QDeclarative1Drag::XAxis);
QCOMPARE(axisSpy.count(),1);
// minimum and maximum properties
@@ -163,7 +163,7 @@ void tst_QDeclarativeMouseArea::dragProperties()
delete canvas;
}
-void tst_QDeclarativeMouseArea::resetDrag()
+void tst_QDeclarative1MouseArea::resetDrag()
{
QDeclarativeView *canvas = createView();
@@ -173,8 +173,8 @@ void tst_QDeclarativeMouseArea::resetDrag()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
- QDeclarativeDrag *drag = mouseRegion->drag();
+ QDeclarative1MouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarative1MouseArea*>("mouseregion");
+ QDeclarative1Drag *drag = mouseRegion->drag();
QVERIFY(mouseRegion != 0);
QVERIFY(drag != 0);
@@ -194,7 +194,7 @@ void tst_QDeclarativeMouseArea::resetDrag()
}
-void tst_QDeclarativeMouseArea::dragging()
+void tst_QDeclarative1MouseArea::dragging()
{
QDeclarativeView *canvas = createView();
@@ -203,8 +203,8 @@ void tst_QDeclarativeMouseArea::dragging()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
- QDeclarativeDrag *drag = mouseRegion->drag();
+ QDeclarative1MouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarative1MouseArea*>("mouseregion");
+ QDeclarative1Drag *drag = mouseRegion->drag();
QVERIFY(mouseRegion != 0);
QVERIFY(drag != 0);
@@ -256,7 +256,7 @@ void tst_QDeclarativeMouseArea::dragging()
delete canvas;
}
-QDeclarativeView *tst_QDeclarativeMouseArea::createView()
+QDeclarativeView *tst_QDeclarative1MouseArea::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
@@ -264,7 +264,7 @@ QDeclarativeView *tst_QDeclarativeMouseArea::createView()
return canvas;
}
-void tst_QDeclarativeMouseArea::updateMouseAreaPosOnClick()
+void tst_QDeclarative1MouseArea::updateMouseAreaPosOnClick()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/updateMousePosOnClick.qml"));
@@ -272,10 +272,10 @@ void tst_QDeclarativeMouseArea::updateMouseAreaPosOnClick()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
+ QDeclarative1MouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarative1MouseArea*>("mouseregion");
QVERIFY(mouseRegion != 0);
- QDeclarativeRectangle *rect = canvas->rootObject()->findChild<QDeclarativeRectangle*>("ball");
+ QDeclarative1Rectangle *rect = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("ball");
QVERIFY(rect != 0);
QCOMPARE(mouseRegion->mouseX(), rect->x());
@@ -297,7 +297,7 @@ void tst_QDeclarativeMouseArea::updateMouseAreaPosOnClick()
delete canvas;
}
-void tst_QDeclarativeMouseArea::updateMouseAreaPosOnResize()
+void tst_QDeclarative1MouseArea::updateMouseAreaPosOnResize()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/updateMousePosOnResize.qml"));
@@ -305,10 +305,10 @@ void tst_QDeclarativeMouseArea::updateMouseAreaPosOnResize()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
+ QDeclarative1MouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarative1MouseArea*>("mouseregion");
QVERIFY(mouseRegion != 0);
- QDeclarativeRectangle *rect = canvas->rootObject()->findChild<QDeclarativeRectangle*>("brother");
+ QDeclarative1Rectangle *rect = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("brother");
QVERIFY(rect != 0);
QCOMPARE(mouseRegion->mouseX(), 0.0);
@@ -337,7 +337,7 @@ void tst_QDeclarativeMouseArea::updateMouseAreaPosOnResize()
delete canvas;
}
-void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold()
+void tst_QDeclarative1MouseArea::noOnClickedWithPressAndHold()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/clickandhold.qml"));
@@ -369,7 +369,7 @@ void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold()
delete canvas;
}
-void tst_QDeclarativeMouseArea::onMousePressRejected()
+void tst_QDeclarative1MouseArea::onMousePressRejected()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/rejectEvent.qml"));
@@ -414,7 +414,7 @@ void tst_QDeclarativeMouseArea::onMousePressRejected()
delete canvas;
}
-void tst_QDeclarativeMouseArea::doubleClick()
+void tst_QDeclarative1MouseArea::doubleClick()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/doubleclick.qml"));
@@ -453,7 +453,7 @@ void tst_QDeclarativeMouseArea::doubleClick()
}
// QTBUG-14832
-void tst_QDeclarativeMouseArea::clickTwice()
+void tst_QDeclarative1MouseArea::clickTwice()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/clicktwice.qml"));
@@ -494,7 +494,7 @@ void tst_QDeclarativeMouseArea::clickTwice()
delete canvas;
}
-void tst_QDeclarativeMouseArea::pressedOrdering()
+void tst_QDeclarative1MouseArea::pressedOrdering()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pressedOrdering.qml"));
@@ -528,7 +528,7 @@ void tst_QDeclarativeMouseArea::pressedOrdering()
delete canvas;
}
-void tst_QDeclarativeMouseArea::preventStealing()
+void tst_QDeclarative1MouseArea::preventStealing()
{
QDeclarativeView *canvas = createView();
@@ -537,13 +537,13 @@ void tst_QDeclarativeMouseArea::preventStealing()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QDeclarative1Flickable *flickable = qobject_cast<QDeclarative1Flickable*>(canvas->rootObject());
QVERIFY(flickable != 0);
- QDeclarativeMouseArea *mouseArea = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mousearea");
+ QDeclarative1MouseArea *mouseArea = canvas->rootObject()->findChild<QDeclarative1MouseArea*>("mousearea");
QVERIFY(mouseArea != 0);
- QSignalSpy mousePositionSpy(mouseArea, SIGNAL(positionChanged(QDeclarativeMouseEvent*)));
+ QSignalSpy mousePositionSpy(mouseArea, SIGNAL(positionChanged(QDeclarative1MouseEvent*)));
QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(80, 80)));
@@ -606,7 +606,7 @@ void tst_QDeclarativeMouseArea::preventStealing()
delete canvas;
}
-void tst_QDeclarativeMouseArea::testQtQuick11Attributes()
+void tst_QDeclarative1MouseArea::testQtQuick11Attributes()
{
QFETCH(QString, code);
QFETCH(QString, warning);
@@ -630,7 +630,7 @@ void tst_QDeclarativeMouseArea::testQtQuick11Attributes()
delete obj;
}
-void tst_QDeclarativeMouseArea::testQtQuick11Attributes_data()
+void tst_QDeclarative1MouseArea::testQtQuick11Attributes_data()
{
QTest::addColumn<QString>("code");
QTest::addColumn<QString>("warning");
@@ -662,7 +662,7 @@ private:
int m_eventCount;
};
-void tst_QDeclarativeMouseArea::preventContextMenu()
+void tst_QDeclarative1MouseArea::preventContextMenu()
{
// A MouseArea accepting Left, Middle and Right buttons should prevent context menu
// events with "Mouse" reason to hit the Item below.
@@ -700,6 +700,6 @@ void tst_QDeclarativeMouseArea::preventContextMenu()
}
#endif // QT_NO_CONTEXTMENU
-QTEST_MAIN(tst_QDeclarativeMouseArea)
+QTEST_MAIN(tst_QDeclarative1MouseArea)
#include "tst_qdeclarativemousearea.moc"
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particle.png b/tests/auto/qtquick1/qdeclarativeparticles/data/particle.png
index defbde53ca..defbde53ca 100644
--- a/tests/auto/declarative/qdeclarativeparticles/data/particle.png
+++ b/tests/auto/qtquick1/qdeclarativeparticles/data/particle.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml b/tests/auto/qtquick1/qdeclarativeparticles/data/particlemotiontest.qml
index dad97465b5..dad97465b5 100644
--- a/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml
+++ b/tests/auto/qtquick1/qdeclarativeparticles/data/particlemotiontest.qml
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml b/tests/auto/qtquick1/qdeclarativeparticles/data/particlestest.qml
index c76fe9b8fc..c76fe9b8fc 100644
--- a/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml
+++ b/tests/auto/qtquick1/qdeclarativeparticles/data/particlestest.qml
diff --git a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro b/tests/auto/qtquick1/qdeclarativeparticles/qdeclarativeparticles.pro
index 57bd1163cc..44bc1a9b30 100644
--- a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
+++ b/tests/auto/qtquick1/qdeclarativeparticles/qdeclarativeparticles.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeparticles.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1
diff --git a/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp b/tests/auto/qtquick1/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
index a724ac678e..a321c284c4 100644
--- a/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
+++ b/tests/auto/qtquick1/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <QtTest/QtTest>
#include <QtTest/QSignalSpy>
-#include <qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <QGraphicsObject>
#ifdef Q_OS_SYMBIAN
diff --git a/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml b/tests/auto/qtquick1/qdeclarativepathview/data/closedPath.qml
index 08b0d2a203..08b0d2a203 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/closedPath.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml b/tests/auto/qtquick1/qdeclarativepathview/data/datamodel.qml
index e2c4e3dd00..e2c4e3dd00 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/datamodel.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml b/tests/auto/qtquick1/qdeclarativepathview/data/displaypath.qml
index 88dfc57b72..88dfc57b72 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/displaypath.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml b/tests/auto/qtquick1/qdeclarativepathview/data/dragpath.qml
index 0f9484083e..0f9484083e 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/dragpath.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml b/tests/auto/qtquick1/qdeclarativepathview/data/emptymodel.qml
index 4deb45fdb3..4deb45fdb3 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/emptymodel.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/openPath.qml b/tests/auto/qtquick1/qdeclarativepathview/data/openPath.qml
index 328e3cdefb..328e3cdefb 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/openPath.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/openPath.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathUpdate.qml
index 0c2ac0ce98..0c2ac0ce98 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathUpdate.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathUpdateOnStartChanged.qml
index bd732ab17b..bd732ab17b 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathUpdateOnStartChanged.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathtest.qml
index b13c00662e..b13c00662e 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathtest.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathview0.qml
index 28b6fb9a72..28b6fb9a72 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathview0.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathview1.qml
index d1ac5171db..d1ac5171db 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathview1.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathview2.qml
index 1e1e893a9c..1e1e893a9c 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathview2.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathview3.qml
index cd1ba0375d..cd1ba0375d 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathview3.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml b/tests/auto/qtquick1/qdeclarativepathview/data/pathview_package.qml
index f9157bddeb..f9157bddeb 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/pathview_package.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml b/tests/auto/qtquick1/qdeclarativepathview/data/propertychanges.qml
index c0cc8555e7..c0cc8555e7 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/propertychanges.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/treemodel.qml b/tests/auto/qtquick1/qdeclarativepathview/data/treemodel.qml
index 56f7ae46da..56f7ae46da 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/treemodel.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/treemodel.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml b/tests/auto/qtquick1/qdeclarativepathview/data/undefinedpath.qml
index 5a647cb079..5a647cb079 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/undefinedpath.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/data/vdm.qml b/tests/auto/qtquick1/qdeclarativepathview/data/vdm.qml
index 012db3fb57..012db3fb57 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/vdm.qml
+++ b/tests/auto/qtquick1/qdeclarativepathview/data/vdm.qml
diff --git a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro b/tests/auto/qtquick1/qdeclarativepathview/qdeclarativepathview.pro
index 8c5ef972a6..251277ef57 100644
--- a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
+++ b/tests/auto/qtquick1/qdeclarativepathview/qdeclarativepathview.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativepathview.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/qtquick1/qdeclarativepathview/tst_qdeclarativepathview.cpp
index 2d91b53ebb..194d42130d 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/qtquick1/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -40,16 +40,15 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
-#include <QtDeclarative/private/qdeclarativepathview_p.h>
-#include <QtDeclarative/private/qdeclarativepath_p.h>
-#include <QtDeclarative/private/qdeclarativetext_p.h>
-#include <QtDeclarative/private/qdeclarativerectangle_p.h>
-#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
+#include <QtQuick1/private/qdeclarativepathview_p.h>
+#include <QtQuick1/private/qdeclarativepath_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
#include <QtDeclarative/private/qdeclarativevaluetype_p.h>
#include <QAbstractListModel>
#include <QStringListModel>
@@ -82,11 +81,11 @@ static void initStandardTreeModel(QStandardItemModel *model)
}
-class tst_QDeclarativePathView : public QObject
+class tst_QDeclarative1PathView : public QObject
{
Q_OBJECT
public:
- tst_QDeclarativePathView();
+ tst_QDeclarative1PathView();
private slots:
void initValues();
@@ -212,15 +211,15 @@ private:
};
-tst_QDeclarativePathView::tst_QDeclarativePathView()
+tst_QDeclarative1PathView::tst_QDeclarative1PathView()
{
}
-void tst_QDeclarativePathView::initValues()
+void tst_QDeclarative1PathView::initValues()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathview1.qml"));
- QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QDeclarative1PathView *obj = qobject_cast<QDeclarative1PathView*>(c.create());
QVERIFY(obj != 0);
QVERIFY(obj->path() == 0);
@@ -234,7 +233,7 @@ void tst_QDeclarativePathView::initValues()
QCOMPARE(obj->pathItemCount(), -1);
}
-void tst_QDeclarativePathView::items()
+void tst_QDeclarative1PathView::items()
{
QDeclarativeView *canvas = createView();
@@ -250,7 +249,7 @@ void tst_QDeclarativePathView::items()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml"));
qApp->processEvents();
- QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QDeclarative1PathView *pathview = findItem<QDeclarative1PathView>(canvas->rootObject(), "view");
QVERIFY(pathview != 0);
QCOMPARE(pathview->count(), model.count());
@@ -258,15 +257,15 @@ void tst_QDeclarativePathView::items()
QCOMPARE(pathview->childItems().count(), model.count()+1); // assumes all are visible, including highlight
for (int i = 0; i < model.count(); ++i) {
- QDeclarativeText *name = findItem<QDeclarativeText>(pathview, "textName", i);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(pathview, "textName", i);
QVERIFY(name != 0);
QCOMPARE(name->text(), model.name(i));
- QDeclarativeText *number = findItem<QDeclarativeText>(pathview, "textNumber", i);
+ QDeclarative1Text *number = findItem<QDeclarative1Text>(pathview, "textNumber", i);
QVERIFY(number != 0);
QCOMPARE(number->text(), model.number(i));
}
- QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QDeclarative1Path *path = qobject_cast<QDeclarative1Path*>(pathview->path());
QVERIFY(path);
QVERIFY(pathview->highlightItem());
@@ -279,11 +278,11 @@ void tst_QDeclarativePathView::items()
delete canvas;
}
-void tst_QDeclarativePathView::pathview2()
+void tst_QDeclarative1PathView::pathview2()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathview2.qml"));
- QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QDeclarative1PathView *obj = qobject_cast<QDeclarative1PathView*>(c.create());
QVERIFY(obj != 0);
QVERIFY(obj->path() != 0);
@@ -297,11 +296,11 @@ void tst_QDeclarativePathView::pathview2()
QCOMPARE(obj->pathItemCount(), 10);
}
-void tst_QDeclarativePathView::pathview3()
+void tst_QDeclarative1PathView::pathview3()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathview3.qml"));
- QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QDeclarative1PathView *obj = qobject_cast<QDeclarative1PathView*>(c.create());
QVERIFY(obj != 0);
QVERIFY(obj->path() != 0);
@@ -315,11 +314,11 @@ void tst_QDeclarativePathView::pathview3()
QCOMPARE(obj->pathItemCount(), 4);
}
-void tst_QDeclarativePathView::path()
+void tst_QDeclarative1PathView::path()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathtest.qml"));
- QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create());
+ QDeclarative1Path *obj = qobject_cast<QDeclarative1Path*>(c.create());
QVERIFY(obj != 0);
QCOMPARE(obj->startX(), 120.);
@@ -329,28 +328,28 @@ void tst_QDeclarativePathView::path()
QDeclarativeListReference list(obj, "pathElements");
QCOMPARE(list.count(), 5);
- QDeclarativePathAttribute* attr = qobject_cast<QDeclarativePathAttribute*>(list.at(0));
+ QDeclarative1PathAttribute* attr = qobject_cast<QDeclarative1PathAttribute*>(list.at(0));
QVERIFY(attr != 0);
QCOMPARE(attr->name(), QString("scale"));
QCOMPARE(attr->value(), 1.0);
- QDeclarativePathQuad* quad = qobject_cast<QDeclarativePathQuad*>(list.at(1));
+ QDeclarative1PathQuad* quad = qobject_cast<QDeclarative1PathQuad*>(list.at(1));
QVERIFY(quad != 0);
QCOMPARE(quad->x(), 120.);
QCOMPARE(quad->y(), 25.);
QCOMPARE(quad->controlX(), 260.);
QCOMPARE(quad->controlY(), 75.);
- QDeclarativePathPercent* perc = qobject_cast<QDeclarativePathPercent*>(list.at(2));
+ QDeclarative1PathPercent* perc = qobject_cast<QDeclarative1PathPercent*>(list.at(2));
QVERIFY(perc != 0);
QCOMPARE(perc->value(), 0.3);
- QDeclarativePathLine* line = qobject_cast<QDeclarativePathLine*>(list.at(3));
+ QDeclarative1PathLine* line = qobject_cast<QDeclarative1PathLine*>(list.at(3));
QVERIFY(line != 0);
QCOMPARE(line->x(), 120.);
QCOMPARE(line->y(), 100.);
- QDeclarativePathCubic* cubic = qobject_cast<QDeclarativePathCubic*>(list.at(4));
+ QDeclarative1PathCubic* cubic = qobject_cast<QDeclarative1PathCubic*>(list.at(4));
QVERIFY(cubic != 0);
QCOMPARE(cubic->x(), 180.);
QCOMPARE(cubic->y(), 0.);
@@ -360,7 +359,7 @@ void tst_QDeclarativePathView::path()
QCOMPARE(cubic->control2Y(), 90.);
}
-void tst_QDeclarativePathView::dataModel()
+void tst_QDeclarative1PathView::dataModel()
{
QDeclarativeView *canvas = createView();
@@ -388,7 +387,7 @@ void tst_QDeclarativePathView::dataModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/datamodel.qml"));
qApp->processEvents();
- QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QDeclarative1PathView *pathview = qobject_cast<QDeclarative1PathView*>(canvas->rootObject());
QVERIFY(pathview != 0);
QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
@@ -407,13 +406,13 @@ void tst_QDeclarativePathView::dataModel()
QVERIFY(pathview->currentIndex() == 0);
- QDeclarativeText *text = findItem<QDeclarativeText>(pathview, "myText", 4);
+ QDeclarative1Text *text = findItem<QDeclarative1Text>(pathview, "myText", 4);
QVERIFY(text);
QCOMPARE(text->text(), model.name(4));
model.removeItem(2);
QCOMPARE(canvas->rootObject()->property("viewCount").toInt(), model.count());
- text = findItem<QDeclarativeText>(pathview, "myText", 2);
+ text = findItem<QDeclarative1Text>(pathview, "myText", 2);
QVERIFY(text);
QCOMPARE(text->text(), model.name(2));
@@ -423,9 +422,9 @@ void tst_QDeclarativePathView::dataModel()
QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
- QDeclarativeRectangle *testItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 4);
+ QDeclarative1Rectangle *testItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 4);
QVERIFY(testItem != 0);
- testItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 5);
+ testItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 5);
QVERIFY(testItem == 0);
pathview->setCurrentIndex(1);
@@ -436,13 +435,13 @@ void tst_QDeclarativePathView::dataModel()
QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
QVERIFY(pathview->currentIndex() == 1);
- text = findItem<QDeclarativeText>(pathview, "myText", 2);
+ text = findItem<QDeclarative1Text>(pathview, "myText", 2);
QVERIFY(text);
QCOMPARE(text->text(), model.name(2));
model.removeItem(3);
QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
- text = findItem<QDeclarativeText>(pathview, "myText", 3);
+ text = findItem<QDeclarative1Text>(pathview, "myText", 3);
QVERIFY(text);
QCOMPARE(text->text(), model.name(3));
@@ -476,7 +475,7 @@ void tst_QDeclarativePathView::dataModel()
delete testObject;
}
-void tst_QDeclarativePathView::pathMoved()
+void tst_QDeclarative1PathView::pathMoved()
{
QDeclarativeView *canvas = createView();
@@ -492,12 +491,12 @@ void tst_QDeclarativePathView::pathMoved()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml"));
qApp->processEvents();
- QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QDeclarative1PathView *pathview = findItem<QDeclarative1PathView>(canvas->rootObject(), "view");
QVERIFY(pathview != 0);
- QDeclarativeRectangle *firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QDeclarative1Rectangle *firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 0);
QVERIFY(firstItem);
- QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QDeclarative1Path *path = qobject_cast<QDeclarative1Path*>(pathview->path());
QVERIFY(path);
QPointF start = path->pointAt(0.0);
QPointF offset;//Center of item is at point, but pos is from corner
@@ -507,7 +506,7 @@ void tst_QDeclarativePathView::pathMoved()
pathview->setOffset(1.0);
for(int i=0; i<model.count(); i++){
- QDeclarativeRectangle *curItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", i);
+ QDeclarative1Rectangle *curItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", i);
QPointF itemPos(path->pointAt(0.25 + i*0.25));
QCOMPARE(curItem->pos() + offset, QPointF(qRound(itemPos.x()), qRound(itemPos.y())));
}
@@ -532,7 +531,7 @@ void tst_QDeclarativePathView::pathMoved()
delete canvas;
}
-void tst_QDeclarativePathView::setCurrentIndex()
+void tst_QDeclarative1PathView::setCurrentIndex()
{
QDeclarativeView *canvas = createView();
@@ -548,12 +547,12 @@ void tst_QDeclarativePathView::setCurrentIndex()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml"));
qApp->processEvents();
- QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QDeclarative1PathView *pathview = findItem<QDeclarative1PathView>(canvas->rootObject(), "view");
QVERIFY(pathview != 0);
- QDeclarativeRectangle *firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QDeclarative1Rectangle *firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 0);
QVERIFY(firstItem);
- QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QDeclarative1Path *path = qobject_cast<QDeclarative1Path*>(pathview->path());
QVERIFY(path);
QPointF start = path->pointAt(0.0);
QPointF offset;//Center of item is at point, but pos is from corner
@@ -565,39 +564,39 @@ void tst_QDeclarativePathView::setCurrentIndex()
pathview->setCurrentIndex(2);
- firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 2);
+ firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 2);
QTRY_COMPARE(firstItem->pos() + offset, start);
QCOMPARE(canvas->rootObject()->property("currentA").toInt(), 2);
QCOMPARE(canvas->rootObject()->property("currentB").toInt(), 2);
pathview->decrementCurrentIndex();
QTRY_COMPARE(pathview->currentIndex(), 1);
- firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 1);
+ firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 1);
QVERIFY(firstItem);
QTRY_COMPARE(firstItem->pos() + offset, start);
pathview->decrementCurrentIndex();
QTRY_COMPARE(pathview->currentIndex(), 0);
- firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 0);
QVERIFY(firstItem);
QTRY_COMPARE(firstItem->pos() + offset, start);
pathview->decrementCurrentIndex();
QTRY_COMPARE(pathview->currentIndex(), 3);
- firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 3);
+ firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 3);
QVERIFY(firstItem);
QTRY_COMPARE(firstItem->pos() + offset, start);
pathview->incrementCurrentIndex();
QTRY_COMPARE(pathview->currentIndex(), 0);
- firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 0);
QVERIFY(firstItem);
QTRY_COMPARE(firstItem->pos() + offset, start);
delete canvas;
}
-void tst_QDeclarativePathView::resetModel()
+void tst_QDeclarative1PathView::resetModel()
{
QDeclarativeView *canvas = createView();
@@ -611,13 +610,13 @@ void tst_QDeclarativePathView::resetModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaypath.qml"));
qApp->processEvents();
- QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QDeclarative1PathView *pathview = findItem<QDeclarative1PathView>(canvas->rootObject(), "view");
QVERIFY(pathview != 0);
QCOMPARE(pathview->count(), model.rowCount());
for (int i = 0; i < model.rowCount(); ++i) {
- QDeclarativeText *display = findItem<QDeclarativeText>(pathview, "displayText", i);
+ QDeclarative1Text *display = findItem<QDeclarative1Text>(pathview, "displayText", i);
QVERIFY(display != 0);
QCOMPARE(display->text(), strings.at(i));
}
@@ -629,7 +628,7 @@ void tst_QDeclarativePathView::resetModel()
QCOMPARE(pathview->count(), model.rowCount());
for (int i = 0; i < model.rowCount(); ++i) {
- QDeclarativeText *display = findItem<QDeclarativeText>(pathview, "displayText", i);
+ QDeclarative1Text *display = findItem<QDeclarative1Text>(pathview, "displayText", i);
QVERIFY(display != 0);
QCOMPARE(display->text(), strings.at(i));
}
@@ -637,13 +636,13 @@ void tst_QDeclarativePathView::resetModel()
delete canvas;
}
-void tst_QDeclarativePathView::propertyChanges()
+void tst_QDeclarative1PathView::propertyChanges()
{
QDeclarativeView *canvas = createView();
QVERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
- QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QDeclarative1PathView *pathView = canvas->rootObject()->findChild<QDeclarative1PathView*>("pathView");
QVERIFY(pathView);
QSignalSpy snapPositionSpy(pathView, SIGNAL(preferredHighlightBeginChanged()));
@@ -672,16 +671,16 @@ void tst_QDeclarativePathView::propertyChanges()
delete canvas;
}
-void tst_QDeclarativePathView::pathChanges()
+void tst_QDeclarative1PathView::pathChanges()
{
QDeclarativeView *canvas = createView();
QVERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
- QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QDeclarative1PathView *pathView = canvas->rootObject()->findChild<QDeclarative1PathView*>("pathView");
QVERIFY(pathView);
- QDeclarativePath *path = canvas->rootObject()->findChild<QDeclarativePath*>("path");
+ QDeclarative1Path *path = canvas->rootObject()->findChild<QDeclarative1Path*>("path");
QVERIFY(path);
QSignalSpy startXSpy(path, SIGNAL(startXChanged()));
@@ -705,7 +704,7 @@ void tst_QDeclarativePathView::pathChanges()
QCOMPARE(startXSpy.count(),1);
QCOMPARE(startYSpy.count(),1);
- QDeclarativePath *alternatePath = canvas->rootObject()->findChild<QDeclarativePath*>("alternatePath");
+ QDeclarative1Path *alternatePath = canvas->rootObject()->findChild<QDeclarative1Path*>("alternatePath");
QVERIFY(alternatePath);
QSignalSpy pathSpy(pathView, SIGNAL(pathChanged()));
@@ -719,7 +718,7 @@ void tst_QDeclarativePathView::pathChanges()
pathView->setPath(alternatePath);
QCOMPARE(pathSpy.count(),1);
- QDeclarativePathAttribute *pathAttribute = canvas->rootObject()->findChild<QDeclarativePathAttribute*>("pathAttribute");
+ QDeclarative1PathAttribute *pathAttribute = canvas->rootObject()->findChild<QDeclarative1PathAttribute*>("pathAttribute");
QVERIFY(pathAttribute);
QSignalSpy nameSpy(pathAttribute, SIGNAL(nameChanged()));
@@ -734,13 +733,13 @@ void tst_QDeclarativePathView::pathChanges()
delete canvas;
}
-void tst_QDeclarativePathView::componentChanges()
+void tst_QDeclarative1PathView::componentChanges()
{
QDeclarativeView *canvas = createView();
QVERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
- QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QDeclarative1PathView *pathView = canvas->rootObject()->findChild<QDeclarative1PathView*>("pathView");
QVERIFY(pathView);
QDeclarativeComponent delegateComponent(canvas->engine());
@@ -757,16 +756,17 @@ void tst_QDeclarativePathView::componentChanges()
delete canvas;
}
-void tst_QDeclarativePathView::modelChanges()
+void tst_QDeclarative1PathView::modelChanges()
{
QDeclarativeView *canvas = createView();
QVERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
- QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QDeclarative1PathView *pathView = canvas->rootObject()->findChild<QDeclarative1PathView*>("pathView");
QVERIFY(pathView);
- QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel");
+// QDeclarative1ListModel *alternateModel = canvas->rootObject()->findChild<QDeclarative1ListModel*>("alternateModel");
+ QObject *alternateModel = canvas->rootObject()->findChild<QObject*>("alternateModel");
QVERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue(alternateModel);
QSignalSpy modelSpy(pathView, SIGNAL(modelChanged()));
@@ -784,16 +784,16 @@ void tst_QDeclarativePathView::modelChanges()
delete canvas;
}
-void tst_QDeclarativePathView::pathUpdateOnStartChanged()
+void tst_QDeclarative1PathView::pathUpdateOnStartChanged()
{
QDeclarativeView *canvas = createView();
QVERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdateOnStartChanged.qml"));
- QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QDeclarative1PathView *pathView = canvas->rootObject()->findChild<QDeclarative1PathView*>("pathView");
QVERIFY(pathView);
- QDeclarativePath *path = canvas->rootObject()->findChild<QDeclarativePath*>("path");
+ QDeclarative1Path *path = canvas->rootObject()->findChild<QDeclarative1Path*>("path");
QVERIFY(path);
QCOMPARE(path->startX(), 400.0);
QCOMPARE(path->startY(), 300.0);
@@ -806,13 +806,13 @@ void tst_QDeclarativePathView::pathUpdateOnStartChanged()
delete canvas;
}
-void tst_QDeclarativePathView::package()
+void tst_QDeclarative1PathView::package()
{
QDeclarativeView *canvas = createView();
QVERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview_package.qml"));
- QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("photoPathView");
+ QDeclarative1PathView *pathView = canvas->rootObject()->findChild<QDeclarative1PathView*>("photoPathView");
QVERIFY(pathView);
QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "pathItem");
@@ -823,7 +823,7 @@ void tst_QDeclarativePathView::package()
}
//QTBUG-13017
-void tst_QDeclarativePathView::emptyModel()
+void tst_QDeclarative1PathView::emptyModel()
{
QDeclarativeView *canvas = createView();
@@ -835,7 +835,7 @@ void tst_QDeclarativePathView::emptyModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/emptymodel.qml"));
qApp->processEvents();
- QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QDeclarative1PathView *pathview = qobject_cast<QDeclarative1PathView*>(canvas->rootObject());
QVERIFY(pathview != 0);
QCOMPARE(pathview->offset(), qreal(0.0));
@@ -843,13 +843,13 @@ void tst_QDeclarativePathView::emptyModel()
delete canvas;
}
-void tst_QDeclarativePathView::closed()
+void tst_QDeclarative1PathView::closed()
{
QDeclarativeEngine engine;
{
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/openPath.qml"));
- QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create());
+ QDeclarative1Path *obj = qobject_cast<QDeclarative1Path*>(c.create());
QVERIFY(obj);
QCOMPARE(obj->isClosed(), false);
delete obj;
@@ -857,7 +857,7 @@ void tst_QDeclarativePathView::closed()
{
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/closedPath.qml"));
- QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create());
+ QDeclarative1Path *obj = qobject_cast<QDeclarative1Path*>(c.create());
QVERIFY(obj);
QCOMPARE(obj->isClosed(), true);
delete obj;
@@ -865,13 +865,13 @@ void tst_QDeclarativePathView::closed()
}
// QTBUG-14239
-void tst_QDeclarativePathView::pathUpdate()
+void tst_QDeclarative1PathView::pathUpdate()
{
QDeclarativeView *canvas = createView();
QVERIFY(canvas);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdate.qml"));
- QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QDeclarative1PathView *pathView = canvas->rootObject()->findChild<QDeclarative1PathView*>("pathView");
QVERIFY(pathView);
QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "wrapper", 0);
@@ -881,12 +881,12 @@ void tst_QDeclarativePathView::pathUpdate()
delete canvas;
}
-void tst_QDeclarativePathView::visualDataModel()
+void tst_QDeclarative1PathView::visualDataModel()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/vdm.qml"));
- QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QDeclarative1PathView *obj = qobject_cast<QDeclarative1PathView*>(c.create());
QVERIFY(obj != 0);
QCOMPARE(obj->count(), 3);
@@ -894,12 +894,12 @@ void tst_QDeclarativePathView::visualDataModel()
delete obj;
}
-void tst_QDeclarativePathView::undefinedPath()
+void tst_QDeclarative1PathView::undefinedPath()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/undefinedpath.qml"));
- QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QDeclarative1PathView *obj = qobject_cast<QDeclarative1PathView*>(c.create());
QVERIFY(obj != 0);
QCOMPARE(obj->count(), 3);
@@ -907,7 +907,7 @@ void tst_QDeclarativePathView::undefinedPath()
delete obj;
}
-void tst_QDeclarativePathView::mouseDrag()
+void tst_QDeclarative1PathView::mouseDrag()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragpath.qml"));
@@ -916,7 +916,7 @@ void tst_QDeclarativePathView::mouseDrag()
QTest::qWaitForWindowShown(canvas);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
- QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QDeclarative1PathView *pathview = qobject_cast<QDeclarative1PathView*>(canvas->rootObject());
QVERIFY(pathview != 0);
int current = pathview->currentIndex();
@@ -939,7 +939,7 @@ void tst_QDeclarativePathView::mouseDrag()
delete canvas;
}
-void tst_QDeclarativePathView::treeModel()
+void tst_QDeclarative1PathView::treeModel()
{
QDeclarativeView *canvas = createView();
@@ -949,24 +949,24 @@ void tst_QDeclarativePathView::treeModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/treemodel.qml"));
- QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QDeclarative1PathView *pathview = qobject_cast<QDeclarative1PathView*>(canvas->rootObject());
QVERIFY(pathview != 0);
QCOMPARE(pathview->count(), 3);
- QDeclarativeText *item = findItem<QDeclarativeText>(pathview, "wrapper", 0);
+ QDeclarative1Text *item = findItem<QDeclarative1Text>(pathview, "wrapper", 0);
QVERIFY(item);
QCOMPARE(item->text(), QLatin1String("Row 1 Item"));
QVERIFY(QMetaObject::invokeMethod(pathview, "setRoot", Q_ARG(QVariant, 1)));
QCOMPARE(pathview->count(), 1);
- QTRY_VERIFY(item = findItem<QDeclarativeText>(pathview, "wrapper", 0));
+ QTRY_VERIFY(item = findItem<QDeclarative1Text>(pathview, "wrapper", 0));
QTRY_COMPARE(item->text(), QLatin1String("Row 2 Child Item"));
delete canvas;
}
-void tst_QDeclarativePathView::changePreferredHighlight()
+void tst_QDeclarative1PathView::changePreferredHighlight()
{
QDeclarativeView *canvas = createView();
canvas->setFixedSize(400,200);
@@ -976,15 +976,15 @@ void tst_QDeclarativePathView::changePreferredHighlight()
QTest::qWaitForWindowShown(canvas);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
- QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QDeclarative1PathView *pathview = qobject_cast<QDeclarative1PathView*>(canvas->rootObject());
QVERIFY(pathview != 0);
int current = pathview->currentIndex();
QCOMPARE(current, 0);
- QDeclarativeRectangle *firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QDeclarative1Rectangle *firstItem = findItem<QDeclarative1Rectangle>(pathview, "wrapper", 0);
QVERIFY(firstItem);
- QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QDeclarative1Path *path = qobject_cast<QDeclarative1Path*>(pathview->path());
QVERIFY(path);
QPointF start = path->pointAt(0.5);
start.setX(qRound(start.x()));
@@ -1005,7 +1005,7 @@ void tst_QDeclarativePathView::changePreferredHighlight()
delete canvas;
}
-QDeclarativeView *tst_QDeclarativePathView::createView()
+QDeclarativeView *tst_QDeclarative1PathView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
@@ -1018,7 +1018,7 @@ QDeclarativeView *tst_QDeclarativePathView::createView()
item must also evaluate the {index} expression equal to index
*/
template<typename T>
-T *tst_QDeclarativePathView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+T *tst_QDeclarative1PathView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
{
const QMetaObject &mo = T::staticMetaObject;
//qDebug() << parent->childItems().count() << "children";
@@ -1045,7 +1045,7 @@ T *tst_QDeclarativePathView::findItem(QGraphicsObject *parent, const QString &ob
}
template<typename T>
-QList<T*> tst_QDeclarativePathView::findItems(QGraphicsObject *parent, const QString &objectName)
+QList<T*> tst_QDeclarative1PathView::findItems(QGraphicsObject *parent, const QString &objectName)
{
QList<T*> items;
const QMetaObject &mo = T::staticMetaObject;
@@ -1063,6 +1063,6 @@ QList<T*> tst_QDeclarativePathView::findItems(QGraphicsObject *parent, const QSt
return items;
}
-QTEST_MAIN(tst_QDeclarativePathView)
+QTEST_MAIN(tst_QDeclarative1PathView)
#include "tst_qdeclarativepathview.moc"
diff --git a/tests/auto/declarative/qdeclarativepincharea/data/flickresize.qml b/tests/auto/qtquick1/qdeclarativepincharea/data/flickresize.qml
index 2da58fce3a..2da58fce3a 100644
--- a/tests/auto/declarative/qdeclarativepincharea/data/flickresize.qml
+++ b/tests/auto/qtquick1/qdeclarativepincharea/data/flickresize.qml
diff --git a/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml b/tests/auto/qtquick1/qdeclarativepincharea/data/pinchproperties.qml
index 0b59d9dc15..0b59d9dc15 100644
--- a/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml
+++ b/tests/auto/qtquick1/qdeclarativepincharea/data/pinchproperties.qml
diff --git a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro b/tests/auto/qtquick1/qdeclarativepincharea/qdeclarativepincharea.pro
index dba87ec011..e0eb3b50f9 100644
--- a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro
+++ b/tests/auto/qtquick1/qdeclarativepincharea/qdeclarativepincharea.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativepincharea.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp b/tests/auto/qtquick1/qdeclarativepincharea/tst_qdeclarativepincharea.cpp
index 220612081c..5f4795e07c 100644
--- a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp
+++ b/tests/auto/qtquick1/qdeclarativepincharea/tst_qdeclarativepincharea.cpp
@@ -41,10 +41,10 @@
#include <QtTest/QtTest>
#include <QtTest/QSignalSpy>
-#include <private/qdeclarativepincharea_p.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativeflickable_p.h>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativepincharea_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativeflickable_p.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativecontext.h>
#ifdef Q_OS_SYMBIAN
@@ -52,7 +52,7 @@
#define SRCDIR "."
#endif
-class tst_QDeclarativePinchArea: public QObject
+class tst_QDeclarative1PinchArea: public QObject
{
Q_OBJECT
private slots:
@@ -65,7 +65,7 @@ private:
QDeclarativeView *createView();
};
-void tst_QDeclarativePinchArea::pinchProperties()
+void tst_QDeclarative1PinchArea::pinchProperties()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml"));
@@ -73,8 +73,8 @@ void tst_QDeclarativePinchArea::pinchProperties()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
- QDeclarativePinch *pinch = pinchArea->pinch();
+ QDeclarative1PinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarative1PinchArea*>("pincharea");
+ QDeclarative1Pinch *pinch = pinchArea->pinch();
QVERIFY(pinchArea != 0);
QVERIFY(pinch != 0);
@@ -91,12 +91,12 @@ void tst_QDeclarativePinchArea::pinchProperties()
QCOMPARE(targetSpy.count(),1);
// axis
- QCOMPARE(pinch->axis(), QDeclarativePinch::XandYAxis);
+ QCOMPARE(pinch->axis(), QDeclarative1Pinch::XandYAxis);
QSignalSpy axisSpy(pinch, SIGNAL(dragAxisChanged()));
- pinch->setAxis(QDeclarativePinch::XAxis);
- QCOMPARE(pinch->axis(), QDeclarativePinch::XAxis);
+ pinch->setAxis(QDeclarative1Pinch::XAxis);
+ QCOMPARE(pinch->axis(), QDeclarative1Pinch::XAxis);
QCOMPARE(axisSpy.count(),1);
- pinch->setAxis(QDeclarativePinch::XAxis);
+ pinch->setAxis(QDeclarative1Pinch::XAxis);
QCOMPARE(axisSpy.count(),1);
// minimum and maximum drag properties
@@ -191,7 +191,7 @@ QTouchEvent::TouchPoint makeTouchPoint(int id, QPoint p, QGraphicsView *v, QGrap
return touchPoint;
}
-void tst_QDeclarativePinchArea::scale()
+void tst_QDeclarative1PinchArea::scale()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml"));
@@ -201,8 +201,8 @@ void tst_QDeclarativePinchArea::scale()
QVERIFY(canvas->rootObject() != 0);
qApp->processEvents();
- QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
- QDeclarativePinch *pinch = pinchArea->pinch();
+ QDeclarative1PinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarative1PinchArea*>("pincharea");
+ QDeclarative1Pinch *pinch = pinchArea->pinch();
QVERIFY(pinchArea != 0);
QVERIFY(pinch != 0);
@@ -246,7 +246,7 @@ void tst_QDeclarativePinchArea::scale()
delete canvas;
}
-void tst_QDeclarativePinchArea::pan()
+void tst_QDeclarative1PinchArea::pan()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml"));
@@ -256,8 +256,8 @@ void tst_QDeclarativePinchArea::pan()
QVERIFY(canvas->rootObject() != 0);
qApp->processEvents();
- QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
- QDeclarativePinch *pinch = pinchArea->pinch();
+ QDeclarative1PinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarative1PinchArea*>("pincharea");
+ QDeclarative1Pinch *pinch = pinchArea->pinch();
QVERIFY(pinchArea != 0);
QVERIFY(pinch != 0);
@@ -303,7 +303,7 @@ void tst_QDeclarativePinchArea::pan()
delete canvas;
}
-void tst_QDeclarativePinchArea::flickable()
+void tst_QDeclarative1PinchArea::flickable()
{
QDeclarativeView *canvas = createView();
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/flickresize.qml"));
@@ -313,12 +313,12 @@ void tst_QDeclarativePinchArea::flickable()
QVERIFY(canvas->rootObject() != 0);
qApp->processEvents();
- QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
- QDeclarativePinch *pinch = pinchArea->pinch();
+ QDeclarative1PinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarative1PinchArea*>("pincharea");
+ QDeclarative1Pinch *pinch = pinchArea->pinch();
QVERIFY(pinchArea != 0);
QVERIFY(pinch != 0);
- QDeclarativeFlickable *root = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QDeclarative1Flickable *root = qobject_cast<QDeclarative1Flickable*>(canvas->rootObject());
QVERIFY(root != 0);
QWidget *vp = canvas->viewport();
@@ -374,7 +374,7 @@ void tst_QDeclarativePinchArea::flickable()
delete canvas;
}
-QDeclarativeView *tst_QDeclarativePinchArea::createView()
+QDeclarativeView *tst_QDeclarative1PinchArea::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
@@ -383,6 +383,6 @@ QDeclarativeView *tst_QDeclarativePinchArea::createView()
return canvas;
}
-QTEST_MAIN(tst_QDeclarativePinchArea)
+QTEST_MAIN(tst_QDeclarative1PinchArea)
#include "tst_qdeclarativepincharea.moc"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/flow-testimplicitsize.qml
index ee4e1048a2..ee4e1048a2 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/flow-testimplicitsize.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flowtest-toptobottom.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest-toptobottom.qml
index ec1d6660c3..ec1d6660c3 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/flowtest-toptobottom.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest-toptobottom.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest.qml
index 7c124a3d44..7c124a3d44 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/flowtest.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-animated.qml
index 3dcbed1103..3dcbed1103 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-animated.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-spacing.qml
index f03733001b..f03733001b 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-spacing.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-toptobottom.qml
index 5d4c3373e5..5d4c3373e5 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/grid-toptobottom.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/gridtest.qml
index 929b7267cf..929b7267cf 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/gridtest.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/gridzerocolumns.qml
index 169f974477..169f974477 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/gridzerocolumns.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-animated.qml
index 3c95f53fe7..3c95f53fe7 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-animated.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-spacing.qml
index 64bedb02d3..64bedb02d3 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal-spacing.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal.qml
index d35c02d538..d35c02d538 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/horizontal.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/propertychangestest.qml
index 3c95c4c279..3c95c4c279 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/propertychangestest.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/repeatertest.qml
index f93ce67da3..f93ce67da3 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/repeatertest.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-animated.qml
index 8899ac83cc..8899ac83cc 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-animated.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-spacing.qml
index 557896115d..557896115d 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical-spacing.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical.qml
index 310d791d55..310d791d55 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/vertical.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/verticalqgraphicswidget.qml b/tests/auto/qtquick1/qdeclarativepositioners/data/verticalqgraphicswidget.qml
index c320714f15..c320714f15 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/verticalqgraphicswidget.qml
+++ b/tests/auto/qtquick1/qdeclarativepositioners/data/verticalqgraphicswidget.qml
diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/qtquick1/qdeclarativepositioners/qdeclarativepositioners.pro
index 235543a240..cf4ebfbf39 100644
--- a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
+++ b/tests/auto/qtquick1/qdeclarativepositioners/qdeclarativepositioners.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
SOURCES += tst_qdeclarativepositioners.cpp
macx:CONFIG -= app_bundle
@@ -13,4 +13,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/qtquick1/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index 0f3f540423..60ad1033fe 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/qtquick1/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -39,13 +39,12 @@
**
****************************************************************************/
#include <QtTest/QtTest>
-#include <private/qlistmodelinterface_p.h>
-#include <qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <qdeclarativeengine.h>
-#include <private/qdeclarativerectangle_p.h>
-#include <private/qdeclarativepositioners_p.h>
-#include <private/qdeclarativetransition_p.h>
-#include <private/qdeclarativeitem_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativepositioners_p.h>
+#include <QtQuick1/private/qdeclarativetransition_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
#include <qdeclarativeexpression.h>
#include <QtGui/qgraphicswidget.h>
#include "../../../shared/util.h"
@@ -105,13 +104,13 @@ void tst_QDeclarativePositioners::test_horizontal()
canvas->rootObject()->setProperty("testRightToLeft", false);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 0.0);
@@ -134,13 +133,13 @@ void tst_QDeclarativePositioners::test_horizontal_rtl()
canvas->rootObject()->setProperty("testRightToLeft", true);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 60.0);
@@ -172,13 +171,13 @@ void tst_QDeclarativePositioners::test_horizontal_spacing()
canvas->rootObject()->setProperty("testRightToLeft", false);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 0.0);
@@ -201,13 +200,13 @@ void tst_QDeclarativePositioners::test_horizontal_spacing_rightToLeft()
canvas->rootObject()->setProperty("testRightToLeft", true);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 80.0);
@@ -230,13 +229,13 @@ void tst_QDeclarativePositioners::test_horizontal_animated()
canvas->rootObject()->setProperty("testRightToLeft", false);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
//Note that they animate in
@@ -284,13 +283,13 @@ void tst_QDeclarativePositioners::test_horizontal_animated_rightToLeft()
canvas->rootObject()->setProperty("testRightToLeft", true);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
//Note that they animate in
@@ -336,13 +335,13 @@ void tst_QDeclarativePositioners::test_vertical()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/vertical.qml");
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 0.0);
@@ -364,13 +363,13 @@ void tst_QDeclarativePositioners::test_vertical_spacing()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/vertical-spacing.qml");
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 0.0);
@@ -392,15 +391,15 @@ void tst_QDeclarativePositioners::test_vertical_animated()
QDeclarativeView *canvas = createView(SRCDIR "/data/vertical-animated.qml");
//Note that they animate in
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
QCOMPARE(one->y(), -100.0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
QCOMPARE(two->y(), -100.0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(three->y(), -100.0);
@@ -439,15 +438,15 @@ void tst_QDeclarativePositioners::test_grid()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/gridtest.qml");
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 0.0);
@@ -461,8 +460,8 @@ void tst_QDeclarativePositioners::test_grid()
QCOMPARE(five->x(), 50.0);
QCOMPARE(five->y(), 50.0);
- QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
- QCOMPARE(grid->flow(), QDeclarativeGrid::LeftToRight);
+ QDeclarative1Grid *grid = canvas->rootObject()->findChild<QDeclarative1Grid*>("grid");
+ QCOMPARE(grid->flow(), QDeclarative1Grid::LeftToRight);
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
@@ -473,15 +472,15 @@ void tst_QDeclarativePositioners::test_grid_topToBottom()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/grid-toptobottom.qml");
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 0.0);
@@ -495,8 +494,8 @@ void tst_QDeclarativePositioners::test_grid_topToBottom()
QCOMPARE(five->x(), 50.0);
QCOMPARE(five->y(), 50.0);
- QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
- QCOMPARE(grid->flow(), QDeclarativeGrid::TopToBottom);
+ QDeclarative1Grid *grid = canvas->rootObject()->findChild<QDeclarative1Grid*>("grid");
+ QCOMPARE(grid->flow(), QDeclarative1Grid::TopToBottom);
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 120.0);
@@ -509,15 +508,15 @@ void tst_QDeclarativePositioners::test_grid_rightToLeft()
canvas->rootObject()->setProperty("testRightToLeft", true);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 50.0);
@@ -531,7 +530,7 @@ void tst_QDeclarativePositioners::test_grid_rightToLeft()
QCOMPARE(five->x(), 40.0);
QCOMPARE(five->y(), 50.0);
- QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
+ QDeclarative1Grid *grid = canvas->rootObject()->findChild<QDeclarative1Grid*>("grid");
QCOMPARE(grid->layoutDirection(), Qt::RightToLeft);
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
@@ -556,15 +555,15 @@ void tst_QDeclarativePositioners::test_grid_spacing()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/grid-spacing.qml");
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 0.0);
@@ -592,27 +591,27 @@ void tst_QDeclarativePositioners::test_grid_animated()
canvas->rootObject()->setProperty("testRightToLeft", false);
//Note that all animate in
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
QCOMPARE(one->x(), -100.0);
QCOMPARE(one->y(), -100.0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
QCOMPARE(two->x(), -100.0);
QCOMPARE(two->y(), -100.0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(three->x(), -100.0);
QCOMPARE(three->y(), -100.0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
QCOMPARE(four->x(), -100.0);
QCOMPARE(four->y(), -100.0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
@@ -675,27 +674,27 @@ void tst_QDeclarativePositioners::test_grid_animated_rightToLeft()
canvas->rootObject()->setProperty("testRightToLeft", true);
//Note that all animate in
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
QCOMPARE(one->x(), -100.0);
QCOMPARE(one->y(), -100.0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
QCOMPARE(two->x(), -100.0);
QCOMPARE(two->y(), -100.0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(three->x(), -100.0);
QCOMPARE(three->y(), -100.0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
QCOMPARE(four->x(), -100.0);
QCOMPARE(four->y(), -100.0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
@@ -755,15 +754,15 @@ void tst_QDeclarativePositioners::test_grid_zero_columns()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/gridzerocolumns.qml");
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 0.0);
@@ -788,10 +787,10 @@ void tst_QDeclarativePositioners::test_propertychanges()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/propertychangestest.qml");
- QDeclarativeGrid *grid = qobject_cast<QDeclarativeGrid*>(canvas->rootObject());
+ QDeclarative1Grid *grid = qobject_cast<QDeclarative1Grid*>(canvas->rootObject());
QVERIFY(grid != 0);
- QDeclarativeTransition *rowTransition = canvas->rootObject()->findChild<QDeclarativeTransition*>("rowTransition");
- QDeclarativeTransition *columnTransition = canvas->rootObject()->findChild<QDeclarativeTransition*>("columnTransition");
+ QDeclarative1Transition *rowTransition = canvas->rootObject()->findChild<QDeclarative1Transition*>("rowTransition");
+ QDeclarative1Transition *columnTransition = canvas->rootObject()->findChild<QDeclarative1Transition*>("columnTransition");
QSignalSpy addSpy(grid, SIGNAL(addChanged()));
QSignalSpy moveSpy(grid, SIGNAL(moveChanged()));
@@ -847,13 +846,13 @@ void tst_QDeclarativePositioners::test_repeater()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/repeatertest.qml");
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
QCOMPARE(one->x(), 0.0);
@@ -872,15 +871,15 @@ void tst_QDeclarativePositioners::test_flow()
canvas->rootObject()->setProperty("testRightToLeft", false);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 0.0);
@@ -908,15 +907,15 @@ void tst_QDeclarativePositioners::test_flow_rightToLeft()
canvas->rootObject()->setProperty("testRightToLeft", true);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 40.0);
@@ -944,15 +943,15 @@ void tst_QDeclarativePositioners::test_flow_topToBottom()
canvas->rootObject()->setProperty("testRightToLeft", false);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 0.0);
@@ -1000,15 +999,15 @@ void tst_QDeclarativePositioners::test_flow_resize()
root->setWidth(125);
root->setProperty("testRightToLeft", false);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 0.0);
@@ -1034,15 +1033,15 @@ void tst_QDeclarativePositioners::test_flow_resize_rightToLeft()
root->setWidth(125);
root->setProperty("testRightToLeft", true);
- QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QDeclarative1Rectangle *one = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("one");
QVERIFY(one != 0);
- QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QDeclarative1Rectangle *two = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("two");
QVERIFY(two != 0);
- QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QDeclarative1Rectangle *three = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("three");
QVERIFY(three != 0);
- QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QDeclarative1Rectangle *four = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("four");
QVERIFY(four != 0);
- QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QDeclarative1Rectangle *five = canvas->rootObject()->findChild<QDeclarative1Rectangle*>("five");
QVERIFY(five != 0);
QCOMPARE(one->x(), 75.0);
@@ -1064,19 +1063,19 @@ void tst_QDeclarativePositioners::test_flow_implicit_resize()
QDeclarativeView *canvas = createView(SRCDIR "/data/flow-testimplicitsize.qml");
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeFlow *flow = canvas->rootObject()->findChild<QDeclarativeFlow*>("flow");
+ QDeclarative1Flow *flow = canvas->rootObject()->findChild<QDeclarative1Flow*>("flow");
QVERIFY(flow != 0);
QCOMPARE(flow->width(), 100.0);
QCOMPARE(flow->height(), 120.0);
canvas->rootObject()->setProperty("flowLayout", 0);
- QCOMPARE(flow->flow(), QDeclarativeFlow::LeftToRight);
+ QCOMPARE(flow->flow(), QDeclarative1Flow::LeftToRight);
QCOMPARE(flow->width(), 220.0);
QCOMPARE(flow->height(), 50.0);
canvas->rootObject()->setProperty("flowLayout", 1);
- QCOMPARE(flow->flow(), QDeclarativeFlow::TopToBottom);
+ QCOMPARE(flow->flow(), QDeclarative1Flow::TopToBottom);
QCOMPARE(flow->width(), 100.0);
QCOMPARE(flow->height(), 120.0);
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml b/tests/auto/qtquick1/qdeclarativerepeater/data/intmodel.qml
index 85e1608bbf..85e1608bbf 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml
+++ b/tests/auto/qtquick1/qdeclarativerepeater/data/intmodel.qml
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml b/tests/auto/qtquick1/qdeclarativerepeater/data/itemlist.qml
index 590a9cd194..590a9cd194 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
+++ b/tests/auto/qtquick1/qdeclarativerepeater/data/itemlist.qml
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/modelChanged.qml b/tests/auto/qtquick1/qdeclarativerepeater/data/modelChanged.qml
index 0b57d50b6f..0b57d50b6f 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/modelChanged.qml
+++ b/tests/auto/qtquick1/qdeclarativerepeater/data/modelChanged.qml
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml b/tests/auto/qtquick1/qdeclarativerepeater/data/objlist.qml
index b47b04237c..b47b04237c 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml
+++ b/tests/auto/qtquick1/qdeclarativerepeater/data/objlist.qml
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/properties.qml b/tests/auto/qtquick1/qdeclarativerepeater/data/properties.qml
index 689a103082..689a103082 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/properties.qml
+++ b/tests/auto/qtquick1/qdeclarativerepeater/data/properties.qml
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml b/tests/auto/qtquick1/qdeclarativerepeater/data/repeater1.qml
index 2456b6d75d..2456b6d75d 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml
+++ b/tests/auto/qtquick1/qdeclarativerepeater/data/repeater1.qml
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml b/tests/auto/qtquick1/qdeclarativerepeater/data/repeater2.qml
index 02ef81033c..02ef81033c 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml
+++ b/tests/auto/qtquick1/qdeclarativerepeater/data/repeater2.qml
diff --git a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro b/tests/auto/qtquick1/qdeclarativerepeater/qdeclarativerepeater.pro
index 30d8b615bf..dd5fa976cf 100644
--- a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
+++ b/tests/auto/qtquick1/qdeclarativerepeater/qdeclarativerepeater.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativerepeater.cpp
@@ -13,4 +13,4 @@ symbian: {
}
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/qtquick1/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
index 2938a5fb52..de9ed67275 100644
--- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
+++ b/tests/auto/qtquick1/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
@@ -41,13 +41,12 @@
#include <QtTest/QtTest>
#include <QtTest/QSignalSpy>
-#include <private/qlistmodelinterface_p.h>
#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
-#include <private/qdeclarativerepeater_p.h>
-#include <private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativerepeater_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -59,11 +58,11 @@ inline QUrl TEST_FILE(const QString &filename)
return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
}
-class tst_QDeclarativeRepeater : public QObject
+class tst_QDeclarative1Repeater : public QObject
{
Q_OBJECT
public:
- tst_QDeclarativeRepeater();
+ tst_QDeclarative1Repeater();
private slots:
void numberModel();
@@ -172,11 +171,11 @@ private:
};
-tst_QDeclarativeRepeater::tst_QDeclarativeRepeater()
+tst_QDeclarative1Repeater::tst_QDeclarative1Repeater()
{
}
-void tst_QDeclarativeRepeater::numberModel()
+void tst_QDeclarative1Repeater::numberModel()
{
QDeclarativeView *canvas = createView();
@@ -188,7 +187,7 @@ void tst_QDeclarativeRepeater::numberModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/intmodel.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QCOMPARE(repeater->parentItem()->childItems().count(), 5+1);
@@ -216,7 +215,7 @@ public:
int m_idx;
};
-void tst_QDeclarativeRepeater::objectList()
+void tst_QDeclarative1Repeater::objectList()
{
QDeclarativeView *canvas = createView();
QObjectList data;
@@ -229,7 +228,7 @@ void tst_QDeclarativeRepeater::objectList()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/objlist.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QCOMPARE(repeater->property("errors").toInt(), 0);//If this fails either they are out of order or can't find the object's data
QCOMPARE(repeater->property("instantiated").toInt(), 100);
@@ -254,7 +253,7 @@ The Repeater element creates children at its own position in its parent's
stacking order. In this test we insert a repeater between two other Text
elements to test this.
*/
-void tst_QDeclarativeRepeater::stringList()
+void tst_QDeclarative1Repeater::stringList()
{
QDeclarativeView *canvas = createView();
@@ -270,7 +269,7 @@ void tst_QDeclarativeRepeater::stringList()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater1.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
@@ -282,21 +281,21 @@ void tst_QDeclarativeRepeater::stringList()
for (int i = 0; i < container->childItems().count(); ++i) {
if (i == 0) {
- QDeclarativeText *name = qobject_cast<QDeclarativeText*>(container->childItems().at(i));
+ QDeclarative1Text *name = qobject_cast<QDeclarative1Text*>(container->childItems().at(i));
QVERIFY(name != 0);
QCOMPARE(name->text(), QLatin1String("Zero"));
} else if (i == container->childItems().count() - 2) {
// The repeater itself
- QDeclarativeRepeater *rep = qobject_cast<QDeclarativeRepeater*>(container->childItems().at(i));
+ QDeclarative1Repeater *rep = qobject_cast<QDeclarative1Repeater*>(container->childItems().at(i));
QCOMPARE(rep, repeater);
saw_repeater = true;
continue;
} else if (i == container->childItems().count() - 1) {
- QDeclarativeText *name = qobject_cast<QDeclarativeText*>(container->childItems().at(i));
+ QDeclarative1Text *name = qobject_cast<QDeclarative1Text*>(container->childItems().at(i));
QVERIFY(name != 0);
QCOMPARE(name->text(), QLatin1String("Last"));
} else {
- QDeclarativeText *name = qobject_cast<QDeclarativeText*>(container->childItems().at(i));
+ QDeclarative1Text *name = qobject_cast<QDeclarative1Text*>(container->childItems().at(i));
QVERIFY(name != 0);
QCOMPARE(name->text(), data.at(i-1));
}
@@ -306,7 +305,7 @@ void tst_QDeclarativeRepeater::stringList()
delete canvas;
}
-void tst_QDeclarativeRepeater::dataModel_adding()
+void tst_QDeclarative1Repeater::dataModel_adding()
{
QDeclarativeView *canvas = createView();
QDeclarativeContext *ctxt = canvas->rootContext();
@@ -318,7 +317,7 @@ void tst_QDeclarativeRepeater::dataModel_adding()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
QVERIFY(container != 0);
@@ -368,7 +367,7 @@ void tst_QDeclarativeRepeater::dataModel_adding()
delete canvas;
}
-void tst_QDeclarativeRepeater::dataModel_removing()
+void tst_QDeclarative1Repeater::dataModel_removing()
{
QDeclarativeView *canvas = createView();
QDeclarativeContext *ctxt = canvas->rootContext();
@@ -386,7 +385,7 @@ void tst_QDeclarativeRepeater::dataModel_removing()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
QVERIFY(container != 0);
@@ -436,7 +435,7 @@ void tst_QDeclarativeRepeater::dataModel_removing()
delete canvas;
}
-void tst_QDeclarativeRepeater::dataModel_changes()
+void tst_QDeclarative1Repeater::dataModel_changes()
{
QDeclarativeView *canvas = createView();
QDeclarativeContext *ctxt = canvas->rootContext();
@@ -452,23 +451,23 @@ void tst_QDeclarativeRepeater::dataModel_changes()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
QVERIFY(container != 0);
QCOMPARE(container->childItems().count(), repeater->count()+1);
// Check that model changes are propagated
- QDeclarativeText *text = findItem<QDeclarativeText>(canvas->rootObject(), "myName", 1);
+ QDeclarative1Text *text = findItem<QDeclarative1Text>(canvas->rootObject(), "myName", 1);
QVERIFY(text);
QCOMPARE(text->text(), QString("two"));
testModel.modifyItem(1, "Item two", "_2");
- text = findItem<QDeclarativeText>(canvas->rootObject(), "myName", 1);
+ text = findItem<QDeclarative1Text>(canvas->rootObject(), "myName", 1);
QVERIFY(text);
QCOMPARE(text->text(), QString("Item two"));
- text = findItem<QDeclarativeText>(canvas->rootObject(), "myNumber", 1);
+ text = findItem<QDeclarative1Text>(canvas->rootObject(), "myNumber", 1);
QVERIFY(text);
QCOMPARE(text->text(), QString("_2"));
@@ -476,7 +475,7 @@ void tst_QDeclarativeRepeater::dataModel_changes()
delete canvas;
}
-void tst_QDeclarativeRepeater::itemModel()
+void tst_QDeclarative1Repeater::itemModel()
{
QDeclarativeView *canvas = createView();
QDeclarativeContext *ctxt = canvas->rootContext();
@@ -486,7 +485,7 @@ void tst_QDeclarativeRepeater::itemModel()
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/itemlist.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
@@ -517,7 +516,7 @@ void tst_QDeclarativeRepeater::itemModel()
delete canvas;
}
-void tst_QDeclarativeRepeater::resetModel()
+void tst_QDeclarative1Repeater::resetModel()
{
QDeclarativeView *canvas = createView();
@@ -529,7 +528,7 @@ void tst_QDeclarativeRepeater::resetModel()
ctxt->setContextProperty("testData", dataA);
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater1.qml"));
qApp->processEvents();
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(canvas->rootObject(), "repeater");
QVERIFY(repeater != 0);
QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
QVERIFY(container != 0);
@@ -581,14 +580,14 @@ void tst_QDeclarativeRepeater::resetModel()
}
// QTBUG-17156
-void tst_QDeclarativeRepeater::modelChanged()
+void tst_QDeclarative1Repeater::modelChanged()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, TEST_FILE("/modelChanged.qml"));
QDeclarativeItem *rootObject = qobject_cast<QDeclarativeItem*>(component.create());
QVERIFY(rootObject);
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(rootObject, "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(rootObject, "repeater");
QVERIFY(repeater);
repeater->setModel(4);
@@ -604,7 +603,7 @@ void tst_QDeclarativeRepeater::modelChanged()
delete rootObject;
}
-void tst_QDeclarativeRepeater::properties()
+void tst_QDeclarative1Repeater::properties()
{
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, TEST_FILE("/properties.qml"));
@@ -612,7 +611,7 @@ void tst_QDeclarativeRepeater::properties()
QDeclarativeItem *rootObject = qobject_cast<QDeclarativeItem*>(component.create());
QVERIFY(rootObject);
- QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(rootObject, "repeater");
+ QDeclarative1Repeater *repeater = findItem<QDeclarative1Repeater>(rootObject, "repeater");
QVERIFY(repeater);
QSignalSpy modelSpy(repeater, SIGNAL(modelChanged()));
@@ -634,7 +633,7 @@ void tst_QDeclarativeRepeater::properties()
delete rootObject;
}
-void tst_QDeclarativeRepeater::testQtQuick11Attributes()
+void tst_QDeclarative1Repeater::testQtQuick11Attributes()
{
QFETCH(QString, code);
QFETCH(QString, warning);
@@ -658,7 +657,7 @@ void tst_QDeclarativeRepeater::testQtQuick11Attributes()
delete obj;
}
-void tst_QDeclarativeRepeater::testQtQuick11Attributes_data()
+void tst_QDeclarative1Repeater::testQtQuick11Attributes_data()
{
QTest::addColumn<QString>("code");
QTest::addColumn<QString>("warning");
@@ -678,7 +677,7 @@ void tst_QDeclarativeRepeater::testQtQuick11Attributes_data()
}
-QDeclarativeView *tst_QDeclarativeRepeater::createView()
+QDeclarativeView *tst_QDeclarative1Repeater::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
@@ -687,7 +686,7 @@ QDeclarativeView *tst_QDeclarativeRepeater::createView()
}
template<typename T>
-T *tst_QDeclarativeRepeater::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+T *tst_QDeclarative1Repeater::findItem(QGraphicsObject *parent, const QString &objectName, int index)
{
const QMetaObject &mo = T::staticMetaObject;
//qDebug() << parent->childItems().count() << "children";
@@ -714,7 +713,7 @@ T *tst_QDeclarativeRepeater::findItem(QGraphicsObject *parent, const QString &ob
}
template<typename T>
-T *tst_QDeclarativeRepeater::findItem(QGraphicsObject *parent, const QString &objectName)
+T *tst_QDeclarative1Repeater::findItem(QGraphicsObject *parent, const QString &objectName)
{
const QMetaObject &mo = T::staticMetaObject;
if (mo.cast(parent) && (objectName.isEmpty() || parent->objectName() == objectName))
@@ -731,6 +730,6 @@ T *tst_QDeclarativeRepeater::findItem(QGraphicsObject *parent, const QString &ob
return 0;
}
-QTEST_MAIN(tst_QDeclarativeRepeater)
+QTEST_MAIN(tst_QDeclarative1Repeater)
#include "tst_qdeclarativerepeater.moc"
diff --git a/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation1.qml b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation1.qml
new file mode 100644
index 0000000000..3a2c4e386b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation1.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+SmoothedAnimation {}
diff --git a/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation2.qml b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation2.qml
new file mode 100644
index 0000000000..47935d48f0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation2.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+SmoothedAnimation {
+ to: 10; duration: 300; reversingMode: SmoothedAnimation.Immediate
+}
diff --git a/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation3.qml b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation3.qml
new file mode 100644
index 0000000000..fe44cce14b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimation3.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+SmoothedAnimation {
+ to: 10; velocity: 250; reversingMode: SmoothedAnimation.Sync
+ maximumEasingTime: 150
+}
diff --git a/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml
new file mode 100644
index 0000000000..65611227d0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400; color: "blue"
+
+ Rectangle {
+ id: rect1
+ color: "red"
+ width: 60; height: 60;
+ x: 100; y: 100;
+ SmoothedAnimation on x { to: 200; velocity: 500 }
+ SmoothedAnimation on y { to: 200; velocity: 500 }
+ }
+
+ Rectangle {
+ objectName: "theRect"
+ color: "green"
+ width: 60; height: 60;
+ x: rect1.x; y: rect1.y;
+ // id are needed for SmoothedAnimation in order to avoid deferred creation
+ Behavior on x { SmoothedAnimation { id: anim1; objectName: "easeX"; velocity: 400 } }
+ Behavior on y { SmoothedAnimation { id: anim2; objectName: "easeY"; velocity: 400 } }
+ }
+ }
diff --git a/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml
new file mode 100644
index 0000000000..5036d5f225
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 300; height: 300;
+ Rectangle {
+ objectName: "theRect"
+ color: "red"
+ width: 60; height: 60;
+ x: 100; y: 100;
+ SmoothedAnimation on x { objectName: "easeX"; to: 200; velocity: 500 }
+ SmoothedAnimation on y { objectName: "easeY"; to: 200; duration: 250; velocity: 500 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/qtquick1/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
new file mode 100644
index 0000000000..f9a0b17f81
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativesmoothedanimation.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/qtquick1/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
new file mode 100644
index 0000000000..0b1c46d20c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
@@ -0,0 +1,216 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativesmoothedanimation_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativesmoothedanimation : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativesmoothedanimation();
+
+private slots:
+ void defaultValues();
+ void values();
+ void disabled();
+ void simpleAnimation();
+ void valueSource();
+ void behavior();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativesmoothedanimation::tst_qdeclarativesmoothedanimation()
+{
+}
+
+void tst_qdeclarativesmoothedanimation::defaultValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimation1.qml"));
+ QDeclarative1SmoothedAnimation *obj = qobject_cast<QDeclarative1SmoothedAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 0.);
+ QCOMPARE(obj->velocity(), 200.);
+ QCOMPARE(obj->duration(), -1);
+ QCOMPARE(obj->maximumEasingTime(), -1);
+ QCOMPARE(obj->reversingMode(), QDeclarative1SmoothedAnimation::Eased);
+
+ delete obj;
+}
+
+void tst_qdeclarativesmoothedanimation::values()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimation2.qml"));
+ QDeclarative1SmoothedAnimation *obj = qobject_cast<QDeclarative1SmoothedAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 10.);
+ QCOMPARE(obj->velocity(), 200.);
+ QCOMPARE(obj->duration(), 300);
+ QCOMPARE(obj->maximumEasingTime(), -1);
+ QCOMPARE(obj->reversingMode(), QDeclarative1SmoothedAnimation::Immediate);
+
+ delete obj;
+}
+
+void tst_qdeclarativesmoothedanimation::disabled()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimation3.qml"));
+ QDeclarative1SmoothedAnimation *obj = qobject_cast<QDeclarative1SmoothedAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 10.);
+ QCOMPARE(obj->velocity(), 250.);
+ QCOMPARE(obj->maximumEasingTime(), 150);
+ QCOMPARE(obj->reversingMode(), QDeclarative1SmoothedAnimation::Sync);
+
+ delete obj;
+}
+
+void tst_qdeclarativesmoothedanimation::simpleAnimation()
+{
+ QDeclarative1Rectangle rect;
+ QDeclarative1SmoothedAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ animation.setDuration(250);
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "x");
+ QVERIFY(animation.to() == 200);
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTRY_COMPARE(rect.x(), qreal(200));
+
+ rect.setX(0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.x(), qreal(100));
+}
+
+void tst_qdeclarativesmoothedanimation::valueSource()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimationValueSource.qml"));
+
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *theRect = rect->findChild<QDeclarative1Rectangle*>("theRect");
+ QVERIFY(theRect);
+
+ QDeclarative1SmoothedAnimation *easeX = rect->findChild<QDeclarative1SmoothedAnimation*>("easeX");
+ QVERIFY(easeX);
+ QVERIFY(easeX->isRunning());
+
+ QDeclarative1SmoothedAnimation *easeY = rect->findChild<QDeclarative1SmoothedAnimation*>("easeY");
+ QVERIFY(easeY);
+ QVERIFY(easeY->isRunning());
+
+ // XXX get the proper duration
+ QTest::qWait(100);
+
+ QTRY_VERIFY(!easeX->isRunning());
+ QTRY_VERIFY(!easeY->isRunning());
+
+ QTRY_COMPARE(theRect->x(), qreal(200));
+ QTRY_COMPARE(theRect->y(), qreal(200));
+
+ delete rect;
+}
+
+void tst_qdeclarativesmoothedanimation::behavior()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimationBehavior.qml"));
+
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarative1Rectangle *theRect = rect->findChild<QDeclarative1Rectangle*>("theRect");
+ QVERIFY(theRect);
+
+ QDeclarative1SmoothedAnimation *easeX = rect->findChild<QDeclarative1SmoothedAnimation*>("easeX");
+ QVERIFY(easeX);
+
+ QDeclarative1SmoothedAnimation *easeY = rect->findChild<QDeclarative1SmoothedAnimation*>("easeY");
+ QVERIFY(easeY);
+
+ // XXX get the proper duration
+ QTest::qWait(400);
+
+ QTRY_VERIFY(!easeX->isRunning());
+ QTRY_VERIFY(!easeY->isRunning());
+
+ QTRY_COMPARE(theRect->x(), qreal(200));
+ QTRY_COMPARE(theRect->y(), qreal(200));
+
+ delete rect;
+}
+
+QTEST_MAIN(tst_qdeclarativesmoothedanimation)
+
+#include "tst_qdeclarativesmoothedanimation.moc"
diff --git a/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation1.qml b/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation1.qml
new file mode 100644
index 0000000000..8890a78fdb
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation1.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+SpringAnimation {
+}
diff --git a/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation2.qml b/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation2.qml
new file mode 100644
index 0000000000..de75bb06cb
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation2.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+SpringAnimation {
+ to: 1.44; velocity: 0.9
+ spring: 1.0; damping: 0.5
+ epsilon: 0.25; modulus: 360.0
+ mass: 2.0;
+ running: true;
+}
diff --git a/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation3.qml b/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation3.qml
new file mode 100644
index 0000000000..b68d769f01
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativespringanimation/data/springanimation3.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+SpringAnimation {
+ to: 1.44; velocity: 0.9
+ spring: 1.0; damping: 0.5
+ epsilon: 0.25; modulus: 360.0
+ mass: 2.0; running: false
+}
diff --git a/tests/auto/qtquick1/qdeclarativespringanimation/qdeclarativespringanimation.pro b/tests/auto/qtquick1/qdeclarativespringanimation/qdeclarativespringanimation.pro
new file mode 100644
index 0000000000..10132374e2
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativespringanimation/qdeclarativespringanimation.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativespringanimation.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp b/tests/auto/qtquick1/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp
new file mode 100644
index 0000000000..8c22f97acb
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativespringanimation_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativespringanimation : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativespringanimation();
+
+private slots:
+ void defaultValues();
+ void values();
+ void disabled();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativespringanimation::tst_qdeclarativespringanimation()
+{
+}
+
+void tst_qdeclarativespringanimation::defaultValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/springanimation1.qml"));
+ QDeclarative1SpringAnimation *obj = qobject_cast<QDeclarative1SpringAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 0.);
+ QCOMPARE(obj->velocity(), 0.);
+ QCOMPARE(obj->spring(), 0.);
+ QCOMPARE(obj->damping(), 0.);
+ QCOMPARE(obj->epsilon(), 0.01);
+ QCOMPARE(obj->modulus(), 0.);
+ QCOMPARE(obj->mass(), 1.);
+ QCOMPARE(obj->isRunning(), false);
+
+ delete obj;
+}
+
+void tst_qdeclarativespringanimation::values()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/springanimation2.qml"));
+ QDeclarative1SpringAnimation *obj = qobject_cast<QDeclarative1SpringAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 1.44);
+ QCOMPARE(obj->velocity(), 0.9);
+ QCOMPARE(obj->spring(), 1.0);
+ QCOMPARE(obj->damping(), 0.5);
+ QCOMPARE(obj->epsilon(), 0.25);
+ QCOMPARE(obj->modulus(), 360.0);
+ QCOMPARE(obj->mass(), 2.0);
+ QCOMPARE(obj->isRunning(), true);
+
+ QTRY_COMPARE(obj->isRunning(), false);
+
+ delete obj;
+}
+
+void tst_qdeclarativespringanimation::disabled()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/springanimation3.qml"));
+ QDeclarative1SpringAnimation *obj = qobject_cast<QDeclarative1SpringAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 1.44);
+ QCOMPARE(obj->velocity(), 0.9);
+ QCOMPARE(obj->spring(), 1.0);
+ QCOMPARE(obj->damping(), 0.5);
+ QCOMPARE(obj->epsilon(), 0.25);
+ QCOMPARE(obj->modulus(), 360.0);
+ QCOMPARE(obj->mass(), 2.0);
+ QCOMPARE(obj->isRunning(), false);
+
+ delete obj;
+}
+
+QTEST_MAIN(tst_qdeclarativespringanimation)
+
+#include "tst_qdeclarativespringanimation.moc"
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/ExtendedRectangle.qml b/tests/auto/qtquick1/qdeclarativestates/data/ExtendedRectangle.qml
new file mode 100644
index 0000000000..d91f504455
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/ExtendedRectangle.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+Rectangle {
+ id: extendedRect
+ objectName: "extendedRect"
+ property color extendedColor: "orange"
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "green"
+ PropertyChanges {
+ target: rect
+ onDidSomething: {
+ extendedRect.color = "green"
+ extendedColor = "green"
+ }
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/Implementation/MyType.qml b/tests/auto/qtquick1/qdeclarativestates/data/Implementation/MyType.qml
new file mode 100644
index 0000000000..6ad3b4a6ba
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/Implementation/MyType.qml
@@ -0,0 +1,32 @@
+import QtQuick 1.0
+
+Item {
+ Column {
+ anchors.centerIn: parent
+ Image { id: image1; objectName: "image1" }
+ Image { id: image2; objectName: "image2" }
+ Image { id: image3; objectName: "image3" }
+ }
+
+ states: State {
+ name: "SetImageState"
+ PropertyChanges {
+ target: image1
+ source: "images/qt-logo.png"
+ }
+ PropertyChanges {
+ target: image2
+ source: "images/" + "qt-logo.png"
+ }
+ PropertyChanges {
+ target: image3
+ source: "images/" + (true ? "qt-logo.png" : "")
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "SetImageState"
+ }
+
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/Implementation/images/qt-logo.png b/tests/auto/qtquick1/qdeclarativestates/data/Implementation/images/qt-logo.png
new file mode 100644
index 0000000000..14ddf2a028
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/Implementation/images/qt-logo.png
Binary files differ
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/QTBUG-14830.qml b/tests/auto/qtquick1/qdeclarativestates/data/QTBUG-14830.qml
new file mode 100644
index 0000000000..7f9ddbfa2d
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/QTBUG-14830.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 1024
+ height: 768
+
+ Item {
+ id: area
+ objectName: "area"
+ property int numx: 6
+ property int cellwidth: 1024/numx
+
+ onWidthChanged: {
+ width = width>1024?1024:width;
+ }
+
+ state: 'minimal'
+ states: [
+ State {
+ name: 'minimal'
+ PropertyChanges {
+ target: area
+ width: cellwidth
+ }
+ }
+ ]
+
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges1.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges1.qml
new file mode 100644
index 0000000000..fad27080fe
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges1.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ width: 50; height: 50
+ color: "green";
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ }
+ states: State {
+ name: "right"
+ AnchorChanges {
+ id: ancCh
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: container.right
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges2.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges2.qml
new file mode 100644
index 0000000000..e1d4d66abd
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges2.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ width: 50; height: 50
+ color: "green";
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ }
+ states: State {
+ name: "right"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: parent.right
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges3.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges3.qml
new file mode 100644
index 0000000000..116b844489
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges3.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.left: parent.left
+ anchors.right: rightGuideline.left
+ anchors.top: topGuideline.top
+ anchors.bottom: container.bottom
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { id: rightGuideline; x: 150 }
+ Item { id: topGuideline; y: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: leftGuideline.left
+ anchors.right: container.right
+ anchors.top: container.top
+ anchors.bottom: bottomGuideline.bottom
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges4.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges4.qml
new file mode 100644
index 0000000000..eaff37345b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges4.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.horizontalCenter: bottomGuideline.horizontalCenter
+ anchors.verticalCenter: leftGuideline.verticalCenter
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges5.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges5.qml
new file mode 100644
index 0000000000..ea7b251151
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorChanges5.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.baseline: parent.baseline
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.horizontalCenter: bottomGuideline.horizontalCenter
+ anchors.baseline: leftGuideline.baseline
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorChangesCrash.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorChangesCrash.qml
new file mode 100644
index 0000000000..ca96da8855
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorChangesCrash.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ width: 400
+ height: 400
+
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ anchors.top: container.top
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug.qml
new file mode 100644
index 0000000000..6277111e68
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+Rectangle {
+ id: container
+ color: "red"
+ height: 200
+ width: 200
+ Column {
+ id: column
+ objectName: "column"
+ anchors.left: container.right
+ anchors.bottom: container.bottom
+
+ Rectangle {
+ id: rectangle
+ color: "blue"
+ height: 100
+ width: 200
+ }
+ Rectangle {
+ color: "blue"
+ height: 100
+ width: 200
+ }
+ }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: column
+ anchors.left: undefined
+ anchors.right: container.right
+ }
+ PropertyChanges {
+ target: rectangle
+ opacity: 0
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug2.qml b/tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug2.qml
new file mode 100644
index 0000000000..d8b02e9b32
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/anchorRewindBug2.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width:200; height:300
+
+ Rectangle {
+ id: rectangle
+ objectName: "mover"
+ color: "green"
+ width:50; height:50
+ }
+
+ states: [
+ State {
+ name: "anchored"
+ AnchorChanges {
+ target: rectangle
+ anchors.left: root.left
+ anchors.right: root.right
+ anchors.bottom: root.bottom
+ }
+ }
+ ]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/attachedPropertyChanges.qml b/tests/auto/qtquick1/qdeclarativestates/data/attachedPropertyChanges.qml
new file mode 100644
index 0000000000..2cad0504b2
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/attachedPropertyChanges.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+Item {
+ id: item
+ width: 100; height: 100
+ MyRectangle.foo: 0
+
+ states: State {
+ name: "foo1"
+ PropertyChanges {
+ target: item
+ MyRectangle.foo: 1
+ width: 50
+ }
+ }
+
+ Component.onCompleted: item.state = "foo1"
+}
+
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml b/tests/auto/qtquick1/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml
new file mode 100644
index 0000000000..ccd126f6a7
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property int input: 1
+ property int test: 9
+
+ states: [
+ State {
+ name: "portrait"
+ when: root.input == 1
+ PropertyChanges {
+ target: root
+ test: 3
+ }
+ }
+ ]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicBinding.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding.qml
new file mode 100644
index 0000000000..2060f03009
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicBinding2.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding2.qml
new file mode 100644
index 0000000000..a329da33dd
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding2.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "red"
+ width: 100; height: 100
+ color: sourceColor
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicBinding3.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding3.qml
new file mode 100644
index 0000000000..cb054d214d
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding3.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "red"
+ property color sourceColor2: "blue"
+ width: 100; height: 100
+ color: sourceColor
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor2 }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicBinding4.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding4.qml
new file mode 100644
index 0000000000..7a740e570c
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicBinding4.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor }
+ },
+ State {
+ name: "green"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicChanges.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges.qml
new file mode 100644
index 0000000000..08ce7875f0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicChanges2.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges2.qml
new file mode 100644
index 0000000000..ab97ba18b5
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges2.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "green"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicChanges3.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges3.qml
new file mode 100644
index 0000000000..73ac34d7ff
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges3.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "bordered"
+ PropertyChanges { target: myRectangle; border.width: 2 }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicChanges4.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges4.qml
new file mode 100644
index 0000000000..b5df922190
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicChanges4.qml
@@ -0,0 +1,19 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyRectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ states: State {
+ name: "aBlueDay"
+ PropertyChanges {
+ target: rect
+ onPropertyWithNotifyChanged: { rect.color = "blue"; }
+ }
+ }
+
+ Component.onCompleted: rect.state = "aBlueDay"
+}
+
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/basicExtension.qml b/tests/auto/qtquick1/qdeclarativestates/data/basicExtension.qml
new file mode 100644
index 0000000000..58c9fbe231
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/basicExtension.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "bordered"
+ extend: "blue"
+ PropertyChanges { target: myRectangle; border.width: 2 }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/deleting.qml b/tests/auto/qtquick1/qdeclarativestates/data/deleting.qml
new file mode 100644
index 0000000000..d1b3fd3a10
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/deleting.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue"; objectName: "pc1" }
+ PropertyChanges { target: myRectangle; radius: 5; objectName: "pc2" }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/deletingState.qml b/tests/auto/qtquick1/qdeclarativestates/data/deletingState.qml
new file mode 100644
index 0000000000..654e09cb2e
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/deletingState.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ StateGroup {
+ id: stateGroup
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/editProperties.qml b/tests/auto/qtquick1/qdeclarativestates/data/editProperties.qml
new file mode 100644
index 0000000000..08d0209615
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/editProperties.qml
@@ -0,0 +1,34 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 400; height: 400
+ color: "red"
+
+ Rectangle {
+ id: rect2
+ objectName: "rect2"
+ width: parent.width + 2
+ height: 200
+ color: "yellow"
+ }
+
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges {
+ target: rect2
+ width:50
+ height: 40
+ }
+ },
+ State {
+ name: "green"
+ PropertyChanges {
+ target: rect2
+ width: myRectangle.width / 2
+ height: myRectangle.width / 4
+ }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/explicit.qml b/tests/auto/qtquick1/qdeclarativestates/data/explicit.qml
new file mode 100644
index 0000000000..426731914f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/explicit.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges {
+ objectName: "changes"
+ target: myRectangle; explicit: true
+ color: sourceColor
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/extendsBug.qml b/tests/auto/qtquick1/qdeclarativestates/data/extendsBug.qml
new file mode 100644
index 0000000000..a4b77b122e
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/extendsBug.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+
+ Rectangle {
+ id: rect
+ objectName: "greenRect"
+ width: 100
+ height: 100
+ color: "green"
+ }
+
+ states:[
+ State {
+ name: "a"
+ PropertyChanges { target: rect; x: 100 }
+ },
+ State {
+ name: "b"
+ extend:"a"
+ PropertyChanges { target: rect; y: 100 }
+ }
+ ]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/fakeExtension.qml b/tests/auto/qtquick1/qdeclarativestates/data/fakeExtension.qml
new file mode 100644
index 0000000000..a98c96bedc
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/fakeExtension.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "green"
+ extend: "blue"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/illegalObj.qml b/tests/auto/qtquick1/qdeclarativestates/data/illegalObj.qml
new file mode 100644
index 0000000000..e6444325a3
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/illegalObj.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: myItem
+
+ states : State {
+ PropertyChanges {
+ target: myItem
+ children: Item { id: newItem }
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/illegalTempState.qml b/tests/auto/qtquick1/qdeclarativestates/data/illegalTempState.qml
new file mode 100644
index 0000000000..c04b03c94b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/illegalTempState.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: card
+ width: 100; height: 100
+
+ states: [
+ State {
+ name: "placed"
+ PropertyChanges { target: card; state: "idle" }
+ },
+ State {
+ name: "idle"
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: card.state = "placed"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/image.png b/tests/auto/qtquick1/qdeclarativestates/data/image.png
new file mode 100644
index 0000000000..ed1833c95b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/image.png
Binary files differ
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/legalTempState.qml b/tests/auto/qtquick1/qdeclarativestates/data/legalTempState.qml
new file mode 100644
index 0000000000..4d500d9e05
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/legalTempState.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: card
+ width: 100; height: 100
+
+ states: [
+ State {
+ name: "placed"
+ onCompleted: card.state = "idle"
+ StateChangeScript { script: console.log("entering placed") }
+ },
+ State {
+ name: "idle"
+ StateChangeScript { script: console.log("entering idle") }
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: card.state = "placed"
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/nonExistantProp.qml b/tests/auto/qtquick1/qdeclarativestates/data/nonExistantProp.qml
new file mode 100644
index 0000000000..4973b82c3f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/nonExistantProp.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; colr: "blue" }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/parentChange1.qml b/tests/auto/qtquick1/qdeclarativestates/data/parentChange1.qml
new file mode 100644
index 0000000000..2f7e80eb08
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/parentChange1.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Item {
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ x: -100; y: -50
+ Item {
+ id: newParent
+ objectName: "NewParent"
+ x: 248; y: 360
+ }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/parentChange2.qml b/tests/auto/qtquick1/qdeclarativestates/data/parentChange2.qml
new file mode 100644
index 0000000000..bdd0c6c282
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/parentChange2.qml
@@ -0,0 +1,31 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: newParent
+ width: 400; height: 400
+ Item {
+ scale: .5
+ rotation: 15
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/parentChange3.qml b/tests/auto/qtquick1/qdeclarativestates/data/parentChange3.qml
new file mode 100644
index 0000000000..55f3ead7c6
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/parentChange3.qml
@@ -0,0 +1,42 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Item {
+ scale: .5
+ rotation: 15
+ transformOrigin: "Center"
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ transformOrigin: "BottomLeft"
+ color: "red"
+ }
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ x: 200; y: 200
+ rotation: 52;
+ scale: 2
+ Item {
+ id: newParent
+ x: 100; y: 100
+ }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/parentChange4.qml b/tests/auto/qtquick1/qdeclarativestates/data/parentChange4.qml
new file mode 100644
index 0000000000..ae05b05072
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/parentChange4.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ transform: Scale { xScale: .5; yScale: .7}
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/parentChange5.qml b/tests/auto/qtquick1/qdeclarativestates/data/parentChange5.qml
new file mode 100644
index 0000000000..32a0b91cd9
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/parentChange5.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ transform: Rotation { angle: 30; axis { x: 0; y: 1; z: 0 } }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/parentChange6.qml b/tests/auto/qtquick1/qdeclarativestates/data/parentChange6.qml
new file mode 100644
index 0000000000..70ad894ffc
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/parentChange6.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ rotation: 180
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/propertyErrors.qml b/tests/auto/qtquick1/qdeclarativestates/data/propertyErrors.qml
new file mode 100644
index 0000000000..3ab3c3252e
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/propertyErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; colr: "blue"; activeFocus: true }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/reset.qml b/tests/auto/qtquick1/qdeclarativestates/data/reset.qml
new file mode 100644
index 0000000000..a140ffab4d
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/reset.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 640
+ height: 480
+ Image {
+ id: image
+ width: 40
+ source: "image.png"
+ }
+
+ states: State {
+ name: "state1"
+ PropertyChanges {
+ target: image
+ width: undefined
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/restoreEntryValues.qml b/tests/auto/qtquick1/qdeclarativestates/data/restoreEntryValues.qml
new file mode 100644
index 0000000000..dfd7c1794a
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/restoreEntryValues.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges {
+ target: myRectangle
+ restoreEntryValues: false
+ color: "blue"
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/returnToBase.qml b/tests/auto/qtquick1/qdeclarativestates/data/returnToBase.qml
new file mode 100644
index 0000000000..a0d053cf03
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/returnToBase.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: theRect
+ property bool triggerState: false
+ property string stateString: ""
+ states: [ State {
+ when: triggerState
+ PropertyChanges {
+ target: theRect
+ stateString: "inState"
+ }
+ },
+ State {
+ name: ""
+ PropertyChanges {
+ target: theRect
+ stateString: "originalState"
+ }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/script.qml b/tests/auto/qtquick1/qdeclarativestates/data/script.qml
new file mode 100644
index 0000000000..630aaf0ffa
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/script.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ StateChangeScript { script: myRectangle.color = "blue"; }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/signalOverride.qml b/tests/auto/qtquick1/qdeclarativestates/data/signalOverride.qml
new file mode 100644
index 0000000000..0eaf547644
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/signalOverride.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+
+ onDidSomething: color = "blue"
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "green"
+ PropertyChanges {
+ target: rect
+ onDidSomething: color = "green"
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/signalOverride2.qml b/tests/auto/qtquick1/qdeclarativestates/data/signalOverride2.qml
new file mode 100644
index 0000000000..ef26ff14e7
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/signalOverride2.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+ onDidSomething: color = "blue"
+ width: 100; height: 100
+ ExtendedRectangle {}
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash.qml b/tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash.qml
new file mode 100644
index 0000000000..8e9b698383
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+
+ width: 100; height: 100
+ states: State {
+ name: "overridden"
+ PropertyChanges {
+ target: rect
+ onDidSomething: rect.state = ""
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash2.qml b/tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash2.qml
new file mode 100644
index 0000000000..74df9430c3
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/signalOverrideCrash2.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: myRect
+ width: 400
+ height: 400
+
+ states: [
+ State {
+ name: "state1"
+ PropertyChanges {
+ target: myRect
+ onHeightChanged: console.log("Hello World")
+ color: "green"
+ }
+ },
+ State {
+ name: "state2"; extend: "state1"
+ PropertyChanges {
+ target: myRect
+ color: "red"
+ }
+ }]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/unnamedWhen.qml b/tests/auto/qtquick1/qdeclarativestates/data/unnamedWhen.qml
new file mode 100644
index 0000000000..4425b4dd49
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/unnamedWhen.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: theRect
+ property bool triggerState: false
+ property string stateString: ""
+ states: State {
+ when: triggerState
+ PropertyChanges {
+ target: theRect
+ stateString: "inState"
+ }
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/urlResolution.qml b/tests/auto/qtquick1/qdeclarativestates/data/urlResolution.qml
new file mode 100644
index 0000000000..743f5404b0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/urlResolution.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+import "Implementation"
+
+Rectangle {
+ width: 100
+ height: 200
+
+ MyType {
+ objectName: "MyType"
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/data/whenOrdering.qml b/tests/auto/qtquick1/qdeclarativestates/data/whenOrdering.qml
new file mode 100644
index 0000000000..48aef5a6ce
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/data/whenOrdering.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+Rectangle {
+ property bool condition1: false
+ property bool condition2: false
+
+ states: [
+ State { name: "state1"; when: condition1 },
+ State { name: "state2"; when: condition2 }
+ ]
+}
diff --git a/tests/auto/qtquick1/qdeclarativestates/qdeclarativestates.pro b/tests/auto/qtquick1/qdeclarativestates/qdeclarativestates.pro
new file mode 100644
index 0000000000..79990aa31a
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/qdeclarativestates.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativestates.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/qtquick1/qdeclarativestates/tst_qdeclarativestates.cpp
new file mode 100644
index 0000000000..8da3abf614
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -0,0 +1,1514 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativeanchors_p_p.h>
+#include <QtQuick1/private/qdeclarativerectangle_p.h>
+#include <QtQuick1/private/qdeclarativeimage_p.h>
+#include <QtQuick1/private/qdeclarativepropertychanges_p.h>
+#include <QtQuick1/private/qdeclarativestategroup_p.h>
+#include <QtQuick1/private/qdeclarativeitem_p.h>
+#include <private/qdeclarativeproperty_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class MyAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int foo READ foo WRITE setFoo)
+public:
+ MyAttached(QObject *parent) : QObject(parent), m_foo(13) {}
+
+ int foo() const { return m_foo; }
+ void setFoo(int f) { m_foo = f; }
+
+private:
+ int m_foo;
+};
+
+class MyRect : public QDeclarative1Rectangle
+{
+ Q_OBJECT
+ Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
+public:
+ MyRect() {}
+
+ void doSomething() { emit didSomething(); }
+
+ int propertyWithNotify() const { return m_prop; }
+ void setPropertyWithNotify(int i) { m_prop = i; emit oddlyNamedNotifySignal(); }
+
+ static MyAttached *qmlAttachedProperties(QObject *o) {
+ return new MyAttached(o);
+ }
+Q_SIGNALS:
+ void didSomething();
+ void oddlyNamedNotifySignal();
+
+private:
+ int m_prop;
+};
+
+QML_DECLARE_TYPE(MyRect)
+QML_DECLARE_TYPEINFO(MyRect, QML_HAS_ATTACHED_PROPERTIES)
+
+class tst_qdeclarativestates : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativestates() {}
+
+private:
+ static QByteArray fullDataPath(const QString &path);
+
+private slots:
+ void initTestCase();
+
+ void basicChanges();
+ void attachedPropertyChanges();
+ void basicExtension();
+ void basicBinding();
+ void signalOverride();
+ void signalOverrideCrash();
+ void signalOverrideCrash2();
+ void parentChange();
+ void parentChangeErrors();
+ void anchorChanges();
+ void anchorChanges2();
+ void anchorChanges3();
+ void anchorChanges4();
+ void anchorChanges5();
+ void anchorChangesRTL();
+ void anchorChangesRTL2();
+ void anchorChangesRTL3();
+ void anchorChangesCrash();
+ void anchorRewindBug();
+ void anchorRewindBug2();
+ void script();
+ void restoreEntryValues();
+ void explicitChanges();
+ void propertyErrors();
+ void incorrectRestoreBug();
+ void autoStateAtStartupRestoreBug();
+ void deletingChange();
+ void deletingState();
+ void tempState();
+ void illegalTempState();
+ void nonExistantProperty();
+ void reset();
+ void illegalObjectCreation();
+ void whenOrdering();
+ void urlResolution();
+ void unnamedWhen();
+ void returnToBase();
+ void extendsBug();
+ void editProperties();
+ void QTBUG_14830();
+};
+
+void tst_qdeclarativestates::initTestCase()
+{
+ qmlRegisterType<MyRect>("Qt.test", 1, 0, "MyRectangle");
+}
+
+QByteArray tst_qdeclarativestates::fullDataPath(const QString &path)
+{
+ return QUrl::fromLocalFile(SRCDIR + path).toString().toUtf8();
+}
+
+void tst_qdeclarativestates::basicChanges()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges2.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges3.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+ //### we should be checking that this is an implicit rather than explicit 1 (which currently fails)
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ }
+
+ {
+ // Test basicChanges4.qml can magically connect to propertyWithNotify's notify
+ // signal using 'onPropertyWithNotifyChanged' even though the signal name is
+ // actually 'oddlyNamedNotifySignal'
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/basicChanges4.qml");
+ QVERIFY(component.isReady());
+
+ MyRect *rect = qobject_cast<MyRect*>(component.create());
+ QVERIFY(rect != 0);
+
+ QMetaProperty prop = rect->metaObject()->property(rect->metaObject()->indexOfProperty("propertyWithNotify"));
+ QVERIFY(prop.hasNotifySignal());
+ QString notifySignal = QByteArray(prop.notifySignal().signature());
+ QVERIFY(!notifySignal.startsWith("propertyWithNotifyChanged("));
+
+ QCOMPARE(rect->color(), QColor(Qt::red));
+
+ rect->setPropertyWithNotify(100);
+ QCOMPARE(rect->color(), QColor(Qt::blue));
+ }
+}
+
+void tst_qdeclarativestates::attachedPropertyChanges()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/attachedPropertyChanges.qml");
+ QVERIFY(component.isReady());
+
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QCOMPARE(item->width(), 50.0);
+
+ // Ensure attached property has been changed
+ QObject *attObj = qmlAttachedPropertiesObject<MyRect>(item, false);
+ QVERIFY(attObj);
+
+ MyAttached *att = qobject_cast<MyAttached*>(attObj);
+ QVERIFY(att);
+
+ QCOMPARE(att->foo(), 1);
+}
+
+void tst_qdeclarativestates::basicExtension()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicExtension.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/fakeExtension.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+ }
+}
+
+void tst_qdeclarativestates::basicBinding()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("yellow"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding2.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("green"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("yellow"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding3.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("red"));
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor2", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor2", QColor("green"));
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding4.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+ rect->setProperty("sourceColor", QColor("purple"));
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("purple"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ }
+}
+
+void tst_qdeclarativestates::signalOverride()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverride.qml");
+ MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ QDeclarativeItemPrivate::get(rect)->setState("green");
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("green"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverride2.qml");
+ MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("white"));
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("extendedRect"));
+ QDeclarativeItemPrivate::get(innerRect)->setState("green");
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(innerRect->color(),QColor("green"));
+ QCOMPARE(innerRect->property("extendedColor").value<QColor>(),QColor("green"));
+ }
+}
+
+void tst_qdeclarativestates::signalOverrideCrash()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash.qml");
+ MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("overridden");
+ rect->doSomething();
+}
+
+void tst_qdeclarativestates::signalOverrideCrash2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash2.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state2");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::parentChange()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange1.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1ParentChange *pChange = qobject_cast<QDeclarative1ParentChange*>(state->operationAt(0));
+ QVERIFY(pChange != 0);
+ QDeclarativeItem *nParent = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("NewParent"));
+ QVERIFY(nParent != 0);
+
+ QCOMPARE(pChange->parent(), nParent);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(-133));
+ QCOMPARE(innerRect->y(), qreal(-300));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange2.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ rectPrivate->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(15));
+ QCOMPARE(innerRect->scale(), qreal(.5));
+ QCOMPARE(QString("%1").arg(innerRect->x()), QString("%1").arg(-19.9075));
+ QCOMPARE(QString("%1").arg(innerRect->y()), QString("%1").arg(-8.73433));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange3.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ rectPrivate->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(-37));
+ QCOMPARE(innerRect->scale(), qreal(.25));
+ QCOMPARE(QString("%1").arg(innerRect->x()), QString("%1").arg(-217.305));
+ QCOMPARE(QString("%1").arg(innerRect->y()), QString("%1").arg(-164.413));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(5));
+ //do a non-qFuzzyCompare fuzzy compare
+ QVERIFY(innerRect->y() < qreal(0.00001) && innerRect->y() > qreal(-0.00001));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange6.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(180));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(-105));
+ QCOMPARE(innerRect->y(), qreal(-105));
+ }
+}
+
+void tst_qdeclarativestates::parentChangeErrors()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange4.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange4.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under non-uniform scale");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(5));
+ QCOMPARE(innerRect->y(), qreal(5));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange5.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange5.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under complex transform");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(5));
+ QCOMPARE(innerRect->y(), qreal(5));
+ }
+}
+
+void tst_qdeclarativestates::anchorChanges()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1AnchorChanges *aChanges = qobject_cast<QDeclarative1AnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), qreal(150));
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarative1AnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1AnchorChanges *aChanges = qobject_cast<QDeclarative1AnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+
+ QCOMPARE(innerRect->x(), qreal(10));
+ QCOMPARE(innerRect->y(), qreal(0));
+ QCOMPARE(innerRect->width(), qreal(190));
+ QCOMPARE(innerRect->height(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), qreal(0));
+ QCOMPARE(innerRect->y(), qreal(10));
+ QCOMPARE(innerRect->width(), qreal(150));
+ QCOMPARE(innerRect->height(), qreal(190));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges4()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges4.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1AnchorChanges *aChanges = qobject_cast<QDeclarative1AnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().item, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().item, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().anchorLine);
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges5()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges5.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1AnchorChanges *aChanges = qobject_cast<QDeclarative1AnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ //QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item);
+ //QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine);
+ //QCOMPARE(aChanges->anchors()->baseline().item, leftGuideline->baseline().item);
+ //QCOMPARE(aChanges->anchors()->baseline().anchorLine, leftGuideline->baseline().anchorLine);
+
+ delete rect;
+}
+
+void mirrorAnchors(QDeclarativeItem *item) {
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->setLayoutMirror(true);
+}
+
+qreal offsetRTL(QDeclarativeItem *anchorItem, QDeclarativeItem *item) {
+ return anchorItem->width()+2*anchorItem->x()-item->width();
+}
+
+void tst_qdeclarativestates::anchorChangesRTL()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1AnchorChanges *aChanges = qobject_cast<QDeclarative1AnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarative1AnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) -qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarative1Rectangle *innerRect = qobject_cast<QDeclarative1Rectangle*>(rect->findChild<QDeclarative1Rectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1AnchorChanges *aChanges = qobject_cast<QDeclarative1AnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+
+ QCOMPARE(innerRect->x(), offsetRTL(leftGuideline, innerRect) - qreal(10));
+ QCOMPARE(innerRect->y(), qreal(0));
+ // between left side of parent and leftGuideline.x: 10, which has width 0
+ QCOMPARE(innerRect->width(), qreal(10));
+ QCOMPARE(innerRect->height(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(0));
+ QCOMPARE(innerRect->y(), qreal(10));
+ // between right side of parent and left side of rightGuideline.x: 150, which has width 0
+ QCOMPARE(innerRect->width(), qreal(50));
+ QCOMPARE(innerRect->height(), qreal(190));
+
+ delete rect;
+}
+
+//QTBUG-9609
+void tst_qdeclarativestates::anchorChangesCrash()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChangesCrash.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+
+ delete rect;
+}
+
+// QTBUG-12273
+void tst_qdeclarativestates::anchorRewindBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItem * column = rect->findChild<QDeclarativeItem*>("column");
+
+ QVERIFY(column != 0);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QCOMPARE(column->height(), 200.0);
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+
+ // column height and width should stay implicit
+ // and column's implicit resizing should still work
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QCOMPARE(column->height(), 100.0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("");
+
+ // column height and width should stay implicit
+ // and column's implicit resizing should still work
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QCOMPARE(column->height(), 200.0);
+
+ delete rect;
+}
+
+// QTBUG-11834
+void tst_qdeclarativestates::anchorRewindBug2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug2.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Rectangle *mover = rect->findChild<QDeclarative1Rectangle*>("mover");
+
+ QVERIFY(mover != 0);
+ QCOMPARE(mover->y(), qreal(0.0));
+ QCOMPARE(mover->width(), qreal(50.0));
+
+ QDeclarativeItemPrivate::get(rect)->setState("anchored");
+ QCOMPARE(mover->y(), qreal(250.0));
+ QCOMPARE(mover->width(), qreal(200.0));
+
+ QDeclarativeItemPrivate::get(rect)->setState("");
+ QCOMPARE(mover->y(), qreal(0.0));
+ QCOMPARE(mover->width(), qreal(50.0));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::script()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/script.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("blue")); // a script isn't reverted
+ }
+}
+
+void tst_qdeclarativestates::restoreEntryValues()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/restoreEntryValues.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("blue"));
+}
+
+void tst_qdeclarativestates::explicitChanges()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/explicit.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarativeListReference list(rect, "states");
+ QDeclarative1State *state = qobject_cast<QDeclarative1State*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarative1PropertyChanges *changes = qobject_cast<QDeclarative1PropertyChanges*>(rect->findChild<QDeclarative1PropertyChanges*>("changes"));
+ QVERIFY(changes != 0);
+ QVERIFY(changes->isExplicit());
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("yellow"));
+}
+
+void tst_qdeclarativestates::propertyErrors()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/propertyErrors.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"activeFocus\"");
+ QDeclarativeItemPrivate::get(rect)->setState("blue");
+}
+
+void tst_qdeclarativestates::incorrectRestoreBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ // make sure if we change the base state value, we then restore to it correctly
+ rect->setColor(QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("green"));
+}
+
+void tst_qdeclarativestates::autoStateAtStartupRestoreBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/autoStateAtStartupRestoreBug.qml");
+ QObject *obj = component.create();
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->property("test").toInt(), 3);
+
+ obj->setProperty("input", 2);
+
+ QCOMPARE(obj->property("test").toInt(), 9);
+
+ delete obj;
+}
+
+void tst_qdeclarativestates::deletingChange()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/deleting.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->radius(),qreal(5));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->radius(),qreal(0));
+
+ QDeclarative1PropertyChanges *pc = rect->findChild<QDeclarative1PropertyChanges*>("pc1");
+ QVERIFY(pc != 0);
+ delete pc;
+
+ QDeclarative1State *state = rect->findChild<QDeclarative1State*>();
+ QVERIFY(state != 0);
+ qmlExecuteDeferred(state);
+ QCOMPARE(state->operationCount(), 1);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->radius(),qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::deletingState()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/deletingState.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1StateGroup *sg = rect->findChild<QDeclarative1StateGroup*>();
+ QVERIFY(sg != 0);
+ QVERIFY(sg->findState("blue") != 0);
+
+ sg->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ sg->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ QDeclarative1State *state = rect->findChild<QDeclarative1State*>();
+ QVERIFY(state != 0);
+ delete state;
+
+ QVERIFY(sg->findState("blue") == 0);
+
+ //### should we warn that state doesn't exist
+ sg->setState("blue");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::tempState()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/legalTempState.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QTest::ignoreMessage(QtDebugMsg, "entering placed");
+ QTest::ignoreMessage(QtDebugMsg, "entering idle");
+ rectPrivate->setState("placed");
+ QCOMPARE(rectPrivate->state(), QLatin1String("idle"));
+}
+
+void tst_qdeclarativestates::illegalTempState()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/illegalTempState.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition.");
+ rectPrivate->setState("placed");
+ QCOMPARE(rectPrivate->state(), QLatin1String("placed"));
+}
+
+void tst_qdeclarativestates::nonExistantProperty()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/nonExistantProp.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/nonExistantProp.qml") + ":9:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
+ rectPrivate->setState("blue");
+ QCOMPARE(rectPrivate->state(), QLatin1String("blue"));
+}
+
+void tst_qdeclarativestates::reset()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/reset.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarative1Image *image = rect->findChild<QDeclarative1Image*>();
+ QVERIFY(image != 0);
+ QCOMPARE(image->width(), qreal(40.));
+ QCOMPARE(image->height(), qreal(20.));
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+
+ QCOMPARE(image->width(), 20.0);
+ QCOMPARE(image->height(), qreal(20.));
+}
+
+void tst_qdeclarativestates::illegalObjectCreation()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/illegalObj.qml");
+ QList<QDeclarativeError> errors = component.errors();
+ QVERIFY(errors.count() == 1);
+ const QDeclarativeError &error = errors.at(0);
+ QCOMPARE(error.line(), 9);
+ QCOMPARE(error.column(), 23);
+ QCOMPARE(error.description().toUtf8().constData(), "PropertyChanges does not support creating state-specific objects.");
+}
+
+void tst_qdeclarativestates::whenOrdering()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/whenOrdering.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ rect->setProperty("condition2", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state2"));
+ rect->setProperty("condition1", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
+ rect->setProperty("condition2", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
+ rect->setProperty("condition2", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
+ rect->setProperty("condition1", false);
+ rect->setProperty("condition2", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+}
+
+void tst_qdeclarativestates::urlResolution()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/urlResolution.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItem *myType = rect->findChild<QDeclarativeItem*>("MyType");
+ QDeclarative1Image *image1 = rect->findChild<QDeclarative1Image*>("image1");
+ QDeclarative1Image *image2 = rect->findChild<QDeclarative1Image*>("image2");
+ QDeclarative1Image *image3 = rect->findChild<QDeclarative1Image*>("image3");
+ QVERIFY(myType != 0 && image1 != 0 && image2 != 0 && image3 != 0);
+
+ QDeclarativeItemPrivate::get(myType)->setState("SetImageState");
+ QUrl resolved = QUrl::fromLocalFile(SRCDIR "/data/Implementation/images/qt-logo.png");
+ QCOMPARE(image1->source(), resolved);
+ QCOMPARE(image2->source(), resolved);
+ QCOMPARE(image3->source(), resolved);
+}
+
+void tst_qdeclarativestates::unnamedWhen()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/unnamedWhen.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+ rect->setProperty("triggerState", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("anonymousState1"));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String("inState"));
+ rect->setProperty("triggerState", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+}
+
+void tst_qdeclarativestates::returnToBase()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/returnToBase.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+ rect->setProperty("triggerState", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("anonymousState1"));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String("inState"));
+ rect->setProperty("triggerState", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String("originalState"));
+}
+
+//QTBUG-12559
+void tst_qdeclarativestates::extendsBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/extendsBug.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarative1Rectangle *greenRect = rect->findChild<QDeclarative1Rectangle*>("greenRect");
+
+ rectPrivate->setState("b");
+ QCOMPARE(greenRect->x(), qreal(100));
+ QCOMPARE(greenRect->y(), qreal(100));
+}
+
+void tst_qdeclarativestates::editProperties()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/editProperties.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarative1StateGroup *stateGroup = rectPrivate->_states();
+ QVERIFY(stateGroup != 0);
+ qmlExecuteDeferred(stateGroup);
+
+ QDeclarative1State *blueState = stateGroup->findState("blue");
+ QVERIFY(blueState != 0);
+ qmlExecuteDeferred(blueState);
+
+ QDeclarative1PropertyChanges *propertyChangesBlue = qobject_cast<QDeclarative1PropertyChanges*>(blueState->operationAt(0));
+ QVERIFY(propertyChangesBlue != 0);
+
+ QDeclarative1State *greenState = stateGroup->findState("green");
+ QVERIFY(greenState != 0);
+ qmlExecuteDeferred(greenState);
+
+ QDeclarative1PropertyChanges *propertyChangesGreen = qobject_cast<QDeclarative1PropertyChanges*>(greenState->operationAt(0));
+ QVERIFY(propertyChangesGreen != 0);
+
+ QDeclarative1Rectangle *childRect = rect->findChild<QDeclarative1Rectangle*>("rect2");
+ QVERIFY(childRect != 0);
+ QCOMPARE(childRect->width(), qreal(402));
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QCOMPARE(childRect->height(), qreal(200));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(childRect->width(), qreal(50));
+ QCOMPARE(childRect->height(), qreal(40));
+ QVERIFY(!QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QVERIFY(blueState->bindingInRevertList(childRect, "width"));
+
+
+ rectPrivate->setState("green");
+ QCOMPARE(childRect->width(), qreal(200));
+ QCOMPARE(childRect->height(), qreal(100));
+ QVERIFY(greenState->bindingInRevertList(childRect, "width"));
+
+
+ rectPrivate->setState("");
+
+
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QVERIFY(propertyChangesBlue->containsValue("width"));
+ QVERIFY(!propertyChangesBlue->containsProperty("x"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 50);
+ QVERIFY(!propertyChangesBlue->value("x").isValid());
+
+ propertyChangesBlue->changeValue("width", 60);
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 60);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+
+
+ propertyChangesBlue->changeExpression("width", "myRectangle.width / 2");
+ QVERIFY(!propertyChangesBlue->containsValue("width"));
+ QVERIFY(propertyChangesBlue->containsExpression("width"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 0);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+
+ propertyChangesBlue->changeValue("width", 50);
+ QVERIFY(propertyChangesBlue->containsValue("width"));
+ QVERIFY(!propertyChangesBlue->containsExpression("width"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 50);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ rectPrivate->setState("blue");
+ QCOMPARE(childRect->width(), qreal(50));
+ QCOMPARE(childRect->height(), qreal(40));
+
+ propertyChangesBlue->changeValue("width", 60);
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 60);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(childRect->width(), qreal(60));
+ QVERIFY(!QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+
+ propertyChangesBlue->changeExpression("width", "myRectangle.width / 2");
+ QVERIFY(!propertyChangesBlue->containsValue("width"));
+ QVERIFY(propertyChangesBlue->containsExpression("width"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 0);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QCOMPARE(childRect->width(), qreal(200));
+
+ propertyChangesBlue->changeValue("width", 50);
+ QCOMPARE(childRect->width(), qreal(50));
+
+ rectPrivate->setState("");
+ QCOMPARE(childRect->width(), qreal(402));
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+
+ QCOMPARE(propertyChangesGreen->actions().length(), 2);
+ rectPrivate->setState("green");
+ QCOMPARE(childRect->width(), qreal(200));
+ QCOMPARE(childRect->height(), qreal(100));
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QVERIFY(greenState->bindingInRevertList(childRect, "width"));
+ QCOMPARE(propertyChangesGreen->actions().length(), 2);
+
+
+ propertyChangesGreen->removeProperty("height");
+ QVERIFY(!QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "height")));
+ QCOMPARE(childRect->height(), qreal(200));
+
+ QVERIFY(greenState->bindingInRevertList(childRect, "width"));
+ QVERIFY(greenState->containsPropertyInRevertList(childRect, "width"));
+ propertyChangesGreen->removeProperty("width");
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QCOMPARE(childRect->width(), qreal(402));
+ QVERIFY(!greenState->bindingInRevertList(childRect, "width"));
+ QVERIFY(!greenState->containsPropertyInRevertList(childRect, "width"));
+
+ propertyChangesBlue->removeProperty("width");
+ QCOMPARE(childRect->width(), qreal(402));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(childRect->width(), qreal(402));
+ QCOMPARE(childRect->height(), qreal(40));
+}
+
+void tst_qdeclarativestates::QTBUG_14830()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/QTBUG-14830.qml");
+ QDeclarative1Rectangle *rect = qobject_cast<QDeclarative1Rectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItem *item = rect->findChild<QDeclarativeItem*>("area");
+
+ QCOMPARE(item->width(), qreal(171));
+}
+
+QTEST_MAIN(tst_qdeclarativestates)
+
+#include "tst_qdeclarativestates.moc"
diff --git a/tests/auto/qtquick1/qdeclarativesystempalette/qdeclarativesystempalette.pro b/tests/auto/qtquick1/qdeclarativesystempalette/qdeclarativesystempalette.pro
new file mode 100644
index 0000000000..eb1ff6ac58
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesystempalette/qdeclarativesystempalette.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativesystempalette.cpp
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp b/tests/auto/qtquick1/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp
new file mode 100644
index 0000000000..0c44e9f833
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDebug>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativesystempalette_p.h>
+#include <qpalette.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativesystempalette : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativesystempalette();
+
+private slots:
+ void activePalette();
+ void inactivePalette();
+ void disabledPalette();
+ void paletteChanged();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativesystempalette::tst_qdeclarativesystempalette()
+{
+}
+
+void tst_qdeclarativesystempalette::activePalette()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1SystemPalette *object = qobject_cast<QDeclarative1SystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+
+ QPalette palette;
+ palette.setCurrentColorGroup(QPalette::Active);
+ QCOMPARE(palette.window().color(), object->window());
+ QCOMPARE(palette.windowText().color(), object->windowText());
+ QCOMPARE(palette.base().color(), object->base());
+ QCOMPARE(palette.text().color(), object->text());
+ QCOMPARE(palette.alternateBase().color(), object->alternateBase());
+ QCOMPARE(palette.button().color(), object->button());
+ QCOMPARE(palette.buttonText().color(), object->buttonText());
+ QCOMPARE(palette.light().color(), object->light());
+ QCOMPARE(palette.midlight().color(), object->midlight());
+ QCOMPARE(palette.dark().color(), object->dark());
+ QCOMPARE(palette.mid().color(), object->mid());
+ QCOMPARE(palette.shadow().color(), object->shadow());
+ QCOMPARE(palette.highlight().color(), object->highlight());
+ QCOMPARE(palette.highlightedText().color(), object->highlightedText());
+
+ delete object;
+}
+
+void tst_qdeclarativesystempalette::inactivePalette()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { colorGroup: SystemPalette.Inactive }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1SystemPalette *object = qobject_cast<QDeclarative1SystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+ QVERIFY(object->colorGroup() == QDeclarative1SystemPalette::Inactive);
+
+ QPalette palette;
+ palette.setCurrentColorGroup(QPalette::Inactive);
+ QCOMPARE(palette.window().color(), object->window());
+ QCOMPARE(palette.windowText().color(), object->windowText());
+ QCOMPARE(palette.base().color(), object->base());
+ QCOMPARE(palette.text().color(), object->text());
+ QCOMPARE(palette.alternateBase().color(), object->alternateBase());
+ QCOMPARE(palette.button().color(), object->button());
+ QCOMPARE(palette.buttonText().color(), object->buttonText());
+ QCOMPARE(palette.light().color(), object->light());
+ QCOMPARE(palette.midlight().color(), object->midlight());
+ QCOMPARE(palette.dark().color(), object->dark());
+ QCOMPARE(palette.mid().color(), object->mid());
+ QCOMPARE(palette.shadow().color(), object->shadow());
+ QCOMPARE(palette.highlight().color(), object->highlight());
+ QCOMPARE(palette.highlightedText().color(), object->highlightedText());
+
+ delete object;
+}
+
+void tst_qdeclarativesystempalette::disabledPalette()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { colorGroup: SystemPalette.Disabled }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1SystemPalette *object = qobject_cast<QDeclarative1SystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+ QVERIFY(object->colorGroup() == QDeclarative1SystemPalette::Disabled);
+
+ QPalette palette;
+ palette.setCurrentColorGroup(QPalette::Disabled);
+ QCOMPARE(palette.window().color(), object->window());
+ QCOMPARE(palette.windowText().color(), object->windowText());
+ QCOMPARE(palette.base().color(), object->base());
+ QCOMPARE(palette.text().color(), object->text());
+ QCOMPARE(palette.alternateBase().color(), object->alternateBase());
+ QCOMPARE(palette.button().color(), object->button());
+ QCOMPARE(palette.buttonText().color(), object->buttonText());
+ QCOMPARE(palette.light().color(), object->light());
+ QCOMPARE(palette.midlight().color(), object->midlight());
+ QCOMPARE(palette.dark().color(), object->dark());
+ QCOMPARE(palette.mid().color(), object->mid());
+ QCOMPARE(palette.shadow().color(), object->shadow());
+ QCOMPARE(palette.highlight().color(), object->highlight());
+ QCOMPARE(palette.highlightedText().color(), object->highlightedText());
+
+ delete object;
+}
+
+void tst_qdeclarativesystempalette::paletteChanged()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarative1SystemPalette *object = qobject_cast<QDeclarative1SystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+
+ QPalette p;
+ p.setCurrentColorGroup(QPalette::Active);
+ p.setColor(QPalette::Active, QPalette::Text, QColor("red"));
+ p.setColor(QPalette::Active, QPalette::ButtonText, QColor("green"));
+ p.setColor(QPalette::Active, QPalette::WindowText, QColor("blue"));
+
+ qApp->setPalette(p);
+
+ object->setColorGroup(QDeclarative1SystemPalette::Active);
+ QTRY_COMPARE(QColor("red"), object->text());
+ QTRY_COMPARE(QColor("green"), object->buttonText());
+ QTRY_COMPARE(QColor("blue"), object->windowText());
+
+ delete object;
+}
+
+QTEST_MAIN(tst_qdeclarativesystempalette)
+
+#include "tst_qdeclarativesystempalette.moc"
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments.qml b/tests/auto/qtquick1/qdeclarativetext/data/alignments.qml
index 25105f6789..25105f6789 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_cb.png
index cf6199a418..cf6199a418 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_cb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_cc.png
index f81ccb4238..f81ccb4238 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_cc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_ct.png
index 9ba64125d5..9ba64125d5 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_ct.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_lb.png
index 1b50a81f3d..1b50a81f3d 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_lb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_lc.png
index f041b868f8..f041b868f8 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_lc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_lt.png
index c75e0d158e..c75e0d158e 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_lt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_rb.png
index b06a5da715..b06a5da715 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_rb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_rc.png
index e468857cd0..e468857cd0 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_rc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png b/tests/auto/qtquick1/qdeclarativetext/data/alignments_rt.png
index 576715ffce..576715ffce 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/alignments_rt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml b/tests/auto/qtquick1/qdeclarativetext/data/elideimplicitwidth.qml
index 60ae15c4e1..60ae15c4e1 100644
--- a/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/elideimplicitwidth.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesLocal.qml
index ee9b95a2a7..ee9b95a2a7 100644
--- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesLocal.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesLocalError.qml
index 4dc0d3e16f..4dc0d3e16f 100644
--- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesLocalError.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesRemote.qml
index 438f4a06d3..438f4a06d3 100644
--- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesRemote.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesRemoteError.qml
index c24bf24f9c..c24bf24f9c 100644
--- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/embeddedImagesRemoteError.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml b/tests/auto/qtquick1/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml
index 4f58944672..4f58944672 100644
--- a/tests/auto/declarative/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/http/exists.png b/tests/auto/qtquick1/qdeclarativetext/data/http/exists.png
index 399bd0b1d9..399bd0b1d9 100644
--- a/tests/auto/declarative/qdeclarativetext/data/http/exists.png
+++ b/tests/auto/qtquick1/qdeclarativetext/data/http/exists.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/lineCount.qml b/tests/auto/qtquick1/qdeclarativetext/data/lineCount.qml
index 63817f6f2a..63817f6f2a 100644
--- a/tests/auto/declarative/qdeclarativetext/data/lineCount.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/lineCount.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/lineHeight.qml b/tests/auto/qtquick1/qdeclarativetext/data/lineHeight.qml
index 851d871192..851d871192 100644
--- a/tests/auto/declarative/qdeclarativetext/data/lineHeight.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/lineHeight.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml b/tests/auto/qtquick1/qdeclarativetext/data/qtbug_14734.qml
index bd07d66727..bd07d66727 100644
--- a/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/qtbug_14734.qml
diff --git a/tests/auto/declarative/qdeclarativetext/data/rotated.qml b/tests/auto/qtquick1/qdeclarativetext/data/rotated.qml
index 1e893b93fc..1e893b93fc 100644
--- a/tests/auto/declarative/qdeclarativetext/data/rotated.qml
+++ b/tests/auto/qtquick1/qdeclarativetext/data/rotated.qml
diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/qtquick1/qdeclarativetext/qdeclarativetext.pro
index 5a043e0a05..fbb88ae1fa 100644
--- a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
+++ b/tests/auto/qtquick1/qdeclarativetext/qdeclarativetext.pro
@@ -1,13 +1,13 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
QT += network
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativetext.cpp
-INCLUDEPATH += ../shared/
-HEADERS += ../shared/testhttpserver.h
-SOURCES += ../shared/testhttpserver.cpp
+INCLUDEPATH += ../../declarative/shared/
+HEADERS += ../../declarative/shared/testhttpserver.h
+SOURCES += ../../declarative/shared/testhttpserver.cpp
symbian: {
importFiles.files = data
@@ -19,4 +19,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/qtquick1/qdeclarativetext/tst_qdeclarativetext.cpp
index 118303ea56..d6984cb98a 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/qtquick1/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -42,13 +42,13 @@
#include <QTextDocument>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <private/qdeclarativetext_p.h>
-#include <private/qdeclarativetext_p_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativetext_p_p.h>
#include <private/qdeclarativevaluetype_p.h>
#include <QFontMetrics>
#include <QGraphicsSceneMouseEvent>
#include <qmath.h>
-#include <QDeclarativeView>
+#include <QtQuick1/QDeclarativeView>
#include <private/qapplication_p.h>
#include <limits.h>
@@ -121,7 +121,7 @@ private:
QList<Qt::Alignment> horizontalAlignmentments;
QStringList styleStrings;
- QList<QDeclarativeText::TextStyle> styles;
+ QList<QDeclarative1Text::TextStyle> styles;
QStringList colorStrings;
@@ -159,10 +159,10 @@ tst_qdeclarativetext::tst_qdeclarativetext()
<< "Raised"
<< "Sunken";
- styles << QDeclarativeText::Normal
- << QDeclarativeText::Outline
- << QDeclarativeText::Raised
- << QDeclarativeText::Sunken;
+ styles << QDeclarative1Text::Normal
+ << QDeclarative1Text::Outline
+ << QDeclarative1Text::Raised
+ << QDeclarative1Text::Sunken;
colorStrings << "aliceblue"
<< "antiquewhite"
@@ -196,7 +196,7 @@ void tst_qdeclarativetext::text()
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData("import QtQuick 1.0\nText { text: \"\" }", QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->text(), QString(""));
@@ -211,7 +211,7 @@ void tst_qdeclarativetext::text()
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->text(), standard.at(i));
@@ -225,7 +225,7 @@ void tst_qdeclarativetext::text()
QString componentStr = "import QtQuick 1.0\nText { text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QString expected = richText.at(i);
@@ -242,7 +242,7 @@ void tst_qdeclarativetext::width()
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData("import QtQuick 1.0\nText { text: \"\" }", QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->width(), 0.);
@@ -262,12 +262,12 @@ void tst_qdeclarativetext::width()
QString componentStr = "import QtQuick 1.0\nText { text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QVERIFY(textObject->boundingRect().width() > 0);
QCOMPARE(textObject->width(), qreal(metricWidth));
- QVERIFY(textObject->textFormat() == QDeclarativeText::AutoText); // setting text doesn't change format
+ QVERIFY(textObject->textFormat() == QDeclarative1Text::AutoText); // setting text doesn't change format
delete textObject;
}
@@ -285,11 +285,11 @@ void tst_qdeclarativetext::width()
QString componentStr = "import QtQuick 1.0\nText { text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->width(), qreal(documentWidth));
- QVERIFY(textObject->textFormat() == QDeclarativeText::AutoText); // setting text doesn't change format
+ QVERIFY(textObject->textFormat() == QDeclarative1Text::AutoText); // setting text doesn't change format
delete textObject;
}
@@ -302,11 +302,11 @@ void tst_qdeclarativetext::wrap()
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData("import QtQuick 1.0\nText { text: \"Hello\"; wrapMode: Text.WordWrap; width: 300 }", QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
textHeight = textObject->height();
QVERIFY(textObject != 0);
- QVERIFY(textObject->wrapMode() == QDeclarativeText::WordWrap);
+ QVERIFY(textObject->wrapMode() == QDeclarative1Text::WordWrap);
QCOMPARE(textObject->width(), 300.);
delete textObject;
@@ -317,7 +317,7 @@ void tst_qdeclarativetext::wrap()
QString componentStr = "import QtQuick 1.0\nText { wrapMode: Text.WordWrap; width: 30; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->width(), 30.);
@@ -335,7 +335,7 @@ void tst_qdeclarativetext::wrap()
QString componentStr = "import QtQuick 1.0\nText { wrapMode: Text.WordWrap; width: 30; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->width(), 30.);
@@ -354,7 +354,7 @@ void tst_qdeclarativetext::wrap()
QString componentStr = "import QtQuick 1.0\nText { wrapMode: Text.WordWrap; width: 30; height: 50; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->width(), 30.);
@@ -370,7 +370,7 @@ void tst_qdeclarativetext::wrap()
void tst_qdeclarativetext::elide()
{
- for (QDeclarativeText::TextElideMode m = QDeclarativeText::ElideLeft; m<=QDeclarativeText::ElideNone; m=QDeclarativeText::TextElideMode(int(m)+1)) {
+ for (QDeclarative1Text::TextElideMode m = QDeclarative1Text::ElideLeft; m<=QDeclarative1Text::ElideNone; m=QDeclarative1Text::TextElideMode(int(m)+1)) {
const char* elidename[]={"ElideLeft", "ElideRight", "ElideMiddle", "ElideNone"};
QString elide = "elide: Text." + QString(elidename[int(m)]) + ";";
@@ -379,7 +379,7 @@ void tst_qdeclarativetext::elide()
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData(("import QtQuick 1.0\nText { text: \"\"; "+elide+" width: 100 }").toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->elideMode(), m);
QCOMPARE(textObject->width(), 100.);
@@ -392,7 +392,7 @@ void tst_qdeclarativetext::elide()
QString componentStr = "import QtQuick 1.0\nText { "+elide+" width: 100; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->elideMode(), m);
QCOMPARE(textObject->width(), 100.);
@@ -406,7 +406,7 @@ void tst_qdeclarativetext::elide()
QString componentStr = "import QtQuick 1.0\nText { "+elide+" width: 100; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->elideMode(), m);
QCOMPARE(textObject->width(), 100.);
@@ -428,20 +428,20 @@ void tst_qdeclarativetext::textFormat()
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData("import QtQuick 1.0\nText { text: \"Hello\"; textFormat: Text.RichText }", QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
- QVERIFY(textObject->textFormat() == QDeclarativeText::RichText);
+ QVERIFY(textObject->textFormat() == QDeclarative1Text::RichText);
delete textObject;
}
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData("import QtQuick 1.0\nText { text: \"<b>Hello</b>\"; textFormat: Text.PlainText }", QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
- QVERIFY(textObject->textFormat() == QDeclarativeText::PlainText);
+ QVERIFY(textObject->textFormat() == QDeclarative1Text::PlainText);
delete textObject;
}
@@ -522,7 +522,7 @@ void tst_qdeclarativetext::horizontalAlignment()
QString componentStr = "import QtQuick 1.0\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j));
@@ -537,7 +537,7 @@ void tst_qdeclarativetext::horizontalAlignment()
QString componentStr = "import QtQuick 1.0\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j));
@@ -550,86 +550,86 @@ void tst_qdeclarativetext::horizontalAlignment()
void tst_qdeclarativetext::horizontalAlignment_RightToLeft()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml");
- QDeclarativeText *text = canvas->rootObject()->findChild<QDeclarativeText*>("text");
+ QDeclarative1Text *text = canvas->rootObject()->findChild<QDeclarative1Text*>("text");
QVERIFY(text != 0);
canvas->show();
- QDeclarativeTextPrivate *textPrivate = QDeclarativeTextPrivate::get(text);
+ QDeclarative1TextPrivate *textPrivate = QDeclarative1TextPrivate::get(text);
QVERIFY(textPrivate != 0);
// implicit alignment should follow the reading direction of RTL text
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
QCOMPARE(text->effectiveHAlign(), text->hAlign());
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
// explicitly left aligned text
- text->setHAlign(QDeclarativeText::AlignLeft);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ text->setHAlign(QDeclarative1Text::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignLeft);
QCOMPARE(text->effectiveHAlign(), text->hAlign());
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
// explicitly right aligned text
- text->setHAlign(QDeclarativeText::AlignRight);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ text->setHAlign(QDeclarative1Text::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
QCOMPARE(text->effectiveHAlign(), text->hAlign());
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
// change to rich text
QString textString = text->text();
text->setText(QString("<i>") + textString + QString("</i>"));
- text->setTextFormat(QDeclarativeText::RichText);
+ text->setTextFormat(QDeclarative1Text::RichText);
text->resetHAlign();
// implicitly aligned rich text should follow the reading direction of text
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
QCOMPARE(text->effectiveHAlign(), text->hAlign());
QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
// explicitly left aligned rich text
- text->setHAlign(QDeclarativeText::AlignLeft);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ text->setHAlign(QDeclarative1Text::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignLeft);
QCOMPARE(text->effectiveHAlign(), text->hAlign());
QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignRight);
// explicitly right aligned rich text
- text->setHAlign(QDeclarativeText::AlignRight);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ text->setHAlign(QDeclarative1Text::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
QCOMPARE(text->effectiveHAlign(), text->hAlign());
QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
text->setText(textString);
- text->setTextFormat(QDeclarativeText::PlainText);
+ text->setTextFormat(QDeclarative1Text::PlainText);
// explicitly center aligned
- text->setHAlign(QDeclarativeText::AlignHCenter);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignHCenter);
+ text->setHAlign(QDeclarative1Text::AlignHCenter);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignHCenter);
QCOMPARE(text->effectiveHAlign(), text->hAlign());
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().right() > canvas->width()/2);
// reseted alignment should go back to following the text reading direction
text->resetHAlign();
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
// mirror the text item
QDeclarativeItemPrivate::get(text)->setLayoutMirror(true);
// mirrored implicit alignment should continue to follow the reading direction of the text
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
- QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarative1Text::AlignRight);
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
// mirrored explicitly right aligned behaves as left aligned
- text->setHAlign(QDeclarativeText::AlignRight);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
- QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignLeft);
+ text->setHAlign(QDeclarative1Text::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarative1Text::AlignLeft);
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
// mirrored explicitly left aligned behaves as right aligned
- text->setHAlign(QDeclarativeText::AlignLeft);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
- QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ text->setHAlign(QDeclarative1Text::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), QDeclarative1Text::AlignRight);
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
// disable mirroring
@@ -638,7 +638,7 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft()
// English text should be implicitly left aligned
text->setText("Hello world!");
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignLeft);
QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
#ifndef Q_OS_MAC // QTBUG-18040
@@ -646,9 +646,9 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft()
// keyboard input direction from QApplication::keyboardInputDirection
text->setText("");
QCOMPARE(text->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
- QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
- text->setHAlign(QDeclarativeText::AlignRight);
- QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QDeclarative1Text::AlignLeft : QDeclarative1Text::AlignRight);
+ text->setHAlign(QDeclarative1Text::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight);
#endif
delete canvas;
@@ -658,9 +658,9 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft()
QString componentStr = "import QtQuick 1.0\nText {}";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
- QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
+ QDeclarative1Text::AlignLeft : QDeclarative1Text::AlignRight);
delete textObject;
#endif
}
@@ -676,7 +676,7 @@ void tst_qdeclarativetext::verticalAlignment()
QString componentStr = "import QtQuick 1.0\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j));
@@ -692,7 +692,7 @@ void tst_qdeclarativetext::verticalAlignment()
QString componentStr = "import QtQuick 1.0\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j));
@@ -705,16 +705,16 @@ void tst_qdeclarativetext::verticalAlignment()
QString componentStr = "import QtQuick 1.0\nText { height: 80; text: \"Hello\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QRectF br = textObject->boundingRect();
QVERIFY(br.y() == 0);
- textObject->setVAlign(QDeclarativeText::AlignVCenter);
+ textObject->setVAlign(QDeclarative1Text::AlignVCenter);
br = textObject->boundingRect();
QCOMPARE(qFloor(br.y()), qFloor((80.0 - br.height())/2));
- textObject->setVAlign(QDeclarativeText::AlignBottom);
+ textObject->setVAlign(QDeclarative1Text::AlignBottom);
br = textObject->boundingRect();
QCOMPARE(qFloor(br.y()), qFloor(80.0 - br.height()));
@@ -728,7 +728,7 @@ void tst_qdeclarativetext::font()
QString componentStr = "import QtQuick 1.0\nText { font.pointSize: 40; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->font().pointSize(), 40);
QCOMPARE(textObject->font().bold(), false);
@@ -741,7 +741,7 @@ void tst_qdeclarativetext::font()
QString componentStr = "import QtQuick 1.0\nText { font.pixelSize: 40; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->font().pixelSize(), 40);
QCOMPARE(textObject->font().bold(), false);
@@ -754,7 +754,7 @@ void tst_qdeclarativetext::font()
QString componentStr = "import QtQuick 1.0\nText { font.bold: true; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->font().bold(), true);
QCOMPARE(textObject->font().italic(), false);
@@ -766,7 +766,7 @@ void tst_qdeclarativetext::font()
QString componentStr = "import QtQuick 1.0\nText { font.italic: true; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->font().italic(), true);
QCOMPARE(textObject->font().bold(), false);
@@ -778,7 +778,7 @@ void tst_qdeclarativetext::font()
QString componentStr = "import QtQuick 1.0\nText { font.family: \"Helvetica\"; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->font().family(), QString("Helvetica"));
QCOMPARE(textObject->font().bold(), false);
@@ -791,7 +791,7 @@ void tst_qdeclarativetext::font()
QString componentStr = "import QtQuick 1.0\nText { font.family: \"\"; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->font().family(), QString(""));
@@ -807,7 +807,7 @@ void tst_qdeclarativetext::style()
QString componentStr = "import QtQuick 1.0\nText { style: \"" + styleStrings.at(i) + "\"; styleColor: \"white\"; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE((int)textObject->style(), (int)styles.at(i));
QCOMPARE(textObject->styleColor(), QColor("white"));
@@ -817,10 +817,10 @@ void tst_qdeclarativetext::style()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QRectF brPre = textObject->boundingRect();
- textObject->setStyle(QDeclarativeText::Outline);
+ textObject->setStyle(QDeclarative1Text::Outline);
QRectF brPost = textObject->boundingRect();
QVERIFY(brPre.width() < brPost.width());
@@ -837,7 +837,7 @@ void tst_qdeclarativetext::color()
QString componentStr = "import QtQuick 1.0\nText { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->color(), QColor(colorStrings.at(i)));
QCOMPARE(textObject->styleColor(), QColor());
@@ -850,7 +850,7 @@ void tst_qdeclarativetext::color()
QString componentStr = "import QtQuick 1.0\nText { styleColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(i)));
// default color to black?
@@ -866,7 +866,7 @@ void tst_qdeclarativetext::color()
QString componentStr = "import QtQuick 1.0\nText { color: \"" + colorStrings.at(i) + "\"; styleColor: \"" + colorStrings.at(j) + "\"; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->color(), QColor(colorStrings.at(i)));
QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(j)));
@@ -882,7 +882,7 @@ void tst_qdeclarativetext::color()
QString componentStr = "import QtQuick 1.0\nText { color: \"" + colorStr + "\"; text: \"Hello World\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->color(), testColor);
@@ -898,7 +898,7 @@ void tst_qdeclarativetext::smooth()
QString componentStr = "import QtQuick 1.0\nText { smooth: true; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->smooth(), true);
delete textObject;
@@ -907,7 +907,7 @@ void tst_qdeclarativetext::smooth()
QString componentStr = "import QtQuick 1.0\nText { text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->smooth(), false);
delete textObject;
@@ -919,7 +919,7 @@ void tst_qdeclarativetext::smooth()
QString componentStr = "import QtQuick 1.0\nText { smooth: true; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->smooth(), true);
delete textObject;
@@ -928,7 +928,7 @@ void tst_qdeclarativetext::smooth()
QString componentStr = "import QtQuick 1.0\nText { text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QCOMPARE(textObject->smooth(), false);
delete textObject;
@@ -942,7 +942,7 @@ void tst_qdeclarativetext::weight()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->font().weight(), (int)QDeclarativeFontValueType::Normal);
@@ -953,7 +953,7 @@ void tst_qdeclarativetext::weight()
QString componentStr = "import QtQuick 1.0\nText { font.weight: \"Bold\"; text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->font().weight(), (int)QDeclarativeFontValueType::Bold);
@@ -968,7 +968,7 @@ void tst_qdeclarativetext::underline()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().underline(), false);
@@ -979,7 +979,7 @@ void tst_qdeclarativetext::underline()
QString componentStr = "import QtQuick 1.0\nText { font.underline: true; text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().underline(), true);
@@ -994,7 +994,7 @@ void tst_qdeclarativetext::overline()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().overline(), false);
@@ -1005,7 +1005,7 @@ void tst_qdeclarativetext::overline()
QString componentStr = "import QtQuick 1.0\nText { font.overline: true; text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().overline(), true);
@@ -1020,7 +1020,7 @@ void tst_qdeclarativetext::strikeout()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().strikeOut(), false);
@@ -1031,7 +1031,7 @@ void tst_qdeclarativetext::strikeout()
QString componentStr = "import QtQuick 1.0\nText { font.strikeout: true; text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().strikeOut(), true);
@@ -1046,7 +1046,7 @@ void tst_qdeclarativetext::capitalization()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::MixedCase);
@@ -1057,7 +1057,7 @@ void tst_qdeclarativetext::capitalization()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"AllUppercase\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::AllUppercase);
@@ -1068,7 +1068,7 @@ void tst_qdeclarativetext::capitalization()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"AllLowercase\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::AllLowercase);
@@ -1079,7 +1079,7 @@ void tst_qdeclarativetext::capitalization()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"SmallCaps\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::SmallCaps);
@@ -1090,7 +1090,7 @@ void tst_qdeclarativetext::capitalization()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"Capitalize\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::Capitalize);
@@ -1105,7 +1105,7 @@ void tst_qdeclarativetext::letterSpacing()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().letterSpacing(), 0.0);
@@ -1116,7 +1116,7 @@ void tst_qdeclarativetext::letterSpacing()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.letterSpacing: -2 }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().letterSpacing(), -2.);
@@ -1127,7 +1127,7 @@ void tst_qdeclarativetext::letterSpacing()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.letterSpacing: 3 }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().letterSpacing(), 3.);
@@ -1142,7 +1142,7 @@ void tst_qdeclarativetext::wordSpacing()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().wordSpacing(), 0.0);
@@ -1153,7 +1153,7 @@ void tst_qdeclarativetext::wordSpacing()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.wordSpacing: -50 }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().wordSpacing(), -50.);
@@ -1164,7 +1164,7 @@ void tst_qdeclarativetext::wordSpacing()
QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.wordSpacing: 200 }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
QCOMPARE(textObject->font().wordSpacing(), 200.);
@@ -1185,7 +1185,7 @@ void tst_qdeclarativetext::QTBUG_12291()
QObject *ob = canvas->rootObject();
QVERIFY(ob != 0);
- QDeclarativeText *text = ob->findChild<QDeclarativeText*>("text");
+ QDeclarative1Text *text = ob->findChild<QDeclarative1Text*>("text");
QVERIFY(text);
QVERIFY(text->boundingRect().isValid());
@@ -1216,7 +1216,7 @@ void tst_qdeclarativetext::clickLink()
QString componentStr = "import QtQuick 1.0\nText { text: \"<a href=\\\"http://qt.nokia.com\\\">Hello world!</a>\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
@@ -1269,7 +1269,7 @@ void tst_qdeclarativetext::embeddedImages()
QTest::ignoreMessage(QtWarningMsg, error.toLatin1());
QDeclarativeComponent textComponent(&engine, qmlfile);
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject != 0);
@@ -1292,7 +1292,7 @@ void tst_qdeclarativetext::lineCount()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/lineCount.qml");
- QDeclarativeText *myText = canvas->rootObject()->findChild<QDeclarativeText*>("myText");
+ QDeclarative1Text *myText = canvas->rootObject()->findChild<QDeclarative1Text*>("myText");
QVERIFY(myText != 0);
QVERIFY(myText->lineCount() > 1);
@@ -1308,7 +1308,7 @@ void tst_qdeclarativetext::lineCount()
QCOMPARE(myText->maximumLineCount(), INT_MAX);
QCOMPARE(myText->truncated(), false);
- myText->setElideMode(QDeclarativeText::ElideRight);
+ myText->setElideMode(QDeclarative1Text::ElideRight);
myText->setMaximumLineCount(2);
QCOMPARE(myText->lineCount(), 2);
QCOMPARE(myText->truncated(), true);
@@ -1321,22 +1321,22 @@ void tst_qdeclarativetext::lineHeight()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/lineHeight.qml");
- QDeclarativeText *myText = canvas->rootObject()->findChild<QDeclarativeText*>("myText");
+ QDeclarative1Text *myText = canvas->rootObject()->findChild<QDeclarative1Text*>("myText");
QVERIFY(myText != 0);
QVERIFY(myText->lineHeight() == 1);
- QVERIFY(myText->lineHeightMode() == QDeclarativeText::ProportionalHeight);
+ QVERIFY(myText->lineHeightMode() == QDeclarative1Text::ProportionalHeight);
qreal h = myText->height();
myText->setLineHeight(1.5);
QVERIFY(myText->height() == h * 1.5);
- myText->setLineHeightMode(QDeclarativeText::FixedHeight);
+ myText->setLineHeightMode(QDeclarative1Text::FixedHeight);
myText->setLineHeight(20);
QCOMPARE(myText->height(), myText->lineCount() * 20.0);
myText->setText("Lorem ipsum sit <b>amet</b>, consectetur adipiscing elit. Integer felis nisl, varius in pretium nec, venenatis non erat. Proin lobortis interdum dictum.");
- myText->setLineHeightMode(QDeclarativeText::ProportionalHeight);
+ myText->setLineHeightMode(QDeclarative1Text::ProportionalHeight);
myText->setLineHeight(1.0);
qreal h2 = myText->height();
@@ -1344,7 +1344,7 @@ void tst_qdeclarativetext::lineHeight()
QEXPECT_FAIL("", "QTBUG-17325", Continue);
QVERIFY(myText->height() == h2 * 2.0);
- myText->setLineHeightMode(QDeclarativeText::FixedHeight);
+ myText->setLineHeightMode(QDeclarative1Text::FixedHeight);
myText->setLineHeight(10);
QEXPECT_FAIL("", "QTBUG-17325", Continue);
QCOMPARE(myText->height(), myText->lineCount() * 10.0);
@@ -1369,7 +1369,7 @@ void tst_qdeclarativetext::implicitSize()
QString componentStr = "import QtQuick 1.1\nText { text: \"" + text + "\"; width: 50; wrapMode: " + wrap + " }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create());
QVERIFY(textObject->width() < textObject->implicitWidth());
QVERIFY(textObject->height() == textObject->implicitHeight());
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/CursorRect.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/CursorRect.qml
index 3af0313692..3af0313692 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/CursorRect.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/CursorRect.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments.qml
index bc977fc6de..bc977fc6de 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_cb.png
index 99de2192de..99de2192de 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_cb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_cc.png
index cb85251180..cb85251180 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_cc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_ct.png
index ddca549c82..ddca549c82 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_ct.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lb.png
index 1b50a81f3d..1b50a81f3d 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lc.png
index f041b868f8..f041b868f8 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lt.png
index c75e0d158e..c75e0d158e 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_lt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rb.png
index b06a5da715..b06a5da715 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rc.png
index e468857cd0..e468857cd0 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rt.png
index 576715ffce..576715ffce 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/alignments_rt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/cursorTest.qml
index f7fb3e7ced..f7fb3e7ced 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/cursorTest.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/geometrySignals.qml
index fe2ae12246..fe2ae12246 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/geometrySignals.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
index 43ea8d8a12..43ea8d8a12 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/http/ErrItem.qml
index fa7dbd107f..fa7dbd107f 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/http/ErrItem.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/http/NormItem.qml
index 4989193527..4989193527 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/http/NormItem.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTest.qml
index 724c058de5..724c058de5 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTest.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml
index 6dcf7855f4..6dcf7855f4 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml
index 5f441d0db6..5f441d0db6 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestPass.qml
index 95f5d87eb7..95f5d87eb7 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/http/cursorHttpTestPass.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/qmldir b/tests/auto/qtquick1/qdeclarativetextedit/data/http/qmldir
index 886e6ffec0..886e6ffec0 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/http/qmldir
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/http/qmldir
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/httpfail/FailItem.qml
index 466eb9d2f1..466eb9d2f1 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/httpfail/FailItem.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/httpslow/WaitItem.qml
index 466eb9d2f1..466eb9d2f1 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/httpslow/WaitItem.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/inputmethodhints.qml
index 7df17f2158..7df17f2158 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/inputmethodhints.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_default.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_default.qml
index 22a9871306..22a9871306 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_default.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_default.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false.qml
index 22a9871306..22a9871306 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_readonly.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false_readonly.qml
index 4aea61160f..4aea61160f 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_readonly.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false_readonly.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false_words.qml
index 22a9871306..22a9871306 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_false_words.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_multiline.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_multiline.qml
index af23f6d91c..af23f6d91c 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_multiline.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_multiline.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true.qml
index d61da46f48..d61da46f48 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_readonly.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true_readonly.qml
index 959e683721..959e683721 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_readonly.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true_readonly.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true_words.qml
index d61da46f48..d61da46f48 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselection_true_words.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_characters.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_characters.qml
index 5784e1960b..5784e1960b 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_characters.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_characters.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_default.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_default.qml
index 1e5f4aac88..1e5f4aac88 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_default.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_default.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_words.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_words.qml
index 4b25f2f890..4b25f2f890 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_words.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/mouseselectionmode_words.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/navigation.qml
index 0e1caf6e23..0e1caf6e23 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/navigation.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/positionAt.qml
index e01013560b..e01013560b 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/positionAt.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml b/tests/auto/qtquick1/qdeclarativetextedit/data/readOnly.qml
index 36177d3be8..36177d3be8 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml
+++ b/tests/auto/qtquick1/qdeclarativetextedit/data/readOnly.qml
diff --git a/tests/auto/qtquick1/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/qtquick1/qdeclarativetextedit/qdeclarativetextedit.pro
new file mode 100644
index 0000000000..2d5461ffc1
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativetextedit/qdeclarativetextedit.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativetextedit.cpp ../../declarative/shared/testhttpserver.cpp
+HEADERS += ../../declarative/shared/testhttpserver.h
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 8530c7f6ee..94378e96c3 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -41,7 +41,7 @@
#include <qtest.h>
#include <QtTest/QSignalSpy>
#include "../../../shared/util.h"
-#include "../shared/testhttpserver.h"
+#include "../../declarative/shared/testhttpserver.h"
#include <math.h>
#include <QFile>
#include <QTextDocument>
@@ -49,10 +49,10 @@
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
#include <QtDeclarative/qdeclarativecomponent.h>
-#include <private/qdeclarativetextedit_p.h>
-#include <private/qdeclarativetextedit_p_p.h>
+#include <QtQuick1/private/qdeclarativetextedit_p.h>
+#include <QtQuick1/private/qdeclarativetextedit_p_p.h>
#include <QFontMetrics>
-#include <QDeclarativeView>
+#include <QtQuick1/QDeclarativeView>
#include <QDir>
#include <QStyle>
#include <QInputContext>
@@ -66,7 +66,7 @@
#define SRCDIR "."
#endif
-Q_DECLARE_METATYPE(QDeclarativeTextEdit::SelectionMode)
+Q_DECLARE_METATYPE(QDeclarative1TextEdit::SelectionMode)
QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual)
{
@@ -223,7 +223,7 @@ void tst_qdeclarativetextedit::text()
{
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData("import QtQuick 1.0\nTextEdit { text: \"\" }", QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->text(), QString(""));
@@ -234,7 +234,7 @@ void tst_qdeclarativetextedit::text()
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->text(), standard.at(i));
@@ -245,7 +245,7 @@ void tst_qdeclarativetextedit::text()
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QString actual = textEditObject->text();
@@ -263,7 +263,7 @@ void tst_qdeclarativetextedit::width()
{
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData("import QtQuick 1.0\nTextEdit { text: \"\" }", QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->width(), 0.0);
@@ -279,7 +279,7 @@ void tst_qdeclarativetextedit::width()
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->width(), qreal(metricWidth));
@@ -296,7 +296,7 @@ void tst_qdeclarativetextedit::width()
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->width(), qreal(documentWidth));
@@ -309,7 +309,7 @@ void tst_qdeclarativetextedit::wrap()
{
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData("import QtQuick 1.0\nTextEdit { text: \"\"; wrapMode: TextEdit.WordWrap; width: 300 }", QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->width(), 300.);
@@ -320,7 +320,7 @@ void tst_qdeclarativetextedit::wrap()
QString componentStr = "import QtQuick 1.0\nTextEdit { wrapMode: TextEdit.WordWrap; width: 300; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->width(), 300.);
@@ -331,7 +331,7 @@ void tst_qdeclarativetextedit::wrap()
QString componentStr = "import QtQuick 1.0\nTextEdit { wrapMode: TextEdit.WordWrap; width: 300; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->width(), 300.);
@@ -344,18 +344,18 @@ void tst_qdeclarativetextedit::textFormat()
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData("import QtQuick 1.0\nTextEdit { text: \"Hello\"; textFormat: Text.RichText }", QUrl::fromLocalFile(""));
- QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+ QDeclarative1TextEdit *textObject = qobject_cast<QDeclarative1TextEdit*>(textComponent.create());
QVERIFY(textObject != 0);
- QVERIFY(textObject->textFormat() == QDeclarativeTextEdit::RichText);
+ QVERIFY(textObject->textFormat() == QDeclarative1TextEdit::RichText);
}
{
QDeclarativeComponent textComponent(&engine);
textComponent.setData("import QtQuick 1.0\nTextEdit { text: \"<b>Hello</b>\"; textFormat: Text.PlainText }", QUrl::fromLocalFile(""));
- QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+ QDeclarative1TextEdit *textObject = qobject_cast<QDeclarative1TextEdit*>(textComponent.create());
QVERIFY(textObject != 0);
- QVERIFY(textObject->textFormat() == QDeclarativeTextEdit::PlainText);
+ QVERIFY(textObject->textFormat() == QDeclarative1TextEdit::PlainText);
}
}
@@ -424,7 +424,7 @@ void tst_qdeclarativetextedit::hAlign()
QString componentStr = "import QtQuick 1.0\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j));
@@ -438,7 +438,7 @@ void tst_qdeclarativetextedit::hAlign()
QString componentStr = "import QtQuick 1.0\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j));
@@ -450,22 +450,22 @@ void tst_qdeclarativetextedit::hAlign()
void tst_qdeclarativetextedit::hAlign_RightToLeft()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml");
- QDeclarativeTextEdit *textEdit = canvas->rootObject()->findChild<QDeclarativeTextEdit*>("text");
+ QDeclarative1TextEdit *textEdit = canvas->rootObject()->findChild<QDeclarative1TextEdit*>("text");
QVERIFY(textEdit != 0);
canvas->show();
// implicit alignment should follow the reading direction of text
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
// explicitly left aligned
- textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignLeft);
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
// explicitly right aligned
- textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
QString textString = textEdit->text();
@@ -473,52 +473,52 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
textEdit->resetHAlign();
// implicitly aligned rich text should follow the reading direction of RTL text
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
// explicitly left aligned rich text
- textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignLeft);
QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
// explicitly right aligned rich text
- textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
textEdit->setText(textString);
// explicitly center aligned
- textEdit->setHAlign(QDeclarativeTextEdit::AlignHCenter);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignHCenter);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignHCenter);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignHCenter);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
// reseted alignment should go back to following the text reading direction
textEdit->resetHAlign();
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
// mirror the text item
QDeclarativeItemPrivate::get(textEdit)->setLayoutMirror(true);
// mirrored implicit alignment should continue to follow the reading direction of the text
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
- QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarative1TextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
// mirrored explicitly right aligned behaves as left aligned
- textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
- QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignLeft);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarative1TextEdit::AlignLeft);
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
// mirrored explicitly left aligned behaves as right aligned
- textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
- QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignLeft);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarative1TextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
// disable mirroring
@@ -527,7 +527,7 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
// English text should be implicitly left aligned
textEdit->setText("Hello world!");
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignLeft);
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
#ifndef Q_OS_MAC // QTBUG-18040
@@ -535,13 +535,13 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
// keyboard input direction from QApplication::keyboardInputDirection
textEdit->setText("");
QCOMPARE(textEdit->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
- QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ QDeclarative1TextEdit::AlignLeft : QDeclarative1TextEdit::AlignRight);
if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
else
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
- textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
- QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ textEdit->setHAlign(QDeclarative1TextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarative1TextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
#endif
@@ -552,9 +552,9 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
QString componentStr = "import QtQuick 1.0\nTextEdit {}";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+ QDeclarative1TextEdit *textObject = qobject_cast<QDeclarative1TextEdit*>(textComponent.create());
QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
- QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ QDeclarative1TextEdit::AlignLeft : QDeclarative1TextEdit::AlignRight);
delete textObject;
#endif
}
@@ -570,7 +570,7 @@ void tst_qdeclarativetextedit::vAlign()
QString componentStr = "import QtQuick 1.0\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j));
@@ -584,7 +584,7 @@ void tst_qdeclarativetextedit::vAlign()
QString componentStr = "import QtQuick 1.0\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j));
@@ -600,7 +600,7 @@ void tst_qdeclarativetextedit::font()
QString componentStr = "import QtQuick 1.0\nTextEdit { font.pointSize: 40; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->font().pointSize(), 40);
@@ -612,7 +612,7 @@ void tst_qdeclarativetextedit::font()
QString componentStr = "import QtQuick 1.0\nTextEdit { font.bold: true; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->font().bold(), true);
@@ -623,7 +623,7 @@ void tst_qdeclarativetextedit::font()
QString componentStr = "import QtQuick 1.0\nTextEdit { font.italic: true; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->font().italic(), true);
@@ -634,7 +634,7 @@ void tst_qdeclarativetextedit::font()
QString componentStr = "import QtQuick 1.0\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->font().family(), QString("Helvetica"));
@@ -646,7 +646,7 @@ void tst_qdeclarativetextedit::font()
QString componentStr = "import QtQuick 1.0\nTextEdit { font.family: \"\"; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->font().family(), QString(""));
@@ -660,9 +660,9 @@ void tst_qdeclarativetextedit::color()
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
- QDeclarativeTextEditPrivate *textEditPrivate = static_cast<QDeclarativeTextEditPrivate*>(QDeclarativeItemPrivate::get(textEditObject));
+ QDeclarative1TextEditPrivate *textEditPrivate = static_cast<QDeclarative1TextEditPrivate*>(QDeclarativeItemPrivate::get(textEditObject));
QVERIFY(textEditObject);
QVERIFY(textEditPrivate);
@@ -678,7 +678,7 @@ void tst_qdeclarativetextedit::color()
QString componentStr = "import QtQuick 1.0\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
//qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i));
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i)));
@@ -690,7 +690,7 @@ void tst_qdeclarativetextedit::color()
QString componentStr = "import QtQuick 1.0\nTextEdit { selectionColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->selectionColor(), QColor(colorStrings.at(i)));
}
@@ -701,7 +701,7 @@ void tst_qdeclarativetextedit::color()
QString componentStr = "import QtQuick 1.0\nTextEdit { selectedTextColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->selectedTextColor(), QColor(colorStrings.at(i)));
}
@@ -714,7 +714,7 @@ void tst_qdeclarativetextedit::color()
QString componentStr = "import QtQuick 1.0\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->color(), testColor);
@@ -727,7 +727,7 @@ void tst_qdeclarativetextedit::textMargin()
QString componentStr = "import QtQuick 1.0\nTextEdit { textMargin: " + QString::number(i) + "; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->textMargin(), i);
}
@@ -739,7 +739,7 @@ void tst_qdeclarativetextedit::persistentSelection()
QString componentStr = "import QtQuick 1.0\nTextEdit { persistentSelection: true; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->persistentSelection(), true);
}
@@ -748,7 +748,7 @@ void tst_qdeclarativetextedit::persistentSelection()
QString componentStr = "import QtQuick 1.0\nTextEdit { persistentSelection: false; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->persistentSelection(), false);
}
@@ -760,7 +760,7 @@ void tst_qdeclarativetextedit::focusOnPress()
QString componentStr = "import QtQuick 1.0\nTextEdit { activeFocusOnPress: true; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->focusOnPress(), true);
}
@@ -769,7 +769,7 @@ void tst_qdeclarativetextedit::focusOnPress()
QString componentStr = "import QtQuick 1.0\nTextEdit { activeFocusOnPress: false; text: \"Hello World\" }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
QCOMPARE(textEditObject->focusOnPress(), false);
}
@@ -781,7 +781,7 @@ void tst_qdeclarativetextedit::selection()
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \""+ testStr +"\"; }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(textEditObject != 0);
@@ -900,7 +900,7 @@ void tst_qdeclarativetextedit::isRightToLeft()
QFETCH(bool, midString);
QFETCH(bool, endString);
- QDeclarativeTextEdit textEdit;
+ QDeclarative1TextEdit textEdit;
textEdit.setText(text);
// first test that the right string is delivered to the QString::isRightToLeft()
@@ -937,7 +937,7 @@ void tst_qdeclarativetextedit::keySelection()
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *input = qobject_cast<QDeclarativeTextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+ QDeclarative1TextEdit *input = qobject_cast<QDeclarative1TextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
QVERIFY(input != 0);
QTRY_VERIFY(input->hasActiveFocus() == true);
@@ -981,146 +981,146 @@ void tst_qdeclarativetextedit::moveCursorSelection_data()
QTest::addColumn<QString>("testStr");
QTest::addColumn<int>("cursorPosition");
QTest::addColumn<int>("movePosition");
- QTest::addColumn<QDeclarativeTextEdit::SelectionMode>("mode");
+ QTest::addColumn<QDeclarative1TextEdit::SelectionMode>("mode");
QTest::addColumn<int>("selectionStart");
QTest::addColumn<int>("selectionEnd");
QTest::addColumn<bool>("reversible");
QTest::newRow("(t)he|characters")
- << standard[0] << 0 << 1 << QDeclarativeTextEdit::SelectCharacters << 0 << 1 << true;
+ << standard[0] << 0 << 1 << QDeclarative1TextEdit::SelectCharacters << 0 << 1 << true;
QTest::newRow("do(g)|characters")
- << standard[0] << 43 << 44 << QDeclarativeTextEdit::SelectCharacters << 43 << 44 << true;
+ << standard[0] << 43 << 44 << QDeclarative1TextEdit::SelectCharacters << 43 << 44 << true;
QTest::newRow("jum(p)ed|characters")
- << standard[0] << 23 << 24 << QDeclarativeTextEdit::SelectCharacters << 23 << 24 << true;
+ << standard[0] << 23 << 24 << QDeclarative1TextEdit::SelectCharacters << 23 << 24 << true;
QTest::newRow("jumped( )over|characters")
- << standard[0] << 26 << 27 << QDeclarativeTextEdit::SelectCharacters << 26 << 27 << true;
+ << standard[0] << 26 << 27 << QDeclarative1TextEdit::SelectCharacters << 26 << 27 << true;
QTest::newRow("(the )|characters")
- << standard[0] << 0 << 4 << QDeclarativeTextEdit::SelectCharacters << 0 << 4 << true;
+ << standard[0] << 0 << 4 << QDeclarative1TextEdit::SelectCharacters << 0 << 4 << true;
QTest::newRow("( dog)|characters")
- << standard[0] << 40 << 44 << QDeclarativeTextEdit::SelectCharacters << 40 << 44 << true;
+ << standard[0] << 40 << 44 << QDeclarative1TextEdit::SelectCharacters << 40 << 44 << true;
QTest::newRow("( jumped )|characters")
- << standard[0] << 19 << 27 << QDeclarativeTextEdit::SelectCharacters << 19 << 27 << true;
+ << standard[0] << 19 << 27 << QDeclarative1TextEdit::SelectCharacters << 19 << 27 << true;
QTest::newRow("th(e qu)ick|characters")
- << standard[0] << 2 << 6 << QDeclarativeTextEdit::SelectCharacters << 2 << 6 << true;
+ << standard[0] << 2 << 6 << QDeclarative1TextEdit::SelectCharacters << 2 << 6 << true;
QTest::newRow("la(zy d)og|characters")
- << standard[0] << 38 << 42 << QDeclarativeTextEdit::SelectCharacters << 38 << 42 << true;
+ << standard[0] << 38 << 42 << QDeclarative1TextEdit::SelectCharacters << 38 << 42 << true;
QTest::newRow("jum(ped ov)er|characters")
- << standard[0] << 23 << 29 << QDeclarativeTextEdit::SelectCharacters << 23 << 29 << true;
+ << standard[0] << 23 << 29 << QDeclarative1TextEdit::SelectCharacters << 23 << 29 << true;
QTest::newRow("()the|characters")
- << standard[0] << 0 << 0 << QDeclarativeTextEdit::SelectCharacters << 0 << 0 << true;
+ << standard[0] << 0 << 0 << QDeclarative1TextEdit::SelectCharacters << 0 << 0 << true;
QTest::newRow("dog()|characters")
- << standard[0] << 44 << 44 << QDeclarativeTextEdit::SelectCharacters << 44 << 44 << true;
+ << standard[0] << 44 << 44 << QDeclarative1TextEdit::SelectCharacters << 44 << 44 << true;
QTest::newRow("jum()ped|characters")
- << standard[0] << 23 << 23 << QDeclarativeTextEdit::SelectCharacters << 23 << 23 << true;
+ << standard[0] << 23 << 23 << QDeclarative1TextEdit::SelectCharacters << 23 << 23 << true;
QTest::newRow("<(t)he>|words")
- << standard[0] << 0 << 1 << QDeclarativeTextEdit::SelectWords << 0 << 3 << true;
+ << standard[0] << 0 << 1 << QDeclarative1TextEdit::SelectWords << 0 << 3 << true;
QTest::newRow("<do(g)>|words")
- << standard[0] << 43 << 44 << QDeclarativeTextEdit::SelectWords << 41 << 44 << true;
+ << standard[0] << 43 << 44 << QDeclarative1TextEdit::SelectWords << 41 << 44 << true;
QTest::newRow("<jum(p)ed>|words")
- << standard[0] << 23 << 24 << QDeclarativeTextEdit::SelectWords << 20 << 26 << true;
+ << standard[0] << 23 << 24 << QDeclarative1TextEdit::SelectWords << 20 << 26 << true;
QTest::newRow("<jumped( )>over|words")
- << standard[0] << 26 << 27 << QDeclarativeTextEdit::SelectWords << 20 << 27 << false;
+ << standard[0] << 26 << 27 << QDeclarative1TextEdit::SelectWords << 20 << 27 << false;
QTest::newRow("jumped<( )over>|words,reversed")
- << standard[0] << 27 << 26 << QDeclarativeTextEdit::SelectWords << 26 << 31 << false;
+ << standard[0] << 27 << 26 << QDeclarative1TextEdit::SelectWords << 26 << 31 << false;
QTest::newRow("<(the )>quick|words")
- << standard[0] << 0 << 4 << QDeclarativeTextEdit::SelectWords << 0 << 4 << false;
+ << standard[0] << 0 << 4 << QDeclarative1TextEdit::SelectWords << 0 << 4 << false;
QTest::newRow("<(the )quick>|words,reversed")
- << standard[0] << 4 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 9 << false;
+ << standard[0] << 4 << 0 << QDeclarative1TextEdit::SelectWords << 0 << 9 << false;
QTest::newRow("<lazy( dog)>|words")
- << standard[0] << 40 << 44 << QDeclarativeTextEdit::SelectWords << 36 << 44 << false;
+ << standard[0] << 40 << 44 << QDeclarative1TextEdit::SelectWords << 36 << 44 << false;
QTest::newRow("lazy<( dog)>|words,reversed")
- << standard[0] << 44 << 40 << QDeclarativeTextEdit::SelectWords << 40 << 44 << false;
+ << standard[0] << 44 << 40 << QDeclarative1TextEdit::SelectWords << 40 << 44 << false;
QTest::newRow("<fox( jumped )>over|words")
- << standard[0] << 19 << 27 << QDeclarativeTextEdit::SelectWords << 16 << 27 << false;
+ << standard[0] << 19 << 27 << QDeclarative1TextEdit::SelectWords << 16 << 27 << false;
QTest::newRow("fox<( jumped )over>|words,reversed")
- << standard[0] << 27 << 19 << QDeclarativeTextEdit::SelectWords << 19 << 31 << false;
+ << standard[0] << 27 << 19 << QDeclarative1TextEdit::SelectWords << 19 << 31 << false;
QTest::newRow("<th(e qu)ick>|words")
- << standard[0] << 2 << 6 << QDeclarativeTextEdit::SelectWords << 0 << 9 << true;
+ << standard[0] << 2 << 6 << QDeclarative1TextEdit::SelectWords << 0 << 9 << true;
QTest::newRow("<la(zy d)og|words>")
- << standard[0] << 38 << 42 << QDeclarativeTextEdit::SelectWords << 36 << 44 << true;
+ << standard[0] << 38 << 42 << QDeclarative1TextEdit::SelectWords << 36 << 44 << true;
QTest::newRow("<jum(ped ov)er>|words")
- << standard[0] << 23 << 29 << QDeclarativeTextEdit::SelectWords << 20 << 31 << true;
+ << standard[0] << 23 << 29 << QDeclarative1TextEdit::SelectWords << 20 << 31 << true;
QTest::newRow("<()>the|words")
- << standard[0] << 0 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 0 << true;
+ << standard[0] << 0 << 0 << QDeclarative1TextEdit::SelectWords << 0 << 0 << true;
QTest::newRow("dog<()>|words")
- << standard[0] << 44 << 44 << QDeclarativeTextEdit::SelectWords << 44 << 44 << true;
+ << standard[0] << 44 << 44 << QDeclarative1TextEdit::SelectWords << 44 << 44 << true;
QTest::newRow("jum<()>ped|words")
- << standard[0] << 23 << 23 << QDeclarativeTextEdit::SelectWords << 23 << 23 << true;
+ << standard[0] << 23 << 23 << QDeclarative1TextEdit::SelectWords << 23 << 23 << true;
QTest::newRow("Hello<(,)> |words")
- << standard[2] << 5 << 6 << QDeclarativeTextEdit::SelectWords << 5 << 6 << true;
+ << standard[2] << 5 << 6 << QDeclarative1TextEdit::SelectWords << 5 << 6 << true;
QTest::newRow("Hello<(, )>world|words")
- << standard[2] << 5 << 7 << QDeclarativeTextEdit::SelectWords << 5 << 7 << false;
+ << standard[2] << 5 << 7 << QDeclarative1TextEdit::SelectWords << 5 << 7 << false;
QTest::newRow("Hello<(, )world>|words,reversed")
- << standard[2] << 7 << 5 << QDeclarativeTextEdit::SelectWords << 5 << 12 << false;
+ << standard[2] << 7 << 5 << QDeclarative1TextEdit::SelectWords << 5 << 12 << false;
QTest::newRow("<Hel(lo, )>world|words")
- << standard[2] << 3 << 7 << QDeclarativeTextEdit::SelectWords << 0 << 7 << false;
+ << standard[2] << 3 << 7 << QDeclarative1TextEdit::SelectWords << 0 << 7 << false;
QTest::newRow("<Hel(lo, )world>|words,reversed")
- << standard[2] << 7 << 3 << QDeclarativeTextEdit::SelectWords << 0 << 12 << false;
+ << standard[2] << 7 << 3 << QDeclarative1TextEdit::SelectWords << 0 << 12 << false;
QTest::newRow("<Hel(lo)>,|words")
- << standard[2] << 3 << 5 << QDeclarativeTextEdit::SelectWords << 0 << 5 << true;
+ << standard[2] << 3 << 5 << QDeclarative1TextEdit::SelectWords << 0 << 5 << true;
QTest::newRow("Hello<()>,|words")
- << standard[2] << 5 << 5 << QDeclarativeTextEdit::SelectWords << 5 << 5 << true;
+ << standard[2] << 5 << 5 << QDeclarative1TextEdit::SelectWords << 5 << 5 << true;
QTest::newRow("Hello,<()>|words")
- << standard[2] << 6 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 6 << true;
+ << standard[2] << 6 << 6 << QDeclarative1TextEdit::SelectWords << 6 << 6 << true;
QTest::newRow("Hello<,( )>world|words")
- << standard[2] << 6 << 7 << QDeclarativeTextEdit::SelectWords << 5 << 7 << false;
+ << standard[2] << 6 << 7 << QDeclarative1TextEdit::SelectWords << 5 << 7 << false;
QTest::newRow("Hello,<( )world>|words,reversed")
- << standard[2] << 7 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 12 << false;
+ << standard[2] << 7 << 6 << QDeclarative1TextEdit::SelectWords << 6 << 12 << false;
QTest::newRow("Hello<,( world)>|words")
- << standard[2] << 6 << 12 << QDeclarativeTextEdit::SelectWords << 5 << 12 << false;
+ << standard[2] << 6 << 12 << QDeclarative1TextEdit::SelectWords << 5 << 12 << false;
QTest::newRow("Hello,<( world)>|words,reversed")
- << standard[2] << 12 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 12 << false;
+ << standard[2] << 12 << 6 << QDeclarative1TextEdit::SelectWords << 6 << 12 << false;
QTest::newRow("Hello<,( world!)>|words")
- << standard[2] << 6 << 13 << QDeclarativeTextEdit::SelectWords << 5 << 13 << false;
+ << standard[2] << 6 << 13 << QDeclarative1TextEdit::SelectWords << 5 << 13 << false;
QTest::newRow("Hello,<( world!)>|words,reversed")
- << standard[2] << 13 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 13 << false;
+ << standard[2] << 13 << 6 << QDeclarative1TextEdit::SelectWords << 6 << 13 << false;
QTest::newRow("Hello<(, world!)>|words")
- << standard[2] << 5 << 13 << QDeclarativeTextEdit::SelectWords << 5 << 13 << true;
+ << standard[2] << 5 << 13 << QDeclarative1TextEdit::SelectWords << 5 << 13 << true;
QTest::newRow("world<(!)>|words")
- << standard[2] << 12 << 13 << QDeclarativeTextEdit::SelectWords << 12 << 13 << true;
+ << standard[2] << 12 << 13 << QDeclarative1TextEdit::SelectWords << 12 << 13 << true;
QTest::newRow("world!<()>)|words")
- << standard[2] << 13 << 13 << QDeclarativeTextEdit::SelectWords << 13 << 13 << true;
+ << standard[2] << 13 << 13 << QDeclarative1TextEdit::SelectWords << 13 << 13 << true;
QTest::newRow("world<()>!)|words")
- << standard[2] << 12 << 12 << QDeclarativeTextEdit::SelectWords << 12 << 12 << true;
+ << standard[2] << 12 << 12 << QDeclarative1TextEdit::SelectWords << 12 << 12 << true;
QTest::newRow("<(,)>olleH |words")
- << standard[3] << 7 << 8 << QDeclarativeTextEdit::SelectWords << 7 << 8 << true;
+ << standard[3] << 7 << 8 << QDeclarative1TextEdit::SelectWords << 7 << 8 << true;
QTest::newRow("<dlrow( ,)>olleH|words")
- << standard[3] << 6 << 8 << QDeclarativeTextEdit::SelectWords << 1 << 8 << false;
+ << standard[3] << 6 << 8 << QDeclarative1TextEdit::SelectWords << 1 << 8 << false;
QTest::newRow("dlrow<( ,)>olleH|words,reversed")
- << standard[3] << 8 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 8 << false;
+ << standard[3] << 8 << 6 << QDeclarative1TextEdit::SelectWords << 6 << 8 << false;
QTest::newRow("<dlrow( ,ol)leH>|words")
- << standard[3] << 6 << 10 << QDeclarativeTextEdit::SelectWords << 1 << 13 << false;
+ << standard[3] << 6 << 10 << QDeclarative1TextEdit::SelectWords << 1 << 13 << false;
QTest::newRow("dlrow<( ,ol)leH>|words,reversed")
- << standard[3] << 10 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 13 << false;
+ << standard[3] << 10 << 6 << QDeclarative1TextEdit::SelectWords << 6 << 13 << false;
QTest::newRow(",<(ol)leH>,|words")
- << standard[3] << 8 << 10 << QDeclarativeTextEdit::SelectWords << 8 << 13 << true;
+ << standard[3] << 8 << 10 << QDeclarative1TextEdit::SelectWords << 8 << 13 << true;
QTest::newRow(",<()>olleH|words")
- << standard[3] << 8 << 8 << QDeclarativeTextEdit::SelectWords << 8 << 8 << true;
+ << standard[3] << 8 << 8 << QDeclarative1TextEdit::SelectWords << 8 << 8 << true;
QTest::newRow("<()>,olleH|words")
- << standard[3] << 7 << 7 << QDeclarativeTextEdit::SelectWords << 7 << 7 << true;
+ << standard[3] << 7 << 7 << QDeclarative1TextEdit::SelectWords << 7 << 7 << true;
QTest::newRow("<dlrow( )>,olleH|words")
- << standard[3] << 6 << 7 << QDeclarativeTextEdit::SelectWords << 1 << 7 << false;
+ << standard[3] << 6 << 7 << QDeclarative1TextEdit::SelectWords << 1 << 7 << false;
QTest::newRow("dlrow<( ),>olleH|words,reversed")
- << standard[3] << 7 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 8 << false;
+ << standard[3] << 7 << 6 << QDeclarative1TextEdit::SelectWords << 6 << 8 << false;
QTest::newRow("<(dlrow )>,olleH|words")
- << standard[3] << 1 << 7 << QDeclarativeTextEdit::SelectWords << 1 << 7 << false;
+ << standard[3] << 1 << 7 << QDeclarative1TextEdit::SelectWords << 1 << 7 << false;
QTest::newRow("<(dlrow ),>olleH|words,reversed")
- << standard[3] << 7 << 1 << QDeclarativeTextEdit::SelectWords << 1 << 8 << false;
+ << standard[3] << 7 << 1 << QDeclarative1TextEdit::SelectWords << 1 << 8 << false;
QTest::newRow("<(!dlrow )>,olleH|words")
- << standard[3] << 0 << 7 << QDeclarativeTextEdit::SelectWords << 0 << 7 << false;
+ << standard[3] << 0 << 7 << QDeclarative1TextEdit::SelectWords << 0 << 7 << false;
QTest::newRow("<(!dlrow ),>olleH|words,reversed")
- << standard[3] << 7 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 8 << false;
+ << standard[3] << 7 << 0 << QDeclarative1TextEdit::SelectWords << 0 << 8 << false;
QTest::newRow("(!dlrow ,)olleH|words")
- << standard[3] << 0 << 8 << QDeclarativeTextEdit::SelectWords << 0 << 8 << true;
+ << standard[3] << 0 << 8 << QDeclarative1TextEdit::SelectWords << 0 << 8 << true;
QTest::newRow("<(!)>dlrow|words")
- << standard[3] << 0 << 1 << QDeclarativeTextEdit::SelectWords << 0 << 1 << true;
+ << standard[3] << 0 << 1 << QDeclarative1TextEdit::SelectWords << 0 << 1 << true;
QTest::newRow("<()>!dlrow|words")
- << standard[3] << 0 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 0 << true;
+ << standard[3] << 0 << 0 << QDeclarative1TextEdit::SelectWords << 0 << 0 << true;
QTest::newRow("!<()>dlrow|words")
- << standard[3] << 1 << 1 << QDeclarativeTextEdit::SelectWords << 1 << 1 << true;
+ << standard[3] << 1 << 1 << QDeclarative1TextEdit::SelectWords << 1 << 1 << true;
}
void tst_qdeclarativetextedit::moveCursorSelection()
@@ -1128,7 +1128,7 @@ void tst_qdeclarativetextedit::moveCursorSelection()
QFETCH(QString, testStr);
QFETCH(int, cursorPosition);
QFETCH(int, movePosition);
- QFETCH(QDeclarativeTextEdit::SelectionMode, mode);
+ QFETCH(QDeclarative1TextEdit::SelectionMode, mode);
QFETCH(int, selectionStart);
QFETCH(int, selectionEnd);
QFETCH(bool, reversible);
@@ -1136,7 +1136,7 @@ void tst_qdeclarativetextedit::moveCursorSelection()
QString componentStr = "import QtQuick 1.1\nTextEdit { text: \""+ testStr +"\"; }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit*>(textinputComponent.create());
+ QDeclarative1TextEdit *texteditObject = qobject_cast<QDeclarative1TextEdit*>(textinputComponent.create());
QVERIFY(texteditObject != 0);
texteditObject->setCursorPosition(cursorPosition);
@@ -1295,17 +1295,17 @@ void tst_qdeclarativetextedit::moveCursorSelectionSequence()
QString componentStr = "import QtQuick 1.1\nTextEdit { text: \""+ testStr +"\"; }";
QDeclarativeComponent texteditComponent(&engine);
texteditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QDeclarative1TextEdit *texteditObject = qobject_cast<QDeclarative1TextEdit*>(texteditComponent.create());
QVERIFY(texteditObject != 0);
texteditObject->setCursorPosition(cursorPosition);
- texteditObject->moveCursorSelection(movePosition1, QDeclarativeTextEdit::SelectWords);
+ texteditObject->moveCursorSelection(movePosition1, QDeclarative1TextEdit::SelectWords);
QCOMPARE(texteditObject->selectedText(), testStr.mid(selection1Start, selection1End - selection1Start));
QCOMPARE(texteditObject->selectionStart(), selection1Start);
QCOMPARE(texteditObject->selectionEnd(), selection1End);
- texteditObject->moveCursorSelection(movePosition2, QDeclarativeTextEdit::SelectWords);
+ texteditObject->moveCursorSelection(movePosition2, QDeclarative1TextEdit::SelectWords);
QCOMPARE(texteditObject->selectedText(), testStr.mid(selection2Start, selection2End - selection2Start));
QCOMPARE(texteditObject->selectionStart(), selection2Start);
QCOMPARE(texteditObject->selectionEnd(), selection2End);
@@ -1338,7 +1338,7 @@ void tst_qdeclarativetextedit::mouseSelection()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEditObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1375,7 +1375,7 @@ void tst_qdeclarativetextedit::multilineMouseSelection()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEditObject != 0);
// press-and-drag from x1,y1 to x2,y1
@@ -1421,7 +1421,7 @@ void tst_qdeclarativetextedit::deferEnableSelectByMouse()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEditObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1461,7 +1461,7 @@ void tst_qdeclarativetextedit::deferDisableSelectByMouse()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEditObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1492,7 +1492,7 @@ void tst_qdeclarativetextedit::dragMouseSelection()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEditObject != 0);
textEditObject->setAcceptDrops(true);
@@ -1553,7 +1553,7 @@ void tst_qdeclarativetextedit::mouseSelectionMode()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEditObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1589,7 +1589,7 @@ void tst_qdeclarativetextedit::inputMethodHints()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEditObject != 0);
QVERIFY(textEditObject->inputMethodHints() & Qt::ImhNoPredictiveText);
textEditObject->setInputMethodHints(Qt::ImhUppercaseOnly);
@@ -1607,7 +1607,7 @@ void tst_qdeclarativetextedit::positionAt()
QApplication::setActiveWindow(canvas);
QTest::qWaitForWindowShown(canvas);
- QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *texteditObject = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(texteditObject != 0);
QFontMetrics fm(texteditObject->font());
@@ -1653,7 +1653,7 @@ void tst_qdeclarativetextedit::cursorDelegate()
QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml");
view->show();
view->setFocus();
- QDeclarativeTextEdit *textEditObject = view->rootObject()->findChild<QDeclarativeTextEdit*>("textEditObject");
+ QDeclarative1TextEdit *textEditObject = view->rootObject()->findChild<QDeclarative1TextEdit*>("textEditObject");
QVERIFY(textEditObject != 0);
QVERIFY(textEditObject->findChild<QDeclarativeItem*>("cursorInstance"));
//Test Delegate gets created
@@ -1700,12 +1700,12 @@ void tst_qdeclarativetextedit::cursorDelegate()
QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
QVERIFY(textEditObject->cursorRectangle().y() >= 0);
QVERIFY(textEditObject->cursorRectangle().y() < textEditObject->cursorRectangle().height());
- textEditObject->setVAlign(QDeclarativeTextEdit::AlignVCenter);
+ textEditObject->setVAlign(QDeclarative1TextEdit::AlignVCenter);
QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
QVERIFY(textEditObject->cursorRectangle().y() > (textEditObject->height() / 2) - textEditObject->cursorRectangle().height());
QVERIFY(textEditObject->cursorRectangle().y() < (textEditObject->height() / 2) + textEditObject->cursorRectangle().height());
- textEditObject->setVAlign(QDeclarativeTextEdit::AlignBottom);
+ textEditObject->setVAlign(QDeclarative1TextEdit::AlignBottom);
QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
QVERIFY(textEditObject->cursorRectangle().y() > textEditObject->height() - (textEditObject->cursorRectangle().height() * 2));
@@ -1728,7 +1728,7 @@ void tst_qdeclarativetextedit::cursorVisible()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
view.setFocus();
- QDeclarativeTextEdit edit;
+ QDeclarative1TextEdit edit;
QSignalSpy spy(&edit, SIGNAL(cursorVisibleChanged(bool)));
QCOMPARE(edit.isCursorVisible(), false);
@@ -1821,7 +1821,7 @@ void tst_qdeclarativetextedit::delegateLoading()
QTRY_VERIFY(!view->rootObject()); // there is fail item inside this test
} else {
QTRY_VERIFY(view->rootObject());//Wait for loading to finish.
- QDeclarativeTextEdit *textEditObject = view->rootObject()->findChild<QDeclarativeTextEdit*>("textEditObject");
+ QDeclarative1TextEdit *textEditObject = view->rootObject()->findChild<QDeclarative1TextEdit*>("textEditObject");
// view->rootObject()->dumpObjectTree();
QVERIFY(textEditObject != 0);
textEditObject->setFocus(true);
@@ -1836,7 +1836,7 @@ void tst_qdeclarativetextedit::delegateLoading()
//A test should be added here with a component which is ready but component.create() returns null
- //Not sure how to accomplish this with QDeclarativeTextEdits cursor delegate
+ //Not sure how to accomplish this with QDeclarative1TextEdits cursor delegate
//###This was only needed for code coverage, and could be a case of overzealous defensive programming
//delegate = view->rootObject()->findChild<QDeclarativeItem*>("delegateErrorB");
//QVERIFY(!delegate);
@@ -1891,7 +1891,7 @@ void tst_qdeclarativetextedit::copyAndPaste() {
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
QDeclarativeComponent textEditComponent(&engine);
textEditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QDeclarative1TextEdit *textEdit = qobject_cast<QDeclarative1TextEdit*>(textEditComponent.create());
QVERIFY(textEdit != 0);
// copy and paste
@@ -1916,7 +1916,7 @@ void tst_qdeclarativetextedit::copyAndPaste() {
// QTBUG-12339
// test that document and internal text attribute are in sync
QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(textEdit);
- QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ QDeclarative1TextEditPrivate *editPrivate = static_cast<QDeclarative1TextEditPrivate*>(pri);
QCOMPARE(textEdit->text(), editPrivate->text);
// select word
@@ -1942,7 +1942,7 @@ void tst_qdeclarativetextedit::canPaste() {
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
QDeclarativeComponent textEditComponent(&engine);
textEditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QDeclarative1TextEdit *textEdit = qobject_cast<QDeclarative1TextEdit*>(textEditComponent.create());
QVERIFY(textEdit != 0);
// check initial value - QTBUG-17765
@@ -1960,7 +1960,7 @@ void tst_qdeclarativetextedit::canPasteEmpty() {
QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
QDeclarativeComponent textEditComponent(&engine);
textEditComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QDeclarative1TextEdit *textEdit = qobject_cast<QDeclarative1TextEdit*>(textEditComponent.create());
QVERIFY(textEdit != 0);
// check initial value - QTBUG-17765
@@ -1978,7 +1978,7 @@ void tst_qdeclarativetextedit::readOnly()
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextEdit *edit = qobject_cast<QDeclarativeTextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+ QDeclarative1TextEdit *edit = qobject_cast<QDeclarative1TextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
QVERIFY(edit != 0);
QTRY_VERIFY(edit->hasActiveFocus() == true);
@@ -2072,9 +2072,9 @@ void tst_qdeclarativetextedit::textInput()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
- QDeclarativeTextEdit edit;
+ QDeclarative1TextEdit edit;
QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
- QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ QDeclarative1TextEditPrivate *editPrivate = static_cast<QDeclarative1TextEditPrivate*>(pri);
edit.setPos(0, 0);
scene.addItem(&edit);
view.show();
@@ -2101,7 +2101,7 @@ void tst_qdeclarativetextedit::openInputPanelOnClick()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextEdit edit;
+ QDeclarative1TextEdit edit;
QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool)));
edit.setText("Hello world");
edit.setPos(0, 0);
@@ -2113,7 +2113,7 @@ void tst_qdeclarativetextedit::openInputPanelOnClick()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
- QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ QDeclarative1TextEditPrivate *editPrivate = static_cast<QDeclarative1TextEditPrivate*>(pri);
// input panel on click
editPrivate->showInputPanelOnFocus = false;
@@ -2149,7 +2149,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextEdit edit;
+ QDeclarative1TextEdit edit;
QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool)));
edit.setText("Hello world");
edit.setPos(0, 0);
@@ -2161,7 +2161,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
- QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ QDeclarative1TextEditPrivate *editPrivate = static_cast<QDeclarative1TextEditPrivate*>(pri);
editPrivate->showInputPanelOnFocus = true;
// test default values
@@ -2190,7 +2190,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
// input method should stay enabled if focus
// is lost to an item that also accepts inputs
- QDeclarativeTextEdit anotherEdit;
+ QDeclarative1TextEdit anotherEdit;
scene.addItem(&anotherEdit);
anotherEdit.setFocus(true);
QApplication::processEvents();
@@ -2290,10 +2290,10 @@ void tst_qdeclarativetextedit::pastingRichText_QTBUG_14003()
QString componentStr = "import QtQuick 1.0\nTextEdit { textFormat: TextEdit.PlainText }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeTextEdit *obj = qobject_cast<QDeclarativeTextEdit*>(component.create());
+ QDeclarative1TextEdit *obj = qobject_cast<QDeclarative1TextEdit*>(component.create());
QTRY_VERIFY(obj != 0);
- QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText);
+ QTRY_VERIFY(obj->textFormat() == QDeclarative1TextEdit::PlainText);
QMimeData *mData = new QMimeData;
mData->setHtml("<font color=\"red\">Hello</font>");
@@ -2301,7 +2301,7 @@ void tst_qdeclarativetextedit::pastingRichText_QTBUG_14003()
obj->paste();
QTRY_VERIFY(obj->text() == "");
- QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText);
+ QTRY_VERIFY(obj->textFormat() == QDeclarative1TextEdit::PlainText);
#endif
}
@@ -2322,7 +2322,7 @@ void tst_qdeclarativetextedit::implicitSize()
QString componentStr = "import QtQuick 1.1\nTextEdit { text: \"" + text + "\"; width: 50; wrapMode: " + wrap + " }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+ QDeclarative1TextEdit *textObject = qobject_cast<QDeclarative1TextEdit*>(textComponent.create());
QVERIFY(textObject->width() < textObject->implicitWidth());
QVERIFY(textObject->height() == textObject->implicitHeight());
@@ -2391,7 +2391,7 @@ void tst_qdeclarativetextedit::preeditMicroFocus()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextEdit edit;
+ QDeclarative1TextEdit edit;
edit.setFocus(true);
scene.addItem(&edit);
view.show();
@@ -2451,7 +2451,7 @@ void tst_qdeclarativetextedit::inputContextMouseHandler()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextEdit edit;
+ QDeclarative1TextEdit edit;
edit.setPos(0, 0);
edit.setWidth(200);
edit.setText(text.mid(0, 12));
@@ -2571,7 +2571,7 @@ void tst_qdeclarativetextedit::inputMethodComposing()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextEdit edit;
+ QDeclarative1TextEdit edit;
edit.setWidth(200);
edit.setText(text.mid(0, 12));
edit.setCursorPosition(12);
@@ -2609,7 +2609,7 @@ void tst_qdeclarativetextedit::cursorRectangleSize()
QApplication::setActiveWindow(canvas);
QTest::qWaitForWindowShown(canvas);
- QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QDeclarative1TextEdit *textEdit = qobject_cast<QDeclarative1TextEdit *>(canvas->rootObject());
QVERIFY(textEdit != 0);
textEdit->setFocus(Qt::OtherFocusReason);
QRectF cursorRect = textEdit->positionToRectangle(textEdit->cursorPosition());
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/cursorTest.qml
index 73085c1749..73085c1749 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/cursorTest.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/echoMode.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/echoMode.qml
index 0320872b86..0320872b86 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/echoMode.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/echoMode.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/geometrySignals.qml
index 353d0e2f77..353d0e2f77 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/geometrySignals.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/halign_center.png b/tests/auto/qtquick1/qdeclarativetextinput/data/halign_center.png
index 53e09a8e5b..53e09a8e5b 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/halign_center.png
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/halign_center.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/halign_left.png b/tests/auto/qtquick1/qdeclarativetextinput/data/halign_left.png
index 247acbc9df..247acbc9df 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/halign_left.png
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/halign_left.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/halign_right.png b/tests/auto/qtquick1/qdeclarativetextinput/data/halign_right.png
index 691bc75c89..691bc75c89 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/halign_right.png
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/halign_right.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/horizontalAlignment.qml
index 3114c48209..3114c48209 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/horizontalAlignment.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
index b11535e50b..b11535e50b 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/inputmethods.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/inputmethods.qml
index 5063892306..5063892306 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/inputmethods.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/inputmethods.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/masks.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/masks.qml
index c75764af91..c75764af91 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/masks.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/masks.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/maxLength.qml
index 95902bb687..95902bb687 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/maxLength.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_default.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_default.qml
index eea83ed035..eea83ed035 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_default.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_default.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false.qml
index eea83ed035..eea83ed035 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_readonly.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false_readonly.qml
index 36a95634e3..36a95634e3 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_readonly.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false_readonly.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_words.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false_words.qml
index eea83ed035..eea83ed035 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_words.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_false_words.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true.qml
index 8115ba05e3..8115ba05e3 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_readonly.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true_readonly.qml
index 678a89aa8b..678a89aa8b 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_readonly.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true_readonly.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_words.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true_words.qml
index 8115ba05e3..8115ba05e3 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_words.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselection_true_words.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_characters.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_characters.qml
index 0ffc6ff225..0ffc6ff225 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_characters.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_characters.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_default.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_default.qml
index 87c174be14..87c174be14 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_default.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_default.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_words.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_words.qml
index df69a7d042..df69a7d042 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_words.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/mouseselectionmode_words.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/navigation.qml
index af1b14090e..af1b14090e 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/navigation.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/positionAt.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/positionAt.qml
index cbbf33d9fd..cbbf33d9fd 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/positionAt.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/positionAt.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/readOnly.qml
index f173649ef5..f173649ef5 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/readOnly.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/validators.qml b/tests/auto/qtquick1/qdeclarativetextinput/data/validators.qml
index e26bcb30e6..e26bcb30e6 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/validators.qml
+++ b/tests/auto/qtquick1/qdeclarativetextinput/data/validators.qml
diff --git a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro b/tests/auto/qtquick1/qdeclarativetextinput/qdeclarativetextinput.pro
index df765db9ec..d39da270a3 100644
--- a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
+++ b/tests/auto/qtquick1/qdeclarativetextinput/qdeclarativetextinput.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativetextinput.cpp
@@ -12,4 +12,4 @@ symbian: {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 63b768ca33..7cc79c7878 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -43,9 +43,9 @@
#include "../../../shared/util.h"
#include <QtDeclarative/qdeclarativeengine.h>
#include <QFile>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativetextinput_p.h>
-#include <private/qdeclarativetextinput_p_p.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativetextinput_p.h>
+#include <QtQuick1/private/qdeclarativetextinput_p_p.h>
#include <QDebug>
#include <QDir>
#include <QStyle>
@@ -57,7 +57,7 @@
#define SRCDIR "."
#endif
-Q_DECLARE_METATYPE(QDeclarativeTextInput::SelectionMode)
+Q_DECLARE_METATYPE(QDeclarative1TextInput::SelectionMode)
QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual)
{
@@ -179,7 +179,7 @@ void tst_qdeclarativetextinput::text()
{
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData("import QtQuick 1.0\nTextInput { text: \"\" }", QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->text(), QString(""));
@@ -192,7 +192,7 @@ void tst_qdeclarativetextinput::text()
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->text(), standard.at(i));
@@ -208,7 +208,7 @@ void tst_qdeclarativetextinput::width()
{
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData("import QtQuick 1.0\nTextInput { text: \"\" }", QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->width(), 0.0);
@@ -225,7 +225,7 @@ void tst_qdeclarativetextinput::width()
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
int delta = abs(int(int(textinputObject->width()) - metricWidth));
@@ -242,7 +242,7 @@ void tst_qdeclarativetextinput::font()
QString componentStr = "import QtQuick 1.0\nTextInput { font.pointSize: 40; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->font().pointSize(), 40);
@@ -256,7 +256,7 @@ void tst_qdeclarativetextinput::font()
QString componentStr = "import QtQuick 1.0\nTextInput { font.bold: true; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->font().bold(), true);
@@ -269,7 +269,7 @@ void tst_qdeclarativetextinput::font()
QString componentStr = "import QtQuick 1.0\nTextInput { font.italic: true; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->font().italic(), true);
@@ -282,7 +282,7 @@ void tst_qdeclarativetextinput::font()
QString componentStr = "import QtQuick 1.0\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->font().family(), QString("Helvetica"));
@@ -296,7 +296,7 @@ void tst_qdeclarativetextinput::font()
QString componentStr = "import QtQuick 1.0\nTextInput { font.family: \"\"; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->font().family(), QString(""));
@@ -313,7 +313,7 @@ void tst_qdeclarativetextinput::color()
QString componentStr = "import QtQuick 1.0\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i)));
@@ -326,7 +326,7 @@ void tst_qdeclarativetextinput::color()
QString componentStr = "import QtQuick 1.0\nTextInput { selectionColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->selectionColor(), QColor(colorStrings.at(i)));
@@ -339,7 +339,7 @@ void tst_qdeclarativetextinput::color()
QString componentStr = "import QtQuick 1.0\nTextInput { selectedTextColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->selectedTextColor(), QColor(colorStrings.at(i)));
@@ -354,7 +354,7 @@ void tst_qdeclarativetextinput::color()
QString componentStr = "import QtQuick 1.0\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
QCOMPARE(textinputObject->color(), testColor);
@@ -369,7 +369,7 @@ void tst_qdeclarativetextinput::selection()
QString componentStr = "import QtQuick 1.0\nTextInput { text: \""+ testStr +"\"; }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
@@ -489,7 +489,7 @@ void tst_qdeclarativetextinput::isRightToLeft()
QFETCH(bool, midString);
QFETCH(bool, endString);
- QDeclarativeTextInput textInput;
+ QDeclarative1TextInput textInput;
textInput.setText(text);
// first test that the right string is delivered to the QString::isRightToLeft()
@@ -520,7 +520,7 @@ void tst_qdeclarativetextinput::moveCursorSelection_data()
QTest::addColumn<QString>("testStr");
QTest::addColumn<int>("cursorPosition");
QTest::addColumn<int>("movePosition");
- QTest::addColumn<QDeclarativeTextInput::SelectionMode>("mode");
+ QTest::addColumn<QDeclarative1TextInput::SelectionMode>("mode");
QTest::addColumn<int>("selectionStart");
QTest::addColumn<int>("selectionEnd");
QTest::addColumn<bool>("reversible");
@@ -529,157 +529,157 @@ void tst_qdeclarativetextinput::moveCursorSelection_data()
// <> contains the actual selection.
QTest::newRow("(t)he|characters")
- << standard[0] << 0 << 1 << QDeclarativeTextInput::SelectCharacters << 0 << 1 << true;
+ << standard[0] << 0 << 1 << QDeclarative1TextInput::SelectCharacters << 0 << 1 << true;
QTest::newRow("do(g)|characters")
- << standard[0] << 43 << 44 << QDeclarativeTextInput::SelectCharacters << 43 << 44 << true;
+ << standard[0] << 43 << 44 << QDeclarative1TextInput::SelectCharacters << 43 << 44 << true;
QTest::newRow("jum(p)ed|characters")
- << standard[0] << 23 << 24 << QDeclarativeTextInput::SelectCharacters << 23 << 24 << true;
+ << standard[0] << 23 << 24 << QDeclarative1TextInput::SelectCharacters << 23 << 24 << true;
QTest::newRow("jumped( )over|characters")
- << standard[0] << 26 << 27 << QDeclarativeTextInput::SelectCharacters << 26 << 27 << true;
+ << standard[0] << 26 << 27 << QDeclarative1TextInput::SelectCharacters << 26 << 27 << true;
QTest::newRow("(the )|characters")
- << standard[0] << 0 << 4 << QDeclarativeTextInput::SelectCharacters << 0 << 4 << true;
+ << standard[0] << 0 << 4 << QDeclarative1TextInput::SelectCharacters << 0 << 4 << true;
QTest::newRow("( dog)|characters")
- << standard[0] << 40 << 44 << QDeclarativeTextInput::SelectCharacters << 40 << 44 << true;
+ << standard[0] << 40 << 44 << QDeclarative1TextInput::SelectCharacters << 40 << 44 << true;
QTest::newRow("( jumped )|characters")
- << standard[0] << 19 << 27 << QDeclarativeTextInput::SelectCharacters << 19 << 27 << true;
+ << standard[0] << 19 << 27 << QDeclarative1TextInput::SelectCharacters << 19 << 27 << true;
QTest::newRow("th(e qu)ick|characters")
- << standard[0] << 2 << 6 << QDeclarativeTextInput::SelectCharacters << 2 << 6 << true;
+ << standard[0] << 2 << 6 << QDeclarative1TextInput::SelectCharacters << 2 << 6 << true;
QTest::newRow("la(zy d)og|characters")
- << standard[0] << 38 << 42 << QDeclarativeTextInput::SelectCharacters << 38 << 42 << true;
+ << standard[0] << 38 << 42 << QDeclarative1TextInput::SelectCharacters << 38 << 42 << true;
QTest::newRow("jum(ped ov)er|characters")
- << standard[0] << 23 << 29 << QDeclarativeTextInput::SelectCharacters << 23 << 29 << true;
+ << standard[0] << 23 << 29 << QDeclarative1TextInput::SelectCharacters << 23 << 29 << true;
QTest::newRow("()the|characters")
- << standard[0] << 0 << 0 << QDeclarativeTextInput::SelectCharacters << 0 << 0 << true;
+ << standard[0] << 0 << 0 << QDeclarative1TextInput::SelectCharacters << 0 << 0 << true;
QTest::newRow("dog()|characters")
- << standard[0] << 44 << 44 << QDeclarativeTextInput::SelectCharacters << 44 << 44 << true;
+ << standard[0] << 44 << 44 << QDeclarative1TextInput::SelectCharacters << 44 << 44 << true;
QTest::newRow("jum()ped|characters")
- << standard[0] << 23 << 23 << QDeclarativeTextInput::SelectCharacters << 23 << 23 << true;
+ << standard[0] << 23 << 23 << QDeclarative1TextInput::SelectCharacters << 23 << 23 << true;
QTest::newRow("<(t)he>|words")
- << standard[0] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 3 << true;
+ << standard[0] << 0 << 1 << QDeclarative1TextInput::SelectWords << 0 << 3 << true;
QTest::newRow("<do(g)>|words")
- << standard[0] << 43 << 44 << QDeclarativeTextInput::SelectWords << 41 << 44 << true;
+ << standard[0] << 43 << 44 << QDeclarative1TextInput::SelectWords << 41 << 44 << true;
QTest::newRow("<jum(p)ed>|words")
- << standard[0] << 23 << 24 << QDeclarativeTextInput::SelectWords << 20 << 26 << true;
+ << standard[0] << 23 << 24 << QDeclarative1TextInput::SelectWords << 20 << 26 << true;
QTest::newRow("<jumped( )>over|words,ltr")
- << standard[0] << 26 << 27 << QDeclarativeTextInput::SelectWords << 20 << 27 << false;
+ << standard[0] << 26 << 27 << QDeclarative1TextInput::SelectWords << 20 << 27 << false;
QTest::newRow("jumped<( )over>|words,rtl")
- << standard[0] << 27 << 26 << QDeclarativeTextInput::SelectWords << 26 << 31 << false;
+ << standard[0] << 27 << 26 << QDeclarative1TextInput::SelectWords << 26 << 31 << false;
QTest::newRow("<(the )>quick|words,ltr")
- << standard[0] << 0 << 4 << QDeclarativeTextInput::SelectWords << 0 << 4 << false;
+ << standard[0] << 0 << 4 << QDeclarative1TextInput::SelectWords << 0 << 4 << false;
QTest::newRow("<(the )quick>|words,rtl")
- << standard[0] << 4 << 0 << QDeclarativeTextInput::SelectWords << 0 << 9 << false;
+ << standard[0] << 4 << 0 << QDeclarative1TextInput::SelectWords << 0 << 9 << false;
QTest::newRow("<lazy( dog)>|words,ltr")
- << standard[0] << 40 << 44 << QDeclarativeTextInput::SelectWords << 36 << 44 << false;
+ << standard[0] << 40 << 44 << QDeclarative1TextInput::SelectWords << 36 << 44 << false;
QTest::newRow("lazy<( dog)>|words,rtl")
- << standard[0] << 44 << 40 << QDeclarativeTextInput::SelectWords << 40 << 44 << false;
+ << standard[0] << 44 << 40 << QDeclarative1TextInput::SelectWords << 40 << 44 << false;
QTest::newRow("<fox( jumped )>over|words,ltr")
- << standard[0] << 19 << 27 << QDeclarativeTextInput::SelectWords << 16 << 27 << false;
+ << standard[0] << 19 << 27 << QDeclarative1TextInput::SelectWords << 16 << 27 << false;
QTest::newRow("fox<( jumped )over>|words,rtl")
- << standard[0] << 27 << 19 << QDeclarativeTextInput::SelectWords << 19 << 31 << false;
+ << standard[0] << 27 << 19 << QDeclarative1TextInput::SelectWords << 19 << 31 << false;
QTest::newRow("<th(e qu)ick>|words")
- << standard[0] << 2 << 6 << QDeclarativeTextInput::SelectWords << 0 << 9 << true;
+ << standard[0] << 2 << 6 << QDeclarative1TextInput::SelectWords << 0 << 9 << true;
QTest::newRow("<la(zy d)og|words>")
- << standard[0] << 38 << 42 << QDeclarativeTextInput::SelectWords << 36 << 44 << true;
+ << standard[0] << 38 << 42 << QDeclarative1TextInput::SelectWords << 36 << 44 << true;
QTest::newRow("<jum(ped ov)er>|words")
- << standard[0] << 23 << 29 << QDeclarativeTextInput::SelectWords << 20 << 31 << true;
+ << standard[0] << 23 << 29 << QDeclarative1TextInput::SelectWords << 20 << 31 << true;
QTest::newRow("<()>the|words")
- << standard[0] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true;
+ << standard[0] << 0 << 0 << QDeclarative1TextInput::SelectWords << 0 << 0 << true;
QTest::newRow("dog<()>|words")
- << standard[0] << 44 << 44 << QDeclarativeTextInput::SelectWords << 44 << 44 << true;
+ << standard[0] << 44 << 44 << QDeclarative1TextInput::SelectWords << 44 << 44 << true;
QTest::newRow("jum<()>ped|words")
- << standard[0] << 23 << 23 << QDeclarativeTextInput::SelectWords << 23 << 23 << true;
+ << standard[0] << 23 << 23 << QDeclarative1TextInput::SelectWords << 23 << 23 << true;
QTest::newRow("Hello<(,)> |words")
- << standard[2] << 5 << 6 << QDeclarativeTextInput::SelectWords << 5 << 6 << true;
+ << standard[2] << 5 << 6 << QDeclarative1TextInput::SelectWords << 5 << 6 << true;
QTest::newRow("Hello<(, )>world|words,ltr")
- << standard[2] << 5 << 7 << QDeclarativeTextInput::SelectWords << 5 << 7 << false;
+ << standard[2] << 5 << 7 << QDeclarative1TextInput::SelectWords << 5 << 7 << false;
QTest::newRow("Hello<(, )world>|words,rtl")
- << standard[2] << 7 << 5 << QDeclarativeTextInput::SelectWords << 5 << 12 << false;
+ << standard[2] << 7 << 5 << QDeclarative1TextInput::SelectWords << 5 << 12 << false;
QTest::newRow("<Hel(lo, )>world|words,ltr")
- << standard[2] << 3 << 7 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ << standard[2] << 3 << 7 << QDeclarative1TextInput::SelectWords << 0 << 7 << false;
QTest::newRow("<Hel(lo, )world>|words,rtl")
- << standard[2] << 7 << 3 << QDeclarativeTextInput::SelectWords << 0 << 12 << false;
+ << standard[2] << 7 << 3 << QDeclarative1TextInput::SelectWords << 0 << 12 << false;
QTest::newRow("<Hel(lo)>,|words")
- << standard[2] << 3 << 5 << QDeclarativeTextInput::SelectWords << 0 << 5 << true;
+ << standard[2] << 3 << 5 << QDeclarative1TextInput::SelectWords << 0 << 5 << true;
QTest::newRow("Hello<()>,|words")
- << standard[2] << 5 << 5 << QDeclarativeTextInput::SelectWords << 5 << 5 << true;
+ << standard[2] << 5 << 5 << QDeclarative1TextInput::SelectWords << 5 << 5 << true;
QTest::newRow("Hello,<()>|words")
- << standard[2] << 6 << 6 << QDeclarativeTextInput::SelectWords << 6 << 6 << true;
+ << standard[2] << 6 << 6 << QDeclarative1TextInput::SelectWords << 6 << 6 << true;
QTest::newRow("Hello<,( )>world|words,ltr")
- << standard[2] << 6 << 7 << QDeclarativeTextInput::SelectWords << 5 << 7 << false;
+ << standard[2] << 6 << 7 << QDeclarative1TextInput::SelectWords << 5 << 7 << false;
QTest::newRow("Hello,<( )world>|words,rtl")
- << standard[2] << 7 << 6 << QDeclarativeTextInput::SelectWords << 6 << 12 << false;
+ << standard[2] << 7 << 6 << QDeclarative1TextInput::SelectWords << 6 << 12 << false;
QTest::newRow("Hello<,( world)>|words,ltr")
- << standard[2] << 6 << 12 << QDeclarativeTextInput::SelectWords << 5 << 12 << false;
+ << standard[2] << 6 << 12 << QDeclarative1TextInput::SelectWords << 5 << 12 << false;
QTest::newRow("Hello,<( world)>|words,rtl")
- << standard[2] << 12 << 6 << QDeclarativeTextInput::SelectWords << 6 << 12 << false;
+ << standard[2] << 12 << 6 << QDeclarative1TextInput::SelectWords << 6 << 12 << false;
QTest::newRow("Hello<,( world!)>|words,ltr")
- << standard[2] << 6 << 13 << QDeclarativeTextInput::SelectWords << 5 << 13 << false;
+ << standard[2] << 6 << 13 << QDeclarative1TextInput::SelectWords << 5 << 13 << false;
QTest::newRow("Hello,<( world!)>|words,rtl")
- << standard[2] << 13 << 6 << QDeclarativeTextInput::SelectWords << 6 << 13 << false;
+ << standard[2] << 13 << 6 << QDeclarative1TextInput::SelectWords << 6 << 13 << false;
QTest::newRow("Hello<(, world!)>|words")
- << standard[2] << 5 << 13 << QDeclarativeTextInput::SelectWords << 5 << 13 << true;
+ << standard[2] << 5 << 13 << QDeclarative1TextInput::SelectWords << 5 << 13 << true;
QTest::newRow("world<(!)>|words")
- << standard[2] << 12 << 13 << QDeclarativeTextInput::SelectWords << 12 << 13 << true;
+ << standard[2] << 12 << 13 << QDeclarative1TextInput::SelectWords << 12 << 13 << true;
QTest::newRow("world!<()>)|words")
- << standard[2] << 13 << 13 << QDeclarativeTextInput::SelectWords << 13 << 13 << true;
+ << standard[2] << 13 << 13 << QDeclarative1TextInput::SelectWords << 13 << 13 << true;
QTest::newRow("world<()>!)|words")
- << standard[2] << 12 << 12 << QDeclarativeTextInput::SelectWords << 12 << 12 << true;
+ << standard[2] << 12 << 12 << QDeclarative1TextInput::SelectWords << 12 << 12 << true;
QTest::newRow("<(,)>olleH |words")
- << standard[3] << 7 << 8 << QDeclarativeTextInput::SelectWords << 7 << 8 << true;
+ << standard[3] << 7 << 8 << QDeclarative1TextInput::SelectWords << 7 << 8 << true;
QTest::newRow("<dlrow( ,)>olleH|words,ltr")
- << standard[3] << 6 << 8 << QDeclarativeTextInput::SelectWords << 1 << 8 << false;
+ << standard[3] << 6 << 8 << QDeclarative1TextInput::SelectWords << 1 << 8 << false;
QTest::newRow("dlrow<( ,)>olleH|words,rtl")
- << standard[3] << 8 << 6 << QDeclarativeTextInput::SelectWords << 6 << 8 << false;
+ << standard[3] << 8 << 6 << QDeclarative1TextInput::SelectWords << 6 << 8 << false;
QTest::newRow("<dlrow( ,ol)leH>|words,ltr")
- << standard[3] << 6 << 10 << QDeclarativeTextInput::SelectWords << 1 << 13 << false;
+ << standard[3] << 6 << 10 << QDeclarative1TextInput::SelectWords << 1 << 13 << false;
QTest::newRow("dlrow<( ,ol)leH>|words,rtl")
- << standard[3] << 10 << 6 << QDeclarativeTextInput::SelectWords << 6 << 13 << false;
+ << standard[3] << 10 << 6 << QDeclarative1TextInput::SelectWords << 6 << 13 << false;
QTest::newRow(",<(ol)leH>,|words")
- << standard[3] << 8 << 10 << QDeclarativeTextInput::SelectWords << 8 << 13 << true;
+ << standard[3] << 8 << 10 << QDeclarative1TextInput::SelectWords << 8 << 13 << true;
QTest::newRow(",<()>olleH|words")
- << standard[3] << 8 << 8 << QDeclarativeTextInput::SelectWords << 8 << 8 << true;
+ << standard[3] << 8 << 8 << QDeclarative1TextInput::SelectWords << 8 << 8 << true;
QTest::newRow("<()>,olleH|words")
- << standard[3] << 7 << 7 << QDeclarativeTextInput::SelectWords << 7 << 7 << true;
+ << standard[3] << 7 << 7 << QDeclarative1TextInput::SelectWords << 7 << 7 << true;
QTest::newRow("<dlrow( )>,olleH|words,ltr")
- << standard[3] << 6 << 7 << QDeclarativeTextInput::SelectWords << 1 << 7 << false;
+ << standard[3] << 6 << 7 << QDeclarative1TextInput::SelectWords << 1 << 7 << false;
QTest::newRow("dlrow<( ),>olleH|words,rtl")
- << standard[3] << 7 << 6 << QDeclarativeTextInput::SelectWords << 6 << 8 << false;
+ << standard[3] << 7 << 6 << QDeclarative1TextInput::SelectWords << 6 << 8 << false;
QTest::newRow("<(dlrow )>,olleH|words,ltr")
- << standard[3] << 1 << 7 << QDeclarativeTextInput::SelectWords << 1 << 7 << false;
+ << standard[3] << 1 << 7 << QDeclarative1TextInput::SelectWords << 1 << 7 << false;
QTest::newRow("<(dlrow ),>olleH|words,rtl")
- << standard[3] << 7 << 1 << QDeclarativeTextInput::SelectWords << 1 << 8 << false;
+ << standard[3] << 7 << 1 << QDeclarative1TextInput::SelectWords << 1 << 8 << false;
QTest::newRow("<(!dlrow )>,olleH|words,ltr")
- << standard[3] << 0 << 7 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ << standard[3] << 0 << 7 << QDeclarative1TextInput::SelectWords << 0 << 7 << false;
QTest::newRow("<(!dlrow ),>olleH|words,rtl")
- << standard[3] << 7 << 0 << QDeclarativeTextInput::SelectWords << 0 << 8 << false;
+ << standard[3] << 7 << 0 << QDeclarative1TextInput::SelectWords << 0 << 8 << false;
QTest::newRow("(!dlrow ,)olleH|words")
- << standard[3] << 0 << 8 << QDeclarativeTextInput::SelectWords << 0 << 8 << true;
+ << standard[3] << 0 << 8 << QDeclarative1TextInput::SelectWords << 0 << 8 << true;
QTest::newRow("<(!)>dlrow|words")
- << standard[3] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 1 << true;
+ << standard[3] << 0 << 1 << QDeclarative1TextInput::SelectWords << 0 << 1 << true;
QTest::newRow("<()>!dlrow|words")
- << standard[3] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true;
+ << standard[3] << 0 << 0 << QDeclarative1TextInput::SelectWords << 0 << 0 << true;
QTest::newRow("!<()>dlrow|words")
- << standard[3] << 1 << 1 << QDeclarativeTextInput::SelectWords << 1 << 1 << true;
+ << standard[3] << 1 << 1 << QDeclarative1TextInput::SelectWords << 1 << 1 << true;
QTest::newRow(" <s(pac)ey> text |words")
- << standard[4] << 1 << 4 << QDeclarativeTextInput::SelectWords << 1 << 7 << true;
+ << standard[4] << 1 << 4 << QDeclarative1TextInput::SelectWords << 1 << 7 << true;
QTest::newRow(" spacey <t(ex)t> |words")
- << standard[4] << 11 << 13 << QDeclarativeTextInput::SelectWords << 10 << 14 << true;
+ << standard[4] << 11 << 13 << QDeclarative1TextInput::SelectWords << 10 << 14 << true;
QTest::newRow("<( )>spacey text |words|ltr")
- << standard[4] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 1 << false;
+ << standard[4] << 0 << 1 << QDeclarative1TextInput::SelectWords << 0 << 1 << false;
QTest::newRow("<( )spacey> text |words|rtl")
- << standard[4] << 1 << 0 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ << standard[4] << 1 << 0 << QDeclarative1TextInput::SelectWords << 0 << 7 << false;
QTest::newRow("spacey <text( )>|words|ltr")
- << standard[4] << 14 << 15 << QDeclarativeTextInput::SelectWords << 10 << 15 << false;
+ << standard[4] << 14 << 15 << QDeclarative1TextInput::SelectWords << 10 << 15 << false;
QTest::newRow("spacey text<( )>|words|rtl")
- << standard[4] << 15 << 14 << QDeclarativeTextInput::SelectWords << 14 << 15 << false;
+ << standard[4] << 15 << 14 << QDeclarative1TextInput::SelectWords << 14 << 15 << false;
QTest::newRow("<()> spacey text |words")
- << standard[4] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << false;
+ << standard[4] << 0 << 0 << QDeclarative1TextInput::SelectWords << 0 << 0 << false;
QTest::newRow(" spacey text <()>|words")
- << standard[4] << 15 << 15 << QDeclarativeTextInput::SelectWords << 15 << 15 << false;
+ << standard[4] << 15 << 15 << QDeclarative1TextInput::SelectWords << 15 << 15 << false;
}
void tst_qdeclarativetextinput::moveCursorSelection()
@@ -687,7 +687,7 @@ void tst_qdeclarativetextinput::moveCursorSelection()
QFETCH(QString, testStr);
QFETCH(int, cursorPosition);
QFETCH(int, movePosition);
- QFETCH(QDeclarativeTextInput::SelectionMode, mode);
+ QFETCH(QDeclarative1TextInput::SelectionMode, mode);
QFETCH(int, selectionStart);
QFETCH(int, selectionEnd);
QFETCH(bool, reversible);
@@ -695,7 +695,7 @@ void tst_qdeclarativetextinput::moveCursorSelection()
QString componentStr = "import QtQuick 1.1\nTextInput { text: \""+ testStr +"\"; }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
textinputObject->setCursorPosition(cursorPosition);
@@ -903,17 +903,17 @@ void tst_qdeclarativetextinput::moveCursorSelectionSequence()
QString componentStr = "import QtQuick 1.1\nTextInput { text: \""+ testStr +"\"; }";
QDeclarativeComponent textinputComponent(&engine);
textinputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput*>(textinputComponent.create());
QVERIFY(textinputObject != 0);
textinputObject->setCursorPosition(cursorPosition);
- textinputObject->moveCursorSelection(movePosition1, QDeclarativeTextInput::SelectWords);
+ textinputObject->moveCursorSelection(movePosition1, QDeclarative1TextInput::SelectWords);
QCOMPARE(textinputObject->selectedText(), testStr.mid(selection1Start, selection1End - selection1Start));
QCOMPARE(textinputObject->selectionStart(), selection1Start);
QCOMPARE(textinputObject->selectionEnd(), selection1End);
- textinputObject->moveCursorSelection(movePosition2, QDeclarativeTextInput::SelectWords);
+ textinputObject->moveCursorSelection(movePosition2, QDeclarative1TextInput::SelectWords);
QCOMPARE(textinputObject->selectedText(), testStr.mid(selection2Start, selection2End - selection2Start));
QCOMPARE(textinputObject->selectionStart(), selection2Start);
QCOMPARE(textinputObject->selectionEnd(), selection2End);
@@ -949,7 +949,7 @@ void tst_qdeclarativetextinput::mouseSelection()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textInputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textInputObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -997,7 +997,7 @@ void tst_qdeclarativetextinput::deferEnableSelectByMouse()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textInputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textInputObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1037,7 +1037,7 @@ void tst_qdeclarativetextinput::deferDisableSelectByMouse()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textInputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textInputObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1068,7 +1068,7 @@ void tst_qdeclarativetextinput::dragMouseSelection()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textInputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textInputObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1127,7 +1127,7 @@ void tst_qdeclarativetextinput::mouseSelectionMode()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textInputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textInputObject != 0);
// press-and-drag-and-release from x1 to x2
@@ -1193,41 +1193,41 @@ void tst_qdeclarativetextinput::horizontalAlignment()
void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml");
- QDeclarativeTextInput *textInput = canvas->rootObject()->findChild<QDeclarativeTextInput*>("text");
+ QDeclarative1TextInput *textInput = canvas->rootObject()->findChild<QDeclarative1TextInput*>("text");
QVERIFY(textInput != 0);
canvas->show();
- QDeclarativeTextInputPrivate *textInputPrivate = QDeclarativeTextInputPrivate::get(textInput);
+ QDeclarative1TextInputPrivate *textInputPrivate = QDeclarative1TextInputPrivate::get(textInput);
QVERIFY(textInputPrivate != 0);
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
// implicit alignment should follow the reading direction of RTL text
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignRight);
QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
// explicitly left aligned
- textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ textInput->setHAlign(QDeclarative1TextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignLeft);
QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
// explicitly right aligned
- textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ textInput->setHAlign(QDeclarative1TextInput::AlignRight);
QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignRight);
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
// explicitly center aligned
- textInput->setHAlign(QDeclarativeTextInput::AlignHCenter);
+ textInput->setHAlign(QDeclarative1TextInput::AlignHCenter);
QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignHCenter);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignHCenter);
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
QVERIFY(-textInputPrivate->hscroll + textInputPrivate->width() > canvas->width()/2);
// reseted alignment should go back to following the text reading direction
textInput->resetHAlign();
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignRight);
QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
@@ -1235,20 +1235,20 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
QDeclarativeItemPrivate::get(textInput)->setLayoutMirror(true);
// mirrored implicit alignment should continue to follow the reading direction of the text
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignRight);
QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
// explicitly right aligned behaves as left aligned
- textInput->setHAlign(QDeclarativeTextInput::AlignRight);
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
- QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignLeft);
+ textInput->setHAlign(QDeclarative1TextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarative1TextInput::AlignLeft);
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
// mirrored explicitly left aligned behaves as right aligned
- textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
- QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignRight);
+ textInput->setHAlign(QDeclarative1TextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignLeft);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarative1TextInput::AlignRight);
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
// disable mirroring
@@ -1258,7 +1258,7 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
// English text should be implicitly left aligned
textInput->setText("Hello world!");
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignLeft);
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
#ifndef Q_OS_MAC // QTBUG-18040
@@ -1266,13 +1266,13 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
// keyboard input direction from QApplication::keyboardInputDirection
textInput->setText("");
QCOMPARE(textInput->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
- QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ QDeclarative1TextInput::AlignLeft : QDeclarative1TextInput::AlignRight);
if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
else
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
- textInput->setHAlign(QDeclarativeTextInput::AlignRight);
- QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ textInput->setHAlign(QDeclarative1TextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarative1TextInput::AlignRight);
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
#endif
@@ -1283,9 +1283,9 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
QString componentStr = "import QtQuick 1.0\nTextInput {}";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
- QDeclarativeTextInput *textObject = qobject_cast<QDeclarativeTextInput*>(textComponent.create());
+ QDeclarative1TextInput *textObject = qobject_cast<QDeclarative1TextInput*>(textComponent.create());
QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
- QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ QDeclarative1TextInput::AlignLeft : QDeclarative1TextInput::AlignRight);
delete textObject;
#endif
}
@@ -1299,7 +1299,7 @@ void tst_qdeclarativetextinput::positionAt()
QApplication::setActiveWindow(canvas);
QTest::qWaitForWindowShown(canvas);
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textinputObject != 0);
// Check autoscrolled...
@@ -1316,8 +1316,8 @@ void tst_qdeclarativetextinput::positionAt()
#endif
int x = textinputObject->positionToRectangle(pos + 1).x() - 1;
- QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
- QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarative1TextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarative1TextInput::CursorOnCharacter), pos);
// Check without autoscroll...
textinputObject->setAutoScroll(false);
@@ -1332,8 +1332,8 @@ void tst_qdeclarativetextinput::positionAt()
#endif
x = textinputObject->positionToRectangle(pos + 1).x() - 1;
- QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
- QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarative1TextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarative1TextInput::CursorOnCharacter), pos);
const qreal x0 = textinputObject->positionToRectangle(pos).x();
const qreal x1 = textinputObject->positionToRectangle(pos + 1).x();
@@ -1366,7 +1366,7 @@ void tst_qdeclarativetextinput::maxLength()
QApplication::setActiveWindow(canvas);
QTest::qWaitForWindowShown(canvas);
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textinputObject != 0);
QVERIFY(textinputObject->text().isEmpty());
QVERIFY(textinputObject->maxLength() == 10);
@@ -1396,7 +1396,7 @@ void tst_qdeclarativetextinput::masks()
canvas->show();
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textinputObject = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textinputObject != 0);
QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
QVERIFY(textinputObject->text().length() == 0);
@@ -1424,7 +1424,7 @@ void tst_qdeclarativetextinput::validators()
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *intInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("intInput")));
+ QDeclarative1TextInput *intInput = qobject_cast<QDeclarative1TextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("intInput")));
QVERIFY(intInput);
intInput->setFocus(true);
QTRY_VERIFY(intInput->hasActiveFocus());
@@ -1445,7 +1445,7 @@ void tst_qdeclarativetextinput::validators()
QCOMPARE(intInput->text(), QLatin1String("11"));
QCOMPARE(intInput->hasAcceptableInput(), true);
- QDeclarativeTextInput *dblInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("dblInput")));
+ QDeclarative1TextInput *dblInput = qobject_cast<QDeclarative1TextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("dblInput")));
QTRY_VERIFY(dblInput);
dblInput->setFocus(true);
QVERIFY(dblInput->hasActiveFocus() == true);
@@ -1474,7 +1474,7 @@ void tst_qdeclarativetextinput::validators()
QCOMPARE(dblInput->text(), QLatin1String("12.11"));
QCOMPARE(dblInput->hasAcceptableInput(), true);
- QDeclarativeTextInput *strInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("strInput")));
+ QDeclarative1TextInput *strInput = qobject_cast<QDeclarative1TextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("strInput")));
QTRY_VERIFY(strInput);
strInput->setFocus(true);
QVERIFY(strInput->hasActiveFocus() == true);
@@ -1516,7 +1516,7 @@ void tst_qdeclarativetextinput::inputMethods()
// test input method hints
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *input = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(input != 0);
QVERIFY(input->imHints() & Qt::ImhNoPredictiveText);
QVERIFY(input->inputMethodHints() & Qt::ImhNoPredictiveText);
@@ -1568,7 +1568,7 @@ void tst_qdeclarativetextinput::navigation()
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+ QDeclarative1TextInput *input = qobject_cast<QDeclarative1TextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
QVERIFY(input != 0);
input->setCursorPosition(0);
@@ -1609,7 +1609,7 @@ void tst_qdeclarativetextinput::navigation_RTL()
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+ QDeclarative1TextInput *input = qobject_cast<QDeclarative1TextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
QVERIFY(input != 0);
const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
@@ -1657,7 +1657,7 @@ void tst_qdeclarativetextinput::copyAndPaste() {
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
QDeclarativeComponent textInputComponent(&engine);
textInputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QDeclarative1TextInput *textInput = qobject_cast<QDeclarative1TextInput*>(textInputComponent.create());
QVERIFY(textInput != 0);
// copy and paste
@@ -1702,12 +1702,12 @@ void tst_qdeclarativetextinput::copyAndPaste() {
// when echo mode is set to hide text/password mode
int index = 0;
while (index < 4) {
- QDeclarativeTextInput::EchoMode echoMode = QDeclarativeTextInput::EchoMode(index);
+ QDeclarative1TextInput::EchoMode echoMode = QDeclarative1TextInput::EchoMode(index);
textInput->setEchoMode(echoMode);
textInput->setText("My password");
textInput->select(0, textInput->text().length());;
textInput->copy();
- if (echoMode == QDeclarativeTextInput::Normal) {
+ if (echoMode == QDeclarative1TextInput::Normal) {
QVERIFY(!clipboard->text().isEmpty());
QCOMPARE(clipboard->text(), QString("My password"));
clipboard->clear();
@@ -1729,7 +1729,7 @@ void tst_qdeclarativetextinput::canPasteEmpty() {
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
QDeclarativeComponent textInputComponent(&engine);
textInputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QDeclarative1TextInput *textInput = qobject_cast<QDeclarative1TextInput*>(textInputComponent.create());
QVERIFY(textInput != 0);
QLineControl lc;
@@ -1747,7 +1747,7 @@ void tst_qdeclarativetextinput::canPaste() {
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
QDeclarativeComponent textInputComponent(&engine);
textInputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QDeclarative1TextInput *textInput = qobject_cast<QDeclarative1TextInput*>(textInputComponent.create());
QVERIFY(textInput != 0);
QLineControl lc;
@@ -1762,7 +1762,7 @@ void tst_qdeclarativetextinput::passwordCharacter()
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\"; font.family: \"Helvetica\"; echoMode: TextInput.Password }";
QDeclarativeComponent textInputComponent(&engine);
textInputComponent.setData(componentStr.toLatin1(), QUrl());
- QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QDeclarative1TextInput *textInput = qobject_cast<QDeclarative1TextInput*>(textInputComponent.create());
QVERIFY(textInput != 0);
textInput->setPasswordCharacter("X");
@@ -1779,7 +1779,7 @@ void tst_qdeclarativetextinput::cursorDelegate()
QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml");
view->show();
view->setFocus();
- QDeclarativeTextInput *textInputObject = view->rootObject()->findChild<QDeclarativeTextInput*>("textInputObject");
+ QDeclarative1TextInput *textInputObject = view->rootObject()->findChild<QDeclarative1TextInput*>("textInputObject");
QVERIFY(textInputObject != 0);
QVERIFY(textInputObject->findChild<QDeclarativeItem*>("cursorInstance"));
//Test Delegate gets created
@@ -1820,7 +1820,7 @@ void tst_qdeclarativetextinput::cursorVisible()
QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
QSignalSpy spy(&input, SIGNAL(cursorVisibleChanged(bool)));
QCOMPARE(input.isCursorVisible(), false);
@@ -1884,7 +1884,7 @@ void tst_qdeclarativetextinput::cursorRectangle()
{
QString text = "Hello World!";
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
input.setText(text);
QFontMetricsF fm(input.font());
input.setWidth(fm.width(text.mid(0, 5)));
@@ -1934,7 +1934,7 @@ void tst_qdeclarativetextinput::readOnly()
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+ QDeclarative1TextInput *input = qobject_cast<QDeclarative1TextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
QVERIFY(input != 0);
QTRY_VERIFY(input->hasActiveFocus() == true);
@@ -1961,21 +1961,21 @@ void tst_qdeclarativetextinput::echoMode()
QVERIFY(canvas->rootObject() != 0);
- QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+ QDeclarative1TextInput *input = qobject_cast<QDeclarative1TextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
QVERIFY(input != 0);
QTRY_VERIFY(input->hasActiveFocus() == true);
QString initial = input->text();
Qt::InputMethodHints ref;
QCOMPARE(initial, QLatin1String("ABCDefgh"));
- QCOMPARE(input->echoMode(), QDeclarativeTextInput::Normal);
+ QCOMPARE(input->echoMode(), QDeclarative1TextInput::Normal);
QCOMPARE(input->displayText(), input->text());
//Normal
ref &= ~Qt::ImhHiddenText;
ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->imHints(), Qt::ImhNone);
- input->setEchoMode(QDeclarativeTextInput::NoEcho);
+ input->setEchoMode(QDeclarative1TextInput::NoEcho);
QCOMPARE(input->text(), initial);
QCOMPARE(input->displayText(), QLatin1String(""));
QCOMPARE(input->passwordCharacter(), QLatin1String("*"));
@@ -1984,7 +1984,7 @@ void tst_qdeclarativetextinput::echoMode()
ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->imHints(), Qt::ImhNone);
- input->setEchoMode(QDeclarativeTextInput::Password);
+ input->setEchoMode(QDeclarative1TextInput::Password);
//Password
ref |= Qt::ImhHiddenText;
ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
@@ -1996,7 +1996,7 @@ void tst_qdeclarativetextinput::echoMode()
QCOMPARE(input->passwordCharacter(), QLatin1String("Q"));
QCOMPARE(input->text(), initial);
QCOMPARE(input->displayText(), QLatin1String("QQQQQQQQ"));
- input->setEchoMode(QDeclarativeTextInput::PasswordEchoOnEdit);
+ input->setEchoMode(QDeclarative1TextInput::PasswordEchoOnEdit);
//PasswordEchoOnEdit
ref &= ~Qt::ImhHiddenText;
ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
@@ -2026,31 +2026,31 @@ void tst_qdeclarativetextinput::echoMode()
input->setIMHints(Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
ref |= Qt::ImhDialableCharactersOnly;
//Normal
- input->setEchoMode(QDeclarativeTextInput::Normal);
+ input->setEchoMode(QDeclarative1TextInput::Normal);
ref |= Qt::ImhHiddenText;
ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
//NoEcho
- input->setEchoMode(QDeclarativeTextInput::NoEcho);
+ input->setEchoMode(QDeclarative1TextInput::NoEcho);
ref |= Qt::ImhHiddenText;
ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
//Password
- input->setEchoMode(QDeclarativeTextInput::Password);
+ input->setEchoMode(QDeclarative1TextInput::Password);
ref |= Qt::ImhHiddenText;
ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
//PasswordEchoOnEdit
- input->setEchoMode(QDeclarativeTextInput::PasswordEchoOnEdit);
+ input->setEchoMode(QDeclarative1TextInput::PasswordEchoOnEdit);
ref &= ~Qt::ImhHiddenText;
ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
//Normal
- input->setEchoMode(QDeclarativeTextInput::Normal);
+ input->setEchoMode(QDeclarative1TextInput::Normal);
ref |= Qt::ImhHiddenText;
ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
QCOMPARE(input->inputMethodHints(), ref);
@@ -2139,7 +2139,7 @@ void tst_qdeclarativetextinput::openInputPanelOnClick()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool)));
input.setText("Hello world");
input.setPos(0, 0);
@@ -2151,7 +2151,7 @@ void tst_qdeclarativetextinput::openInputPanelOnClick()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&input);
- QDeclarativeTextInputPrivate *inputPrivate = static_cast<QDeclarativeTextInputPrivate*>(pri);
+ QDeclarative1TextInputPrivate *inputPrivate = static_cast<QDeclarative1TextInputPrivate*>(pri);
// input panel on click
inputPrivate->showInputPanelOnFocus = false;
@@ -2186,7 +2186,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool)));
input.setText("Hello world");
input.setPos(0, 0);
@@ -2198,7 +2198,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&input);
- QDeclarativeTextInputPrivate *inputPrivate = static_cast<QDeclarativeTextInputPrivate*>(pri);
+ QDeclarative1TextInputPrivate *inputPrivate = static_cast<QDeclarative1TextInputPrivate*>(pri);
inputPrivate->showInputPanelOnFocus = true;
// test default values
@@ -2227,7 +2227,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
// input method should stay enabled if focus
// is lost to an item that also accepts inputs
- QDeclarativeTextInput anotherInput;
+ QDeclarative1TextInput anotherInput;
scene.addItem(&anotherInput);
anotherInput.setFocus(true);
QApplication::processEvents();
@@ -2311,17 +2311,17 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
}
-class MyTextInput : public QDeclarativeTextInput
+class MyTextInput : public QDeclarative1TextInput
{
public:
- MyTextInput(QDeclarativeItem *parent = 0) : QDeclarativeTextInput(parent)
+ MyTextInput(QDeclarativeItem *parent = 0) : QDeclarative1TextInput(parent)
{
nbPaint = 0;
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
nbPaint++;
- QDeclarativeTextInput::paint(painter, option, widget);
+ QDeclarative1TextInput::paint(painter, option, widget);
}
int nbPaint;
};
@@ -2337,7 +2337,7 @@ void tst_qdeclarativetextinput::setHAlignClearCache()
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(input.nbPaint, 1);
- input.setHAlign(QDeclarativeTextInput::AlignRight);
+ input.setHAlign(QDeclarative1TextInput::AlignRight);
QApplication::processEvents();
//Changing the alignment should trigger a repaint
QCOMPARE(input.nbPaint, 2);
@@ -2347,8 +2347,8 @@ void tst_qdeclarativetextinput::focusOutClearSelection()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
- QDeclarativeTextInput input;
- QDeclarativeTextInput input2;
+ QDeclarative1TextInput input;
+ QDeclarative1TextInput input2;
input.setText(QLatin1String("Hello world"));
input.setFocus(true);
scene.addItem(&input2);
@@ -2427,7 +2427,7 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
QFontMetricsF fm(input.font());
input.setWidth(fm.width(committedText));
input.setText(committedText);
@@ -2526,7 +2526,7 @@ void tst_qdeclarativetextinput::preeditMicroFocus()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
input.setPos(0, 0);
input.setAutoScroll(false);
input.setFocus(true);
@@ -2582,7 +2582,7 @@ void tst_qdeclarativetextinput::inputContextMouseHandler()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
input.setWidth(200);
input.setText(text.mid(0, 12));
input.setCursorPosition(12);
@@ -2700,7 +2700,7 @@ void tst_qdeclarativetextinput::inputMethodComposing()
QGraphicsView view(&scene);
MyInputContext ic;
view.setInputContext(&ic);
- QDeclarativeTextInput input;
+ QDeclarative1TextInput input;
input.setWidth(200);
input.setText(text.mid(0, 12));
input.setCursorPosition(12);
@@ -2738,7 +2738,7 @@ void tst_qdeclarativetextinput::cursorRectangleSize()
QApplication::setActiveWindow(canvas);
QTest::qWaitForWindowShown(canvas);
- QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QDeclarative1TextInput *textInput = qobject_cast<QDeclarative1TextInput *>(canvas->rootObject());
QVERIFY(textInput != 0);
textInput->setFocus(Qt::OtherFocusReason);
QRectF cursorRect = textInput->positionToRectangle(textInput->cursorPosition());
diff --git a/tests/auto/qtquick1/qdeclarativetimer/qdeclarativetimer.pro b/tests/auto/qtquick1/qdeclarativetimer/qdeclarativetimer.pro
new file mode 100644
index 0000000000..dfc3421c2b
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativetimer/qdeclarativetimer.pro
@@ -0,0 +1,12 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativetimer.cpp
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/qtquick1/qdeclarativetimer/tst_qdeclarativetimer.cpp
new file mode 100644
index 0000000000..8b1b79a034
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativetimer/tst_qdeclarativetimer.cpp
@@ -0,0 +1,344 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QSignalSpy>
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativetimer_p.h>
+#include <QtQuick1/qdeclarativeitem.h>
+#include <QDebug>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativetimer : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativetimer();
+
+private slots:
+ void notRepeating();
+ void notRepeatingStart();
+ void repeat();
+ void noTriggerIfNotRunning();
+ void triggeredOnStart();
+ void triggeredOnStartRepeat();
+ void changeDuration();
+ void restart();
+ void parentProperty();
+};
+
+class TimerHelper : public QObject
+{
+ Q_OBJECT
+public:
+ TimerHelper() : QObject(), count(0)
+ {
+ }
+
+ int count;
+
+public slots:
+ void timeout() {
+ ++count;
+ }
+};
+
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+// Increase wait as emulator startup can cause unexpected delays
+#define TIMEOUT_TIMEOUT 2000
+#else
+#define TIMEOUT_TIMEOUT 200
+#endif
+
+tst_qdeclarativetimer::tst_qdeclarativetimer()
+{
+}
+
+void tst_qdeclarativetimer::notRepeating()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarative1Timer *timer = qobject_cast<QDeclarative1Timer*>(component.create());
+ QVERIFY(timer != 0);
+ QVERIFY(timer->isRunning());
+ QVERIFY(!timer->isRepeating());
+ QCOMPARE(timer->interval(), 100);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QVERIFY(timer->isRunning() == false);
+}
+
+void tst_qdeclarativetimer::notRepeatingStart()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100 }"), QUrl::fromLocalFile(""));
+ QDeclarative1Timer *timer = qobject_cast<QDeclarative1Timer*>(component.create());
+ QVERIFY(timer != 0);
+ QVERIFY(!timer->isRunning());
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 0);
+
+ timer->start();
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QVERIFY(timer->isRunning() == false);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::repeat()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarative1Timer *timer = qobject_cast<QDeclarative1Timer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QCOMPARE(helper.count, 0);
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > 0);
+ int oldCount = helper.count;
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > oldCount);
+ QVERIFY(timer->isRunning());
+
+ oldCount = helper.count;
+ timer->stop();
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count == oldCount);
+ QVERIFY(timer->isRunning() == false);
+
+ QSignalSpy spy(timer, SIGNAL(repeatChanged()));
+
+ timer->setRepeating(false);
+ QVERIFY(!timer->isRepeating());
+ QCOMPARE(spy.count(),1);
+
+ timer->setRepeating(false);
+ QCOMPARE(spy.count(),1);
+
+ timer->setRepeating(true);
+ QCOMPARE(spy.count(),2);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::triggeredOnStart()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl::fromLocalFile(""));
+ QDeclarative1Timer *timer = qobject_cast<QDeclarative1Timer*>(component.create());
+ QVERIFY(timer != 0);
+ QVERIFY(timer->triggeredOnStart());
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QTest::qWait(1);
+ QCOMPARE(helper.count, 1);
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 2);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 2);
+ QVERIFY(timer->isRunning() == false);
+
+ QSignalSpy spy(timer, SIGNAL(triggeredOnStartChanged()));
+
+ timer->setTriggeredOnStart(false);
+ QVERIFY(!timer->triggeredOnStart());
+ QCOMPARE(spy.count(),1);
+
+ timer->setTriggeredOnStart(false);
+ QCOMPARE(spy.count(),1);
+
+ timer->setTriggeredOnStart(true);
+ QCOMPARE(spy.count(),2);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::triggeredOnStartRepeat()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl::fromLocalFile(""));
+ QDeclarative1Timer *timer = qobject_cast<QDeclarative1Timer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QTest::qWait(1);
+ QCOMPARE(helper.count, 1);
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > 1);
+ int oldCount = helper.count;
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > oldCount);
+ QVERIFY(timer->isRunning());
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::noTriggerIfNotRunning()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray(
+ "import QtQuick 1.0\n"
+ "Item { property bool ok: true\n"
+ "Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }"
+ "Timer { interval: 10; running: true; onTriggered: t1.running=false }"
+ "}"
+ ), QUrl::fromLocalFile(""));
+ QObject *item = component.create();
+ QVERIFY(item != 0);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(item->property("ok").toBool(), true);
+
+ delete item;
+}
+
+void tst_qdeclarativetimer::changeDuration()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 200; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarative1Timer *timer = qobject_cast<QDeclarative1Timer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QCOMPARE(helper.count, 0);
+
+ QTest::qWait(500);
+ QCOMPARE(helper.count, 2);
+
+ timer->setInterval(500);
+
+ QTest::qWait(600);
+ QCOMPARE(helper.count, 3);
+ QVERIFY(timer->isRunning());
+
+ QSignalSpy spy(timer, SIGNAL(intervalChanged()));
+
+ timer->setInterval(200);
+ QCOMPARE(timer->interval(), 200);
+ QCOMPARE(spy.count(),1);
+
+ timer->setInterval(200);
+ QCOMPARE(spy.count(),1);
+
+ timer->setInterval(300);
+ QCOMPARE(spy.count(),2);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::restart()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarative1Timer *timer = qobject_cast<QDeclarative1Timer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QCOMPARE(helper.count, 0);
+
+ QTest::qWait(600);
+ QCOMPARE(helper.count, 1);
+
+ QTest::qWait(300);
+
+ timer->restart();
+
+ QTest::qWait(700);
+
+ QCOMPARE(helper.count, 2);
+ QVERIFY(timer->isRunning());
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::parentProperty()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QDeclarative1Timer *timer = item->findChild<QDeclarative1Timer*>("timer");
+ QVERIFY(timer != 0);
+
+ QVERIFY(timer->isRunning());
+
+ delete timer;
+}
+
+QTEST_MAIN(tst_qdeclarativetimer)
+
+#include "tst_qdeclarativetimer.moc"
diff --git a/tests/auto/declarative/qdeclarativeview/data/error1.qml b/tests/auto/qtquick1/qdeclarativeview/data/error1.qml
index 4887ff908f..4887ff908f 100644
--- a/tests/auto/declarative/qdeclarativeview/data/error1.qml
+++ b/tests/auto/qtquick1/qdeclarativeview/data/error1.qml
diff --git a/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml b/tests/auto/qtquick1/qdeclarativeview/data/resizemodedeclarativeitem.qml
index e5501a10dc..e5501a10dc 100644
--- a/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml
+++ b/tests/auto/qtquick1/qdeclarativeview/data/resizemodedeclarativeitem.qml
diff --git a/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml b/tests/auto/qtquick1/qdeclarativeview/data/resizemodegraphicswidget.qml
index f27090888b..f27090888b 100644
--- a/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml
+++ b/tests/auto/qtquick1/qdeclarativeview/data/resizemodegraphicswidget.qml
diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/qtquick1/qdeclarativeview/qdeclarativeview.pro
index 5b401973f9..603eab08d7 100644
--- a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
+++ b/tests/auto/qtquick1/qdeclarativeview/qdeclarativeview.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeview.cpp
@@ -11,4 +11,4 @@ symbian: {
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/qtquick1/qdeclarativeview/tst_qdeclarativeview.cpp
index 0483e0a0e8..d98215126b 100644
--- a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp
+++ b/tests/auto/qtquick1/qdeclarativeview/tst_qdeclarativeview.cpp
@@ -42,8 +42,8 @@
#include <QtTest/QSignalSpy>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeitem.h>
#include <QtGui/qgraphicswidget.h>
#include "../../../shared/util.h"
diff --git a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml b/tests/auto/qtquick1/qdeclarativeviewer/data/orientation.qml
index fb343120f1..fb343120f1 100644
--- a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
+++ b/tests/auto/qtquick1/qdeclarativeviewer/data/orientation.qml
diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/qtquick1/qdeclarativeviewer/qdeclarativeviewer.pro
index c24467575f..010fa3696a 100644
--- a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
+++ b/tests/auto/qtquick1/qdeclarativeviewer/qdeclarativeviewer.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
include(../../../../tools/qmlviewer/qml.pri)
@@ -17,4 +17,4 @@ symbian: {
}
CONFIG += parallel_test
-QT += core-private gui-private declarative-private
+QT += core-private gui-private declarative-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/qtquick1/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index 4e2b313414..6ef2a114d7 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/qtquick1/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -41,8 +41,8 @@
#include <qtest.h>
#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/qdeclarativeitem.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtGui/qmenubar.h>
#include <QSignalSpy>
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/datalist.qml
index ebf1eea674..ebf1eea674 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/datalist.qml
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties.qml b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/modelproperties.qml
index 8cd5763684..8cd5763684 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties.qml
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/modelproperties.qml
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties2.qml b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/modelproperties2.qml
index 67721c92a1..67721c92a1 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties2.qml
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/modelproperties2.qml
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/objectlist.qml
index 4134259714..4134259714 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/objectlist.qml
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole1.qml b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/singlerole1.qml
index d72e128b82..d72e128b82 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole1.qml
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/singlerole1.qml
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole2.qml b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/singlerole2.qml
index b9e666cec3..b9e666cec3 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole2.qml
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/singlerole2.qml
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/visualdatamodel.qml
index a5c44d0151..a5c44d0151 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/data/visualdatamodel.qml
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/qtquick1/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
index e15a7b0577..93019a53c5 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui qtquick1
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativevisualdatamodel.cpp
@@ -14,4 +14,4 @@ symbian: {
CONFIG += parallel_test
-QT += core-private gui-private declarative-private script-private
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/qtquick1/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
index ee787e2923..d08251e67b 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
+++ b/tests/auto/qtquick1/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -45,10 +45,10 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <private/qdeclarativelistview_p.h>
-#include <private/qdeclarativetext_p.h>
-#include <private/qdeclarativevisualitemmodel_p.h>
+#include <QtQuick1/qdeclarativeview.h>
+#include <QtQuick1/private/qdeclarativelistview_p.h>
+#include <QtQuick1/private/qdeclarativetext_p.h>
+#include <QtQuick1/private/qdeclarativevisualitemmodel_p.h>
#include <private/qdeclarativevaluetype_p.h>
#include <math.h>
@@ -181,7 +181,7 @@ void tst_qdeclarativevisualdatamodel::rootIndex()
engine.rootContext()->setContextProperty("myModel", &model);
- QDeclarativeVisualDataModel *obj = qobject_cast<QDeclarativeVisualDataModel*>(c.create());
+ QDeclarative1VisualDataModel *obj = qobject_cast<QDeclarative1VisualDataModel*>(c.create());
QVERIFY(obj != 0);
QMetaObject::invokeMethod(obj, "setRoot");
@@ -209,31 +209,31 @@ void tst_qdeclarativevisualdatamodel::updateLayout()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "display", 0);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 1 Item"));
- name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 1);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 2 Item"));
- name = findItem<QDeclarativeText>(contentItem, "display", 2);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 2);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 3 Item"));
model.invisibleRootItem()->sortChildren(0, Qt::DescendingOrder);
- name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 0);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 3 Item"));
- name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 1);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 2 Item"));
- name = findItem<QDeclarativeText>(contentItem, "display", 2);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 2);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 1 Item"));
}
@@ -249,45 +249,45 @@ void tst_qdeclarativevisualdatamodel::childChanged()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QDeclarativeVisualDataModel *vdm = listview->findChild<QDeclarativeVisualDataModel*>("visualModel");
+ QDeclarative1VisualDataModel *vdm = listview->findChild<QDeclarative1VisualDataModel*>("visualModel");
vdm->setRootIndex(QVariant::fromValue(model.indexFromItem(model.item(1,0))));
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "display", 0);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 2 Child Item"));
model.item(1,0)->child(0,0)->setText("Row 2 updated child");
- name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 0);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 2 updated child"));
model.item(1,0)->appendRow(new QStandardItem(QLatin1String("Row 2 Child Item 2")));
QTest::qWait(300);
- name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 1);
QVERIFY(name != 0);
QCOMPARE(name->text(), QString("Row 2 Child Item 2"));
model.item(1,0)->takeRow(1);
- name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 1);
QVERIFY(name == 0);
vdm->setRootIndex(QVariant::fromValue(QModelIndex()));
QTest::qWait(300);
- name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 0);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 1 Item"));
- name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 1);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 2 Item"));
- name = findItem<QDeclarativeText>(contentItem, "display", 2);
+ name = findItem<QDeclarative1Text>(contentItem, "display", 2);
QVERIFY(name);
QCOMPARE(name->text(), QString("Row 3 Item"));
}
@@ -307,16 +307,16 @@ void tst_qdeclarativevisualdatamodel::objectListModel()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/objectlist.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 0);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "name", 0);
QCOMPARE(name->text(), QString("Item 1"));
- QDeclarativeText *section = findItem<QDeclarativeText>(contentItem, "section", 0);
+ QDeclarative1Text *section = findItem<QDeclarative1Text>(contentItem, "section", 0);
QCOMPARE(section->text(), QString("Item 1"));
dataList[0]->setProperty("name", QLatin1String("Changed"));
@@ -335,13 +335,13 @@ void tst_qdeclarativevisualdatamodel::singleRole()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/singlerole1.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "name", 1);
QCOMPARE(name->text(), QString("two"));
model.set(1, "Changed");
@@ -357,13 +357,13 @@ void tst_qdeclarativevisualdatamodel::singleRole()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/singlerole2.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 1);
+ QDeclarative1Text *name = findItem<QDeclarative1Text>(contentItem, "name", 1);
QCOMPARE(name->text(), QString("two"));
model.set(1, "Changed");
@@ -383,7 +383,7 @@ void tst_qdeclarativevisualdatamodel::modelProperties()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/modelproperties.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -415,7 +415,7 @@ void tst_qdeclarativevisualdatamodel::modelProperties()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/modelproperties.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -457,7 +457,7 @@ void tst_qdeclarativevisualdatamodel::modelProperties()
view.setSource(source);
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
QDeclarativeItem *contentItem = listview->contentItem();
@@ -489,10 +489,10 @@ void tst_qdeclarativevisualdatamodel::noDelegate()
view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml"));
- QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QDeclarative1ListView *listview = qobject_cast<QDeclarative1ListView*>(view.rootObject());
QVERIFY(listview != 0);
- QDeclarativeVisualDataModel *vdm = listview->findChild<QDeclarativeVisualDataModel*>("visualModel");
+ QDeclarative1VisualDataModel *vdm = listview->findChild<QDeclarative1VisualDataModel*>("visualModel");
QVERIFY(vdm != 0);
QCOMPARE(vdm->count(), 3);
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/get.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/get.qml
new file mode 100644
index 0000000000..4e03503f90
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/get.qml
@@ -0,0 +1,61 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { name: "name"; query: "name/string()" }
+ XmlRole { name: "type"; query: "type/string()" }
+ XmlRole { name: "age"; query: "age/number()" }
+ XmlRole { name: "size"; query: "size/string()" }
+
+ id: root
+
+ property bool preTest: false
+ property bool postTest: false
+
+ function runPreTest() {
+ if (root.get(0) != undefined)
+ return;
+
+ preTest = true;
+ }
+
+ function runPostTest() {
+ if (root.get(-1) != undefined)
+ return;
+
+ var row = root.get(0);
+ if (row.name != "Polly" ||
+ row.type != "Parrot" ||
+ row.age != 12 ||
+ row.size != "Small")
+ return;
+
+ row = root.get(1);
+ if (row.name != "Penny" ||
+ row.type != "Turtle" ||
+ row.age != 4 ||
+ row.size != "Small")
+ return;
+
+ row = root.get(7);
+ if (row.name != "Rover" ||
+ row.type != "Dog" ||
+ row.age != 0 ||
+ row.size != "Large")
+ return;
+
+ row = root.get(8);
+ if (row.name != "Tiny" ||
+ row.type != "Elephant" ||
+ row.age != 15 ||
+ row.size != "Large")
+ return;
+
+ if (root.get(9) != undefined)
+ return;
+
+ postTest = true;
+ }
+}
+
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.qml
new file mode 100644
index 0000000000..fdacb6c445
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { name: "name"; query: "name/string()" }
+ XmlRole { name: "type"; query: "type/string()" }
+ XmlRole { name: "age"; query: "age/number()" }
+ XmlRole { name: "size"; query: "size/string()" }
+}
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.xml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.xml
new file mode 100644
index 0000000000..40cd6d0432
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model.xml
@@ -0,0 +1,54 @@
+<Pets>
+ <Pet>
+ <name>Polly</name>
+ <type>Parrot</type>
+ <age>12</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Penny</name>
+ <type>Turtle</type>
+ <age>4</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Warren</name>
+ <type>Rabbit</type>
+ <age>2</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Spot</name>
+ <type>Dog</type>
+ <age>9</age>
+ <size>Medium</size>
+ </Pet>
+ <Pet>
+ <name>Whiskers</name>
+ <type>Cat</type>
+ <age>2</age>
+ <size>Medium</size>
+ </Pet>
+ <Pet>
+ <name>Joey</name>
+ <type>Kangaroo</type>
+ <age>1</age>
+ </Pet>
+ <Pet>
+ <name>Kimba</name>
+ <type>Bunny</type>
+ <age>65</age>
+ <size>Large</size>
+ </Pet>
+ <Pet>
+ <name>Rover</name>
+ <type>Dog</type>
+ <size>Large</size>
+ </Pet>
+ <Pet>
+ <name>Tiny</name>
+ <type>Elephant</type>
+ <age>15</age>
+ <size>Large</size>
+ </Pet>
+</Pets>
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model2.xml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model2.xml
new file mode 100644
index 0000000000..dab2ec6dc0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/model2.xml
@@ -0,0 +1,14 @@
+<Pets>
+ <Pet>
+ <name>Polly</name>
+ <type>Parrot</type>
+ <age>12</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Penny</name>
+ <type>Turtle</type>
+ <age>4</age>
+ <size>Small</size>
+ </Pet>
+</Pets>
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/propertychanges.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/propertychanges.qml
new file mode 100644
index 0000000000..ed674ce36f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/propertychanges.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { objectName: "role"; name: "name"; query: "name/string()" }
+ XmlRole { name: "type"; query: "type/string()" }
+ XmlRole { name: "age"; query: "age/number()" }
+ XmlRole { name: "size"; query: "size/string()" }
+}
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.qml
new file mode 100644
index 0000000000..6345101d9a
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "recipes.xml"
+ query: "/recipes/recipe"
+ XmlRole { name: "title"; query: "@title/string()" }
+ XmlRole { name: "picture"; query: "picture/string()" }
+ XmlRole { name: "ingredients"; query: "ingredients/string()" }
+ XmlRole { name: "preparation"; query: "method/string()" }
+}
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.xml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.xml
new file mode 100644
index 0000000000..d71de60710
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/recipes.xml
@@ -0,0 +1,90 @@
+<recipes>
+ <recipe title="Pancakes">
+ <picture>content/pics/pancakes.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+ <recipe title="Fruit Salad">
+ <picture>content/pics/fruit-salad.jpg</picture>
+ <ingredients><![CDATA[* Seasonal Fruit]]></ingredients>
+ <method><![CDATA[* Chop fruit and place in a bowl.]]></method>
+ </recipe>
+ <recipe title="Vegetable Soup">
+ <picture>content/pics/vegetable-soup.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+ <recipe title="Hamburger">
+ <picture>content/pics/hamburger.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+ <recipe title="Lemonade">
+ <picture>content/pics/lemonade.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+</recipes>
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleCrash.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleCrash.qml
new file mode 100644
index 0000000000..492dad920f
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleCrash.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+XmlListModel {
+ id: model
+ XmlRole {}
+ Component.onCompleted: model.roles = 0
+}
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleErrors.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleErrors.qml
new file mode 100644
index 0000000000..a0d846f188
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { name: "name"; query: "/name/string()" } //starts with '/'
+ XmlRole { name: "type"; query: "type" } //no type
+ XmlRole { name: "age"; query: "age/" } //ends with '/'
+ XmlRole { name: "size"; query: "size/number()" } //wrong type
+}
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleKeys.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleKeys.qml
new file mode 100644
index 0000000000..d90cd61096
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/roleKeys.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+XmlListModel {
+ query: "/data/item"
+ XmlRole { id: nameRole; name: "name"; query: "name/string()"; isKey: true }
+ XmlRole { name: "age"; query: "age/number()"; isKey: true }
+ XmlRole { name: "sport"; query: "sport/string()" }
+
+ function disableNameKey() {
+ nameRole.isKey = false;
+ }
+}
+
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/testtypes.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/testtypes.qml
new file mode 100644
index 0000000000..4dbcc029e0
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/testtypes.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+XmlListModel {
+ query: "/data"
+ XmlRole { name: "stringValue"; query: "a-string/string()" }
+ XmlRole { name: "numberValue"; query: "a-number/number()" }
+}
+
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/data/unique.qml b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/unique.qml
new file mode 100644
index 0000000000..dab8ffa78e
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/data/unique.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { name: "name"; query: "name/string()" }
+ XmlRole { name: "name"; query: "type/string()" }
+}
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro b/tests/auto/qtquick1/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
new file mode 100644
index 0000000000..6a4a50c7a3
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
@@ -0,0 +1,21 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative script gui network qtquick1
+contains(QT_CONFIG,xmlpatterns) {
+ QT += xmlpatterns
+ DEFINES += QTEST_XMLPATTERNS
+}
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativexmllistmodel.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+QT += core-private gui-private declarative-private script-private qtquick1-private
diff --git a/tests/auto/qtquick1/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/qtquick1/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
new file mode 100644
index 0000000000..35a78e0a46
--- /dev/null
+++ b/tests/auto/qtquick1/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
@@ -0,0 +1,965 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.1, 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <private/qdeclarativeengine_p.h>
+
+#include <QtTest/QtTest>
+#include <QtGlobal>
+#include <math.h>
+
+#include <qtest.h>
+#include <QtTest/qsignalspy.h>
+#include <QtDeclarative/qdeclarativenetworkaccessmanagerfactory.h>
+#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtNetwork/qnetworkrequest.h>
+#include <QtCore/qtimer.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qtemporaryfile.h>
+
+#ifdef QTEST_XMLPATTERNS
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtQuick1/private/qdeclarativexmllistmodel_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+typedef QPair<int, int> QDeclarativeXmlListRange;
+typedef QList<QVariantList> QDeclarativeXmlModelData;
+
+Q_DECLARE_METATYPE(QList<QDeclarativeXmlListRange>)
+Q_DECLARE_METATYPE(QDeclarativeXmlModelData)
+Q_DECLARE_METATYPE(QDeclarative1XmlListModel::Status)
+
+class tst_qdeclarativexmllistmodel : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativexmllistmodel() {}
+
+private slots:
+ void initTestCase() {
+ qRegisterMetaType<QDeclarative1XmlListModel::Status>("QDeclarative1XmlListModel::Status");
+ }
+
+ void buildModel();
+ void testTypes();
+ void testTypes_data();
+ void cdata();
+ void attributes();
+ void roles();
+ void roleErrors();
+ void uniqueRoleNames();
+ void headers();
+ void xml();
+ void xml_data();
+ void source();
+ void source_data();
+ void data();
+ void get();
+ void reload();
+ void useKeys();
+ void useKeys_data();
+ void noKeysValueChanges();
+ void keysChanged();
+ void threading();
+ void threading_data();
+ void propertyChanges();
+
+ void roleCrash();
+
+private:
+ QString makeItemXmlAndData(const QString &data, QDeclarativeXmlModelData *modelData = 0) const
+ {
+ if (modelData)
+ modelData->clear();
+ QString xml;
+
+ if (!data.isEmpty()) {
+ QStringList items = data.split(";");
+ foreach(const QString &item, items) {
+ if (item.isEmpty())
+ continue;
+ QVariantList variants;
+ xml += QLatin1String("<item>");
+ QStringList fields = item.split(",");
+ foreach(const QString &field, fields) {
+ QStringList values = field.split("=");
+ if (values.count() != 2) {
+ qWarning() << "makeItemXmlAndData: invalid field:" << field;
+ continue;
+ }
+ xml += QString("<%1>%2</%1>").arg(values[0], values[1]);
+ if (!modelData)
+ continue;
+ bool isNum = false;
+ int number = values[1].toInt(&isNum);
+ if (isNum)
+ variants << number;
+ else
+ variants << values[1];
+ }
+ xml += QLatin1String("</item>");
+ if (modelData)
+ modelData->append(variants);
+ }
+ }
+
+ QString decl = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>";
+ return decl + QLatin1String("<data>") + xml + QLatin1String("</data>");
+ }
+
+ QDeclarativeEngine engine;
+};
+
+class CustomNetworkAccessManagerFactory : public QObject, public QDeclarativeNetworkAccessManagerFactory
+{
+ Q_OBJECT
+public:
+ QVariantMap lastSentHeaders;
+
+protected:
+ QNetworkAccessManager *create(QObject *parent);
+};
+
+class CustomNetworkAccessManager : public QNetworkAccessManager
+{
+ Q_OBJECT
+public:
+ CustomNetworkAccessManager(CustomNetworkAccessManagerFactory *factory, QObject *parent)
+ : QNetworkAccessManager(parent), m_factory(factory) {}
+
+protected:
+ QNetworkReply *createRequest(Operation op, const QNetworkRequest &req, QIODevice * outgoingData = 0)
+ {
+ if (m_factory) {
+ QVariantMap map;
+ foreach (const QString &header, req.rawHeaderList())
+ map[header] = req.rawHeader(header.toUtf8());
+ m_factory->lastSentHeaders = map;
+ }
+ return QNetworkAccessManager::createRequest(op, req, outgoingData);
+ }
+
+ QPointer<CustomNetworkAccessManagerFactory> m_factory;
+};
+
+QNetworkAccessManager *CustomNetworkAccessManagerFactory::create(QObject *parent)
+{
+ return new CustomNetworkAccessManager(this, parent);
+}
+
+
+void tst_qdeclarativexmllistmodel::buildModel()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles;
+ roles << Qt::UserRole << Qt::UserRole + 1 << Qt::UserRole + 2 << Qt::UserRole + 3;
+ QHash<int, QVariant> data = model->data(3, roles);
+ QVERIFY(data.count() == 4);
+ QCOMPARE(data.value(Qt::UserRole).toString(), QLatin1String("Spot"));
+ QCOMPARE(data.value(Qt::UserRole+1).toString(), QLatin1String("Dog"));
+ QCOMPARE(data.value(Qt::UserRole+2).toInt(), 9);
+ QCOMPARE(data.value(Qt::UserRole+3).toString(), QLatin1String("Medium"));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::testTypes()
+{
+ QFETCH(QString, xml);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, expectedValue);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/testtypes.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ model->setXml(xml.toUtf8());
+ model->reload();
+ QTRY_COMPARE(model->count(), 1);
+
+ int role = -1;
+ foreach (int i, model->roles()) {
+ if (model->toString(i) == roleName) {
+ role = i;
+ break;
+ }
+ }
+ QVERIFY(role >= 0);
+
+ if (expectedValue.toString() == "nan")
+ QVERIFY(qIsNaN(model->data(0, role).toDouble()));
+ else
+ QCOMPARE(model->data(0, role), expectedValue);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::testTypes_data()
+{
+ QTest::addColumn<QString>("xml");
+ QTest::addColumn<QString>("roleName");
+ QTest::addColumn<QVariant>("expectedValue");
+
+ QTest::newRow("missing string field") << "<data></data>"
+ << "stringValue" << QVariant("");
+ QTest::newRow("empty string") << "<data><a-string></a-string></data>"
+ << "stringValue" << QVariant("");
+ QTest::newRow("1-char string") << "<data><a-string>5</a-string></data>"
+ << "stringValue" << QVariant("5");
+ QTest::newRow("string ok") << "<data><a-string>abc def g</a-string></data>"
+ << "stringValue" << QVariant("abc def g");
+
+ QTest::newRow("missing number field") << "<data></data>"
+ << "numberValue" << QVariant("");
+ double nan = qQNaN();
+ QTest::newRow("empty number field") << "<data><a-number></a-number></data>"
+ << "numberValue" << QVariant(nan);
+ QTest::newRow("number field with string") << "<data><a-number>a string</a-number></data>"
+ << "numberValue" << QVariant(nan);
+ QTest::newRow("-1") << "<data><a-number>-1</a-number></data>"
+ << "numberValue" << QVariant("-1");
+ QTest::newRow("-1.5") << "<data><a-number>-1.5</a-number></data>"
+ << "numberValue" << QVariant("-1.5");
+ QTest::newRow("0") << "<data><a-number>0</a-number></data>"
+ << "numberValue" << QVariant("0");
+ QTest::newRow("+1") << "<data><a-number>1</a-number></data>"
+ << "numberValue" << QVariant("1");
+ QTest::newRow("+1.5") << "<data><a-number>1.5</a-number></data>"
+ << "numberValue" << QVariant("1.5");
+}
+
+void tst_qdeclarativexmllistmodel::cdata()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/recipes.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 5);
+
+ QList<int> roles;
+ roles << Qt::UserRole + 2;
+ QHash<int, QVariant> data = model->data(2, roles);
+ QVERIFY(data.count() == 1);
+ QVERIFY(data.value(Qt::UserRole+2).toString().startsWith(QLatin1String("<html>")));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::attributes()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/recipes.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 5);
+ QList<int> roles;
+ roles << Qt::UserRole;
+ QHash<int, QVariant> data = model->data(2, roles);
+ QVERIFY(data.count() == 1);
+ QCOMPARE(data.value(Qt::UserRole).toString(), QLatin1String("Vegetable Soup"));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::roles()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles = model->roles();
+ QCOMPARE(roles.count(), 4);
+ QCOMPARE(model->toString(roles.at(0)), QLatin1String("name"));
+ QCOMPARE(model->toString(roles.at(1)), QLatin1String("type"));
+ QCOMPARE(model->toString(roles.at(2)), QLatin1String("age"));
+ QCOMPARE(model->toString(roles.at(3)), QLatin1String("size"));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::roleErrors()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml"));
+ QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml").toString() + ":6:5: QML XmlRole: An XmlRole query must not start with '/'").toUtf8().constData());
+ QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml").toString() + ":9:5: QML XmlRole: invalid query: \"age/\"").toUtf8().constData());
+
+ //### make sure we receive all expected warning messages.
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles;
+ roles << Qt::UserRole << Qt::UserRole + 1 << Qt::UserRole + 2 << Qt::UserRole + 3;
+ QHash<int, QVariant> data = model->data(3, roles);
+ QVERIFY(data.count() == 4);
+
+ //### should any of these return valid values?
+ QCOMPARE(data.value(Qt::UserRole), QVariant());
+ QCOMPARE(data.value(Qt::UserRole+1), QVariant());
+ QCOMPARE(data.value(Qt::UserRole+2), QVariant());
+
+ QEXPECT_FAIL("", "QTBUG-10797", Continue);
+ QCOMPARE(data.value(Qt::UserRole+3), QVariant());
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::uniqueRoleNames()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/unique.qml"));
+ QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/unique.qml").toString() + ":7:5: QML XmlRole: \"name\" duplicates a previous role name and will be disabled.").toUtf8().constData());
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles = model->roles();
+ QCOMPARE(roles.count(), 1);
+
+ delete model;
+}
+
+
+void tst_qdeclarativexmllistmodel::xml()
+{
+ QFETCH(QString, xml);
+ QFETCH(int, count);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QSignalSpy spy(model, SIGNAL(statusChanged(QDeclarative1XmlListModel::Status)));
+
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(0.0));
+ QCOMPARE(model->status(), QDeclarative1XmlListModel::Loading);
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarative1XmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(1.0));
+ QCOMPARE(model->count(), 9);
+
+ // if xml is empty (i.e. clearing) it won't have any effect if a source is set
+ if (xml.isEmpty())
+ model->setSource(QUrl());
+ model->setXml(xml);
+ QCOMPARE(model->progress(), qreal(1.0)); // immediately goes to 1.0 if using setXml()
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarative1XmlListModel::Loading);
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarative1XmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->count(), count);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::xml_data()
+{
+ QTest::addColumn<QString>("xml");
+ QTest::addColumn<int>("count");
+
+ QTest::newRow("xml with no items") << "<Pets></Pets>" << 0;
+ QTest::newRow("empty xml") << "" << 0;
+ QTest::newRow("one item") << "<Pets><Pet><name>Hobbes</name><type>Tiger</type><age>7</age><size>Large</size></Pet></Pets>" << 1;
+}
+
+void tst_qdeclarativexmllistmodel::headers()
+{
+ // ensure the QNetworkAccessManagers created for this test are immediately deleted
+ QDeclarativeEngine qmlEng;
+
+ CustomNetworkAccessManagerFactory factory;
+ qmlEng.setNetworkAccessManagerFactory(&factory);
+
+ QDeclarativeComponent component(&qmlEng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->status(), QDeclarative1XmlListModel::Ready);
+
+ QVariantMap expectedHeaders;
+ expectedHeaders["Accept"] = "application/xml,*/*";
+
+ QCOMPARE(factory.lastSentHeaders.count(), expectedHeaders.count());
+ foreach (const QString &header, expectedHeaders.keys()) {
+ QVERIFY(factory.lastSentHeaders.contains(header));
+ QCOMPARE(factory.lastSentHeaders[header].toString(), expectedHeaders[header].toString());
+ }
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::source()
+{
+ QFETCH(QUrl, source);
+ QFETCH(int, count);
+ QFETCH(QDeclarative1XmlListModel::Status, status);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QSignalSpy spy(model, SIGNAL(statusChanged(QDeclarative1XmlListModel::Status)));
+
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(0.0));
+ QCOMPARE(model->status(), QDeclarative1XmlListModel::Loading);
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarative1XmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(1.0));
+ QCOMPARE(model->count(), 9);
+
+ model->setSource(source);
+ QCOMPARE(model->progress(), qreal(0.0));
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarative1XmlListModel::Loading);
+ QVERIFY(model->errorString().isEmpty());
+
+ QEventLoop loop;
+ QTimer timer;
+ timer.setSingleShot(true);
+ connect(model, SIGNAL(statusChanged(QDeclarative1XmlListModel::Status)), &loop, SLOT(quit()));
+ connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.start(20000);
+ loop.exec();
+
+ if (spy.count() == 0 && status != QDeclarative1XmlListModel::Ready) {
+ qWarning("QDeclarative1XmlListModel invalid source test timed out");
+ } else {
+ QCOMPARE(spy.count(), 1); spy.clear();
+ }
+
+ QCOMPARE(model->status(), status);
+ QCOMPARE(model->count(), count);
+
+ if (status == QDeclarative1XmlListModel::Ready)
+ QCOMPARE(model->progress(), qreal(1.0));
+
+ QCOMPARE(model->errorString().isEmpty(), status == QDeclarative1XmlListModel::Ready);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::source_data()
+{
+ QTest::addColumn<QUrl>("source");
+ QTest::addColumn<int>("count");
+ QTest::addColumn<QDeclarative1XmlListModel::Status>("status");
+
+ QTest::newRow("valid") << QUrl::fromLocalFile(SRCDIR "/data/model2.xml") << 2 << QDeclarative1XmlListModel::Ready;
+ QTest::newRow("invalid") << QUrl("http://blah.blah/blah.xml") << 0 << QDeclarative1XmlListModel::Error;
+
+ // empty file
+ QTemporaryFile *temp = new QTemporaryFile(this);
+ if (temp->open())
+ QTest::newRow("empty file") << QUrl::fromLocalFile(temp->fileName()) << 0 << QDeclarative1XmlListModel::Ready;
+ temp->close();
+}
+
+void tst_qdeclarativexmllistmodel::data()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ QHash<int,QVariant> blank;
+ for (int i=0; i<model->roles().count(); i++)
+ blank.insert(model->roles()[i], QVariant());
+ for (int i=0; i<9; i++) {
+ QCOMPARE(model->data(i, model->roles()), blank);
+ for (int j=0; j<model->roles().count(); j++) {
+ QCOMPARE(model->data(i, j), QVariant());
+ }
+ }
+ QTRY_COMPARE(model->count(), 9);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::get()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/get.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ QVERIFY(QMetaObject::invokeMethod(model, "runPreTest"));
+ QCOMPARE(model->property("preTest").toBool(), true);
+
+ QTRY_COMPARE(model->count(), 9);
+
+ QVERIFY(QMetaObject::invokeMethod(model, "runPostTest"));
+ QCOMPARE(model->property("postTest").toBool(), true);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::reload()
+{
+ // If no keys are used, the model should be rebuilt from scratch when
+ // reload() is called.
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ //reload multiple times to test the xml query aborting
+ model->reload();
+ model->reload();
+ QCoreApplication::processEvents();
+ model->reload();
+ model->reload();
+ QTRY_COMPARE(spyCount.count(), 1);
+ QTRY_COMPARE(spyInsert.count(), 1);
+ QTRY_COMPARE(spyRemove.count(), 1);
+
+ QCOMPARE(spyInsert[0][0].toInt(), 0);
+ QCOMPARE(spyInsert[0][1].toInt(), 9);
+
+ QCOMPARE(spyRemove[0][0].toInt(), 0);
+ QCOMPARE(spyRemove[0][1].toInt(), 9);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::useKeys()
+{
+ // If using incremental updates through keys, the model should only
+ // insert & remove some of the items, instead of throwing everything
+ // away and causing the view to repaint the whole view.
+
+ QFETCH(QString, oldXml);
+ QFETCH(int, oldCount);
+ QFETCH(QString, newXml);
+ QFETCH(QDeclarativeXmlModelData, newData);
+ QFETCH(QList<QDeclarativeXmlListRange>, insertRanges);
+ QFETCH(QList<QDeclarativeXmlListRange>, removeRanges);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ model->setXml(oldXml);
+ QTRY_COMPARE(model->count(), oldCount);
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ model->setXml(newXml);
+
+ if (oldCount != newData.count()) {
+ QTRY_COMPARE(model->count(), newData.count());
+ QCOMPARE(spyCount.count(), 1);
+ } else {
+ QTRY_VERIFY(spyInsert.count() > 0 || spyRemove.count() > 0);
+ QCOMPARE(spyCount.count(), 0);
+ }
+
+ QList<int> roles = model->roles();
+ for (int i=0; i<model->count(); i++) {
+ for (int j=0; j<roles.count(); j++)
+ QCOMPARE(model->data(i, roles[j]), newData[i][j]);
+ }
+
+ QCOMPARE(spyInsert.count(), insertRanges.count());
+ for (int i=0; i<spyInsert.count(); i++) {
+ QCOMPARE(spyInsert[i][0].toInt(), insertRanges[i].first);
+ QCOMPARE(spyInsert[i][1].toInt(), insertRanges[i].second);
+ }
+
+ QCOMPARE(spyRemove.count(), removeRanges.count());
+ for (int i=0; i<spyRemove.count(); i++) {
+ QCOMPARE(spyRemove[i][0].toInt(), removeRanges[i].first);
+ QCOMPARE(spyRemove[i][1].toInt(), removeRanges[i].second);
+ }
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::useKeys_data()
+{
+ QTest::addColumn<QString>("oldXml");
+ QTest::addColumn<int>("oldCount");
+ QTest::addColumn<QString>("newXml");
+ QTest::addColumn<QDeclarativeXmlModelData>("newData");
+ QTest::addColumn<QList<QDeclarativeXmlListRange> >("insertRanges");
+ QTest::addColumn<QList<QDeclarativeXmlListRange> >("removeRanges");
+
+ QDeclarativeXmlModelData modelData;
+
+ QTest::newRow("append 1")
+ << makeItemXmlAndData("name=A,age=25,sport=Football") << 1
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("append multiple")
+ << makeItemXmlAndData("name=A,age=25,sport=Football") << 1
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("insert in different spots")
+ << makeItemXmlAndData("name=B,age=35,sport=Athletics") << 1
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1) << qMakePair(2,2))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("insert in middle")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=D,age=55,sport=Golf") << 2
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("remove first")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics") << 2
+ << makeItemXmlAndData("name=B,age=35,sport=Athletics", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1));
+
+ QTest::newRow("remove last")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics") << 2
+ << makeItemXmlAndData("name=A,age=25,sport=Football", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1));
+
+ QTest::newRow("remove from multiple spots")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf;name=E,age=65,sport=Fencing") << 5
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=C,age=45,sport=Curling", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1) << qMakePair(3,2));
+
+ QTest::newRow("remove all")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling") << 3
+ << makeItemXmlAndData("", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 3));
+
+ QTest::newRow("replace item")
+ << makeItemXmlAndData("name=A,age=25,sport=Football") << 1
+ << makeItemXmlAndData("name=ZZZ,age=25,sport=Football", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1));
+
+ QTest::newRow("add and remove simultaneously, in different spots")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf") << 4
+ << makeItemXmlAndData("name=B,age=35,sport=Athletics;name=E,age=65,sport=Fencing", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1) << qMakePair(2,2));
+
+ QTest::newRow("insert at start, remove at end i.e. rss feed")
+ << makeItemXmlAndData("name=C,age=45,sport=Curling;name=D,age=55,sport=Golf;name=E,age=65,sport=Fencing") << 3
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2));
+
+ QTest::newRow("remove at start, insert at end")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling") << 3
+ << makeItemXmlAndData("name=C,age=45,sport=Curling;name=D,age=55,sport=Golf;name=E,age=65,sport=Fencing", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2));
+
+ QTest::newRow("all data has changed")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35") << 2
+ << makeItemXmlAndData("name=C,age=45,sport=Curling;name=D,age=55,sport=Golf", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2));
+}
+
+void tst_qdeclarativexmllistmodel::noKeysValueChanges()
+{
+ // The 'key' roles are 'name' and 'age', as defined in roleKeys.qml.
+ // If a 'sport' value is changed, the model should not be reloaded,
+ // since 'sport' is not marked as a key.
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ QString xml;
+
+ xml = makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics");
+ model->setXml(xml);
+ QTRY_COMPARE(model->count(), 2);
+
+ model->setXml("");
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ xml = makeItemXmlAndData("name=A,age=25,sport=AussieRules;name=B,age=35,sport=Athletics");
+ model->setXml(xml);
+
+ // wait for the new xml data to be set, and verify no signals were emitted
+ QTRY_VERIFY(model->data(0, model->roles()[2]).toString() != QLatin1String("Football"));
+ QCOMPARE(model->data(0, model->roles()[2]).toString(), QLatin1String("AussieRules"));
+
+ QVERIFY(spyInsert.count() == 0);
+ QVERIFY(spyRemove.count() == 0);
+ QVERIFY(spyCount.count() == 0);
+
+ QCOMPARE(model->count(), 2);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::keysChanged()
+{
+ // If the key roles change, the next time the data is reloaded, it should
+ // delete all its data and build a clean model (i.e. same behaviour as
+ // if no keys are set).
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ QString xml = makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics");
+ model->setXml(xml);
+ QTRY_COMPARE(model->count(), 2);
+
+ model->setXml("");
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ QVERIFY(QMetaObject::invokeMethod(model, "disableNameKey"));
+ model->setXml(xml);
+
+ QTRY_VERIFY(spyInsert.count() > 0 && spyRemove.count() > 0);
+
+ QCOMPARE(spyInsert.count(), 1);
+ QCOMPARE(spyInsert[0][0].toInt(), 0);
+ QCOMPARE(spyInsert[0][1].toInt(), 2);
+
+ QCOMPARE(spyRemove.count(), 1);
+ QCOMPARE(spyRemove[0][0].toInt(), 0);
+ QCOMPARE(spyRemove[0][1].toInt(), 2);
+
+ QCOMPARE(spyCount.count(), 0);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::threading()
+{
+ QFETCH(int, xmlDataCount);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+
+ QDeclarative1XmlListModel *m1 = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(m1 != 0);
+ QDeclarative1XmlListModel *m2 = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(m2 != 0);
+ QDeclarative1XmlListModel *m3 = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(m3 != 0);
+
+ for (int dataCount=0; dataCount<xmlDataCount; dataCount++) {
+
+ QString data1, data2, data3;
+ for (int i=0; i<dataCount; i++) {
+ data1 += "name=A" + QString::number(i) + ",age=1" + QString::number(i) + ",sport=Football;";
+ data2 += "name=B" + QString::number(i) + ",age=2" + QString::number(i) + ",sport=Athletics;";
+ data3 += "name=C" + QString::number(i) + ",age=3" + QString::number(i) + ",sport=Curling;";
+ }
+
+ //Set the xml data multiple times with randomized order and mixed with multiple event loops
+ //to test the xml query reloading/aborting, the result should be stable.
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ QCoreApplication::processEvents();
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+
+ QTRY_VERIFY(m1->count() == dataCount && m2->count() == dataCount && m3->count() == dataCount);
+
+ for (int i=0; i<dataCount; i++) {
+ QCOMPARE(m1->data(i, m1->roles()[0]).toString(), QString("A" + QString::number(i)));
+ QCOMPARE(m1->data(i, m1->roles()[1]).toString(), QString("1" + QString::number(i)));
+ QCOMPARE(m1->data(i, m1->roles()[2]).toString(), QString("Football"));
+
+ QCOMPARE(m2->data(i, m2->roles()[0]).toString(), QString("B" + QString::number(i)));
+ QCOMPARE(m2->data(i, m2->roles()[1]).toString(), QString("2" + QString::number(i)));
+ QCOMPARE(m2->data(i, m2->roles()[2]).toString(), QString("Athletics"));
+
+ QCOMPARE(m3->data(i, m3->roles()[0]).toString(), QString("C" + QString::number(i)));
+ QCOMPARE(m3->data(i, m3->roles()[1]).toString(), QString("3" + QString::number(i)));
+ QCOMPARE(m3->data(i, m3->roles()[2]).toString(), QString("Curling"));
+ }
+ }
+
+ delete m1;
+ delete m2;
+ delete m3;
+}
+
+void tst_qdeclarativexmllistmodel::threading_data()
+{
+ QTest::addColumn<int>("xmlDataCount");
+
+ QTest::newRow("1") << 1;
+ QTest::newRow("2") << 2;
+ QTest::newRow("10") << 10;
+}
+
+void tst_qdeclarativexmllistmodel::propertyChanges()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QDeclarative1XmlListModelRole *role = model->findChild<QDeclarative1XmlListModelRole*>("role");
+ QVERIFY(role);
+
+ QSignalSpy nameSpy(role, SIGNAL(nameChanged()));
+ QSignalSpy querySpy(role, SIGNAL(queryChanged()));
+ QSignalSpy isKeySpy(role, SIGNAL(isKeyChanged()));
+
+ role->setName("size");
+ role->setQuery("size/string()");
+ role->setIsKey(true);
+
+ QCOMPARE(role->name(), QString("size"));
+ QCOMPARE(role->query(), QString("size/string()"));
+ QVERIFY(role->isKey());
+
+ QCOMPARE(nameSpy.count(),1);
+ QCOMPARE(querySpy.count(),1);
+ QCOMPARE(isKeySpy.count(),1);
+
+ role->setName("size");
+ role->setQuery("size/string()");
+ role->setIsKey(true);
+
+ QCOMPARE(nameSpy.count(),1);
+ QCOMPARE(querySpy.count(),1);
+ QCOMPARE(isKeySpy.count(),1);
+
+ QSignalSpy sourceSpy(model, SIGNAL(sourceChanged()));
+ QSignalSpy xmlSpy(model, SIGNAL(xmlChanged()));
+ QSignalSpy modelQuerySpy(model, SIGNAL(queryChanged()));
+ QSignalSpy namespaceDeclarationsSpy(model, SIGNAL(namespaceDeclarationsChanged()));
+
+ model->setSource(QUrl(""));
+ model->setXml("<Pets><Pet><name>Polly</name><type>Parrot</type><age>12</age><size>Small</size></Pet></Pets>");
+ model->setQuery("/Pets");
+ model->setNamespaceDeclarations("declare namespace media=\"http://search.yahoo.com/mrss/\";");
+
+ QCOMPARE(model->source(), QUrl(""));
+ QCOMPARE(model->xml(), QString("<Pets><Pet><name>Polly</name><type>Parrot</type><age>12</age><size>Small</size></Pet></Pets>"));
+ QCOMPARE(model->query(), QString("/Pets"));
+ QCOMPARE(model->namespaceDeclarations(), QString("declare namespace media=\"http://search.yahoo.com/mrss/\";"));
+
+ QTRY_VERIFY(model->count() == 1);
+
+ QCOMPARE(sourceSpy.count(),1);
+ QCOMPARE(xmlSpy.count(),1);
+ QCOMPARE(modelQuerySpy.count(),1);
+ QCOMPARE(namespaceDeclarationsSpy.count(),1);
+
+ model->setSource(QUrl(""));
+ model->setXml("<Pets><Pet><name>Polly</name><type>Parrot</type><age>12</age><size>Small</size></Pet></Pets>");
+ model->setQuery("/Pets");
+ model->setNamespaceDeclarations("declare namespace media=\"http://search.yahoo.com/mrss/\";");
+
+ QCOMPARE(sourceSpy.count(),1);
+ QCOMPARE(xmlSpy.count(),1);
+ QCOMPARE(modelQuerySpy.count(),1);
+ QCOMPARE(namespaceDeclarationsSpy.count(),1);
+
+ QTRY_VERIFY(model->count() == 1);
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::roleCrash()
+{
+ // don't crash
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleCrash.qml"));
+ QDeclarative1XmlListModel *model = qobject_cast<QDeclarative1XmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ delete model;
+}
+
+QTEST_MAIN(tst_qdeclarativexmllistmodel)
+
+#include "tst_qdeclarativexmllistmodel.moc"
+
+#else
+QTEST_NOOP_MAIN
+#endif
diff --git a/tests/auto/qtquick1/qtquick1.pro b/tests/auto/qtquick1/qtquick1.pro
new file mode 100644
index 0000000000..0c3e2498ff
--- /dev/null
+++ b/tests/auto/qtquick1/qtquick1.pro
@@ -0,0 +1,50 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ qdeclarativeview \
+ qdeclarativeviewer \
+ moduleqt47
+
+contains(QT_CONFIG, private_tests) {
+ SUBDIRS += \
+ qdeclarativeanchors \
+ qdeclarativeanimatedimage \
+ qdeclarativeanimations \
+ qdeclarativeapplication \
+ qdeclarativebehaviors \
+ qdeclarativebinding \
+ qdeclarativeborderimage \
+ qdeclarativeconnection \
+ qdeclarativeflickable \
+ qdeclarativeflipable \
+ qdeclarativefocusscope \
+ qdeclarativefontloader \
+ qdeclarativegridview \
+ qdeclarativeimage \
+ qdeclarativeimageprovider \
+ qdeclarativeitem \
+ qdeclarativelayoutitem \
+# qdeclarativelistmodel \
+ qdeclarativelistview \
+ qdeclarativeloader \
+ qdeclarativemousearea \
+ qdeclarativeparticles \
+ qdeclarativepathview \
+ qdeclarativepincharea \
+ qdeclarativepositioners \
+ qdeclarativerepeater \
+ qdeclarativesmoothedanimation \
+ qdeclarativespringanimation \
+ qdeclarativestates \
+ qdeclarativesystempalette \
+ qdeclarativetext \
+ qdeclarativetextedit \
+ qdeclarativetextinput \
+ qdeclarativetimer \
+ qdeclarativevisualdatamodel \
+ qdeclarativexmllistmodel \
+
+}
+
+# Tests which should run in Pulse
+PULSE_TESTS = $$SUBDIRS