diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/debugger.pri | 32 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativeenginedebug.cpp | 1072 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativeenginedebug_p.h | 397 | ||||
-rw-r--r-- | src/declarative/qml/parser/parser.pri | 19 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarative.h | 451 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecompiler_p.h | 466 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeextensioninterface.h | 75 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeinfo.h | 103 | ||||
-rw-r--r-- | src/declarative/qml/qml.pri | 125 | ||||
-rw-r--r-- | src/declarative/qml/v4/qv4irbuilder_p.h | 240 | ||||
-rw-r--r-- | src/declarative/util/util.pri | 5 | ||||
-rw-r--r-- | src/imports/folderlistmodel/folderlistmodel.pro | 8 | ||||
-rw-r--r-- | src/imports/folderlistmodel/plugin.cpp | 12 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp (renamed from src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp) | 82 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.h (renamed from src/imports/folderlistmodel/qdeclarativefolderlistmodel.h) | 26 | ||||
-rw-r--r-- | src/imports/localstorage/localstorage.pro | 4 | ||||
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 46 | ||||
-rw-r--r-- | src/imports/qimportbase.pri | 2 | ||||
-rw-r--r-- | src/imports/qtquick2/plugin.cpp | 8 | ||||
-rw-r--r-- | src/imports/qtquick2/qtquick2.pro | 4 | ||||
-rw-r--r-- | src/imports/testlib/main.cpp | 28 | ||||
-rw-r--r-- | src/imports/testlib/signalspy.h | 6 | ||||
-rw-r--r-- | src/imports/testlib/testcase.h | 6 | ||||
-rw-r--r-- | src/imports/testlib/testlib.pro | 6 | ||||
-rw-r--r-- | src/imports/xmllistmodel/plugin.cpp | 14 | ||||
-rw-r--r-- | src/imports/xmllistmodel/qqmlxmllistmodel.cpp (renamed from src/imports/xmllistmodel/qdeclarativexmllistmodel.cpp) | 276 | ||||
-rw-r--r-- | src/imports/xmllistmodel/qqmlxmllistmodel_p.h (renamed from src/imports/xmllistmodel/qdeclarativexmllistmodel_p.h) | 52 | ||||
-rw-r--r-- | src/imports/xmllistmodel/xmllistmodel.pro | 8 | ||||
-rw-r--r-- | src/plugins/accessible/quick/main.cpp | 4 | ||||
-rw-r--r-- | src/plugins/accessible/quick/qaccessiblequickitem.cpp | 4 | ||||
-rw-r--r-- | src/plugins/accessible/quick/qaccessiblequickitem.h | 6 | ||||
-rw-r--r-- | src/plugins/accessible/quick/qaccessiblequickview.cpp | 4 | ||||
-rw-r--r-- | src/plugins/accessible/quick/qaccessiblequickview.h | 2 | ||||
-rw-r--r-- | src/plugins/accessible/quick/quick.pro | 2 | ||||
-rw-r--r-- | src/plugins/accessible/shared/qaccessiblebase.pri | 4 | ||||
-rw-r--r-- | src/plugins/accessible/shared/qqmlaccessible.cpp (renamed from src/plugins/accessible/shared/qdeclarativeaccessible.cpp) | 18 | ||||
-rw-r--r-- | src/plugins/accessible/shared/qqmlaccessible.h (renamed from src/plugins/accessible/shared/qdeclarativeaccessible.h) | 18 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro | 4 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp | 12 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h | 12 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_ost/qostdevice.h | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_ost/usbostcomm.h | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/highlight.h | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro | 6 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp | 6 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h | 4 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.h | 16 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.h | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro | 6 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp | 16 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h | 12 | ||||
-rw-r--r-- | src/plugins/qmltooling/shared/abstracttool.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/shared/abstracttool.h | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/shared/abstractviewinspector.cpp | 30 | ||||
-rw-r--r-- | src/plugins/qmltooling/shared/abstractviewinspector.h | 14 | ||||
-rw-r--r-- | src/plugins/qmltooling/shared/qmlinspectorconstants.h | 4 | ||||
-rw-r--r-- | src/plugins/qmltooling/shared/qqmlinspectorprotocol.h (renamed from src/plugins/qmltooling/shared/qdeclarativeinspectorprotocol.h) | 8 | ||||
-rw-r--r-- | src/qml/animations/animations.pri (renamed from src/declarative/animations/animations.pri) | 0 | ||||
-rw-r--r-- | src/qml/animations/qabstractanimationjob.cpp (renamed from src/declarative/animations/qabstractanimationjob.cpp) | 58 | ||||
-rw-r--r-- | src/qml/animations/qabstractanimationjob_p.h (renamed from src/declarative/animations/qabstractanimationjob_p.h) | 17 | ||||
-rw-r--r-- | src/qml/animations/qanimationgroupjob.cpp (renamed from src/declarative/animations/qanimationgroupjob.cpp) | 2 | ||||
-rw-r--r-- | src/qml/animations/qanimationgroupjob_p.h (renamed from src/declarative/animations/qanimationgroupjob_p.h) | 6 | ||||
-rw-r--r-- | src/qml/animations/qanimationjobutil_p.h (renamed from src/declarative/animations/qanimationjobutil_p.h) | 2 | ||||
-rw-r--r-- | src/qml/animations/qparallelanimationgroupjob.cpp (renamed from src/declarative/animations/qparallelanimationgroupjob.cpp) | 2 | ||||
-rw-r--r-- | src/qml/animations/qparallelanimationgroupjob_p.h (renamed from src/declarative/animations/qparallelanimationgroupjob_p.h) | 6 | ||||
-rw-r--r-- | src/qml/animations/qpauseanimationjob.cpp (renamed from src/declarative/animations/qpauseanimationjob.cpp) | 2 | ||||
-rw-r--r-- | src/qml/animations/qpauseanimationjob_p.h (renamed from src/declarative/animations/qpauseanimationjob_p.h) | 6 | ||||
-rw-r--r-- | src/qml/animations/qsequentialanimationgroupjob.cpp (renamed from src/declarative/animations/qsequentialanimationgroupjob.cpp) | 2 | ||||
-rw-r--r-- | src/qml/animations/qsequentialanimationgroupjob_p.h (renamed from src/declarative/animations/qsequentialanimationgroupjob_p.h) | 6 | ||||
-rw-r--r-- | src/qml/debugger/debugger.pri | 32 | ||||
-rw-r--r-- | src/qml/debugger/qdebugmessageservice.cpp (renamed from src/declarative/debugger/qdebugmessageservice.cpp) | 16 | ||||
-rw-r--r-- | src/qml/debugger/qdebugmessageservice_p.h (renamed from src/declarative/debugger/qdebugmessageservice_p.h) | 8 | ||||
-rw-r--r-- | src/qml/debugger/qpacketprotocol.cpp (renamed from src/declarative/debugger/qpacketprotocol.cpp) | 2 | ||||
-rw-r--r-- | src/qml/debugger/qpacketprotocol_p.h (renamed from src/declarative/debugger/qpacketprotocol_p.h) | 10 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebug.h (renamed from src/declarative/debugger/qdeclarativedebug.h) | 18 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugclient.cpp (renamed from src/declarative/debugger/qdeclarativedebugclient.cpp) | 128 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugclient_p.h (renamed from src/declarative/debugger/qdeclarativedebugclient_p.h) | 42 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebughelper.cpp (renamed from src/declarative/debugger/qdeclarativedebughelper.cpp) | 22 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebughelper_p.h (renamed from src/declarative/debugger/qdeclarativedebughelper_p.h) | 18 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugserver.cpp (renamed from src/declarative/debugger/qdeclarativedebugserver.cpp) | 189 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugserver_p.h (renamed from src/declarative/debugger/qdeclarativedebugserver_p.h) | 46 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugserverconnection_p.h (renamed from src/declarative/debugger/qdeclarativedebugserverconnection_p.h) | 23 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugservice.cpp (renamed from src/declarative/debugger/qdeclarativedebugservice.cpp) | 82 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugservice_p.h (renamed from src/declarative/debugger/qdeclarativedebugservice_p.h) | 28 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugservice_p_p.h (renamed from src/declarative/debugger/qdeclarativedebugservice_p_p.h) | 20 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugstatesdelegate_p.h (renamed from src/declarative/debugger/qdeclarativedebugstatesdelegate_p.h) | 28 | ||||
-rw-r--r-- | src/qml/debugger/qqmlenginedebug.cpp | 1072 | ||||
-rw-r--r-- | src/qml/debugger/qqmlenginedebug_p.h | 397 | ||||
-rw-r--r-- | src/qml/debugger/qqmlenginedebugservice.cpp (renamed from src/declarative/debugger/qdeclarativeenginedebugservice.cpp) | 232 | ||||
-rw-r--r-- | src/qml/debugger/qqmlenginedebugservice_p.h (renamed from src/declarative/debugger/qdeclarativeenginedebugservice_p.h) | 60 | ||||
-rw-r--r-- | src/qml/debugger/qqmlinspectorinterface_p.h (renamed from src/declarative/debugger/qdeclarativeinspectorinterface_p.h) | 18 | ||||
-rw-r--r-- | src/qml/debugger/qqmlinspectorservice.cpp (renamed from src/declarative/debugger/qdeclarativeinspectorservice.cpp) | 56 | ||||
-rw-r--r-- | src/qml/debugger/qqmlinspectorservice_p.h (renamed from src/declarative/debugger/qdeclarativeinspectorservice_p.h) | 24 | ||||
-rw-r--r-- | src/qml/debugger/qqmlprofilerservice.cpp (renamed from src/declarative/debugger/qdeclarativeprofilerservice.cpp) | 138 | ||||
-rw-r--r-- | src/qml/debugger/qqmlprofilerservice_p.h (renamed from src/declarative/debugger/qdeclarativeprofilerservice_p.h) | 32 | ||||
-rw-r--r-- | src/qml/debugger/qv8debugservice.cpp (renamed from src/declarative/debugger/qv8debugservice.cpp) | 12 | ||||
-rw-r--r-- | src/qml/debugger/qv8debugservice_p.h (renamed from src/declarative/debugger/qv8debugservice_p.h) | 6 | ||||
-rw-r--r-- | src/qml/debugger/qv8profilerservice.cpp (renamed from src/declarative/debugger/qv8profilerservice.cpp) | 16 | ||||
-rw-r--r-- | src/qml/debugger/qv8profilerservice_p.h (renamed from src/declarative/debugger/qv8profilerservice_p.h) | 8 | ||||
-rw-r--r-- | src/qml/qml.pro (renamed from src/declarative/declarative.pro) | 15 | ||||
-rw-r--r-- | src/qml/qml/ftw/ftw.pri (renamed from src/declarative/qml/ftw/ftw.pri) | 14 | ||||
-rw-r--r-- | src/qml/qml/ftw/qbitfield_p.h (renamed from src/declarative/qml/ftw/qbitfield_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qdeletewatcher_p.h (renamed from src/declarative/qml/ftw/qdeletewatcher_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qfastmetabuilder.cpp (renamed from src/declarative/qml/ftw/qfastmetabuilder.cpp) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qfastmetabuilder_p.h (renamed from src/declarative/qml/ftw/qfastmetabuilder_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qfieldlist_p.h (renamed from src/declarative/qml/ftw/qfieldlist_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qfinitestack_p.h (renamed from src/declarative/qml/ftw/qfinitestack_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qflagpointer_p.h (renamed from src/declarative/qml/ftw/qflagpointer_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qhashedstring.cpp (renamed from src/declarative/qml/ftw/qhashedstring.cpp) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qhashedstring_p.h (renamed from src/declarative/qml/ftw/qhashedstring_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qhashfield_p.h (renamed from src/declarative/qml/ftw/qhashfield_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qintrusivelist.cpp (renamed from src/declarative/qml/ftw/qintrusivelist.cpp) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qintrusivelist_p.h (renamed from src/declarative/qml/ftw/qintrusivelist_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qlazilyallocated_p.h (renamed from src/declarative/qml/ftw/qlazilyallocated_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qpodvector_p.h (renamed from src/declarative/qml/ftw/qpodvector_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qpointervaluepair_p.h (renamed from src/declarative/qml/ftw/qpointervaluepair_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmlpool.cpp (renamed from src/declarative/qml/ftw/qdeclarativepool.cpp) | 12 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmlpool_p.h (renamed from src/declarative/qml/ftw/qdeclarativepool_p.h) | 60 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmlrefcount_p.h (renamed from src/declarative/qml/ftw/qdeclarativerefcount_p.h) | 54 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmlthread.cpp (renamed from src/declarative/qml/ftw/qdeclarativethread.cpp) | 76 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmlthread_p.h (renamed from src/declarative/qml/ftw/qdeclarativethread_p.h) | 70 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmltrace.cpp (renamed from src/declarative/qml/ftw/qdeclarativetrace.cpp) | 52 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmltrace_p.h (renamed from src/declarative/qml/ftw/qdeclarativetrace_p.h) | 78 | ||||
-rw-r--r-- | src/qml/qml/ftw/qrecursionwatcher_p.h (renamed from src/declarative/qml/ftw/qrecursionwatcher_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qrecyclepool_p.h (renamed from src/declarative/qml/ftw/qrecyclepool_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/parser/parser.pri | 19 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljs.g (renamed from src/declarative/qml/parser/qdeclarativejs.g) | 46 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsast.cpp (renamed from src/declarative/qml/parser/qdeclarativejsast.cpp) | 10 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsast_p.h (renamed from src/declarative/qml/parser/qdeclarativejsast_p.h) | 196 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsastfwd_p.h (renamed from src/declarative/qml/parser/qdeclarativejsastfwd_p.h) | 10 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsastvisitor.cpp (renamed from src/declarative/qml/parser/qdeclarativejsastvisitor.cpp) | 8 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsastvisitor_p.h (renamed from src/declarative/qml/parser/qdeclarativejsastvisitor_p.h) | 16 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsengine_p.cpp (renamed from src/declarative/qml/parser/qdeclarativejsengine_p.cpp) | 14 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsengine_p.h (renamed from src/declarative/qml/parser/qdeclarativejsengine_p.h) | 18 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsglobal_p.h (renamed from src/declarative/qml/parser/qdeclarativejsglobal_p.h) | 10 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsgrammar.cpp (renamed from src/declarative/qml/parser/qdeclarativejsgrammar.cpp) | 18 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsgrammar_p.h (renamed from src/declarative/qml/parser/qdeclarativejsgrammar_p.h) | 8 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljskeywords_p.h (renamed from src/declarative/qml/parser/qdeclarativejskeywords_p.h) | 8 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljslexer.cpp (renamed from src/declarative/qml/parser/qdeclarativejslexer.cpp) | 32 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljslexer_p.h (renamed from src/declarative/qml/parser/qdeclarativejslexer_p.h) | 16 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsmemorypool_p.h (renamed from src/declarative/qml/parser/qdeclarativejsmemorypool_p.h) | 12 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsparser.cpp (renamed from src/declarative/qml/parser/qdeclarativejsparser.cpp) | 26 | ||||
-rw-r--r-- | src/qml/qml/parser/qqmljsparser_p.h (renamed from src/declarative/qml/parser/qdeclarativejsparser_p.h) | 22 | ||||
-rw-r--r-- | src/qml/qml/qlistmodelinterface.cpp (renamed from src/declarative/qml/qlistmodelinterface.cpp) | 4 | ||||
-rw-r--r-- | src/qml/qml/qlistmodelinterface_p.h (renamed from src/declarative/qml/qlistmodelinterface_p.h) | 6 | ||||
-rw-r--r-- | src/qml/qml/qml.pri | 125 | ||||
-rw-r--r-- | src/qml/qml/qqml.h | 451 | ||||
-rw-r--r-- | src/qml/qml/qqmlaccessors.cpp (renamed from src/declarative/qml/qdeclarativeaccessors.cpp) | 34 | ||||
-rw-r--r-- | src/qml/qml/qqmlaccessors_p.h (renamed from src/declarative/qml/qdeclarativeaccessors_p.h) | 45 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp (renamed from src/declarative/qml/qdeclarativebinding.cpp) | 220 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding_p.h (renamed from src/declarative/qml/qdeclarativebinding_p.h) | 124 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding_p_p.h (renamed from src/declarative/qml/qdeclarativebinding_p_p.h) | 26 | ||||
-rw-r--r-- | src/qml/qml/qqmlboundsignal.cpp (renamed from src/declarative/qml/qdeclarativeboundsignal.cpp) | 104 | ||||
-rw-r--r-- | src/qml/qml/qqmlboundsignal_p.h (renamed from src/declarative/qml/qdeclarativeboundsignal_p.h) | 36 | ||||
-rw-r--r-- | src/qml/qml/qqmlcleanup.cpp (renamed from src/declarative/qml/qdeclarativecleanup.cpp) | 38 | ||||
-rw-r--r-- | src/qml/qml/qqmlcleanup_p.h (renamed from src/declarative/qml/qdeclarativecleanup_p.h) | 30 | ||||
-rw-r--r-- | src/qml/qml/qqmlcompileddata.cpp (renamed from src/declarative/qml/qdeclarativecompileddata.cpp) | 76 | ||||
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp (renamed from src/declarative/qml/qdeclarativecompiler.cpp) | 612 | ||||
-rw-r--r-- | src/qml/qml/qqmlcompiler_p.h | 466 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp (renamed from src/declarative/qml/qdeclarativecomponent.cpp) | 419 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent.h (renamed from src/declarative/qml/qdeclarativecomponent.h) | 80 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent_p.h (renamed from src/declarative/qml/qdeclarativecomponent_p.h) | 62 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponentattached_p.h (renamed from src/declarative/qml/qdeclarativecomponentattached_p.h) | 26 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext.cpp (renamed from src/declarative/qml/qdeclarativecontext.cpp) | 274 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext.h (renamed from src/declarative/qml/qdeclarativecontext.h) | 60 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext_p.h (renamed from src/declarative/qml/qdeclarativecontext_p.h) | 178 | ||||
-rw-r--r-- | src/qml/qml/qqmlcustomparser.cpp (renamed from src/declarative/qml/qdeclarativecustomparser.cpp) | 102 | ||||
-rw-r--r-- | src/qml/qml/qqmlcustomparser_p.h (renamed from src/declarative/qml/qdeclarativecustomparser_p.h) | 94 | ||||
-rw-r--r-- | src/qml/qml/qqmlcustomparser_p_p.h (renamed from src/declarative/qml/qdeclarativecustomparser_p_p.h) | 28 | ||||
-rw-r--r-- | src/qml/qml/qqmldata_p.h (renamed from src/declarative/qml/qdeclarativedata_p.h) | 76 | ||||
-rw-r--r-- | src/qml/qml/qqmldirparser.cpp (renamed from src/declarative/qml/qdeclarativedirparser.cpp) | 54 | ||||
-rw-r--r-- | src/qml/qml/qqmldirparser_p.h (renamed from src/declarative/qml/qdeclarativedirparser_p.h) | 26 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.cpp (renamed from src/declarative/qml/qdeclarativeengine.cpp) | 650 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.h (renamed from src/declarative/qml/qdeclarativeengine.h) | 64 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine_p.h (renamed from src/declarative/qml/qdeclarativeengine_p.h) | 276 | ||||
-rw-r--r-- | src/qml/qml/qqmlerror.cpp (renamed from src/declarative/qml/qdeclarativeerror.cpp) | 62 | ||||
-rw-r--r-- | src/qml/qml/qqmlerror.h (renamed from src/declarative/qml/qdeclarativeerror.h) | 26 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp (renamed from src/declarative/qml/qdeclarativeexpression.cpp) | 342 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression.h (renamed from src/declarative/qml/qdeclarativeexpression.h) | 66 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression_p.h (renamed from src/declarative/qml/qdeclarativeexpression_p.h) | 194 | ||||
-rw-r--r-- | src/qml/qml/qqmlextensioninterface.h (renamed from src/declarative/qml/qdeclarativepropertyvaluesource.h) | 30 | ||||
-rw-r--r-- | src/qml/qml/qqmlextensionplugin.cpp (renamed from src/declarative/qml/qdeclarativeextensionplugin.cpp) | 24 | ||||
-rw-r--r-- | src/qml/qml/qqmlextensionplugin.h (renamed from src/declarative/qml/qdeclarativeextensionplugin.h) | 28 | ||||
-rw-r--r-- | src/qml/qml/qqmlglobal_p.h (renamed from src/declarative/qml/qdeclarativeglobal_p.h) | 18 | ||||
-rw-r--r-- | src/qml/qml/qqmlguard_p.h (renamed from src/declarative/qml/qdeclarativeguard_p.h) | 74 | ||||
-rw-r--r-- | src/qml/qml/qqmlimageprovider.cpp (renamed from src/declarative/qml/qdeclarativeimageprovider.cpp) | 56 | ||||
-rw-r--r-- | src/qml/qml/qqmlimageprovider.h (renamed from src/declarative/qml/qdeclarativeimageprovider.h) | 27 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport.cpp (renamed from src/declarative/qml/qdeclarativeimport.cpp) | 366 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport_p.h (renamed from src/declarative/qml/qdeclarativeimport_p.h) | 78 | ||||
-rw-r--r-- | src/qml/qml/qqmlincubator.cpp (renamed from src/declarative/qml/qdeclarativeincubator.cpp) | 250 | ||||
-rw-r--r-- | src/qml/qml/qqmlincubator.h (renamed from src/declarative/qml/qdeclarativeincubator.h) | 52 | ||||
-rw-r--r-- | src/qml/qml/qqmlincubator_p.h (renamed from src/declarative/qml/qdeclarativeincubator_p.h) | 52 | ||||
-rw-r--r-- | src/qml/qml/qqmlinfo.cpp (renamed from src/declarative/qml/qdeclarativeinfo.cpp) | 62 | ||||
-rw-r--r-- | src/qml/qml/qqmlinfo.h | 103 | ||||
-rw-r--r-- | src/qml/qml/qqmlinstruction.cpp (renamed from src/declarative/qml/qdeclarativeinstruction.cpp) | 148 | ||||
-rw-r--r-- | src/qml/qml/qqmlinstruction_p.h (renamed from src/declarative/qml/qdeclarativeinstruction_p.h) | 36 | ||||
-rw-r--r-- | src/qml/qml/qqmlintegercache.cpp (renamed from src/declarative/qml/qdeclarativeintegercache.cpp) | 16 | ||||
-rw-r--r-- | src/qml/qml/qqmlintegercache_p.h (renamed from src/declarative/qml/qdeclarativeintegercache_p.h) | 24 | ||||
-rw-r--r-- | src/qml/qml/qqmllist.cpp (renamed from src/declarative/qml/qdeclarativelist.cpp) | 142 | ||||
-rw-r--r-- | src/qml/qml/qqmllist.h (renamed from src/declarative/qml/qdeclarativelist.h) | 62 | ||||
-rw-r--r-- | src/qml/qml/qqmllist_p.h (renamed from src/declarative/qml/qdeclarativelist_p.h) | 24 | ||||
-rw-r--r-- | src/qml/qml/qqmllocale.cpp (renamed from src/declarative/qml/qdeclarativelocale.cpp) | 42 | ||||
-rw-r--r-- | src/qml/qml/qqmllocale_p.h (renamed from src/declarative/qml/qdeclarativelocale_p.h) | 18 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp (renamed from src/declarative/qml/qdeclarativemetatype.cpp) | 388 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype_p.h (renamed from src/declarative/qml/qdeclarativemetatype_p.h) | 118 | ||||
-rw-r--r-- | src/qml/qml/qqmlnetworkaccessmanagerfactory.cpp (renamed from src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp) | 16 | ||||
-rw-r--r-- | src/qml/qml/qqmlnetworkaccessmanagerfactory.h (renamed from src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h) | 13 | ||||
-rw-r--r-- | src/qml/qml/qqmlnotifier.cpp (renamed from src/declarative/qml/qdeclarativenotifier.cpp) | 18 | ||||
-rw-r--r-- | src/qml/qml/qqmlnotifier_p.h (renamed from src/declarative/qml/qdeclarativenotifier_p.h) | 84 | ||||
-rw-r--r-- | src/qml/qml/qqmlnullablevalue_p_p.h (renamed from src/declarative/qml/qdeclarativenullablevalue_p_p.h) | 20 | ||||
-rw-r--r-- | src/qml/qml/qqmlopenmetaobject.cpp (renamed from src/declarative/qml/qdeclarativeopenmetaobject.cpp) | 104 | ||||
-rw-r--r-- | src/qml/qml/qqmlopenmetaobject_p.h (renamed from src/declarative/qml/qdeclarativeopenmetaobject_p.h) | 46 | ||||
-rw-r--r-- | src/qml/qml/qqmlparserstatus.cpp (renamed from src/declarative/qml/qdeclarativeparserstatus.cpp) | 28 | ||||
-rw-r--r-- | src/qml/qml/qqmlparserstatus.h (renamed from src/declarative/qml/qdeclarativeparserstatus.h) | 27 | ||||
-rw-r--r-- | src/qml/qml/qqmlprivate.h (renamed from src/declarative/qml/qdeclarativeprivate.h) | 48 | ||||
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp (renamed from src/declarative/qml/qdeclarativeproperty.cpp) | 548 | ||||
-rw-r--r-- | src/qml/qml/qqmlproperty.h (renamed from src/declarative/qml/qdeclarativeproperty.h) | 55 | ||||
-rw-r--r-- | src/qml/qml/qqmlproperty_p.h (renamed from src/declarative/qml/qdeclarativeproperty_p.h) | 110 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycache.cpp (renamed from src/declarative/qml/qdeclarativepropertycache.cpp) | 296 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h (renamed from src/declarative/qml/qdeclarativepropertycache_p.h) | 178 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertyvalueinterceptor.cpp (renamed from src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp) | 20 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertyvalueinterceptor_p.h (renamed from src/declarative/qml/qdeclarativepropertyvalueinterceptor_p.h) | 21 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertyvaluesource.cpp (renamed from src/declarative/qml/qdeclarativepropertyvaluesource.cpp) | 18 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertyvaluesource.h | 67 | ||||
-rw-r--r-- | src/qml/qml/qqmlproxymetaobject.cpp (renamed from src/declarative/qml/qdeclarativeproxymetaobject.cpp) | 14 | ||||
-rw-r--r-- | src/qml/qml/qqmlproxymetaobject_p.h (renamed from src/declarative/qml/qdeclarativeproxymetaobject_p.h) | 16 | ||||
-rw-r--r-- | src/qml/qml/qqmlrewrite.cpp (renamed from src/declarative/qml/qdeclarativerewrite.cpp) | 22 | ||||
-rw-r--r-- | src/qml/qml/qqmlrewrite_p.h (renamed from src/declarative/qml/qdeclarativerewrite_p.h) | 24 | ||||
-rw-r--r-- | src/qml/qml/qqmlscript.cpp (renamed from src/declarative/qml/qdeclarativescript.cpp) | 394 | ||||
-rw-r--r-- | src/qml/qml/qqmlscript_p.h (renamed from src/declarative/qml/qdeclarativescript_p.h) | 104 | ||||
-rw-r--r-- | src/qml/qml/qqmlscriptstring.cpp (renamed from src/declarative/qml/qdeclarativescriptstring.cpp) | 42 | ||||
-rw-r--r-- | src/qml/qml/qqmlscriptstring.h (renamed from src/declarative/qml/qdeclarativescriptstring.h) | 35 | ||||
-rw-r--r-- | src/qml/qml/qqmlscriptstring_p.h (renamed from src/declarative/qml/qdeclarativescriptstring_p.h) | 16 | ||||
-rw-r--r-- | src/qml/qml/qqmlstringconverters.cpp (renamed from src/declarative/qml/qdeclarativestringconverters.cpp) | 26 | ||||
-rw-r--r-- | src/qml/qml/qqmlstringconverters_p.h (renamed from src/declarative/qml/qdeclarativestringconverters_p.h) | 34 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp (renamed from src/declarative/qml/qdeclarativetypeloader.cpp) | 618 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader_p.h (renamed from src/declarative/qml/qdeclarativetypeloader_p.h) | 246 | ||||
-rw-r--r-- | src/qml/qml/qqmltypenamecache.cpp (renamed from src/declarative/qml/qdeclarativetypenamecache.cpp) | 22 | ||||
-rw-r--r-- | src/qml/qml/qqmltypenamecache_p.h (renamed from src/declarative/qml/qdeclarativetypenamecache_p.h) | 64 | ||||
-rw-r--r-- | src/qml/qml/qqmltypenotavailable.cpp (renamed from src/declarative/qml/qdeclarativetypenotavailable.cpp) | 8 | ||||
-rw-r--r-- | src/qml/qml/qqmltypenotavailable_p.h (renamed from src/declarative/qml/qdeclarativetypenotavailable_p.h) | 16 | ||||
-rw-r--r-- | src/qml/qml/qqmlvaluetype.cpp (renamed from src/declarative/qml/qdeclarativevaluetype.cpp) | 310 | ||||
-rw-r--r-- | src/qml/qml/qqmlvaluetype_p.h (renamed from src/declarative/qml/qdeclarativevaluetype_p.h) | 122 | ||||
-rw-r--r-- | src/qml/qml/qqmlvme.cpp (renamed from src/declarative/qml/qdeclarativevme.cpp) | 340 | ||||
-rw-r--r-- | src/qml/qml/qqmlvme_p.h (renamed from src/declarative/qml/qdeclarativevme_p.h) | 106 | ||||
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp (renamed from src/declarative/qml/qdeclarativevmemetaobject.cpp) | 260 | ||||
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject_p.h (renamed from src/declarative/qml/qdeclarativevmemetaobject_p.h) | 58 | ||||
-rw-r--r-- | src/qml/qml/qqmlwatcher.cpp (renamed from src/declarative/qml/qdeclarativewatcher.cpp) | 82 | ||||
-rw-r--r-- | src/qml/qml/qqmlwatcher_p.h (renamed from src/declarative/qml/qdeclarativewatcher_p.h) | 22 | ||||
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp (renamed from src/declarative/qml/qdeclarativexmlhttprequest.cpp) | 264 | ||||
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest_p.h (renamed from src/declarative/qml/qdeclarativexmlhttprequest_p.h) | 10 | ||||
-rw-r--r-- | src/qml/qml/qquickapplication.cpp (renamed from src/declarative/qml/qdeclarativeapplication.cpp) | 28 | ||||
-rw-r--r-- | src/qml/qml/qquickapplication_p.h (renamed from src/declarative/qml/qdeclarativeapplication_p.h) | 26 | ||||
-rw-r--r-- | src/qml/qml/qquicklistmodel.cpp (renamed from src/declarative/qml/qdeclarativelistmodel.cpp) | 248 | ||||
-rw-r--r-- | src/qml/qml/qquicklistmodel_p.h (renamed from src/declarative/qml/qdeclarativelistmodel_p.h) | 60 | ||||
-rw-r--r-- | src/qml/qml/qquicklistmodel_p_p.h (renamed from src/declarative/qml/qdeclarativelistmodel_p_p.h) | 46 | ||||
-rw-r--r-- | src/qml/qml/qquicklistmodelworkeragent.cpp (renamed from src/declarative/qml/qdeclarativelistmodelworkeragent.cpp) | 64 | ||||
-rw-r--r-- | src/qml/qml/qquicklistmodelworkeragent_p.h (renamed from src/declarative/qml/qdeclarativelistmodelworkeragent_p.h) | 44 | ||||
-rw-r--r-- | src/qml/qml/qquickworkerscript.cpp (renamed from src/declarative/qml/qdeclarativeworkerscript.cpp) | 162 | ||||
-rw-r--r-- | src/qml/qml/qquickworkerscript_p.h (renamed from src/declarative/qml/qdeclarativeworkerscript_p.h) | 50 | ||||
-rw-r--r-- | src/qml/qml/rewriter/rewriter.pri (renamed from src/declarative/qml/rewriter/rewriter.pri) | 0 | ||||
-rw-r--r-- | src/qml/qml/rewriter/textwriter.cpp (renamed from src/declarative/qml/rewriter/textwriter.cpp) | 4 | ||||
-rw-r--r-- | src/qml/qml/rewriter/textwriter_p.h (renamed from src/declarative/qml/rewriter/textwriter_p.h) | 8 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4bindings.cpp (renamed from src/declarative/qml/v4/qv4bindings.cpp) | 86 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4bindings_p.h (renamed from src/declarative/qml/v4/qv4bindings_p.h) | 40 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4compiler.cpp (renamed from src/declarative/qml/v4/qv4compiler.cpp) | 35 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4compiler_p.h (renamed from src/declarative/qml/v4/qv4compiler_p.h) | 28 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4compiler_p_p.h (renamed from src/declarative/qml/v4/qv4compiler_p_p.h) | 90 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4instruction.cpp (renamed from src/declarative/qml/v4/qv4instruction.cpp) | 6 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4instruction_p.h (renamed from src/declarative/qml/v4/qv4instruction_p.h) | 10 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4ir.cpp (renamed from src/declarative/qml/v4/qv4ir.cpp) | 50 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4ir_p.h (renamed from src/declarative/qml/v4/qv4ir_p.h) | 78 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4irbuilder.cpp (renamed from src/declarative/qml/v4/qv4irbuilder.cpp) | 45 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4irbuilder_p.h | 240 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4program_p.h (renamed from src/declarative/qml/v4/qv4program_p.h) | 4 | ||||
-rw-r--r-- | src/qml/qml/v4/v4.pri (renamed from src/declarative/qml/v4/v4.pri) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/notes.txt (renamed from src/declarative/qml/v8/notes.txt) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsconverter_impl_p.h (renamed from src/declarative/qml/v8/qjsconverter_impl_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsconverter_p.h (renamed from src/declarative/qml/v8/qjsconverter_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsengine.cpp (renamed from src/declarative/qml/v8/qjsengine.cpp) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsengine.h (renamed from src/declarative/qml/v8/qjsengine.h) | 4 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsengine_p.h (renamed from src/declarative/qml/v8/qjsengine_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalue.cpp (renamed from src/declarative/qml/v8/qjsvalue.cpp) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalue.h (renamed from src/declarative/qml/v8/qjsvalue.h) | 5 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalue_impl_p.h (renamed from src/declarative/qml/v8/qjsvalue_impl_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalue_p.h (renamed from src/declarative/qml/v8/qjsvalue_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalueiterator.cpp (renamed from src/declarative/qml/v8/qjsvalueiterator.cpp) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalueiterator.h (renamed from src/declarative/qml/v8/qjsvalueiterator.h) | 4 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalueiterator_impl_p.h (renamed from src/declarative/qml/v8/qjsvalueiterator_impl_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalueiterator_p.h (renamed from src/declarative/qml/v8/qjsvalueiterator_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions.cpp (renamed from src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp) | 88 | ||||
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions_p.h (renamed from src/declarative/qml/v8/qdeclarativebuiltinfunctions_p.h) | 10 | ||||
-rw-r--r-- | src/qml/qml/v8/qscript_impl_p.h (renamed from src/declarative/qml/v8/qscript_impl_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qscriptisolate_p.h (renamed from src/declarative/qml/v8/qscriptisolate_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qscriptoriginalglobalobject_p.h (renamed from src/declarative/qml/v8/qscriptoriginalglobalobject_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qscriptshareddata_p.h (renamed from src/declarative/qml/v8/qscriptshareddata_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qscripttools_p.h (renamed from src/declarative/qml/v8/qscripttools_p.h) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8_p.h (renamed from src/declarative/qml/v8/qv8_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8bindings.cpp (renamed from src/declarative/qml/v8/qv8bindings.cpp) | 60 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8bindings_p.h (renamed from src/declarative/qml/v8/qv8bindings_p.h) | 48 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8contextwrapper.cpp (renamed from src/declarative/qml/v8/qv8contextwrapper.cpp) | 60 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8contextwrapper_p.h (renamed from src/declarative/qml/v8/qv8contextwrapper_p.h) | 12 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8debug_p.h (renamed from src/declarative/qml/v8/qv8debug_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8domerrors.cpp (renamed from src/declarative/qml/v8/qv8domerrors.cpp) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8domerrors_p.h (renamed from src/declarative/qml/v8/qv8domerrors_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8engine.cpp (renamed from src/declarative/qml/v8/qv8engine.cpp) | 54 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8engine_impl_p.h (renamed from src/declarative/qml/v8/qv8engine_impl_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8engine_p.h (renamed from src/declarative/qml/v8/qv8engine_p.h) | 78 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8include.cpp (renamed from src/declarative/qml/v8/qv8include.cpp) | 20 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8include_p.h (renamed from src/declarative/qml/v8/qv8include_p.h) | 14 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8listwrapper.cpp (renamed from src/declarative/qml/v8/qv8listwrapper.cpp) | 12 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8listwrapper_p.h (renamed from src/declarative/qml/v8/qv8listwrapper_p.h) | 6 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8profiler_p.h (renamed from src/declarative/qml/v8/qv8profiler_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8qobjectwrapper.cpp (renamed from src/declarative/qml/v8/qv8qobjectwrapper.cpp) | 250 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8qobjectwrapper_p.h (renamed from src/declarative/qml/v8/qv8qobjectwrapper_p.h) | 20 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8sequencewrapper.cpp (renamed from src/declarative/qml/v8/qv8sequencewrapper.cpp) | 4 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8sequencewrapper_p.h (renamed from src/declarative/qml/v8/qv8sequencewrapper_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8sequencewrapper_p_p.h (renamed from src/declarative/qml/v8/qv8sequencewrapper_p_p.h) | 16 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8sqlerrors.cpp (renamed from src/declarative/qml/v8/qv8sqlerrors.cpp) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8sqlerrors_p.h (renamed from src/declarative/qml/v8/qv8sqlerrors_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8stringwrapper.cpp (renamed from src/declarative/qml/v8/qv8stringwrapper.cpp) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8stringwrapper_p.h (renamed from src/declarative/qml/v8/qv8stringwrapper_p.h) | 12 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8typewrapper.cpp (renamed from src/declarative/qml/v8/qv8typewrapper.cpp) | 30 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8typewrapper_p.h (renamed from src/declarative/qml/v8/qv8typewrapper_p.h) | 10 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8valuetypewrapper.cpp (renamed from src/declarative/qml/v8/qv8valuetypewrapper.cpp) | 40 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8valuetypewrapper_p.h (renamed from src/declarative/qml/v8/qv8valuetypewrapper_p.h) | 10 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8variantresource_p.h (renamed from src/declarative/qml/v8/qv8variantresource_p.h) | 6 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8variantwrapper.cpp (renamed from src/declarative/qml/v8/qv8variantwrapper.cpp) | 10 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8variantwrapper_p.h (renamed from src/declarative/qml/v8/qv8variantwrapper_p.h) | 4 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8worker.cpp (renamed from src/declarative/qml/v8/qv8worker.cpp) | 14 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8worker_p.h (renamed from src/declarative/qml/v8/qv8worker_p.h) | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/script.pri (renamed from src/declarative/qml/v8/script.pri) | 0 | ||||
-rw-r--r-- | src/qml/qml/v8/v8.pri (renamed from src/declarative/qml/v8/v8.pri) | 4 | ||||
-rw-r--r-- | src/qml/qtqmlglobal.h | 67 | ||||
-rw-r--r-- | src/qml/qtqmlglobal_p.h | 60 | ||||
-rw-r--r-- | src/qml/util/qqmlpropertymap.cpp (renamed from src/declarative/util/qdeclarativepropertymap.cpp) | 100 | ||||
-rw-r--r-- | src/qml/util/qqmlpropertymap.h (renamed from src/declarative/util/qdeclarativepropertymap.h) | 20 | ||||
-rw-r--r-- | src/qml/util/util.pri | 5 | ||||
-rw-r--r-- | src/qmldevtools/qmldevtools.pro | 2 | ||||
-rw-r--r-- | src/qmltest/qmltest.pro | 2 | ||||
-rw-r--r-- | src/qmltest/quicktest.cpp | 18 | ||||
-rw-r--r-- | src/qmltest/quicktestevent.cpp | 4 | ||||
-rw-r--r-- | src/quick/designer/designersupport.cpp | 16 | ||||
-rw-r--r-- | src/quick/designer/designersupport.h | 8 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcanvascontext.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcanvascontext_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitem.cpp | 32 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitem_p.h | 12 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitemnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitemnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2d.cpp | 14 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2d_p.h | 8 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dtexture.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dtexture_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dtile.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dtile_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/items.pri | 6 | ||||
-rw-r--r-- | src/quick/items/qquickaccessibleattached.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickaccessibleattached_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickanchors.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquickanchors_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickanchors_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickanimatedimage.cpp | 12 | ||||
-rw-r--r-- | src/quick/items/qquickanimatedimage_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickanimatedimage_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickborderimage.cpp | 29 | ||||
-rw-r--r-- | src/quick/items/qquickborderimage_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickborderimage_p_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickcanvas.cpp | 20 | ||||
-rw-r--r-- | src/quick/items/qquickcanvas.h | 8 | ||||
-rw-r--r-- | src/quick/items/qquickcanvas_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickclipnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickclipnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickdrag.cpp | 12 | ||||
-rw-r--r-- | src/quick/items/qquickdrag_p.h | 10 | ||||
-rw-r--r-- | src/quick/items/qquickdroparea.cpp | 10 | ||||
-rw-r--r-- | src/quick/items/qquickdroparea_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickevents.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 38 | ||||
-rw-r--r-- | src/quick/items/qquickflickable_p.h | 10 | ||||
-rw-r--r-- | src/quick/items/qquickflickable_p_p.h | 28 | ||||
-rw-r--r-- | src/quick/items/qquickflipable.cpp | 14 | ||||
-rw-r--r-- | src/quick/items/qquickflipable_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickfocusscope.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickfocusscope_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickgridview.cpp | 34 | ||||
-rw-r--r-- | src/quick/items/qquickgridview_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickimage.cpp | 8 | ||||
-rw-r--r-- | src/quick/items/qquickimage_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickimage_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickimagebase.cpp | 10 | ||||
-rw-r--r-- | src/quick/items/qquickimagebase_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickimagebase_p_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickimplicitsizeitem.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickimplicitsizeitem_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickimplicitsizeitem_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickitem.cpp | 115 | ||||
-rw-r--r-- | src/quick/items/qquickitem.h | 36 | ||||
-rw-r--r-- | src/quick/items/qquickitem_p.h | 86 | ||||
-rw-r--r-- | src/quick/items/qquickitemanimation.cpp (renamed from src/quick/items/qquickanimation.cpp) | 82 | ||||
-rw-r--r-- | src/quick/items/qquickitemanimation_p.h (renamed from src/quick/items/qquickanimation_p.h) | 40 | ||||
-rw-r--r-- | src/quick/items/qquickitemanimation_p_p.h (renamed from src/quick/items/qquickanimation_p_p.h) | 36 | ||||
-rw-r--r-- | src/quick/items/qquickitemchangelistener_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 50 | ||||
-rw-r--r-- | src/quick/items/qquickitemsmodule_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 118 | ||||
-rw-r--r-- | src/quick/items/qquickitemview_p.h | 78 | ||||
-rw-r--r-- | src/quick/items/qquickitemview_p_p.h | 56 | ||||
-rw-r--r-- | src/quick/items/qquicklistview.cpp | 60 | ||||
-rw-r--r-- | src/quick/items/qquicklistview_p.h | 14 | ||||
-rw-r--r-- | src/quick/items/qquickloader.cpp | 78 | ||||
-rw-r--r-- | src/quick/items/qquickloader_p.h | 10 | ||||
-rw-r--r-- | src/quick/items/qquickloader_p_p.h | 20 | ||||
-rw-r--r-- | src/quick/items/qquickmousearea.cpp | 14 | ||||
-rw-r--r-- | src/quick/items/qquickmousearea_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickmousearea_p_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickmultipointtoucharea.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquickmultipointtoucharea_p.h | 20 | ||||
-rw-r--r-- | src/quick/items/qquickninepatchnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickninepatchnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickpainteditem.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickpainteditem.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickpainteditem_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 69 | ||||
-rw-r--r-- | src/quick/items/qquickpathview_p.h | 30 | ||||
-rw-r--r-- | src/quick/items/qquickpathview_p_p.h | 30 | ||||
-rw-r--r-- | src/quick/items/qquickpositioners.cpp | 62 | ||||
-rw-r--r-- | src/quick/items/qquickpositioners_p.h | 16 | ||||
-rw-r--r-- | src/quick/items/qquickpositioners_p_p.h | 20 | ||||
-rw-r--r-- | src/quick/items/qquickrectangle.cpp | 16 | ||||
-rw-r--r-- | src/quick/items/qquickrectangle_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickrectangle_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickrepeater.cpp | 40 | ||||
-rw-r--r-- | src/quick/items/qquickrepeater_p.h | 12 | ||||
-rw-r--r-- | src/quick/items/qquickrepeater_p_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickscalegrid.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquickscalegrid_p_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickscreen.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickscreen_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffect.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffect_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffectmesh.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffectmesh_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffectnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffectnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffectsource.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffectsource_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquicksprite.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquicksprite_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickspriteengine.cpp | 30 | ||||
-rw-r--r-- | src/quick/items/qquickspriteengine_p.h | 36 | ||||
-rw-r--r-- | src/quick/items/qquickspriteimage.cpp | 10 | ||||
-rw-r--r-- | src/quick/items/qquickspriteimage_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickstateoperations.cpp | 358 | ||||
-rw-r--r-- | src/quick/items/qquickstateoperations_p.h | 98 | ||||
-rw-r--r-- | src/quick/items/qquicktext.cpp | 59 | ||||
-rw-r--r-- | src/quick/items/qquicktext_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktext_p_p.h | 16 | ||||
-rw-r--r-- | src/quick/items/qquicktextedit.cpp | 24 | ||||
-rw-r--r-- | src/quick/items/qquicktextedit_p.h | 8 | ||||
-rw-r--r-- | src/quick/items/qquicktextedit_p_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 20 | ||||
-rw-r--r-- | src/quick/items/qquicktextinput_p.h | 10 | ||||
-rw-r--r-- | src/quick/items/qquicktextinput_p_p.h | 8 | ||||
-rw-r--r-- | src/quick/items/qquicktextnode.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquicktextnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktranslate.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktranslate_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickview.cpp | 62 | ||||
-rw-r--r-- | src/quick/items/qquickview.h | 16 | ||||
-rw-r--r-- | src/quick/items/qquickview_p.h | 14 | ||||
-rw-r--r-- | src/quick/items/qquickvisualadaptormodel.cpp | 38 | ||||
-rw-r--r-- | src/quick/items/qquickvisualadaptormodel_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickvisualdatamodel.cpp | 168 | ||||
-rw-r--r-- | src/quick/items/qquickvisualdatamodel_p.h | 54 | ||||
-rw-r--r-- | src/quick/items/qquickvisualdatamodel_p_p.h | 98 | ||||
-rw-r--r-- | src/quick/items/qquickvisualitemmodel.cpp | 28 | ||||
-rw-r--r-- | src/quick/items/qquickvisualitemmodel_p.h | 12 | ||||
-rw-r--r-- | src/quick/items/qquickwindowmanager.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquickwindowmanager_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickwindowmodule_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/syncexcludes | 4 | ||||
-rw-r--r-- | src/quick/particles/qquickcumulativedirection.cpp | 4 | ||||
-rw-r--r-- | src/quick/particles/qquickcumulativedirection_p.h | 6 | ||||
-rw-r--r-- | src/quick/particles/qquickcustomaffector.cpp | 14 | ||||
-rw-r--r-- | src/quick/particles/qquickcustomaffector_p.h | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickcustomparticle.cpp | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickcustomparticle_p.h | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickimageparticle.cpp | 8 | ||||
-rw-r--r-- | src/quick/particles/qquickimageparticle_p.h | 10 | ||||
-rw-r--r-- | src/quick/particles/qquickitemparticle.cpp | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickitemparticle_p.h | 12 | ||||
-rw-r--r-- | src/quick/particles/qquickmaskextruder.cpp | 4 | ||||
-rw-r--r-- | src/quick/particles/qquickmaskextruder_p.h | 4 | ||||
-rw-r--r-- | src/quick/particles/qquickparticleemitter.cpp | 8 | ||||
-rw-r--r-- | src/quick/particles/qquickparticleemitter_p.h | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickparticlegroup.cpp | 8 | ||||
-rw-r--r-- | src/quick/particles/qquickparticlegroup_p.h | 10 | ||||
-rw-r--r-- | src/quick/particles/qquickparticlesmodule_p.h | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickparticlesystem.cpp | 9 | ||||
-rw-r--r-- | src/quick/particles/qquickparticlesystem_p.h | 8 | ||||
-rw-r--r-- | src/quick/particles/qquickspritegoal_p.h | 2 | ||||
-rw-r--r-- | src/quick/particles/qquicktrailemitter.cpp | 10 | ||||
-rw-r--r-- | src/quick/particles/qquicktrailemitter_p.h | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickturbulence_p.h | 2 | ||||
-rw-r--r-- | src/quick/particles/qquickv8particledata.cpp | 4 | ||||
-rw-r--r-- | src/quick/particles/qquickv8particledata_p.h | 2 | ||||
-rw-r--r-- | src/quick/qtquick2.cpp | 86 | ||||
-rw-r--r-- | src/quick/qtquick2_p.h | 4 | ||||
-rw-r--r-- | src/quick/qtquickglobal.h | 2 | ||||
-rw-r--r-- | src/quick/qtquickglobal_p.h | 2 | ||||
-rw-r--r-- | src/quick/quick.pro | 12 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsggeometry_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnodeupdater.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnodeupdater_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrenderer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrenderer_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 16 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext_p.h | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontextplugin.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontextplugin_p.h | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultimagenode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultimagenode_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultrectanglenode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultrectanglenode_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgflashnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgflashnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgpathsimplifier.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgpathsimplifier_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgareaallocator.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgareaallocator_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgdistancefieldutil.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgdistancefieldutil_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgengine.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgengine.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgflatcolormaterial.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgflatcolormaterial.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgpainternode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgpainternode_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimplematerial.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimplerectnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimplerectnode.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimpletexturenode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimpletexturenode.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.cpp | 5 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexturematerial.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexturematerial.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexturematerial_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtextureprovider.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtextureprovider.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgvertexcolormaterial.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgvertexcolormaterial.h | 2 | ||||
-rw-r--r-- | src/quick/util/qdeclarativeutilmodule.cpp | 103 | ||||
-rw-r--r-- | src/quick/util/qquickanimation.cpp (renamed from src/quick/util/qdeclarativeanimation.cpp) | 716 | ||||
-rw-r--r-- | src/quick/util/qquickanimation_p.h (renamed from src/quick/util/qdeclarativeanimation_p.h) | 234 | ||||
-rw-r--r-- | src/quick/util/qquickanimation_p_p.h (renamed from src/quick/util/qdeclarativeanimation_p_p.h) | 124 | ||||
-rw-r--r-- | src/quick/util/qquickanimationcontroller.cpp (renamed from src/quick/util/qdeclarativeanimationcontroller.cpp) | 68 | ||||
-rw-r--r-- | src/quick/util/qquickanimationcontroller_p.h (renamed from src/quick/util/qdeclarativeanimationcontroller_p.h) | 32 | ||||
-rw-r--r-- | src/quick/util/qquickbehavior.cpp (renamed from src/quick/util/qdeclarativebehavior.cpp) | 86 | ||||
-rw-r--r-- | src/quick/util/qquickbehavior_p.h (renamed from src/quick/util/qdeclarativebehavior_p.h) | 36 | ||||
-rw-r--r-- | src/quick/util/qquickbind.cpp (renamed from src/quick/util/qdeclarativebind.cpp) | 108 | ||||
-rw-r--r-- | src/quick/util/qquickbind_p.h (renamed from src/quick/util/qdeclarativebind_p.h) | 26 | ||||
-rw-r--r-- | src/quick/util/qquickchangeset.cpp (renamed from src/quick/util/qdeclarativechangeset.cpp) | 52 | ||||
-rw-r--r-- | src/quick/util/qquickchangeset_p.h (renamed from src/quick/util/qdeclarativechangeset_p.h) | 30 | ||||
-rw-r--r-- | src/quick/util/qquickconnections.cpp (renamed from src/quick/util/qdeclarativeconnections.cpp) | 100 | ||||
-rw-r--r-- | src/quick/util/qquickconnections_p.h (renamed from src/quick/util/qdeclarativeconnections_p.h) | 32 | ||||
-rw-r--r-- | src/quick/util/qquickfontloader.cpp (renamed from src/quick/util/qdeclarativefontloader.cpp) | 94 | ||||
-rw-r--r-- | src/quick/util/qquickfontloader_p.h (renamed from src/quick/util/qdeclarativefontloader_p.h) | 24 | ||||
-rw-r--r-- | src/quick/util/qquicklistaccessor.cpp (renamed from src/quick/util/qdeclarativelistaccessor.cpp) | 34 | ||||
-rw-r--r-- | src/quick/util/qquicklistaccessor_p.h (renamed from src/quick/util/qdeclarativelistaccessor_p.h) | 18 | ||||
-rw-r--r-- | src/quick/util/qquicklistcompositor.cpp (renamed from src/quick/util/qdeclarativelistcompositor.cpp) | 276 | ||||
-rw-r--r-- | src/quick/util/qquicklistcompositor_p.h (renamed from src/quick/util/qdeclarativelistcompositor_p.h) | 58 | ||||
-rw-r--r-- | src/quick/util/qquickpackage.cpp (renamed from src/quick/util/qdeclarativepackage.cpp) | 72 | ||||
-rw-r--r-- | src/quick/util/qquickpackage_p.h (renamed from src/quick/util/qdeclarativepackage_p.h) | 40 | ||||
-rw-r--r-- | src/quick/util/qquickpath.cpp (renamed from src/quick/util/qdeclarativepath.cpp) | 330 | ||||
-rw-r--r-- | src/quick/util/qquickpath_p.h (renamed from src/quick/util/qdeclarativepath_p.h) | 146 | ||||
-rw-r--r-- | src/quick/util/qquickpath_p_p.h (renamed from src/quick/util/qdeclarativepath_p_p.h) | 28 | ||||
-rw-r--r-- | src/quick/util/qquickpathinterpolator.cpp (renamed from src/quick/util/qdeclarativepathinterpolator.cpp) | 26 | ||||
-rw-r--r-- | src/quick/util/qquickpathinterpolator_p.h (renamed from src/quick/util/qdeclarativepathinterpolator_p.h) | 26 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp (renamed from src/quick/util/qdeclarativepixmapcache.cpp) | 486 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache_p.h (renamed from src/quick/util/qdeclarativepixmapcache_p.h) | 50 | ||||
-rw-r--r-- | src/quick/util/qquickpropertychanges.cpp (renamed from src/quick/util/qdeclarativepropertychanges.cpp) | 312 | ||||
-rw-r--r-- | src/quick/util/qquickpropertychanges_p.h (renamed from src/quick/util/qdeclarativepropertychanges_p.h) | 34 | ||||
-rw-r--r-- | src/quick/util/qquicksmoothedanimation.cpp (renamed from src/quick/util/qdeclarativesmoothedanimation.cpp) | 110 | ||||
-rw-r--r-- | src/quick/util/qquicksmoothedanimation_p.h (renamed from src/quick/util/qdeclarativesmoothedanimation_p.h) | 30 | ||||
-rw-r--r-- | src/quick/util/qquicksmoothedanimation_p_p.h (renamed from src/quick/util/qdeclarativesmoothedanimation_p_p.h) | 34 | ||||
-rw-r--r-- | src/quick/util/qquickspringanimation.cpp (renamed from src/quick/util/qdeclarativespringanimation.cpp) | 108 | ||||
-rw-r--r-- | src/quick/util/qquickspringanimation_p.h (renamed from src/quick/util/qdeclarativespringanimation_p.h) | 30 | ||||
-rw-r--r-- | src/quick/util/qquickstate.cpp (renamed from src/quick/util/qdeclarativestate.cpp) | 294 | ||||
-rw-r--r-- | src/quick/util/qquickstate_p.h (renamed from src/quick/util/qdeclarativestate_p.h) | 120 | ||||
-rw-r--r-- | src/quick/util/qquickstate_p_p.h (renamed from src/quick/util/qdeclarativestate_p_p.h) | 108 | ||||
-rw-r--r-- | src/quick/util/qquickstatechangescript.cpp (renamed from src/quick/util/qdeclarativestateoperations.cpp) | 67 | ||||
-rw-r--r-- | src/quick/util/qquickstatechangescript_p.h (renamed from src/quick/util/qdeclarativestateoperations_p.h) | 30 | ||||
-rw-r--r-- | src/quick/util/qquickstategroup.cpp (renamed from src/quick/util/qdeclarativestategroup.cpp) | 176 | ||||
-rw-r--r-- | src/quick/util/qquickstategroup_p.h (renamed from src/quick/util/qdeclarativestategroup_p.h) | 42 | ||||
-rw-r--r-- | src/quick/util/qquickstyledtext.cpp (renamed from src/quick/util/qdeclarativestyledtext.cpp) | 102 | ||||
-rw-r--r-- | src/quick/util/qquickstyledtext_p.h (renamed from src/quick/util/qdeclarativestyledtext_p.h) | 40 | ||||
-rw-r--r-- | src/quick/util/qquicksvgparser.cpp (renamed from src/quick/util/qdeclarativesvgparser.cpp) | 6 | ||||
-rw-r--r-- | src/quick/util/qquicksvgparser_p.h (renamed from src/quick/util/qdeclarativesvgparser_p.h) | 8 | ||||
-rw-r--r-- | src/quick/util/qquicksystempalette.cpp (renamed from src/quick/util/qdeclarativesystempalette.cpp) | 90 | ||||
-rw-r--r-- | src/quick/util/qquicksystempalette_p.h (renamed from src/quick/util/qdeclarativesystempalette_p.h) | 28 | ||||
-rw-r--r-- | src/quick/util/qquicktimeline.cpp (renamed from src/quick/util/qdeclarativetimeline.cpp) | 232 | ||||
-rw-r--r-- | src/quick/util/qquicktimeline_p_p.h (renamed from src/quick/util/qdeclarativetimeline_p_p.h) | 106 | ||||
-rw-r--r-- | src/quick/util/qquicktimer.cpp (renamed from src/quick/util/qdeclarativetimer.cpp) | 78 | ||||
-rw-r--r-- | src/quick/util/qquicktimer_p.h (renamed from src/quick/util/qdeclarativetimer_p.h) | 20 | ||||
-rw-r--r-- | src/quick/util/qquicktransition.cpp (renamed from src/quick/util/qdeclarativetransition.cpp) | 146 | ||||
-rw-r--r-- | src/quick/util/qquicktransition_p.h (renamed from src/quick/util/qdeclarativetransition_p.h) | 48 | ||||
-rw-r--r-- | src/quick/util/qquicktransitionmanager.cpp (renamed from src/quick/util/qdeclarativetransitionmanager.cpp) | 98 | ||||
-rw-r--r-- | src/quick/util/qquicktransitionmanager_p_p.h (renamed from src/quick/util/qdeclarativetransitionmanager_p_p.h) | 32 | ||||
-rw-r--r-- | src/quick/util/qquickutilmodule.cpp | 103 | ||||
-rw-r--r-- | src/quick/util/qquickutilmodule_p.h (renamed from src/quick/util/qdeclarativeutilmodule_p.h) | 12 | ||||
-rw-r--r-- | src/quick/util/util.pri | 116 | ||||
-rw-r--r-- | src/src.pro | 2 |
642 files changed, 16411 insertions, 16250 deletions
diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri deleted file mode 100644 index 8e29e9fdf6..0000000000 --- a/src/declarative/debugger/debugger.pri +++ /dev/null @@ -1,32 +0,0 @@ -SOURCES += \ - $$PWD/qpacketprotocol.cpp \ - $$PWD/qdeclarativedebugservice.cpp \ - $$PWD/qdeclarativedebugclient.cpp \ - $$PWD/qdeclarativeenginedebug.cpp \ - $$PWD/qdeclarativeprofilerservice.cpp \ - $$PWD/qdeclarativedebughelper.cpp \ - $$PWD/qdeclarativedebugserver.cpp \ - $$PWD/qdeclarativeinspectorservice.cpp \ - $$PWD/qv8debugservice.cpp \ - $$PWD/qv8profilerservice.cpp \ - $$PWD/qdeclarativeenginedebugservice.cpp \ - $$PWD/qdebugmessageservice.cpp - -HEADERS += \ - $$PWD/qpacketprotocol_p.h \ - $$PWD/qdeclarativedebugservice_p.h \ - $$PWD/qdeclarativedebugservice_p_p.h \ - $$PWD/qdeclarativedebugclient_p.h \ - $$PWD/qdeclarativeenginedebug_p.h \ - $$PWD/qdeclarativeprofilerservice_p.h \ - $$PWD/qdeclarativedebughelper_p.h \ - $$PWD/qdeclarativedebugserver_p.h \ - $$PWD/qdeclarativedebugserverconnection_p.h \ - $$PWD/qdeclarativedebugstatesdelegate_p.h \ - $$PWD/qdeclarativeinspectorservice_p.h \ - $$PWD/qdeclarativeinspectorinterface_p.h \ - $$PWD/qv8debugservice_p.h \ - $$PWD/qv8profilerservice_p.h \ - $$PWD/qdeclarativeenginedebugservice_p.h \ - $$PWD/qdeclarativedebug.h \ - $$PWD/qdebugmessageservice_p.h diff --git a/src/declarative/debugger/qdeclarativeenginedebug.cpp b/src/declarative/debugger/qdeclarativeenginedebug.cpp deleted file mode 100644 index 462f99937e..0000000000 --- a/src/declarative/debugger/qdeclarativeenginedebug.cpp +++ /dev/null @@ -1,1072 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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 "qdeclarativeenginedebug_p.h" - -#include "qdeclarativedebugclient_p.h" - -#include "qdeclarativeenginedebugservice_p.h" - -#include <private/qobject_p.h> - -QT_BEGIN_NAMESPACE - -class QDeclarativeEngineDebugClient : public QDeclarativeDebugClient -{ -public: - QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p); - -protected: - virtual void stateChanged(State state); - virtual void messageReceived(const QByteArray &); - -private: - QDeclarativeEngineDebugPrivate *priv; - friend class QDeclarativeEngineDebugPrivate; -}; - -class QDeclarativeEngineDebugPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QDeclarativeEngineDebug) -public: - QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *); - ~QDeclarativeEngineDebugPrivate(); - - void stateChanged(QDeclarativeEngineDebug::State status); - void message(const QByteArray &); - - QDeclarativeEngineDebugClient *client; - int nextId; - int getId(); - - void decode(QDataStream &, QDeclarativeDebugContextReference &); - void decode(QDataStream &, QDeclarativeDebugObjectReference &, bool simple); - - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugWatch *); - - QHash<int, QDeclarativeDebugEnginesQuery *> enginesQuery; - QHash<int, QDeclarativeDebugRootContextQuery *> rootContextQuery; - QHash<int, QDeclarativeDebugObjectQuery *> objectQuery; - QHash<int, QDeclarativeDebugExpressionQuery *> expressionQuery; - - QHash<int, QDeclarativeDebugWatch *> watched; -}; - -QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, - QDeclarativeEngineDebugPrivate *p) - : QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p) -{ -} - -void QDeclarativeEngineDebugClient::stateChanged(State status) -{ - if (priv) - priv->stateChanged(static_cast<QDeclarativeEngineDebug::State>(status)); -} - -void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data) -{ - if (priv) - priv->message(data); -} - -QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *c) - : client(new QDeclarativeEngineDebugClient(c, this)), nextId(0) -{ -} - -QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate() -{ - if (client) - client->priv = 0; - delete client; - - QHash<int, QDeclarativeDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin(); - for (; enginesIter != enginesQuery.end(); ++enginesIter) { - enginesIter.value()->m_client = 0; - if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting) - enginesIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash<int, QDeclarativeDebugRootContextQuery*>::iterator rootContextIter = rootContextQuery.begin(); - for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) { - rootContextIter.value()->m_client = 0; - if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting) - rootContextIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash<int, QDeclarativeDebugObjectQuery*>::iterator objectIter = objectQuery.begin(); - for (; objectIter != objectQuery.end(); ++objectIter) { - objectIter.value()->m_client = 0; - if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting) - objectIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash<int, QDeclarativeDebugExpressionQuery*>::iterator exprIter = expressionQuery.begin(); - for (; exprIter != expressionQuery.end(); ++exprIter) { - exprIter.value()->m_client = 0; - if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting) - exprIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash<int, QDeclarativeDebugWatch*>::iterator watchIter = watched.begin(); - for (; watchIter != watched.end(); ++watchIter) { - watchIter.value()->m_client = 0; - watchIter.value()->setState(QDeclarativeDebugWatch::Dead); - } -} - -int QDeclarativeEngineDebugPrivate::getId() -{ - return nextId++; -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugEnginesQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->enginesQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, - QDeclarativeDebugRootContextQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->rootContextQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugObjectQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->objectQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugExpressionQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->expressionQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugWatch *w) -{ - if (c && w) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->watched.remove(w->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o, - bool simple) -{ - QDeclarativeEngineDebugService::QDeclarativeObjectData data; - ds >> data; - o.m_debugId = data.objectId; - o.m_class = data.objectType; - o.m_idString = data.idString; - o.m_name = data.objectName; - o.m_source.m_url = data.url; - o.m_source.m_lineNumber = data.lineNumber; - o.m_source.m_columnNumber = data.columnNumber; - o.m_contextDebugId = data.contextId; - - if (simple) - return; - - int childCount; - bool recur; - ds >> childCount >> recur; - - for (int ii = 0; ii < childCount; ++ii) { - o.m_children.append(QDeclarativeDebugObjectReference()); - decode(ds, o.m_children.last(), !recur); - } - - int propCount; - ds >> propCount; - - for (int ii = 0; ii < propCount; ++ii) { - QDeclarativeEngineDebugService::QDeclarativeObjectProperty data; - ds >> data; - QDeclarativeDebugPropertyReference prop; - prop.m_objectDebugId = o.m_debugId; - prop.m_name = data.name; - prop.m_binding = data.binding; - prop.m_hasNotifySignal = data.hasNotifySignal; - prop.m_valueTypeName = data.valueTypeName; - switch (data.type) { - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic: - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List: - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty: - { - prop.m_value = data.value; - break; - } - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object: - { - QDeclarativeDebugObjectReference obj; - obj.m_debugId = prop.m_value.toInt(); - prop.m_value = QVariant::fromValue(obj); - break; - } - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown: - break; - } - o.m_properties << prop; - } -} - -void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugContextReference &c) -{ - ds >> c.m_name >> c.m_debugId; - - int contextCount; - ds >> contextCount; - - for (int ii = 0; ii < contextCount; ++ii) { - c.m_contexts.append(QDeclarativeDebugContextReference()); - decode(ds, c.m_contexts.last()); - } - - int objectCount; - ds >> objectCount; - - for (int ii = 0; ii < objectCount; ++ii) { - QDeclarativeDebugObjectReference obj; - decode(ds, obj, true); - - obj.m_contextDebugId = c.m_debugId; - c.m_objects << obj; - } -} - -void QDeclarativeEngineDebugPrivate::stateChanged(QDeclarativeEngineDebug::State status) -{ - emit q_func()->stateChanged(status); -} - -void QDeclarativeEngineDebugPrivate::message(const QByteArray &data) -{ - QDataStream ds(data); - - QByteArray type; - ds >> type; - - //qDebug() << "QDeclarativeEngineDebugPrivate::message()" << type; - - if (type == "LIST_ENGINES_R") { - int queryId; - ds >> queryId; - - QDeclarativeDebugEnginesQuery *query = enginesQuery.value(queryId); - if (!query) - return; - enginesQuery.remove(queryId); - - int count; - ds >> count; - - for (int ii = 0; ii < count; ++ii) { - QDeclarativeDebugEngineReference ref; - ds >> ref.m_name; - ds >> ref.m_debugId; - query->m_engines << ref; - } - - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "LIST_OBJECTS_R") { - int queryId; - ds >> queryId; - - QDeclarativeDebugRootContextQuery *query = rootContextQuery.value(queryId); - if (!query) - return; - rootContextQuery.remove(queryId); - - if (!ds.atEnd()) - decode(ds, query->m_context); - - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "FETCH_OBJECT_R") { - int queryId; - ds >> queryId; - - QDeclarativeDebugObjectQuery *query = objectQuery.value(queryId); - if (!query) - return; - objectQuery.remove(queryId); - - if (!ds.atEnd()) - decode(ds, query->m_object, false); - - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "EVAL_EXPRESSION_R") { - int queryId; - QVariant result; - ds >> queryId >> result; - - QDeclarativeDebugExpressionQuery *query = expressionQuery.value(queryId); - if (!query) - return; - expressionQuery.remove(queryId); - - query->m_result = result; - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "WATCH_PROPERTY_R") { - int queryId; - bool ok; - ds >> queryId >> ok; - - QDeclarativeDebugWatch *watch = watched.value(queryId); - if (!watch) - return; - - watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); - } else if (type == "WATCH_OBJECT_R") { - int queryId; - bool ok; - ds >> queryId >> ok; - - QDeclarativeDebugWatch *watch = watched.value(queryId); - if (!watch) - return; - - watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); - } else if (type == "WATCH_EXPR_OBJECT_R") { - int queryId; - bool ok; - ds >> queryId >> ok; - - QDeclarativeDebugWatch *watch = watched.value(queryId); - if (!watch) - return; - - watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); - } else if (type == "UPDATE_WATCH") { - int queryId; - int debugId; - QByteArray name; - QVariant value; - ds >> queryId >> debugId >> name >> value; - - QDeclarativeDebugWatch *watch = watched.value(queryId, 0); - if (!watch) - return; - emit watch->valueChanged(name, value); - } else if (type == "OBJECT_CREATED") { - emit q_func()->newObjects(); - } -} - -QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent) - : QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent) -{ -} - -QDeclarativeEngineDebug::~QDeclarativeEngineDebug() -{ -} - -QDeclarativeEngineDebug::State QDeclarativeEngineDebug::state() const -{ - Q_D(const QDeclarativeEngineDebug); - - return static_cast<QDeclarativeEngineDebug::State>(d->client->state()); -} - -QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugPropertyWatch *watch = new QDeclarativeDebugPropertyWatch(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled) { - int queryId = d->getId(); - watch->m_queryId = queryId; - watch->m_client = this; - watch->m_objectDebugId = property.objectDebugId(); - watch->m_name = property.name(); - d->watched.insert(queryId, watch); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8(); - d->client->sendMessage(message); - } else { - watch->m_state = QDeclarativeDebugWatch::Dead; - } - - return watch; -} - -QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugContextReference &, const QString &, QObject *) -{ - qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented"); - return 0; -} - -QDeclarativeDebugObjectExpressionWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, const QString &expr, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - QDeclarativeDebugObjectExpressionWatch *watch = new QDeclarativeDebugObjectExpressionWatch(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled) { - int queryId = d->getId(); - watch->m_queryId = queryId; - watch->m_client = this; - watch->m_objectDebugId = object.debugId(); - watch->m_expr = expr; - d->watched.insert(queryId, watch); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr; - d->client->sendMessage(message); - } else { - watch->m_state = QDeclarativeDebugWatch::Dead; - } - return watch; -} - -QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled) { - int queryId = d->getId(); - watch->m_queryId = queryId; - watch->m_client = this; - watch->m_objectDebugId = object.debugId(); - d->watched.insert(queryId, watch); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId(); - d->client->sendMessage(message); - } else { - watch->m_state = QDeclarativeDebugWatch::Dead; - } - - return watch; -} - -QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugFileReference &, QObject *) -{ - qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented"); - return 0; -} - -void QDeclarativeEngineDebug::removeWatch(QDeclarativeDebugWatch *watch) -{ - Q_D(QDeclarativeEngineDebug); - - if (!watch || !watch->m_client) - return; - - watch->m_client = 0; - watch->setState(QDeclarativeDebugWatch::Inactive); - - d->watched.remove(watch->queryId()); - - if (d->client && d->client->state() == QDeclarativeDebugClient::Enabled) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("NO_WATCH") << watch->queryId(); - d->client->sendMessage(message); - } -} - -QDeclarativeDebugEnginesQuery *QDeclarativeEngineDebug::queryAvailableEngines(QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugEnginesQuery *query = new QDeclarativeDebugEnginesQuery(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->enginesQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("LIST_ENGINES") << queryId; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugRootContextQuery *QDeclarativeEngineDebug::queryRootContexts(const QDeclarativeDebugEngineReference &engine, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugRootContextQuery *query = new QDeclarativeDebugRootContextQuery(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->rootContextQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId(); - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclarativeDebugObjectReference &object, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->objectQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() - << false << true; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(const QDeclarativeDebugObjectReference &object, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->objectQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() - << true << true; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent); - if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - query->m_client = this; - query->m_expr = expr; - int queryId = d->getId(); - query->m_queryId = queryId; - d->expressionQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName, - const QVariant &bindingExpression, - bool isLiteralValue, - QString source, int line) -{ - Q_D(QDeclarativeEngineDebug); - - if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line; - d->client->sendMessage(message); - return true; - } else { - return false; - } -} - -bool QDeclarativeEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName) -{ - Q_D(QDeclarativeEngineDebug); - - if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName; - d->client->sendMessage(message); - return true; - } else { - return false; - } -} - -bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName, - const QString &methodBody) -{ - Q_D(QDeclarativeEngineDebug); - - if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody; - d->client->sendMessage(message); - return true; - } else { - return false; - } -} - -QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent) - : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1) -{ -} - -QDeclarativeDebugWatch::~QDeclarativeDebugWatch() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -int QDeclarativeDebugWatch::queryId() const -{ - return m_queryId; -} - -int QDeclarativeDebugWatch::objectDebugId() const -{ - return m_objectDebugId; -} - -QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state() const -{ - return m_state; -} - -void QDeclarativeDebugWatch::setState(State s) -{ - if (m_state == s) - return; - m_state = s; - emit stateChanged(m_state); -} - -QDeclarativeDebugPropertyWatch::QDeclarativeDebugPropertyWatch(QObject *parent) - : QDeclarativeDebugWatch(parent) -{ -} - -QString QDeclarativeDebugPropertyWatch::name() const -{ - return m_name; -} - - -QDeclarativeDebugObjectExpressionWatch::QDeclarativeDebugObjectExpressionWatch(QObject *parent) - : QDeclarativeDebugWatch(parent) -{ -} - -QString QDeclarativeDebugObjectExpressionWatch::expression() const -{ - return m_expr; -} - - -QDeclarativeDebugQuery::QDeclarativeDebugQuery(QObject *parent) - : QObject(parent), m_state(Waiting) -{ -} - -QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state() const -{ - return m_state; -} - -bool QDeclarativeDebugQuery::isWaiting() const -{ - return m_state == Waiting; -} - -void QDeclarativeDebugQuery::setState(State s) -{ - if (m_state == s) - return; - m_state = s; - emit stateChanged(m_state); -} - -QDeclarativeDebugEnginesQuery::QDeclarativeDebugEnginesQuery(QObject *parent) - : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugEnginesQuery::~QDeclarativeDebugEnginesQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QList<QDeclarativeDebugEngineReference> QDeclarativeDebugEnginesQuery::engines() const -{ - return m_engines; -} - -QDeclarativeDebugRootContextQuery::QDeclarativeDebugRootContextQuery(QObject *parent) - : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugRootContextQuery::~QDeclarativeDebugRootContextQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QDeclarativeDebugContextReference QDeclarativeDebugRootContextQuery::rootContext() const -{ - return m_context; -} - -QDeclarativeDebugObjectQuery::QDeclarativeDebugObjectQuery(QObject *parent) - : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugObjectQuery::~QDeclarativeDebugObjectQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QDeclarativeDebugObjectReference QDeclarativeDebugObjectQuery::object() const -{ - return m_object; -} - -QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(QObject *parent) - : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QVariant QDeclarativeDebugExpressionQuery::expression() const -{ - return m_expr; -} - -QVariant QDeclarativeDebugExpressionQuery::result() const -{ - return m_result; -} - -QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference() - : m_debugId(-1) -{ -} - -QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(int debugId) - : m_debugId(debugId) -{ -} - -QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &o) - : m_debugId(o.m_debugId), m_name(o.m_name) -{ -} - -QDeclarativeDebugEngineReference & -QDeclarativeDebugEngineReference::operator=(const QDeclarativeDebugEngineReference &o) -{ - m_debugId = o.m_debugId; m_name = o.m_name; - return *this; -} - -int QDeclarativeDebugEngineReference::debugId() const -{ - return m_debugId; -} - -QString QDeclarativeDebugEngineReference::name() const -{ - return m_name; -} - -QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference() - : m_debugId(-1), m_contextDebugId(-1) -{ -} - -QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(int debugId) - : m_debugId(debugId), m_contextDebugId(-1) -{ -} - -QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &o) - : m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString), - m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId), - m_properties(o.m_properties), m_children(o.m_children) -{ -} - -QDeclarativeDebugObjectReference & -QDeclarativeDebugObjectReference::operator=(const QDeclarativeDebugObjectReference &o) -{ - m_debugId = o.m_debugId; m_class = o.m_class; m_idString = o.m_idString; - m_name = o.m_name; m_source = o.m_source; m_contextDebugId = o.m_contextDebugId; - m_properties = o.m_properties; m_children = o.m_children; - return *this; -} - -int QDeclarativeDebugObjectReference::debugId() const -{ - return m_debugId; -} - -QString QDeclarativeDebugObjectReference::className() const -{ - return m_class; -} - -QString QDeclarativeDebugObjectReference::idString() const -{ - return m_idString; -} - -QString QDeclarativeDebugObjectReference::name() const -{ - return m_name; -} - -QDeclarativeDebugFileReference QDeclarativeDebugObjectReference::source() const -{ - return m_source; -} - -int QDeclarativeDebugObjectReference::contextDebugId() const -{ - return m_contextDebugId; -} - -QList<QDeclarativeDebugPropertyReference> QDeclarativeDebugObjectReference::properties() const -{ - return m_properties; -} - -QList<QDeclarativeDebugObjectReference> QDeclarativeDebugObjectReference::children() const -{ - return m_children; -} - -QDeclarativeDebugContextReference::QDeclarativeDebugContextReference() - : m_debugId(-1) -{ -} - -QDeclarativeDebugContextReference::QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &o) - : m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts) -{ -} - -QDeclarativeDebugContextReference &QDeclarativeDebugContextReference::operator=(const QDeclarativeDebugContextReference &o) -{ - m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects; - m_contexts = o.m_contexts; - return *this; -} - -int QDeclarativeDebugContextReference::debugId() const -{ - return m_debugId; -} - -QString QDeclarativeDebugContextReference::name() const -{ - return m_name; -} - -QList<QDeclarativeDebugObjectReference> QDeclarativeDebugContextReference::objects() const -{ - return m_objects; -} - -QList<QDeclarativeDebugContextReference> QDeclarativeDebugContextReference::contexts() const -{ - return m_contexts; -} - -QDeclarativeDebugFileReference::QDeclarativeDebugFileReference() - : m_lineNumber(-1), m_columnNumber(-1) -{ -} - -QDeclarativeDebugFileReference::QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &o) - : m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber) -{ -} - -QDeclarativeDebugFileReference &QDeclarativeDebugFileReference::operator=(const QDeclarativeDebugFileReference &o) -{ - m_url = o.m_url; m_lineNumber = o.m_lineNumber; m_columnNumber = o.m_columnNumber; - return *this; -} - -QUrl QDeclarativeDebugFileReference::url() const -{ - return m_url; -} - -void QDeclarativeDebugFileReference::setUrl(const QUrl &u) -{ - m_url = u; -} - -int QDeclarativeDebugFileReference::lineNumber() const -{ - return m_lineNumber; -} - -void QDeclarativeDebugFileReference::setLineNumber(int l) -{ - m_lineNumber = l; -} - -int QDeclarativeDebugFileReference::columnNumber() const -{ - return m_columnNumber; -} - -void QDeclarativeDebugFileReference::setColumnNumber(int c) -{ - m_columnNumber = c; -} - -QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference() - : m_objectDebugId(-1), m_hasNotifySignal(false) -{ -} - -QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &o) - : m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value), - m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding), - m_hasNotifySignal(o.m_hasNotifySignal) -{ -} - -QDeclarativeDebugPropertyReference &QDeclarativeDebugPropertyReference::operator=(const QDeclarativeDebugPropertyReference &o) -{ - m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value; - m_valueTypeName = o.m_valueTypeName; m_binding = o.m_binding; - m_hasNotifySignal = o.m_hasNotifySignal; - return *this; -} - -int QDeclarativeDebugPropertyReference::objectDebugId() const -{ - return m_objectDebugId; -} - -QString QDeclarativeDebugPropertyReference::name() const -{ - return m_name; -} - -QString QDeclarativeDebugPropertyReference::valueTypeName() const -{ - return m_valueTypeName; -} - -QVariant QDeclarativeDebugPropertyReference::value() const -{ - return m_value; -} - -QString QDeclarativeDebugPropertyReference::binding() const -{ - return m_binding; -} - -bool QDeclarativeDebugPropertyReference::hasNotifySignal() const -{ - return m_hasNotifySignal; -} - -QT_END_NAMESPACE - diff --git a/src/declarative/debugger/qdeclarativeenginedebug_p.h b/src/declarative/debugger/qdeclarativeenginedebug_p.h deleted file mode 100644 index 5ca2987da3..0000000000 --- a/src/declarative/debugger/qdeclarativeenginedebug_p.h +++ /dev/null @@ -1,397 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEENGINEDEBUG_H -#define QDECLARATIVEENGINEDEBUG_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qobject.h> -#include <QtCore/qurl.h> -#include <QtCore/qvariant.h> - -#include <private/qdeclarativeglobal_p.h> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QDeclarativeDebugConnection; -class QDeclarativeDebugWatch; -class QDeclarativeDebugPropertyWatch; -class QDeclarativeDebugObjectExpressionWatch; -class QDeclarativeDebugEnginesQuery; -class QDeclarativeDebugRootContextQuery; -class QDeclarativeDebugObjectQuery; -class QDeclarativeDebugExpressionQuery; -class QDeclarativeDebugPropertyReference; -class QDeclarativeDebugContextReference; -class QDeclarativeDebugObjectReference; -class QDeclarativeDebugFileReference; -class QDeclarativeDebugEngineReference; -class QDeclarativeEngineDebugPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEngineDebug : public QObject -{ - Q_OBJECT -public: - enum State { NotConnected, Unavailable, Enabled }; - - explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0); - ~QDeclarativeEngineDebug(); - - State state() const; - - QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &, - QObject *parent = 0); - QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugContextReference &, const QString &, - QObject *parent = 0); - QDeclarativeDebugObjectExpressionWatch *addWatch(const QDeclarativeDebugObjectReference &, const QString &, - QObject *parent = 0); - QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugObjectReference &, - QObject *parent = 0); - QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugFileReference &, - QObject *parent = 0); - - void removeWatch(QDeclarativeDebugWatch *watch); - - QDeclarativeDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0); - QDeclarativeDebugRootContextQuery *queryRootContexts(const QDeclarativeDebugEngineReference &, - QObject *parent = 0); - QDeclarativeDebugObjectQuery *queryObject(const QDeclarativeDebugObjectReference &, - QObject *parent = 0); - QDeclarativeDebugObjectQuery *queryObjectRecursive(const QDeclarativeDebugObjectReference &, - QObject *parent = 0); - QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId, - const QString &expr, - QObject *parent = 0); - bool setBindingForObject(int objectDebugId, const QString &propertyName, - const QVariant &bindingExpression, bool isLiteralValue, - QString source = QString(), int line = -1); - bool resetBindingForObject(int objectDebugId, const QString &propertyName); - bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody); - -Q_SIGNALS: - void newObjects(); - void stateChanged(State state); - -private: - Q_DECLARE_PRIVATE(QDeclarativeEngineDebug) -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugWatch : public QObject -{ - Q_OBJECT -public: - enum State { Waiting, Active, Inactive, Dead }; - - QDeclarativeDebugWatch(QObject *); - ~QDeclarativeDebugWatch(); - - int queryId() const; - int objectDebugId() const; - State state() const; - -Q_SIGNALS: - void stateChanged(QDeclarativeDebugWatch::State); - //void objectChanged(int, const QDeclarativeDebugObjectReference &); - //void valueChanged(int, const QVariant &); - - // Server sends value as string if it is a user-type variant - void valueChanged(const QByteArray &name, const QVariant &value); - -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - void setState(State); - State m_state; - int m_queryId; - QDeclarativeEngineDebug *m_client; - int m_objectDebugId; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyWatch : public QDeclarativeDebugWatch -{ - Q_OBJECT -public: - QDeclarativeDebugPropertyWatch(QObject *parent); - - QString name() const; - -private: - friend class QDeclarativeEngineDebug; - QString m_name; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectExpressionWatch : public QDeclarativeDebugWatch -{ - Q_OBJECT -public: - QDeclarativeDebugObjectExpressionWatch(QObject *parent); - - QString expression() const; - -private: - friend class QDeclarativeEngineDebug; - QString m_expr; - int m_debugId; -}; - - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugQuery : public QObject -{ - Q_OBJECT -public: - enum State { Waiting, Error, Completed }; - - State state() const; - bool isWaiting() const; - -Q_SIGNALS: - void stateChanged(QDeclarativeDebugQuery::State); - -protected: - QDeclarativeDebugQuery(QObject *); - -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - void setState(State); - State m_state; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugFileReference -{ -public: - QDeclarativeDebugFileReference(); - QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &); - QDeclarativeDebugFileReference &operator=(const QDeclarativeDebugFileReference &); - - QUrl url() const; - void setUrl(const QUrl &); - int lineNumber() const; - void setLineNumber(int); - int columnNumber() const; - void setColumnNumber(int); - -private: - friend class QDeclarativeEngineDebugPrivate; - QUrl m_url; - int m_lineNumber; - int m_columnNumber; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEngineReference -{ -public: - QDeclarativeDebugEngineReference(); - QDeclarativeDebugEngineReference(int); - QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &); - QDeclarativeDebugEngineReference &operator=(const QDeclarativeDebugEngineReference &); - - int debugId() const; - QString name() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_debugId; - QString m_name; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectReference -{ -public: - QDeclarativeDebugObjectReference(); - QDeclarativeDebugObjectReference(int); - QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &); - QDeclarativeDebugObjectReference &operator=(const QDeclarativeDebugObjectReference &); - - int debugId() const; - QString className() const; - QString idString() const; - QString name() const; - - QDeclarativeDebugFileReference source() const; - int contextDebugId() const; - - QList<QDeclarativeDebugPropertyReference> properties() const; - QList<QDeclarativeDebugObjectReference> children() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_debugId; - QString m_class; - QString m_idString; - QString m_name; - QDeclarativeDebugFileReference m_source; - int m_contextDebugId; - QList<QDeclarativeDebugPropertyReference> m_properties; - QList<QDeclarativeDebugObjectReference> m_children; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugContextReference -{ -public: - QDeclarativeDebugContextReference(); - QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &); - QDeclarativeDebugContextReference &operator=(const QDeclarativeDebugContextReference &); - - int debugId() const; - QString name() const; - - QList<QDeclarativeDebugObjectReference> objects() const; - QList<QDeclarativeDebugContextReference> contexts() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_debugId; - QString m_name; - QList<QDeclarativeDebugObjectReference> m_objects; - QList<QDeclarativeDebugContextReference> m_contexts; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyReference -{ -public: - QDeclarativeDebugPropertyReference(); - QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &); - QDeclarativeDebugPropertyReference &operator=(const QDeclarativeDebugPropertyReference &); - - int objectDebugId() const; - QString name() const; - QVariant value() const; - QString valueTypeName() const; - QString binding() const; - bool hasNotifySignal() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_objectDebugId; - QString m_name; - QVariant m_value; - QString m_valueTypeName; - QString m_binding; - bool m_hasNotifySignal; -}; - - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEnginesQuery : public QDeclarativeDebugQuery -{ - Q_OBJECT -public: - virtual ~QDeclarativeDebugEnginesQuery(); - QList<QDeclarativeDebugEngineReference> engines() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugEnginesQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QList<QDeclarativeDebugEngineReference> m_engines; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugRootContextQuery : public QDeclarativeDebugQuery -{ - Q_OBJECT -public: - virtual ~QDeclarativeDebugRootContextQuery(); - QDeclarativeDebugContextReference rootContext() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugRootContextQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QDeclarativeDebugContextReference m_context; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectQuery : public QDeclarativeDebugQuery -{ - Q_OBJECT -public: - virtual ~QDeclarativeDebugObjectQuery(); - QDeclarativeDebugObjectReference object() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugObjectQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QDeclarativeDebugObjectReference m_object; - -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugExpressionQuery : public QDeclarativeDebugQuery -{ - Q_OBJECT -public: - virtual ~QDeclarativeDebugExpressionQuery(); - QVariant expression() const; - QVariant result() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugExpressionQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QVariant m_expr; - QVariant m_result; -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QDeclarativeDebugEngineReference) -Q_DECLARE_METATYPE(QDeclarativeDebugObjectReference) -Q_DECLARE_METATYPE(QDeclarativeDebugContextReference) -Q_DECLARE_METATYPE(QDeclarativeDebugPropertyReference) - -QT_END_HEADER - -#endif // QDECLARATIVEENGINEDEBUG_H diff --git a/src/declarative/qml/parser/parser.pri b/src/declarative/qml/parser/parser.pri deleted file mode 100644 index 3ae0a6d8eb..0000000000 --- a/src/declarative/qml/parser/parser.pri +++ /dev/null @@ -1,19 +0,0 @@ -HEADERS += \ - $$PWD/qdeclarativejsast_p.h \ - $$PWD/qdeclarativejsastfwd_p.h \ - $$PWD/qdeclarativejsastvisitor_p.h \ - $$PWD/qdeclarativejsengine_p.h \ - $$PWD/qdeclarativejsgrammar_p.h \ - $$PWD/qdeclarativejslexer_p.h \ - $$PWD/qdeclarativejsmemorypool_p.h \ - $$PWD/qdeclarativejsparser_p.h \ - $$PWD/qdeclarativejsglobal_p.h \ - $$PWD/qdeclarativejskeywords_p.h - -SOURCES += \ - $$PWD/qdeclarativejsast.cpp \ - $$PWD/qdeclarativejsastvisitor.cpp \ - $$PWD/qdeclarativejsengine_p.cpp \ - $$PWD/qdeclarativejsgrammar.cpp \ - $$PWD/qdeclarativejslexer.cpp \ - $$PWD/qdeclarativejsparser.cpp diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h deleted file mode 100644 index 2d199b79e6..0000000000 --- a/src/declarative/qml/qdeclarative.h +++ /dev/null @@ -1,451 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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$ -** -****************************************************************************/ - -#ifndef QDECLARATIVE_H -#define QDECLARATIVE_H - -#include <QtDeclarative/qdeclarativeprivate.h> -#include <QtDeclarative/qdeclarativeparserstatus.h> -#include <QtDeclarative/qdeclarativepropertyvaluesource.h> -#include <QtDeclarative/qdeclarativelist.h> - -#include <QtCore/qbytearray.h> -#include <QtCore/qmetaobject.h> - -QT_BEGIN_HEADER - -#define QML_VERSION 0x020000 -#define QML_VERSION_STR "2.0" - -#define QML_DECLARE_TYPE(TYPE) \ - Q_DECLARE_METATYPE(TYPE *) \ - Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>) - -#define QML_DECLARE_TYPE_HASMETATYPE(TYPE) \ - Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>) - -#define QML_DECLARE_INTERFACE(INTERFACE) \ - QML_DECLARE_TYPE(INTERFACE) - -#define QML_DECLARE_INTERFACE_HASMETATYPE(INTERFACE) \ - QML_DECLARE_TYPE_HASMETATYPE(INTERFACE) - -enum { /* TYPEINFO flags */ - QML_HAS_ATTACHED_PROPERTIES = 0x01 -}; - -#define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \ -QT_BEGIN_NAMESPACE \ -template <> \ -class QDeclarativeTypeInfo<TYPE > \ -{ \ -public: \ - enum { \ - hasAttachedProperties = (((FLAGS) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) \ - }; \ -}; \ -QT_END_NAMESPACE - -QT_BEGIN_NAMESPACE - - -class QDeclarativePropertyValueInterceptor; - -template<typename T> -int qmlRegisterType() -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterType type = { - 0, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - 0, 0, - QString(), - - 0, 0, 0, 0, &T::staticMetaObject, - - QDeclarativePrivate::attachedPropertiesFunc<T>(), - QDeclarativePrivate::attachedPropertiesMetaObject<T>(), - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - 0, 0, - - 0, - 0 - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - -int Q_DECLARATIVE_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message); - -template<typename T> -int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason) -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterType type = { - 0, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - 0, 0, - reason, - - uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, - - QDeclarativePrivate::attachedPropertiesFunc<T>(), - QDeclarativePrivate::attachedPropertiesMetaObject<T>(), - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - 0, 0, - - 0, - 0 - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - -template<typename T> -int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterType type = { - 0, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - sizeof(T), QDeclarativePrivate::createInto<T>, - QString(), - - uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, - - QDeclarativePrivate::attachedPropertiesFunc<T>(), - QDeclarativePrivate::attachedPropertiesMetaObject<T>(), - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - 0, 0, - - 0, - 0 - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - -template<typename T, int metaObjectRevision> -int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterType type = { - 1, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - sizeof(T), QDeclarativePrivate::createInto<T>, - QString(), - - uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, - - QDeclarativePrivate::attachedPropertiesFunc<T>(), - QDeclarativePrivate::attachedPropertiesMetaObject<T>(), - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - 0, 0, - - 0, - metaObjectRevision - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - -template<typename T, int metaObjectRevision> -int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterType type = { - 1, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - sizeof(T), QDeclarativePrivate::createInto<T>, - QString(), - - uri, versionMajor, versionMinor, 0, &T::staticMetaObject, - - QDeclarativePrivate::attachedPropertiesFunc<T>(), - QDeclarativePrivate::attachedPropertiesMetaObject<T>(), - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - 0, 0, - - 0, - metaObjectRevision - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - - -template<typename T, typename E> -int qmlRegisterExtendedType() -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterType type = { - 0, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - 0, 0, - QString(), - - 0, 0, 0, 0, &T::staticMetaObject, - - QDeclarativePrivate::attachedPropertiesFunc<T>(), - QDeclarativePrivate::attachedPropertiesMetaObject<T>(), - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - QDeclarativePrivate::createParent<E>, &E::staticMetaObject, - - 0, - 0 - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - -template<typename T, typename E> -int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor, - const char *qmlName) -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativeAttachedPropertiesFunc attached = QDeclarativePrivate::attachedPropertiesFunc<E>(); - const QMetaObject * attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<E>(); - if (!attached) { - attached = QDeclarativePrivate::attachedPropertiesFunc<T>(); - attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<T>(); - } - - QDeclarativePrivate::RegisterType type = { - 0, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - sizeof(T), QDeclarativePrivate::createInto<T>, - QString(), - - uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, - - attached, - attachedMetaObject, - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - QDeclarativePrivate::createParent<E>, &E::staticMetaObject, - - 0, - 0 - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - -template<typename T> -int qmlRegisterInterface(const char *typeName) -{ - QByteArray name(typeName); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterInterface qmlInterface = { - 0, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - - qobject_interface_iid<T *>() - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::InterfaceRegistration, &qmlInterface); -} - -template<typename T> -int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, - const char *qmlName, QDeclarativeCustomParser *parser) -{ - QByteArray name(T::staticMetaObject.className()); - - QByteArray pointerName(name + '*'); - QByteArray listName("QDeclarativeListProperty<" + name + ">"); - - QDeclarativePrivate::RegisterType type = { - 0, - - qRegisterMetaType<T *>(pointerName.constData()), - qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), - sizeof(T), QDeclarativePrivate::createInto<T>, - QString(), - - uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, - - QDeclarativePrivate::attachedPropertiesFunc<T>(), - QDeclarativePrivate::attachedPropertiesMetaObject<T>(), - - QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), - QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), - - 0, 0, - - parser, - 0 - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); -} - -class QDeclarativeContext; -class QDeclarativeEngine; -class QJSValue; -class QJSEngine; -Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *); -Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *); -Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *); -Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true); -Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create); - -template<typename T> -QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true) -{ - static int idx = -1; - return qmlAttachedPropertiesObject(&idx, obj, &T::staticMetaObject, create); -} - -// For the use of QtQuick1 module -Q_DECLARATIVE_EXPORT void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor); - -inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, - QJSValue (*callback)(QDeclarativeEngine *, QJSEngine *)) -{ - QDeclarativePrivate::RegisterModuleApi api = { - 0, - - uri, versionMajor, versionMinor, - - callback, 0 - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::ModuleApiRegistration, &api); -} - -inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, - QObject *(*callback)(QDeclarativeEngine *, QJSEngine *)) -{ - QDeclarativePrivate::RegisterModuleApi api = { - 0, - - uri, versionMajor, versionMinor, - - 0, callback - }; - - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::ModuleApiRegistration, &api); -} - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QObject) -Q_DECLARE_METATYPE(QVariant) - -QT_END_HEADER - -#endif // QDECLARATIVE_H diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h deleted file mode 100644 index 637cd80569..0000000000 --- a/src/declarative/qml/qdeclarativecompiler_p.h +++ /dev/null @@ -1,466 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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$ -** -****************************************************************************/ - -#ifndef QDECLARATIVECOMPILER_P_H -#define QDECLARATIVECOMPILER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qdeclarative.h" -#include "qdeclarativeerror.h" -#include <private/qv8_p.h> -#include "qdeclarativeinstruction_p.h" -#include "qdeclarativescript_p.h" -#include "qdeclarativeengine_p.h" -#include <private/qbitfield_p.h> -#include "qdeclarativepropertycache_p.h" -#include "qdeclarativeintegercache_p.h" -#include "qdeclarativetypenamecache_p.h" -#include "qdeclarativetypeloader_p.h" - -#include <QtCore/qbytearray.h> -#include <QtCore/qset.h> -#include <QtCore/QCoreApplication> - -QT_BEGIN_NAMESPACE - -class QDeclarativeEngine; -class QDeclarativeComponent; -class QDeclarativeContext; -class QDeclarativeContextData; - -class Q_AUTOTEST_EXPORT QDeclarativeCompiledData : public QDeclarativeRefCount, - public QDeclarativeCleanup -{ -public: - QDeclarativeCompiledData(QDeclarativeEngine *engine); - virtual ~QDeclarativeCompiledData(); - - QDeclarativeEngine *engine; - - QString name; - QUrl url; - QDeclarativeTypeNameCache *importCache; - - struct TypeReference - { - TypeReference() - : type(0), typePropertyCache(0), component(0) {} - - QString className; - QDeclarativeType *type; - QDeclarativePropertyCache *typePropertyCache; - QDeclarativeCompiledData *component; - - const QMetaObject *metaObject() const; - QDeclarativePropertyCache *propertyCache() const; - QDeclarativePropertyCache *createPropertyCache(QDeclarativeEngine *); - }; - QList<TypeReference> types; - - struct V8Program { - V8Program(const QByteArray &p, QDeclarativeCompiledData *c) - : program(p), cdata(c) {} - - QByteArray program; - v8::Persistent<v8::Array> bindings; - QDeclarativeCompiledData *cdata; - }; - - QList<V8Program> programs; - - const QMetaObject *root; - QAbstractDynamicMetaObject rootData; - QDeclarativePropertyCache *rootPropertyCache; - QList<QString> primitives; - QList<QByteArray> datas; - QByteArray bytecode; - QList<QDeclarativePropertyCache *> propertyCaches; - QList<QDeclarativeIntegerCache *> contextCaches; - QList<QDeclarativeScriptData *> scripts; - QList<QUrl> urls; - - struct Instruction { -#define QML_INSTR_DATA_TYPEDEF(I, FMT) typedef QDeclarativeInstructionData<QDeclarativeInstruction::I> I; - FOR_EACH_QML_INSTR(QML_INSTR_DATA_TYPEDEF) -#undef QML_INSTR_DATA_TYPEDEF - private: - Instruction(); - }; - - void dumpInstructions(); - - template <int Instr> - int addInstruction(const QDeclarativeInstructionData<Instr> &data) - { - QDeclarativeInstruction genericInstr; - QDeclarativeInstructionMeta<Instr>::setData(genericInstr, data); - return addInstructionHelper(static_cast<QDeclarativeInstruction::Type>(Instr), genericInstr); - } - int nextInstructionIndex(); - QDeclarativeInstruction *instruction(int index); - QDeclarativeInstruction::Type instructionType(const QDeclarativeInstruction *instr); - - bool isInitialized() const { return hasEngine(); } - void initialize(QDeclarativeEngine *); - -protected: - virtual void destroy(); // From QDeclarativeRefCount - virtual void clear(); // From QDeclarativeCleanup - -private: - friend class QDeclarativeCompiler; - - int addInstructionHelper(QDeclarativeInstruction::Type type, QDeclarativeInstruction &instr); - void dump(QDeclarativeInstruction *, int idx = -1); - QDeclarativeCompiledData(const QDeclarativeCompiledData &other); - QDeclarativeCompiledData &operator=(const QDeclarativeCompiledData &other); - QByteArray packData; - int pack(const char *, size_t); - - int indexForString(const QString &); - int indexForByteArray(const QByteArray &); - int indexForUrl(const QUrl &); -}; - -namespace QDeclarativeCompilerTypes { - struct BindingContext - { - BindingContext() - : stack(0), owner(0), object(0) {} - BindingContext(QDeclarativeScript::Object *o) - : stack(0), owner(0), object(o) {} - BindingContext incr() const { - BindingContext rv(object); - rv.stack = stack + 1; - return rv; - } - bool isSubContext() const { return stack != 0; } - int stack; - int owner; - QDeclarativeScript::Object *object; - }; - - struct BindingReference - { - enum DataType { QtScript, V4, V8, - Tr, TrId }; - DataType dataType; - }; - - struct JSBindingReference : public QDeclarativePool::Class, - public BindingReference - { - JSBindingReference() : nextReference(0) {} - - QDeclarativeScript::Variant expression; - QDeclarativeScript::Property *property; - QDeclarativeScript::Value *value; - - int compiledIndex; - - QString rewrittenExpression; - BindingContext bindingContext; - - JSBindingReference *nextReference; - }; - - struct TrBindingReference : public QDeclarativePool::POD, - public BindingReference - { - QStringRef text; - QStringRef comment; - int n; - }; - - struct IdList : public QFieldList<QDeclarativeScript::Object, - &QDeclarativeScript::Object::nextIdObject> - { - QDeclarativeScript::Object *value(const QString &id) const { - for (QDeclarativeScript::Object *o = first(); o; o = next(o)) { - if (o->id == id) - return o; - } - return 0; - } - }; - - struct DepthStack { - DepthStack() : _depth(0), _maxDepth(0) {} - DepthStack(const DepthStack &o) : _depth(o._depth), _maxDepth(o._maxDepth) {} - DepthStack &operator=(const DepthStack &o) { _depth = o._depth; _maxDepth = o._maxDepth; return *this; } - - int depth() const { return _depth; } - int maxDepth() const { return _maxDepth; } - - void push() { ++_depth; _maxDepth = qMax(_depth, _maxDepth); } - void pop() { --_depth; Q_ASSERT(_depth >= 0); Q_ASSERT(_maxDepth > _depth); } - - void pushPop(int count) { _maxDepth = qMax(_depth + count, _maxDepth); } - private: - int _depth; - int _maxDepth; - }; - - // Contains all the incremental compiler state about a component. As - // a single QML file can have multiple components defined, there may be - // more than one of these for each compile - struct ComponentCompileState : public QDeclarativePool::Class - { - ComponentCompileState() - : parserStatusCount(0), totalBindingsCount(0), pushedProperties(0), nested(false), - v8BindingProgramLine(-1), root(0) {} - - IdList ids; - int parserStatusCount; - int totalBindingsCount; - int pushedProperties; - bool nested; - - QByteArray compiledBindingData; - QByteArray v8BindingProgram; - int v8BindingProgramLine; - - DepthStack objectDepth; - DepthStack listDepth; - - typedef QDeclarativeCompilerTypes::JSBindingReference B; - typedef QFieldList<B, &B::nextReference> JSBindingReferenceList; - JSBindingReferenceList bindings; - typedef QDeclarativeScript::Object O; - typedef QFieldList<O, &O::nextAliasingObject> AliasingObjectsList; - AliasingObjectsList aliasingObjects; - QDeclarativeScript::Object *root; - }; -}; - -class QMetaObjectBuilder; -class Q_AUTOTEST_EXPORT QDeclarativeCompiler -{ - Q_DECLARE_TR_FUNCTIONS(QDeclarativeCompiler) -public: - QDeclarativeCompiler(QDeclarativePool *); - - bool compile(QDeclarativeEngine *, QDeclarativeTypeData *, QDeclarativeCompiledData *); - - bool isError() const; - QList<QDeclarativeError> errors() const; - - static bool isAttachedPropertyName(const QString &); - static bool isSignalPropertyName(const QString &); - static bool isAttachedPropertyName(const QHashedStringRef &); - static bool isSignalPropertyName(const QHashedStringRef &); - - int evaluateEnum(const QByteArray& script) const; // for QDeclarativeCustomParser::evaluateEnum - const QMetaObject *resolveType(const QString& name) const; // for QDeclarativeCustomParser::resolveType - int rewriteBinding(const QDeclarativeScript::Variant& value, const QString& name); // for QDeclarativeCustomParser::rewriteBinding - QString rewriteSignalHandler(const QDeclarativeScript::Variant& value, const QString &name); // for QDeclarativeCustomParser::rewriteSignalHandler - -private: - typedef QDeclarativeCompiledData::Instruction Instruction; - - static void reset(QDeclarativeCompiledData *); - - void compileTree(QDeclarativeScript::Object *tree); - - - bool buildObject(QDeclarativeScript::Object *obj, const QDeclarativeCompilerTypes::BindingContext &); - bool buildComponent(QDeclarativeScript::Object *obj, const QDeclarativeCompilerTypes::BindingContext &); - bool buildSubObject(QDeclarativeScript::Object *obj, const QDeclarativeCompilerTypes::BindingContext &); - bool buildSignal(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &); - bool buildProperty(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &); - bool buildPropertyInNamespace(QDeclarativeImportedNamespace *ns, - QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &); - bool buildIdProperty(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj); - bool buildAttachedProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildGroupedProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildValueTypeProperty(QObject *type, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Object *baseObj, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildListProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildScriptStringProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildPropertyAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildPropertyObjectAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Value *value, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildPropertyOnAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Object *baseObj, - QDeclarativeScript::Value *value, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildPropertyLiteralAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Value *value, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool doesPropertyExist(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj); - bool testLiteralAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Value *value); - bool testQualifiedEnumAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Value *value, - bool *isAssignment); - enum DynamicMetaMode { IgnoreAliases, ResolveAliases, ForceCreation }; - bool mergeDynamicMetaProperties(QDeclarativeScript::Object *obj); - bool buildDynamicMeta(QDeclarativeScript::Object *obj, DynamicMetaMode mode); - bool checkDynamicMeta(QDeclarativeScript::Object *obj); - bool buildBinding(QDeclarativeScript::Value *, QDeclarativeScript::Property *prop, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildLiteralBinding(QDeclarativeScript::Value *, QDeclarativeScript::Property *prop, - const QDeclarativeCompilerTypes::BindingContext &ctxt); - bool buildComponentFromRoot(QDeclarativeScript::Object *obj, const QDeclarativeCompilerTypes::BindingContext &); - bool compileAlias(QFastMetaBuilder &, - QByteArray &data, - QDeclarativeScript::Object *obj, - int propIndex, int aliasIndex, - QDeclarativeScript::Object::DynamicProperty &); - bool completeComponentBuild(); - bool checkValidId(QDeclarativeScript::Value *, const QString &); - - - void genObject(QDeclarativeScript::Object *obj); - void genObjectBody(QDeclarativeScript::Object *obj); - void genValueTypeProperty(QDeclarativeScript::Object *obj,QDeclarativeScript::Property *); - void genComponent(QDeclarativeScript::Object *obj); - void genValueProperty(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj); - void genListProperty(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj); - void genPropertyAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Property *valueTypeProperty = 0); - void genLiteralAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Value *value); - void genBindingAssignment(QDeclarativeScript::Value *binding, - QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Property *valueTypeProperty = 0); - int genContextCache(); - - QDeclarativePropertyData genValueTypeData(QDeclarativeScript::Property *prop, - QDeclarativeScript::Property *valueTypeProp); - - int componentTypeRef(); - int translationContextIndex(); - - static QDeclarativeType *toQmlType(QDeclarativeScript::Object *from); - bool canCoerce(int to, QDeclarativeScript::Object *from); - - QString elementName(QDeclarativeScript::Object *); - - QStringList deferredProperties(QDeclarativeScript::Object *); - - QDeclarativePropertyData *property(QDeclarativeScript::Object *, int); - QDeclarativePropertyData *property(QDeclarativeScript::Object *, const QHashedStringRef &, - bool *notInRevision = 0); - QDeclarativePropertyData *signal(QDeclarativeScript::Object *, const QHashedStringRef &, - bool *notInRevision = 0); - int indexOfProperty(QDeclarativeScript::Object *, const QHashedStringRef &, bool *notInRevision = 0); - int indexOfProperty(QDeclarativeScript::Object *, const QString &, bool *notInRevision = 0); - int indexOfSignal(QDeclarativeScript::Object *, const QString &, bool *notInRevision = 0); - - void addId(const QString &, QDeclarativeScript::Object *); - - void dumpStats(); - - void addBindingReference(QDeclarativeCompilerTypes::JSBindingReference *); - - QDeclarativeCompilerTypes::ComponentCompileState *compileState; - - QDeclarativePool *pool; - - QDeclarativeCompilerTypes::ComponentCompileState *componentState(QDeclarativeScript::Object *); - void saveComponentState(); - - QList<QDeclarativeError> exceptions; - QDeclarativeCompiledData *output; - QDeclarativeEngine *engine; - QDeclarativeEnginePrivate *enginePrivate; - QDeclarativeScript::Object *unitRoot; - QDeclarativeTypeData *unit; - int cachedComponentTypeRef; - int cachedTranslationContextIndex; - - // Compiler component statistics. Only collected if QML_COMPILER_STATS=1 - struct ComponentStat - { - ComponentStat() : ids(0), objects(0) {} - - int lineNumber; - - int ids; - QList<QDeclarativeScript::LocationSpan> scriptBindings; - QList<QDeclarativeScript::LocationSpan> optimizedBindings; - int objects; - }; - struct ComponentStats : public QDeclarativePool::Class - { - ComponentStat componentStat; - QList<ComponentStat> savedComponentStats; - }; - ComponentStats *componentStats; -}; - -QT_END_NAMESPACE - -#endif // QDECLARATIVECOMPILER_P_H diff --git a/src/declarative/qml/qdeclarativeextensioninterface.h b/src/declarative/qml/qdeclarativeextensioninterface.h deleted file mode 100644 index fcfaa7c402..0000000000 --- a/src/declarative/qml/qdeclarativeextensioninterface.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEEXTENSIONINTERFACE_H -#define QDECLARATIVEEXTENSIONINTERFACE_H - -#include <QtCore/qobject.h> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QDeclarativeEngine; - -class Q_DECLARATIVE_EXPORT QDeclarativeTypesExtensionInterface -{ -public: - virtual ~QDeclarativeTypesExtensionInterface() {} - virtual void registerTypes(const char *uri) = 0; -}; - -class Q_DECLARATIVE_EXPORT QDeclarativeExtensionInterface : public QDeclarativeTypesExtensionInterface -{ -public: - virtual ~QDeclarativeExtensionInterface() {} - virtual void initializeEngine(QDeclarativeEngine *engine, const char *uri) = 0; -}; - -Q_DECLARE_INTERFACE(QDeclarativeTypesExtensionInterface, "org.qt-project.Qt.QDeclarativeTypesExtensionInterface/1.0") -Q_DECLARE_INTERFACE(QDeclarativeExtensionInterface, "org.qt-project.Qt.QDeclarativeExtensionInterface/1.0") - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEEXTENSIONINTERFACE_H diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h deleted file mode 100644 index edd56df1a3..0000000000 --- a/src/declarative/qml/qdeclarativeinfo.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEINFO_H -#define QDECLARATIVEINFO_H - -#include <QtCore/qdebug.h> -#include <QtCore/qurl.h> -#include <QtDeclarative/qdeclarativeerror.h> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QDeclarativeInfoPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeInfo : public QDebug -{ -public: - QDeclarativeInfo(const QDeclarativeInfo &); - ~QDeclarativeInfo(); - - inline QDeclarativeInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(bool t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(char t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(signed short t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(unsigned short t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(signed int t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(unsigned int t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(signed long t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(unsigned long t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(qint64 t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(quint64 t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(float t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(double t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(const char* t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(const QString & t) { QDebug::operator<<(t.toLocal8Bit().constData()); return *this; } - inline QDeclarativeInfo &operator<<(const QStringRef & t) { return operator<<(t.toString()); } - inline QDeclarativeInfo &operator<<(const QLatin1String &t) { QDebug::operator<<(t.latin1()); return *this; } - inline QDeclarativeInfo &operator<<(const QByteArray & t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; } - inline QDeclarativeInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; } - inline QDeclarativeInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; } -#ifndef QT_NO_DEBUG_STREAM - inline QDeclarativeInfo &operator<<(const QUrl &t) { static_cast<QDebug &>(*this) << t; return *this; } -#endif - -private: - friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); - friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); - friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList<QDeclarativeError> &errors); - - QDeclarativeInfo(QDeclarativeInfoPrivate *); - QDeclarativeInfoPrivate *d; -}; - -Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); -Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); -Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList<QDeclarativeError> &errors); - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEINFO_H diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri deleted file mode 100644 index 8b03028c34..0000000000 --- a/src/declarative/qml/qml.pri +++ /dev/null @@ -1,125 +0,0 @@ -SOURCES += \ - $$PWD/qdeclarativeapplication.cpp \ - $$PWD/qdeclarativeinstruction.cpp \ - $$PWD/qdeclarativelistmodel.cpp \ - $$PWD/qdeclarativelistmodelworkeragent.cpp \ - $$PWD/qdeclarativeopenmetaobject.cpp \ - $$PWD/qdeclarativevmemetaobject.cpp \ - $$PWD/qdeclarativeengine.cpp \ - $$PWD/qdeclarativeexpression.cpp \ - $$PWD/qdeclarativebinding.cpp \ - $$PWD/qdeclarativeproperty.cpp \ - $$PWD/qdeclarativecomponent.cpp \ - $$PWD/qdeclarativeincubator.cpp \ - $$PWD/qdeclarativecontext.cpp \ - $$PWD/qdeclarativecustomparser.cpp \ - $$PWD/qdeclarativepropertyvaluesource.cpp \ - $$PWD/qdeclarativepropertyvalueinterceptor.cpp \ - $$PWD/qdeclarativeproxymetaobject.cpp \ - $$PWD/qdeclarativevme.cpp \ - $$PWD/qdeclarativecompiler.cpp \ - $$PWD/qdeclarativecompileddata.cpp \ - $$PWD/qdeclarativeboundsignal.cpp \ - $$PWD/qdeclarativemetatype.cpp \ - $$PWD/qdeclarativestringconverters.cpp \ - $$PWD/qdeclarativeparserstatus.cpp \ - $$PWD/qdeclarativetypeloader.cpp \ - $$PWD/qdeclarativeinfo.cpp \ - $$PWD/qdeclarativeerror.cpp \ - $$PWD/qdeclarativescript.cpp \ - $$PWD/qdeclarativerewrite.cpp \ - $$PWD/qdeclarativevaluetype.cpp \ - $$PWD/qdeclarativeaccessors.cpp \ - $$PWD/qdeclarativexmlhttprequest.cpp \ - $$PWD/qdeclarativewatcher.cpp \ - $$PWD/qdeclarativecleanup.cpp \ - $$PWD/qdeclarativepropertycache.cpp \ - $$PWD/qdeclarativenotifier.cpp \ - $$PWD/qdeclarativeintegercache.cpp \ - $$PWD/qdeclarativetypenotavailable.cpp \ - $$PWD/qdeclarativetypenamecache.cpp \ - $$PWD/qdeclarativescriptstring.cpp \ - $$PWD/qdeclarativeworkerscript.cpp \ - $$PWD/qdeclarativeimageprovider.cpp \ - $$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \ - $$PWD/qdeclarativedirparser.cpp \ - $$PWD/qdeclarativeextensionplugin.cpp \ - $$PWD/qdeclarativeimport.cpp \ - $$PWD/qdeclarativelist.cpp \ - $$PWD/qdeclarativelocale.cpp \ - $$PWD/qlistmodelinterface.cpp - -HEADERS += \ - $$PWD/qdeclarativeglobal_p.h \ - $$PWD/qdeclarativeinstruction_p.h \ - $$PWD/qdeclarativelistmodel_p.h\ - $$PWD/qdeclarativelistmodel_p_p.h\ - $$PWD/qdeclarativelistmodelworkeragent_p.h \ - $$PWD/qdeclarativeopenmetaobject_p.h \ - $$PWD/qdeclarativevmemetaobject_p.h \ - $$PWD/qdeclarative.h \ - $$PWD/qdeclarativeapplication_p.h \ - $$PWD/qdeclarativebinding_p.h \ - $$PWD/qdeclarativebinding_p_p.h \ - $$PWD/qdeclarativeproperty.h \ - $$PWD/qdeclarativecomponent.h \ - $$PWD/qdeclarativecomponent_p.h \ - $$PWD/qdeclarativeincubator.h \ - $$PWD/qdeclarativeincubator_p.h \ - $$PWD/qdeclarativecustomparser_p.h \ - $$PWD/qdeclarativecustomparser_p_p.h \ - $$PWD/qdeclarativepropertyvaluesource.h \ - $$PWD/qdeclarativepropertyvalueinterceptor_p.h \ - $$PWD/qdeclarativeboundsignal_p.h \ - $$PWD/qdeclarativeparserstatus.h \ - $$PWD/qdeclarativeproxymetaobject_p.h \ - $$PWD/qdeclarativevme_p.h \ - $$PWD/qdeclarativecompiler_p.h \ - $$PWD/qdeclarativeengine_p.h \ - $$PWD/qdeclarativeexpression_p.h \ - $$PWD/qdeclarativeprivate.h \ - $$PWD/qdeclarativemetatype_p.h \ - $$PWD/qdeclarativeengine.h \ - $$PWD/qdeclarativecontext.h \ - $$PWD/qdeclarativeexpression.h \ - $$PWD/qdeclarativestringconverters_p.h \ - $$PWD/qdeclarativeinfo.h \ - $$PWD/qdeclarativeproperty_p.h \ - $$PWD/qdeclarativecontext_p.h \ - $$PWD/qdeclarativetypeloader_p.h \ - $$PWD/qdeclarativelist.h \ - $$PWD/qdeclarativelist_p.h \ - $$PWD/qdeclarativedata_p.h \ - $$PWD/qdeclarativeerror.h \ - $$PWD/qdeclarativescript_p.h \ - $$PWD/qdeclarativerewrite_p.h \ - $$PWD/qdeclarativevaluetype_p.h \ - $$PWD/qdeclarativeaccessors_p.h \ - $$PWD/qdeclarativexmlhttprequest_p.h \ - $$PWD/qdeclarativewatcher_p.h \ - $$PWD/qdeclarativecleanup_p.h \ - $$PWD/qdeclarativepropertycache_p.h \ - $$PWD/qdeclarativenotifier_p.h \ - $$PWD/qdeclarativeintegercache_p.h \ - $$PWD/qdeclarativetypenotavailable_p.h \ - $$PWD/qdeclarativetypenamecache_p.h \ - $$PWD/qdeclarativescriptstring.h \ - $$PWD/qdeclarativeworkerscript_p.h \ - $$PWD/qdeclarativeguard_p.h \ - $$PWD/qdeclarativeimageprovider.h \ - $$PWD/qdeclarativenetworkaccessmanagerfactory.h \ - $$PWD/qdeclarativedirparser_p.h \ - $$PWD/qdeclarativeextensioninterface.h \ - $$PWD/qdeclarativeimport_p.h \ - $$PWD/qdeclarativeextensionplugin.h \ - $$PWD/qdeclarativenullablevalue_p_p.h \ - $$PWD/qdeclarativescriptstring_p.h \ - $$PWD/qdeclarativelocale_p.h \ - $$PWD/qlistmodelinterface_p.h \ - $$PWD/qdeclarativecomponentattached_p.h - -include(parser/parser.pri) -include(rewriter/rewriter.pri) -include(ftw/ftw.pri) -include(v4/v4.pri) -include(v8/v8.pri) diff --git a/src/declarative/qml/v4/qv4irbuilder_p.h b/src/declarative/qml/v4/qv4irbuilder_p.h deleted file mode 100644 index c0c7ff874c..0000000000 --- a/src/declarative/qml/v4/qv4irbuilder_p.h +++ /dev/null @@ -1,240 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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$ -** -****************************************************************************/ - -#ifndef QV4IRBUILDER_P_H -#define QV4IRBUILDER_P_H - -#include <QtCore/qglobal.h> - -#include "qv4ir_p.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QV4IRBuilder : public QDeclarativeJS::AST::Visitor -{ -public: - QV4IRBuilder(const QV4Compiler::Expression *, QDeclarativeEnginePrivate *); - - bool operator()(QDeclarativeJS::IR::Function *, QDeclarativeJS::AST::Node *); - -protected: - struct ExprResult { - enum Format { - ex, // expression - cx // condition - }; - - QDeclarativeJS::IR::Expr *code; - QDeclarativeJS::IR::BasicBlock *iftrue; - QDeclarativeJS::IR::BasicBlock *iffalse; - Format hint; // requested format - Format format; // instruction format - - ExprResult(QDeclarativeJS::IR::Expr *expr = 0) - : code(expr), iftrue(0), iffalse(0), hint(ex), format(ex) {} - - ExprResult(QDeclarativeJS::IR::BasicBlock *iftrue, QDeclarativeJS::IR::BasicBlock *iffalse) - : code(0), iftrue(iftrue), iffalse(iffalse), hint(cx), format(ex) {} - - inline QDeclarativeJS::IR::Type type() const { return code ? code->type : QDeclarativeJS::IR::InvalidType; } - - inline QDeclarativeJS::IR::Expr *get() const { return code; } - inline operator QDeclarativeJS::IR::Expr *() const { return get(); } - inline QDeclarativeJS::IR::Expr *operator->() const { return get(); } - inline bool isValid() const { return code ? code->type != QDeclarativeJS::IR::InvalidType : false; } - inline bool is(QDeclarativeJS::IR::Type t) const { return type() == t; } - inline bool isNot(QDeclarativeJS::IR::Type t) const { return type() != t; } - - bool isPrimitive() const { - switch (type()) { - case QDeclarativeJS::IR::UndefinedType: // ### TODO - case QDeclarativeJS::IR::NullType: // ### TODO - case QDeclarativeJS::IR::UrlType: // ### TODO - return false; - - case QDeclarativeJS::IR::StringType: - case QDeclarativeJS::IR::BoolType: - case QDeclarativeJS::IR::IntType: - case QDeclarativeJS::IR::RealType: - case QDeclarativeJS::IR::RealNaNType: - return true; - - default: - return false; - } // switch - } - }; - - inline void accept(QDeclarativeJS::AST::Node *ast) { QDeclarativeJS::AST::Node::accept(ast, this); } - - ExprResult expression(QDeclarativeJS::AST::ExpressionNode *ast); - ExprResult statement(QDeclarativeJS::AST::Statement *ast); - void sourceElement(QDeclarativeJS::AST::SourceElement *ast); - void condition(QDeclarativeJS::AST::ExpressionNode *ast, QDeclarativeJS::IR::BasicBlock *iftrue, QDeclarativeJS::IR::BasicBlock *iffalse); - void binop(QDeclarativeJS::AST::BinaryExpression *ast, ExprResult left, ExprResult right); - - void implicitCvt(ExprResult &expr, QDeclarativeJS::IR::Type type); - - virtual bool preVisit(QDeclarativeJS::AST::Node *ast); - - // QML - virtual bool visit(QDeclarativeJS::AST::UiProgram *ast); - virtual bool visit(QDeclarativeJS::AST::UiImportList *ast); - virtual bool visit(QDeclarativeJS::AST::UiImport *ast); - virtual bool visit(QDeclarativeJS::AST::UiPublicMember *ast); - virtual bool visit(QDeclarativeJS::AST::UiSourceElement *ast); - virtual bool visit(QDeclarativeJS::AST::UiObjectDefinition *ast); - virtual bool visit(QDeclarativeJS::AST::UiObjectInitializer *ast); - virtual bool visit(QDeclarativeJS::AST::UiObjectBinding *ast); - virtual bool visit(QDeclarativeJS::AST::UiScriptBinding *ast); - virtual bool visit(QDeclarativeJS::AST::UiArrayBinding *ast); - virtual bool visit(QDeclarativeJS::AST::UiObjectMemberList *ast); - virtual bool visit(QDeclarativeJS::AST::UiArrayMemberList *ast); - virtual bool visit(QDeclarativeJS::AST::UiQualifiedId *ast); - - // JS - virtual bool visit(QDeclarativeJS::AST::Program *ast); - virtual bool visit(QDeclarativeJS::AST::SourceElements *ast); - virtual bool visit(QDeclarativeJS::AST::FunctionSourceElement *ast); - virtual bool visit(QDeclarativeJS::AST::StatementSourceElement *ast); - - // object literals - virtual bool visit(QDeclarativeJS::AST::PropertyNameAndValueList *ast); - virtual bool visit(QDeclarativeJS::AST::IdentifierPropertyName *ast); - virtual bool visit(QDeclarativeJS::AST::StringLiteralPropertyName *ast); - virtual bool visit(QDeclarativeJS::AST::NumericLiteralPropertyName *ast); - - // array literals - virtual bool visit(QDeclarativeJS::AST::ElementList *ast); - virtual bool visit(QDeclarativeJS::AST::Elision *ast); - - // function calls - virtual bool visit(QDeclarativeJS::AST::ArgumentList *ast); - - // expressions - virtual bool visit(QDeclarativeJS::AST::ObjectLiteral *ast); - virtual bool visit(QDeclarativeJS::AST::ArrayLiteral *ast); - virtual bool visit(QDeclarativeJS::AST::ThisExpression *ast); - virtual bool visit(QDeclarativeJS::AST::IdentifierExpression *ast); - virtual bool visit(QDeclarativeJS::AST::NullExpression *ast); - virtual bool visit(QDeclarativeJS::AST::TrueLiteral *ast); - virtual bool visit(QDeclarativeJS::AST::FalseLiteral *ast); - virtual bool visit(QDeclarativeJS::AST::StringLiteral *ast); - virtual bool visit(QDeclarativeJS::AST::NumericLiteral *ast); - virtual bool visit(QDeclarativeJS::AST::RegExpLiteral *ast); - virtual bool visit(QDeclarativeJS::AST::NestedExpression *ast); - virtual bool visit(QDeclarativeJS::AST::ArrayMemberExpression *ast); - virtual bool visit(QDeclarativeJS::AST::FieldMemberExpression *ast); - virtual bool visit(QDeclarativeJS::AST::NewMemberExpression *ast); - virtual bool visit(QDeclarativeJS::AST::NewExpression *ast); - virtual bool visit(QDeclarativeJS::AST::CallExpression *ast); - virtual bool visit(QDeclarativeJS::AST::PostIncrementExpression *ast); - virtual bool visit(QDeclarativeJS::AST::PostDecrementExpression *ast); - virtual bool visit(QDeclarativeJS::AST::DeleteExpression *ast); - virtual bool visit(QDeclarativeJS::AST::VoidExpression *ast); - virtual bool visit(QDeclarativeJS::AST::TypeOfExpression *ast); - virtual bool visit(QDeclarativeJS::AST::PreIncrementExpression *ast); - virtual bool visit(QDeclarativeJS::AST::PreDecrementExpression *ast); - virtual bool visit(QDeclarativeJS::AST::UnaryPlusExpression *ast); - virtual bool visit(QDeclarativeJS::AST::UnaryMinusExpression *ast); - virtual bool visit(QDeclarativeJS::AST::TildeExpression *ast); - virtual bool visit(QDeclarativeJS::AST::NotExpression *ast); - virtual bool visit(QDeclarativeJS::AST::BinaryExpression *ast); - virtual bool visit(QDeclarativeJS::AST::ConditionalExpression *ast); - virtual bool visit(QDeclarativeJS::AST::Expression *ast); - - // statements - virtual bool visit(QDeclarativeJS::AST::Block *ast); - virtual bool visit(QDeclarativeJS::AST::StatementList *ast); - virtual bool visit(QDeclarativeJS::AST::VariableStatement *ast); - virtual bool visit(QDeclarativeJS::AST::VariableDeclarationList *ast); - virtual bool visit(QDeclarativeJS::AST::VariableDeclaration *ast); - virtual bool visit(QDeclarativeJS::AST::EmptyStatement *ast); - virtual bool visit(QDeclarativeJS::AST::ExpressionStatement *ast); - virtual bool visit(QDeclarativeJS::AST::IfStatement *ast); - virtual bool visit(QDeclarativeJS::AST::DoWhileStatement *ast); - virtual bool visit(QDeclarativeJS::AST::WhileStatement *ast); - virtual bool visit(QDeclarativeJS::AST::ForStatement *ast); - virtual bool visit(QDeclarativeJS::AST::LocalForStatement *ast); - virtual bool visit(QDeclarativeJS::AST::ForEachStatement *ast); - virtual bool visit(QDeclarativeJS::AST::LocalForEachStatement *ast); - virtual bool visit(QDeclarativeJS::AST::ContinueStatement *ast); - virtual bool visit(QDeclarativeJS::AST::BreakStatement *ast); - virtual bool visit(QDeclarativeJS::AST::ReturnStatement *ast); - virtual bool visit(QDeclarativeJS::AST::WithStatement *ast); - virtual bool visit(QDeclarativeJS::AST::SwitchStatement *ast); - virtual bool visit(QDeclarativeJS::AST::CaseBlock *ast); - virtual bool visit(QDeclarativeJS::AST::CaseClauses *ast); - virtual bool visit(QDeclarativeJS::AST::CaseClause *ast); - virtual bool visit(QDeclarativeJS::AST::DefaultClause *ast); - virtual bool visit(QDeclarativeJS::AST::LabelledStatement *ast); - virtual bool visit(QDeclarativeJS::AST::ThrowStatement *ast); - virtual bool visit(QDeclarativeJS::AST::TryStatement *ast); - virtual bool visit(QDeclarativeJS::AST::Catch *ast); - virtual bool visit(QDeclarativeJS::AST::Finally *ast); - virtual bool visit(QDeclarativeJS::AST::FunctionDeclaration *ast); - virtual bool visit(QDeclarativeJS::AST::FunctionExpression *ast); - virtual bool visit(QDeclarativeJS::AST::FormalParameterList *ast); - virtual bool visit(QDeclarativeJS::AST::FunctionBody *ast); - virtual bool visit(QDeclarativeJS::AST::DebuggerStatement *ast); - -private: - bool buildName(QList<QStringRef> &name, QDeclarativeJS::AST::Node *node, - QList<QDeclarativeJS::AST::ExpressionNode *> *nodes); - void discard(); - - const QV4Compiler::Expression *m_expression; - QDeclarativeEnginePrivate *m_engine; - - QDeclarativeJS::IR::Function *_function; - QDeclarativeJS::IR::BasicBlock *_block; - bool _discard; - - ExprResult _expr; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QV4IRBUILDER_P_H diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri deleted file mode 100644 index 01d4247ff8..0000000000 --- a/src/declarative/util/util.pri +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES += \ - $$PWD/qdeclarativepropertymap.cpp - -HEADERS += \ - $$PWD/qdeclarativepropertymap.h diff --git a/src/imports/folderlistmodel/folderlistmodel.pro b/src/imports/folderlistmodel/folderlistmodel.pro index 26efc654b8..b4cfcea495 100644 --- a/src/imports/folderlistmodel/folderlistmodel.pro +++ b/src/imports/folderlistmodel/folderlistmodel.pro @@ -2,12 +2,12 @@ TARGET = qmlfolderlistmodelplugin TARGETPATH = Qt/labs/folderlistmodel include(../qimportbase.pri) -QT += widgets declarative +QT += widgets qml -SOURCES += qdeclarativefolderlistmodel.cpp plugin.cpp -HEADERS += qdeclarativefolderlistmodel.h +SOURCES += qquickfolderlistmodel.cpp plugin.cpp +HEADERS += qquickfolderlistmodel.h -DESTDIR = $$QT.declarative.imports/$$TARGETPATH +DESTDIR = $$QT.qml.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$PWD/qmldir diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index 48d7b5b7cb..78fc230fdc 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqmlextensionplugin.h> +#include <QtQml/qqml.h> -#include "qdeclarativefolderlistmodel.h" +#include "qquickfolderlistmodel.h" QT_BEGIN_NAMESPACE //![class decl] -class QmlFolderListModelPlugin : public QDeclarativeExtensionPlugin +class QmlFolderListModelPlugin : public QQmlExtensionPlugin { Q_OBJECT public: @@ -55,7 +55,7 @@ public: { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel")); #ifndef QT_NO_DIRMODEL - qmlRegisterType<QDeclarativeFolderListModel>(uri,1,0,"FolderListModel"); + qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel"); #endif } }; diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 870479afad..5621622cca 100644 --- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -40,39 +40,39 @@ ****************************************************************************/ //![code] -#include "qdeclarativefolderlistmodel.h" +#include "qquickfolderlistmodel.h" #include <QDirModel> #include <QDebug> -#include <qdeclarativecontext.h> +#include <qqmlcontext.h> #ifndef QT_NO_DIRMODEL QT_BEGIN_NAMESPACE -class QDeclarativeFolderListModelPrivate +class QQuickFolderListModelPrivate { public: - QDeclarativeFolderListModelPrivate() - : sortField(QDeclarativeFolderListModel::Name), sortReversed(false), count(0), showDirs(true), showDots(false), showOnlyReadable(false), insideRefresh(false) { + QQuickFolderListModelPrivate() + : sortField(QQuickFolderListModel::Name), sortReversed(false), count(0), showDirs(true), showDots(false), showOnlyReadable(false), insideRefresh(false) { nameFilters << QLatin1String("*"); } void updateSorting() { QDir::SortFlags flags = 0; switch(sortField) { - case QDeclarativeFolderListModel::Unsorted: + case QQuickFolderListModel::Unsorted: flags |= QDir::Unsorted; break; - case QDeclarativeFolderListModel::Name: + case QQuickFolderListModel::Name: flags |= QDir::Name; break; - case QDeclarativeFolderListModel::Time: + case QQuickFolderListModel::Time: flags |= QDir::Time; break; - case QDeclarativeFolderListModel::Size: + case QQuickFolderListModel::Size: flags |= QDir::Size; break; - case QDeclarativeFolderListModel::Type: + case QQuickFolderListModel::Type: flags |= QDir::Type; break; } @@ -87,7 +87,7 @@ public: QUrl folder; QStringList nameFilters; QModelIndex folderIndex; - QDeclarativeFolderListModel::SortField sortField; + QQuickFolderListModel::SortField sortField; bool sortReversed; int count; bool showDirs; @@ -97,7 +97,7 @@ public: }; /*! - \qmlclass FolderListModel QDeclarativeFolderListModel + \qmlclass FolderListModel QQuickFolderListModel \ingroup qml-working-with-data \brief The FolderListModel provides a model of the contents of a file system folder. @@ -144,7 +144,7 @@ public: The following example shows a FolderListModel being used to provide a list of QML files in a \l ListView: - \snippet doc/src/snippets/declarative/folderlistmodel.qml 0 + \snippet doc/src/snippets/qml/folderlistmodel.qml 0 \section1 Path Separators @@ -156,7 +156,7 @@ public: \sa {QML Data Models} */ -QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent) +QQuickFolderListModel::QQuickFolderListModel(QObject *parent) : QAbstractListModel(parent) { QHash<int, QByteArray> roles; @@ -164,7 +164,7 @@ QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent) roles[FilePathRole] = "filePath"; setRoleNames(roles); - d = new QDeclarativeFolderListModelPrivate; + d = new QQuickFolderListModelPrivate; d->model.setFilter(QDir::AllDirs | QDir::Files | QDir::Drives | QDir::NoDotAndDotDot); connect(&d->model, SIGNAL(rowsInserted(const QModelIndex&,int,int)) , this, SLOT(inserted(const QModelIndex&,int,int))); @@ -176,12 +176,12 @@ QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent) connect(&d->model, SIGNAL(layoutChanged()), this, SLOT(refresh())); } -QDeclarativeFolderListModel::~QDeclarativeFolderListModel() +QQuickFolderListModel::~QQuickFolderListModel() { delete d; } -QVariant QDeclarativeFolderListModel::data(const QModelIndex &index, int role) const +QVariant QQuickFolderListModel::data(const QModelIndex &index, int role) const { QVariant rv; QModelIndex modelIndex = d->model.index(index.row(), 0, d->folderIndex); @@ -200,7 +200,7 @@ QVariant QDeclarativeFolderListModel::data(const QModelIndex &index, int role) c Returns the number of items in the current folder that match the filter criteria. */ -int QDeclarativeFolderListModel::rowCount(const QModelIndex &parent) const +int QQuickFolderListModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); return d->count; @@ -217,12 +217,12 @@ int QDeclarativeFolderListModel::rowCount(const QModelIndex &parent) const By default, the value is an invalid URL. */ -QUrl QDeclarativeFolderListModel::folder() const +QUrl QQuickFolderListModel::folder() const { return d->folder; } -void QDeclarativeFolderListModel::setFolder(const QUrl &folder) +void QQuickFolderListModel::setFolder(const QUrl &folder) { if (folder == d->folder) return; @@ -235,7 +235,7 @@ void QDeclarativeFolderListModel::setFolder(const QUrl &folder) } } -void QDeclarativeFolderListModel::resetFiltering() +void QQuickFolderListModel::resetFiltering() { // ensure that we reset the filtering rules, because the QDirModel::index() // function isn't quite as const as it claims to be. @@ -264,7 +264,7 @@ void QDeclarativeFolderListModel::resetFiltering() Returns the URL of the parent of of the current \l folder. */ -QUrl QDeclarativeFolderListModel::parentFolder() const +QUrl QQuickFolderListModel::parentFolder() const { QString localFile = d->folder.toLocalFile(); if (!localFile.isEmpty()) { @@ -301,22 +301,22 @@ QUrl QDeclarativeFolderListModel::parentFolder() const \note Directories are not excluded by filters. */ -QStringList QDeclarativeFolderListModel::nameFilters() const +QStringList QQuickFolderListModel::nameFilters() const { return d->nameFilters; } -void QDeclarativeFolderListModel::setNameFilters(const QStringList &filters) +void QQuickFolderListModel::setNameFilters(const QStringList &filters) { d->nameFilters = filters; d->model.setNameFilters(d->nameFilters); } -void QDeclarativeFolderListModel::classBegin() +void QQuickFolderListModel::classBegin() { } -void QDeclarativeFolderListModel::componentComplete() +void QQuickFolderListModel::componentComplete() { if (!d->folder.isValid() || d->folder.toLocalFile().isEmpty() || !QDir().exists(d->folder.toLocalFile())) setFolder(QUrl(QLatin1String("file://")+QDir::currentPath())); @@ -340,12 +340,12 @@ void QDeclarativeFolderListModel::componentComplete() \sa sortReversed */ -QDeclarativeFolderListModel::SortField QDeclarativeFolderListModel::sortField() const +QQuickFolderListModel::SortField QQuickFolderListModel::sortField() const { return d->sortField; } -void QDeclarativeFolderListModel::setSortField(SortField field) +void QQuickFolderListModel::setSortField(SortField field) { if (field != d->sortField) { d->sortField = field; @@ -360,12 +360,12 @@ void QDeclarativeFolderListModel::setSortField(SortField field) \sa sortField */ -bool QDeclarativeFolderListModel::sortReversed() const +bool QQuickFolderListModel::sortReversed() const { return d->sortReversed; } -void QDeclarativeFolderListModel::setSortReversed(bool rev) +void QQuickFolderListModel::setSortReversed(bool rev) { if (rev != d->sortReversed) { d->sortReversed = rev; @@ -379,7 +379,7 @@ void QDeclarativeFolderListModel::setSortReversed(bool rev) Returns true if the entry \a index is a folder; otherwise returns false. */ -bool QDeclarativeFolderListModel::isFolder(int index) const +bool QQuickFolderListModel::isFolder(int index) const { if (index != -1) { QModelIndex idx = d->model.index(index, 0, d->folderIndex); @@ -389,7 +389,7 @@ bool QDeclarativeFolderListModel::isFolder(int index) const return false; } -void QDeclarativeFolderListModel::refresh() +void QQuickFolderListModel::refresh() { if (d->insideRefresh) return; @@ -413,7 +413,7 @@ void QDeclarativeFolderListModel::refresh() d->insideRefresh = false; // finished refreshing. } -void QDeclarativeFolderListModel::inserted(const QModelIndex &index, int start, int end) +void QQuickFolderListModel::inserted(const QModelIndex &index, int start, int end) { if (index == d->folderIndex) { emit beginInsertRows(QModelIndex(), start, end); @@ -422,7 +422,7 @@ void QDeclarativeFolderListModel::inserted(const QModelIndex &index, int start, } } -void QDeclarativeFolderListModel::removed(const QModelIndex &index, int start, int end) +void QQuickFolderListModel::removed(const QModelIndex &index, int start, int end) { if (index == d->folderIndex) { emit beginRemoveRows(QModelIndex(), start, end); @@ -431,7 +431,7 @@ void QDeclarativeFolderListModel::removed(const QModelIndex &index, int start, i } } -void QDeclarativeFolderListModel::handleDataChanged(const QModelIndex &start, const QModelIndex &end) +void QQuickFolderListModel::handleDataChanged(const QModelIndex &start, const QModelIndex &end) { if (start.parent() == d->folderIndex) emit dataChanged(index(start.row(),0), index(end.row(),0)); @@ -449,12 +449,12 @@ void QDeclarativeFolderListModel::handleDataChanged(const QModelIndex &start, co \sa showDotAndDotDot */ -bool QDeclarativeFolderListModel::showDirs() const +bool QQuickFolderListModel::showDirs() const { return d->model.filter() & QDir::AllDirs; } -void QDeclarativeFolderListModel::setShowDirs(bool on) +void QQuickFolderListModel::setShowDirs(bool on) { if (!(d->model.filter() & QDir::AllDirs) == !on) return; @@ -477,12 +477,12 @@ void QDeclarativeFolderListModel::setShowDirs(bool on) \sa showDirs */ -bool QDeclarativeFolderListModel::showDotAndDotDot() const +bool QQuickFolderListModel::showDotAndDotDot() const { return !(d->model.filter() & QDir::NoDotAndDotDot); } -void QDeclarativeFolderListModel::setShowDotAndDotDot(bool on) +void QQuickFolderListModel::setShowDotAndDotDot(bool on) { if (!(d->model.filter() & QDir::NoDotAndDotDot) == on) return; @@ -505,12 +505,12 @@ void QDeclarativeFolderListModel::setShowDotAndDotDot(bool on) \sa showDirs */ -bool QDeclarativeFolderListModel::showOnlyReadable() const +bool QQuickFolderListModel::showOnlyReadable() const { return d->model.filter() & QDir::Readable; } -void QDeclarativeFolderListModel::setShowOnlyReadable(bool on) +void QQuickFolderListModel::setShowOnlyReadable(bool on) { if (!(d->model.filter() & QDir::Readable) == !on) return; diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h index 5f9cb0e81a..10af7c8075 100644 --- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.h +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEFOLDERLISTMODEL_H -#define QDECLARATIVEFOLDERLISTMODEL_H +#ifndef QQUICKFOLDERLISTMODEL_H +#define QQUICKFOLDERLISTMODEL_H -#include <qdeclarative.h> +#include <qqml.h> #include <QStringList> #include <QUrl> #include <QAbstractListModel> @@ -54,16 +54,16 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeContext; +class QQmlContext; class QModelIndex; -class QDeclarativeFolderListModelPrivate; +class QQuickFolderListModelPrivate; //![class begin] -class QDeclarativeFolderListModel : public QAbstractListModel, public QDeclarativeParserStatus +class QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) //![class begin] //![class props] @@ -80,8 +80,8 @@ class QDeclarativeFolderListModel : public QAbstractListModel, public QDeclarati //![abslistmodel] public: - QDeclarativeFolderListModel(QObject *parent = 0); - ~QDeclarativeFolderListModel(); + QQuickFolderListModel(QObject *parent = 0); + ~QQuickFolderListModel(); enum Roles { FileNameRole = Qt::UserRole+1, FilePathRole = Qt::UserRole+2 }; @@ -141,19 +141,19 @@ private Q_SLOTS: void handleDataChanged(const QModelIndex &start, const QModelIndex &end); private: - Q_DISABLE_COPY(QDeclarativeFolderListModel) - QDeclarativeFolderListModelPrivate *d; + Q_DISABLE_COPY(QQuickFolderListModel) + QQuickFolderListModelPrivate *d; }; //![class end] QT_END_NAMESPACE //![qml decl] -QML_DECLARE_TYPE(QDeclarativeFolderListModel) +QML_DECLARE_TYPE(QQuickFolderListModel) //![qml decl] QT_END_HEADER #endif // QT_NO_DIRMODEL -#endif // QDECLARATIVEFOLDERLISTMODEL_H +#endif // QQUICKFOLDERLISTMODEL_H diff --git a/src/imports/localstorage/localstorage.pro b/src/imports/localstorage/localstorage.pro index 51a69aac4f..c54bc564d9 100644 --- a/src/imports/localstorage/localstorage.pro +++ b/src/imports/localstorage/localstorage.pro @@ -2,11 +2,11 @@ TARGET = qmllocalstorageplugin TARGETPATH = QtQuick/LocalStorage include(../qimportbase.pri) -QT += sql declarative declarative-private v8-private core-private +QT += sql qml qml-private v8-private core-private SOURCES += plugin.cpp -DESTDIR = $$QT.declarative.imports/$$TARGETPATH +DESTDIR = $$QT.qml.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$PWD/qmldir diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index dd747d0d09..77e68877d4 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ #include <QStringList> -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> -#include <private/qdeclarativeengine_p.h> +#include <QtQml/qqmlextensionplugin.h> +#include <QtQml/qqml.h> +#include <private/qqmlengine_p.h> #include <QDebug> #include <private/qv8engine_p.h> #include <QtSql/qsqldatabase.h> @@ -83,18 +83,18 @@ return; \ } -class QDeclarativeSqlDatabaseData : public QV8Engine::Deletable +class QQmlSqlDatabaseData : public QV8Engine::Deletable { public: - QDeclarativeSqlDatabaseData(QV8Engine *engine); - ~QDeclarativeSqlDatabaseData(); + QQmlSqlDatabaseData(QV8Engine *engine); + ~QQmlSqlDatabaseData(); v8::Persistent<v8::Function> constructor; v8::Persistent<v8::Function> queryConstructor; v8::Persistent<v8::Function> rowsConstructor; }; -V8_DEFINE_EXTENSION(QDeclarativeSqlDatabaseData, databaseData) +V8_DEFINE_EXTENSION(QQmlSqlDatabaseData, databaseData) class QV8SqlDatabaseResource : public QV8ObjectResource { @@ -167,7 +167,7 @@ static void qmlsqldatabase_rows_setForwardOnly(v8::Local<v8::String> /* property r->query.setForwardOnly(value->BooleanValue()); } -QDeclarativeSqlDatabaseData::~QDeclarativeSqlDatabaseData() +QQmlSqlDatabaseData::~QQmlSqlDatabaseData() { qPersistentDispose(constructor); qPersistentDispose(queryConstructor); @@ -239,14 +239,14 @@ static v8::Handle<v8::Value> qmlsqldatabase_executeSql(const v8::Arguments& args QV8Engine *engine = r->engine; if (!r->inTransaction) - V8THROW_SQL(SQLEXCEPTION_DATABASE_ERR,QDeclarativeEngine::tr("executeSql called outside transaction()")); + V8THROW_SQL(SQLEXCEPTION_DATABASE_ERR,QQmlEngine::tr("executeSql called outside transaction()")); QSqlDatabase db = r->database; QString sql = engine->toString(args[0]); if (r->readonly && !sql.startsWith(QLatin1String("SELECT"),Qt::CaseInsensitive)) { - V8THROW_SQL(SQLEXCEPTION_SYNTAX_ERR, QDeclarativeEngine::tr("Read-only Transaction")); + V8THROW_SQL(SQLEXCEPTION_SYNTAX_ERR, QQmlEngine::tr("Read-only Transaction")); } QSqlQuery query(db); @@ -316,7 +316,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_changeVersion(const v8::Arguments& a v8::Handle<v8::Value> callback = args[2]; if (from_version != r->version) - V8THROW_SQL(SQLEXCEPTION_VERSION_ERR, QDeclarativeEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(r->version)); + V8THROW_SQL(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(r->version)); v8::Local<v8::Object> instance = databaseData(engine)->queryConstructor->NewInstance(); QV8SqlDatabaseResource *r2 = new QV8SqlDatabaseResource(engine); @@ -341,7 +341,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_changeVersion(const v8::Arguments& a return v8::Handle<v8::Value>(); } else if (!db.commit()) { db.rollback(); - V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QDeclarativeEngine::tr("SQL transaction failed")); + V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QQmlEngine::tr("SQL transaction failed")); } else { ok = true; } @@ -369,7 +369,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_transaction_shared(const v8::Argumen QV8Engine *engine = r->engine; if (args.Length() == 0 || !args[0]->IsFunction()) - V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QDeclarativeEngine::tr("transaction: missing callback")); + V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QQmlEngine::tr("transaction: missing callback")); QSqlDatabase db = r->database; v8::Handle<v8::Function> callback = v8::Handle<v8::Function>::Cast(args[0]); @@ -410,7 +410,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_read_transaction(const v8::Arguments return qmlsqldatabase_transaction_shared(args, true); } -QDeclarativeSqlDatabaseData::QDeclarativeSqlDatabaseData(QV8Engine *engine) +QQmlSqlDatabaseData::QQmlSqlDatabaseData(QV8Engine *engine) { { v8::Local<v8::FunctionTemplate> ft = v8::FunctionTemplate::New(); @@ -460,7 +460,7 @@ through the data. These databases are user-specific and QML-specific, but accessible to all QML applications. They are stored in the \c Databases subdirectory -of QDeclarativeEngine::offlineStoragePath(), currently as SQLite databases. +of QQmlEngine::offlineStoragePath(), currently as SQLite databases. Database connections are automatically closed during Javascript garbage collection. @@ -549,7 +549,7 @@ public: ~QQuickLocalStorage() { } - Q_INVOKABLE void openDatabaseSync(QDeclarativeV8Function* args); + Q_INVOKABLE void openDatabaseSync(QQmlV8Function* args); }; /*! @@ -563,7 +563,7 @@ public: * \c callback is an optional parameter, which is invoked if the database has not yet been created. * \return the database object */ -void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args) +void QQuickLocalStorage::openDatabaseSync(QQmlV8Function *args) { #ifndef QT_NO_SETTINGS QV8Engine *engine = args->engine(); @@ -592,7 +592,7 @@ void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args) database = QSqlDatabase::database(dbid); version = ini.value(QLatin1String("Version")).toString(); if (version != dbversion && !dbversion.isEmpty() && !version.isEmpty()) - V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR, QDeclarativeEngine::tr("SQL: database version mismatch")); + V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("SQL: database version mismatch")); } else { created = !QFile::exists(basename+QLatin1String(".sqlite")); database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid); @@ -607,7 +607,7 @@ void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args) } else { if (!dbversion.isEmpty() && ini.value(QLatin1String("Version")) != dbversion) { // Incompatible - V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR,QDeclarativeEngine::tr("SQL: database version mismatch")); + V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR,QQmlEngine::tr("SQL: database version mismatch")); } version = ini.value(QLatin1String("Version")).toString(); } @@ -639,7 +639,7 @@ void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args) #endif // QT_NO_SETTINGS } -static QObject *module_api_factory(QDeclarativeEngine *engine, QJSEngine *scriptEngine) +static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) @@ -648,11 +648,11 @@ static QObject *module_api_factory(QDeclarativeEngine *engine, QJSEngine *script return api; } -class QDeclarativeLocalStoragePlugin : public QDeclarativeExtensionPlugin +class QQmlLocalStoragePlugin : public QQmlExtensionPlugin { Q_OBJECT public: - QDeclarativeLocalStoragePlugin() + QQmlLocalStoragePlugin() { } @@ -665,4 +665,4 @@ public: #include "plugin.moc" -Q_EXPORT_PLUGIN2(plugin, QDeclarativeLocalStoragePlugin); +Q_EXPORT_PLUGIN2(plugin, QQmlLocalStoragePlugin); diff --git a/src/imports/qimportbase.pri b/src/imports/qimportbase.pri index 110d145e94..ab54e4b1b9 100644 --- a/src/imports/qimportbase.pri +++ b/src/imports/qimportbase.pri @@ -14,7 +14,7 @@ isEmpty(TARGET) { QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir copy2build.input = QMLDIRFILE -copy2build.output = $$QT.declarative.imports/$$TARGETPATH/qmldir +copy2build.output = $$QT.qml.imports/$$TARGETPATH/qmldir !contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} copy2build.name = COPY ${QMAKE_FILE_IN} diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index 808d5196b2..2cb70a4fd3 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -39,23 +39,23 @@ ** ****************************************************************************/ -#include <QtDeclarative/qdeclarativeextensionplugin.h> +#include <QtQml/qqmlextensionplugin.h> #include <private/qtquick2_p.h> QT_BEGIN_NAMESPACE //![class decl] -class QtQuick2Plugin : public QDeclarativeExtensionPlugin +class QtQuick2Plugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick")); Q_UNUSED(uri); - QDeclarativeQtQuick2Module::defineModule(); + QQmlQtQuick2Module::defineModule(); } }; //![class decl] diff --git a/src/imports/qtquick2/qtquick2.pro b/src/imports/qtquick2/qtquick2.pro index 3f76abd87f..3a95c5fd21 100644 --- a/src/imports/qtquick2/qtquick2.pro +++ b/src/imports/qtquick2/qtquick2.pro @@ -5,12 +5,12 @@ include(../qimportbase.pri) SOURCES += \ plugin.cpp -QT += quick-private declarative-private +QT += quick-private qml-private OTHER_FILES += \ qmldir -DESTDIR = $$QT.declarative.imports/$$TARGETPATH +DESTDIR = $$QT.qml.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$PWD/qmldir diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index 672de10639..8ab745a7d2 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qjsvalue.h> -#include <QtDeclarative/qjsengine.h> +#include <QtQml/qqmlextensionplugin.h> +#include <QtQml/qqml.h> +#include <QtQml/qjsvalue.h> +#include <QtQml/qjsengine.h> #include "QtQuickTest/private/quicktestresult_p.h" #include "QtQuickTest/private/quicktestevent_p.h" #include "private/qtestoptions_p.h" #include "QtQuick/qquickitem.h" -#include <QtDeclarative/private/qdeclarativeengine_p.h> +#include <QtQml/private/qqmlengine_p.h> QML_DECLARE_TYPE(QuickTestResult) QML_DECLARE_TYPE(QuickTestEvent) @@ -81,15 +81,15 @@ Q_SIGNALS: void wrapperChanged(); public Q_SLOTS: - QDeclarativeV8Handle typeName(const QVariant& v) const + QQmlV8Handle typeName(const QVariant& v) const { QString name(v.typeName()); //qDebug() << "type:" << name << " string value:" << v.toString() << " value:" << v; if (v.canConvert<QObject*>()) { - QDeclarativeType *type = 0; + QQmlType *type = 0; const QMetaObject *mo = v.value<QObject*>()->metaObject(); while (!type && mo) { - type = QDeclarativeMetaType::qmlType(mo); + type = QQmlMetaType::qmlType(mo); mo = mo->superClass(); } if (type) { @@ -97,22 +97,22 @@ public Q_SLOTS: } } - return QDeclarativeV8Handle::fromHandle(v8::String::New(name.toUtf8())); + return QQmlV8Handle::fromHandle(v8::String::New(name.toUtf8())); } bool compare(const QVariant& act, const QVariant& exp) const { return act == exp; } - QDeclarativeV8Handle callerFile(int frameIndex = 0) const + QQmlV8Handle callerFile(int frameIndex = 0) const { v8::Local<v8::StackTrace> stacks = v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); int count = stacks->GetFrameCount(); if (count >= frameIndex + 1) { v8::Local<v8::StackFrame> frame = stacks->GetFrame(frameIndex + 1); - return QDeclarativeV8Handle::fromHandle(frame->GetScriptNameOrSourceURL()); + return QQmlV8Handle::fromHandle(frame->GetScriptNameOrSourceURL()); } - return QDeclarativeV8Handle(); + return QQmlV8Handle(); } int callerLine(int frameIndex = 0) const { @@ -132,7 +132,7 @@ QML_DECLARE_TYPE(QuickTestUtil) QT_BEGIN_NAMESPACE -class QTestQmlModule : public QDeclarativeExtensionPlugin +class QTestQmlModule : public QQmlExtensionPlugin { Q_OBJECT public: @@ -144,7 +144,7 @@ public: qmlRegisterType<QuickTestUtil>(uri,1,0,"TestUtil"); } - void initializeEngine(QDeclarativeEngine *, const char *) + void initializeEngine(QQmlEngine *, const char *) { } }; diff --git a/src/imports/testlib/signalspy.h b/src/imports/testlib/signalspy.h index 6b5166d8e0..6542203ce4 100644 --- a/src/imports/testlib/signalspy.h +++ b/src/imports/testlib/signalspy.h @@ -44,20 +44,20 @@ // This is a dummy header for defining the interface of "SignalSpy.qml" to qdoc. -#include <QtDeclarative/qdeclarativeitem.h> +#include <QtQuick/qquickitem.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class SignalSpy : public QDeclarativeItem +class SignalSpy : public QQuickItem { Q_OBJECT Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) Q_PROPERTY(QString signalName READ signalName WRITE signalName NOTIFY signalNameChanged) Q_PROPERTY(int count READ count countChanged) public: - SignalSpy(QDeclarativeItem *parent) : QDeclarativeItem(parent) {} + SignalSpy(QQuickItem *parent) : QQuickItem(parent) {} ~SignalSpy() QObject *target() const; diff --git a/src/imports/testlib/testcase.h b/src/imports/testlib/testcase.h index 1793cca0f2..e7758ec9df 100644 --- a/src/imports/testlib/testcase.h +++ b/src/imports/testlib/testcase.h @@ -44,13 +44,13 @@ // This is a dummy header for defining the interface of "TestCase.qml" to qdoc. -#include <QtDeclarative/qdeclarativeitem.h> +#include <QtQuick/qquickitem.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class TestCase : public QDeclarativeItem +class TestCase : public QQuickItem { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) @@ -60,7 +60,7 @@ class TestCase : public QDeclarativeItem Q_PROPERTY(bool running READ running NOTIFY runningChanged) Q_PROPERTY(bool windowShown READ windowShown NOTIFY windowShownChanged) public: - TestCase(QDeclarativeItem *parent) : QDeclarativeItem(parent) {} + TestCase(QQuickItem *parent) : QQuickItem(parent) {} ~TestCase() QString name() const; diff --git a/src/imports/testlib/testlib.pro b/src/imports/testlib/testlib.pro index 3b8a5bf75e..a4cb03466e 100644 --- a/src/imports/testlib/testlib.pro +++ b/src/imports/testlib/testlib.pro @@ -4,12 +4,12 @@ include(../qimportbase.pri) CONFIG += qt plugin -QT += declarative quick qmltest qmltest-private v8-private declarative-private core-private testlib +QT += qml quick qmltest qmltest-private v8-private qml-private core-private testlib SOURCES += main.cpp HEADERS += -DESTDIR = $$QT.declarative.imports/$$TARGETPATH +DESTDIR = $$QT.qml.imports/$$TARGETPATH target.path += $$[QT_INSTALL_IMPORTS]/QtTest OTHER_IMPORT_FILES = \ @@ -23,7 +23,7 @@ otherImportFiles.files += $$OTHER_IMPORT_FILES otherImportFiles.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH copy2build.input = OTHER_IMPORT_FILES -copy2build.output = $$QT.declarative.imports/$$TARGETPATH/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} +copy2build.output = $$QT.qml.imports/$$TARGETPATH/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT} INSTALLS += target otherImportFiles diff --git a/src/imports/xmllistmodel/plugin.cpp b/src/imports/xmllistmodel/plugin.cpp index 9085a60885..54a6d5e212 100644 --- a/src/imports/xmllistmodel/plugin.cpp +++ b/src/imports/xmllistmodel/plugin.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,22 +39,22 @@ ** ****************************************************************************/ -#include <QtDeclarative/qdeclarativeextensionplugin.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqmlextensionplugin.h> +#include <QtQml/qqml.h> -#include "qdeclarativexmllistmodel_p.h" +#include "qqmlxmllistmodel_p.h" QT_BEGIN_NAMESPACE -class QmlXmlListModelPlugin : public QDeclarativeExtensionPlugin +class QmlXmlListModelPlugin : public QQmlExtensionPlugin { Q_OBJECT public: virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.XmlListModel")); - qmlRegisterType<QDeclarativeXmlListModel>(uri,2,0,"XmlListModel"); - qmlRegisterType<QDeclarativeXmlListModelRole>(uri,2,0,"XmlRole"); + qmlRegisterType<QQuickXmlListModel>(uri,2,0,"XmlListModel"); + qmlRegisterType<QQuickXmlListModelRole>(uri,2,0,"XmlRole"); } }; diff --git a/src/imports/xmllistmodel/qdeclarativexmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp index db7fec2c97..1377859b5e 100644 --- a/src/imports/xmllistmodel/qdeclarativexmllistmodel.cpp +++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include "qdeclarativexmllistmodel_p.h" +#include "qqmlxmllistmodel_p.h" -#include <qdeclarativecontext.h> -#include <private/qdeclarativeengine_p.h> +#include <qqmlcontext.h> +#include <private/qqmlengine_p.h> #include <QDebug> #include <QStringList> @@ -59,22 +59,22 @@ #include <private/qobject_p.h> -Q_DECLARE_METATYPE(QDeclarativeXmlQueryResult) +Q_DECLARE_METATYPE(QQuickXmlQueryResult) QT_BEGIN_NAMESPACE -typedef QPair<int, int> QDeclarativeXmlListRange; +typedef QPair<int, int> QQuickXmlListRange; #define XMLLISTMODEL_CLEAR_ID 0 /*! - \qmlclass XmlRole QDeclarativeXmlListModelRole + \qmlclass XmlRole QQuickXmlListModelRole \inqmlmodule QtQuick 2 \ingroup qml-working-with-data \brief The XmlRole element allows you to specify a role for an XmlListModel. - \sa {QtDeclarative} + \sa {QtQml} */ /*! @@ -111,12 +111,12 @@ typedef QPair<int, int> QDeclarativeXmlListRange; For example, if there is an XML document like this: - \quotefile doc/src/snippets/declarative/xmlrole.xml + \quotefile doc/src/snippets/qml/xmlrole.xml Here are some valid XPath expressions for XmlRole queries on this document: - \snippet doc/src/snippets/declarative/xmlrole.qml 0 + \snippet doc/src/snippets/qml/xmlrole.qml 0 \dots 4 - \snippet doc/src/snippets/declarative/xmlrole.qml 1 + \snippet doc/src/snippets/qml/xmlrole.qml 1 See the \l{http://www.w3.org/TR/xpath20/}{W3C XPath 2.0 specification} for more information. */ @@ -145,37 +145,37 @@ struct XmlQueryJob }; -class QDeclarativeXmlQueryEngine; -class QDeclarativeXmlQueryThreadObject : public QObject +class QQuickXmlQueryEngine; +class QQuickXmlQueryThreadObject : public QObject { Q_OBJECT public: - QDeclarativeXmlQueryThreadObject(QDeclarativeXmlQueryEngine *); + QQuickXmlQueryThreadObject(QQuickXmlQueryEngine *); void processJobs(); virtual bool event(QEvent *e); private: - QDeclarativeXmlQueryEngine *m_queryEngine; + QQuickXmlQueryEngine *m_queryEngine; }; -class QDeclarativeXmlQueryEngine : public QThread +class QQuickXmlQueryEngine : public QThread { Q_OBJECT public: - QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng); - ~QDeclarativeXmlQueryEngine(); + QQuickXmlQueryEngine(QQmlEngine *eng); + ~QQuickXmlQueryEngine(); - int doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache); + int doQuery(QString query, QString namespaces, QByteArray data, QList<QQuickXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache); void abort(int id); void processJobs(); - static QDeclarativeXmlQueryEngine *instance(QDeclarativeEngine *engine); + static QQuickXmlQueryEngine *instance(QQmlEngine *engine); signals: - void queryCompleted(const QDeclarativeXmlQueryResult &); + void queryCompleted(const QQuickXmlQueryResult &); void error(void*, const QString&); protected: @@ -183,38 +183,38 @@ protected: private: void processQuery(XmlQueryJob *job); - void doQueryJob(XmlQueryJob *job, QDeclarativeXmlQueryResult *currentResult); - void doSubQueryJob(XmlQueryJob *job, QDeclarativeXmlQueryResult *currentResult); + void doQueryJob(XmlQueryJob *job, QQuickXmlQueryResult *currentResult); + void doSubQueryJob(XmlQueryJob *job, QQuickXmlQueryResult *currentResult); void getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const; - void addIndexToRangeList(QList<QDeclarativeXmlListRange> *ranges, int index) const; + void addIndexToRangeList(QList<QQuickXmlListRange> *ranges, int index) const; QMutex m_mutex; - QDeclarativeXmlQueryThreadObject *m_threadObject; + QQuickXmlQueryThreadObject *m_threadObject; QList<XmlQueryJob> m_jobs; QSet<int> m_cancelledJobs; QAtomicInt m_queryIds; - QDeclarativeEngine *m_engine; + QQmlEngine *m_engine; QObject *m_eventLoopQuitHack; - static QHash<QDeclarativeEngine *,QDeclarativeXmlQueryEngine*> queryEngines; + static QHash<QQmlEngine *,QQuickXmlQueryEngine*> queryEngines; static QMutex queryEnginesMutex; }; -QHash<QDeclarativeEngine *,QDeclarativeXmlQueryEngine*> QDeclarativeXmlQueryEngine::queryEngines; -QMutex QDeclarativeXmlQueryEngine::queryEnginesMutex; +QHash<QQmlEngine *,QQuickXmlQueryEngine*> QQuickXmlQueryEngine::queryEngines; +QMutex QQuickXmlQueryEngine::queryEnginesMutex; -QDeclarativeXmlQueryThreadObject::QDeclarativeXmlQueryThreadObject(QDeclarativeXmlQueryEngine *e) +QQuickXmlQueryThreadObject::QQuickXmlQueryThreadObject(QQuickXmlQueryEngine *e) : m_queryEngine(e) { } -void QDeclarativeXmlQueryThreadObject::processJobs() +void QQuickXmlQueryThreadObject::processJobs() { QCoreApplication::postEvent(this, new QEvent(QEvent::User)); } -bool QDeclarativeXmlQueryThreadObject::event(QEvent *e) +bool QQuickXmlQueryThreadObject::event(QEvent *e) { if (e->type() == QEvent::User) { m_queryEngine->processJobs(); @@ -226,10 +226,10 @@ bool QDeclarativeXmlQueryThreadObject::event(QEvent *e) -QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng) +QQuickXmlQueryEngine::QQuickXmlQueryEngine(QQmlEngine *eng) : QThread(eng), m_threadObject(0), m_queryIds(XMLLISTMODEL_CLEAR_ID + 1), m_engine(eng), m_eventLoopQuitHack(0) { - qRegisterMetaType<QDeclarativeXmlQueryResult>("QDeclarativeXmlQueryResult"); + qRegisterMetaType<QQuickXmlQueryResult>("QQuickXmlQueryResult"); m_eventLoopQuitHack = new QObject; m_eventLoopQuitHack->moveToThread(this); @@ -237,7 +237,7 @@ QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng) start(QThread::IdlePriority); } -QDeclarativeXmlQueryEngine::~QDeclarativeXmlQueryEngine() +QQuickXmlQueryEngine::~QQuickXmlQueryEngine() { queryEnginesMutex.lock(); queryEngines.remove(m_engine); @@ -247,7 +247,7 @@ QDeclarativeXmlQueryEngine::~QDeclarativeXmlQueryEngine() wait(); } -int QDeclarativeXmlQueryEngine::doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache) { +int QQuickXmlQueryEngine::doQuery(QString query, QString namespaces, QByteArray data, QList<QQuickXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache) { { QMutexLocker m1(&m_mutex); m_queryIds.ref(); @@ -283,17 +283,17 @@ int QDeclarativeXmlQueryEngine::doQuery(QString query, QString namespaces, QByte return job.queryId; } -void QDeclarativeXmlQueryEngine::abort(int id) +void QQuickXmlQueryEngine::abort(int id) { QMutexLocker ml(&m_mutex); if (id != -1) m_cancelledJobs.insert(id); } -void QDeclarativeXmlQueryEngine::run() +void QQuickXmlQueryEngine::run() { m_mutex.lock(); - m_threadObject = new QDeclarativeXmlQueryThreadObject(this); + m_threadObject = new QQuickXmlQueryThreadObject(this); m_mutex.unlock(); processJobs(); @@ -303,7 +303,7 @@ void QDeclarativeXmlQueryEngine::run() m_threadObject = 0; } -void QDeclarativeXmlQueryEngine::processJobs() +void QQuickXmlQueryEngine::processJobs() { QMutexLocker locker(&m_mutex); @@ -324,12 +324,12 @@ void QDeclarativeXmlQueryEngine::processJobs() } } -QDeclarativeXmlQueryEngine *QDeclarativeXmlQueryEngine::instance(QDeclarativeEngine *engine) +QQuickXmlQueryEngine *QQuickXmlQueryEngine::instance(QQmlEngine *engine) { queryEnginesMutex.lock(); - QDeclarativeXmlQueryEngine *queryEng = queryEngines.value(engine); + QQuickXmlQueryEngine *queryEng = queryEngines.value(engine); if (!queryEng) { - queryEng = new QDeclarativeXmlQueryEngine(engine); + queryEng = new QQuickXmlQueryEngine(engine); queryEngines.insert(engine, queryEng); } queryEnginesMutex.unlock(); @@ -337,9 +337,9 @@ QDeclarativeXmlQueryEngine *QDeclarativeXmlQueryEngine::instance(QDeclarativeEng return queryEng; } -void QDeclarativeXmlQueryEngine::processQuery(XmlQueryJob *job) +void QQuickXmlQueryEngine::processQuery(XmlQueryJob *job) { - QDeclarativeXmlQueryResult result; + QQuickXmlQueryResult result; result.queryId = job->queryId; doQueryJob(job, &result); doSubQueryJob(job, &result); @@ -354,7 +354,7 @@ void QDeclarativeXmlQueryEngine::processQuery(XmlQueryJob *job) } } -void QDeclarativeXmlQueryEngine::doQueryJob(XmlQueryJob *currentJob, QDeclarativeXmlQueryResult *currentResult) +void QQuickXmlQueryEngine::doQueryJob(XmlQueryJob *currentJob, QQuickXmlQueryResult *currentResult) { Q_ASSERT(currentJob->queryId != -1); @@ -393,7 +393,7 @@ void QDeclarativeXmlQueryEngine::doQueryJob(XmlQueryJob *currentJob, QDeclarativ currentResult->size = (count > 0 ? count : 0); } -void QDeclarativeXmlQueryEngine::getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const +void QQuickXmlQueryEngine::getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const { const QStringList &keysQueries = currentJob.keyRoleQueries; QString keysQuery; @@ -414,7 +414,7 @@ void QDeclarativeXmlQueryEngine::getValuesOfKeyRoles(const XmlQueryJob& currentJ } } -void QDeclarativeXmlQueryEngine::addIndexToRangeList(QList<QDeclarativeXmlListRange> *ranges, int index) const { +void QQuickXmlQueryEngine::addIndexToRangeList(QList<QQuickXmlListRange> *ranges, int index) const { if (ranges->isEmpty()) ranges->append(qMakePair(index, 1)); else if (ranges->last().first + ranges->last().second == index) @@ -423,7 +423,7 @@ void QDeclarativeXmlQueryEngine::addIndexToRangeList(QList<QDeclarativeXmlListRa ranges->append(qMakePair(index, 1)); } -void QDeclarativeXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QDeclarativeXmlQueryResult *currentResult) +void QQuickXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QQuickXmlQueryResult *currentResult) { Q_ASSERT(currentJob->queryId != -1); @@ -489,7 +489,7 @@ void QDeclarativeXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QDeclara /*for (int j = 0; j < m_size; ++j) { QList<QVariant> resultList; for (int i = 0; i < m_roleObjects->size(); ++i) { - QDeclarativeXmlListModelRole *role = m_roleObjects->at(i); + QQuickXmlListModelRole *role = m_roleObjects->at(i); subquery.setQuery(m_prefix.arg(j+1) + role->query()); if (role->isStringList()) { QStringList data; @@ -514,27 +514,27 @@ void QDeclarativeXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QDeclara }*/ } -class QDeclarativeXmlListModelPrivate : public QObjectPrivate +class QQuickXmlListModelPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeXmlListModel) + Q_DECLARE_PUBLIC(QQuickXmlListModel) public: - QDeclarativeXmlListModelPrivate() + QQuickXmlListModelPrivate() : isComponentComplete(true), size(-1), highestRole(Qt::UserRole) - , reply(0), status(QDeclarativeXmlListModel::Null), progress(0.0) + , reply(0), status(QQuickXmlListModel::Null), progress(0.0) , queryId(-1), roleObjects(), redirectCount(0) {} void notifyQueryStarted(bool remoteSource) { - Q_Q(QDeclarativeXmlListModel); + Q_Q(QQuickXmlListModel); progress = remoteSource ? 0.0 : 1.0; - status = QDeclarativeXmlListModel::Loading; + status = QQuickXmlListModel::Loading; errorString.clear(); emit q->progressChanged(progress); emit q->statusChanged(status); } void deleteReply() { - Q_Q(QDeclarativeXmlListModel); + Q_Q(QQuickXmlListModel); if (reply) { QObject::disconnect(reply, 0, q, 0); reply->deleteLater(); @@ -553,23 +553,23 @@ public: int highestRole; QNetworkReply *reply; - QDeclarativeXmlListModel::Status status; + QQuickXmlListModel::Status status; QString errorString; qreal progress; int queryId; QStringList keyRoleResultsCache; - QList<QDeclarativeXmlListModelRole *> roleObjects; + QList<QQuickXmlListModelRole *> roleObjects; - static void append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role); - static void clear_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list); + static void append_role(QQmlListProperty<QQuickXmlListModelRole> *list, QQuickXmlListModelRole *role); + static void clear_role(QQmlListProperty<QQuickXmlListModelRole> *list); QList<QList<QVariant> > data; int redirectCount; }; -void QDeclarativeXmlListModelPrivate::append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role) +void QQuickXmlListModelPrivate::append_role(QQmlListProperty<QQuickXmlListModelRole> *list, QQuickXmlListModelRole *role) { - QDeclarativeXmlListModel *_this = qobject_cast<QDeclarativeXmlListModel *>(list->object); + QQuickXmlListModel *_this = qobject_cast<QQuickXmlListModel *>(list->object); if (_this && role) { int i = _this->d_func()->roleObjects.count(); _this->d_func()->roleObjects.append(role); @@ -585,16 +585,16 @@ void QDeclarativeXmlListModelPrivate::append_role(QDeclarativeListProperty<QDecl //### clear needs to invalidate any cached data (in data table) as well // (and the model should emit the appropriate signals) -void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list) +void QQuickXmlListModelPrivate::clear_role(QQmlListProperty<QQuickXmlListModelRole> *list) { - QDeclarativeXmlListModel *_this = static_cast<QDeclarativeXmlListModel *>(list->object); + QQuickXmlListModel *_this = static_cast<QQuickXmlListModel *>(list->object); _this->d_func()->roles.clear(); _this->d_func()->roleNames.clear(); _this->d_func()->roleObjects.clear(); } /*! - \qmlclass XmlListModel QDeclarativeXmlListModel + \qmlclass XmlListModel QQuickXmlListModel \inqmlmodule QtQuick 2 \ingroup qml-working-with-data \brief The XmlListModel element is used to specify a read-only model using XPath expressions. @@ -690,12 +690,12 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla \sa {RSS News} */ -QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent) - : QListModelInterface(*(new QDeclarativeXmlListModelPrivate), parent) +QQuickXmlListModel::QQuickXmlListModel(QObject *parent) + : QListModelInterface(*(new QQuickXmlListModelPrivate), parent) { } -QDeclarativeXmlListModel::~QDeclarativeXmlListModel() +QQuickXmlListModel::~QQuickXmlListModel() { } @@ -704,18 +704,18 @@ QDeclarativeXmlListModel::~QDeclarativeXmlListModel() The roles to make available for this model. */ -QDeclarativeListProperty<QDeclarativeXmlListModelRole> QDeclarativeXmlListModel::roleObjects() +QQmlListProperty<QQuickXmlListModelRole> QQuickXmlListModel::roleObjects() { - Q_D(QDeclarativeXmlListModel); - QDeclarativeListProperty<QDeclarativeXmlListModelRole> list(this, d->roleObjects); - list.append = &QDeclarativeXmlListModelPrivate::append_role; - list.clear = &QDeclarativeXmlListModelPrivate::clear_role; + Q_D(QQuickXmlListModel); + QQmlListProperty<QQuickXmlListModelRole> list(this, d->roleObjects); + list.append = &QQuickXmlListModelPrivate::append_role; + list.clear = &QQuickXmlListModelPrivate::clear_role; return list; } -QHash<int,QVariant> QDeclarativeXmlListModel::data(int index, const QList<int> &roles) const +QHash<int,QVariant> QQuickXmlListModel::data(int index, const QList<int> &roles) const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); QHash<int, QVariant> rv; for (int i = 0; i < roles.size(); ++i) { int role = roles.at(i); @@ -725,9 +725,9 @@ QHash<int,QVariant> QDeclarativeXmlListModel::data(int index, const QList<int> & return rv; } -QVariant QDeclarativeXmlListModel::data(int index, int role) const +QVariant QQuickXmlListModel::data(int index, int role) const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); int roleIndex = d->roles.indexOf(role); return (roleIndex == -1) ? QVariant() : d->data.value(roleIndex).value(index); } @@ -736,21 +736,21 @@ QVariant QDeclarativeXmlListModel::data(int index, int role) const \qmlproperty int QtQuick2::XmlListModel::count The number of data entries in the model. */ -int QDeclarativeXmlListModel::count() const +int QQuickXmlListModel::count() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->size; } -QList<int> QDeclarativeXmlListModel::roles() const +QList<int> QQuickXmlListModel::roles() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->roles; } -QString QDeclarativeXmlListModel::toString(int role) const +QString QQuickXmlListModel::toString(int role) const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); int index = d->roles.indexOf(role); if (index == -1) return QString(); @@ -763,15 +763,15 @@ QString QDeclarativeXmlListModel::toString(int role) const If both \c source and \l xml are set, \l xml is used. */ -QUrl QDeclarativeXmlListModel::source() const +QUrl QQuickXmlListModel::source() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->src; } -void QDeclarativeXmlListModel::setSource(const QUrl &src) +void QQuickXmlListModel::setSource(const QUrl &src) { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); if (d->src != src) { d->src = src; if (d->xml.isEmpty()) // src is only used if d->xml is not set @@ -788,15 +788,15 @@ void QDeclarativeXmlListModel::setSource(const QUrl &src) If both \l source and \c xml are set, \c xml is used. */ -QString QDeclarativeXmlListModel::xml() const +QString QQuickXmlListModel::xml() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->xml; } -void QDeclarativeXmlListModel::setXml(const QString &xml) +void QQuickXmlListModel::setXml(const QString &xml) { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); if (d->xml != xml) { d->xml = xml; reload(); @@ -809,17 +809,17 @@ void QDeclarativeXmlListModel::setXml(const QString &xml) An absolute XPath query representing the base query for creating model items from this model's XmlRole objects. The query should start with '/' or '//'. */ -QString QDeclarativeXmlListModel::query() const +QString QQuickXmlListModel::query() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->query; } -void QDeclarativeXmlListModel::setQuery(const QString &query) +void QQuickXmlListModel::setQuery(const QString &query) { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); if (!query.startsWith(QLatin1Char('/'))) { - qmlInfo(this) << QCoreApplication::translate("QDeclarativeXmlRoleList", "An XmlListModel query must start with '/' or \"//\""); + qmlInfo(this) << QCoreApplication::translate("QQuickXmlRoleList", "An XmlListModel query must start with '/' or \"//\""); return; } @@ -848,15 +848,15 @@ void QDeclarativeXmlListModel::setQuery(const QString &query) } \endqml */ -QString QDeclarativeXmlListModel::namespaceDeclarations() const +QString QQuickXmlListModel::namespaceDeclarations() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->namespaces; } -void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarations) +void QQuickXmlListModel::setNamespaceDeclarations(const QString &declarations) { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); if (d->namespaces != declarations) { d->namespaces = declarations; reload(); @@ -886,22 +886,22 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati var title = model.get(0).title; \endjs */ -QDeclarativeV8Handle QDeclarativeXmlListModel::get(int index) const +QQmlV8Handle QQuickXmlListModel::get(int index) const { // Must be called with a context and handle scope - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); if (index < 0 || index >= count()) - return QDeclarativeV8Handle::fromHandle(v8::Undefined()); + return QQmlV8Handle::fromHandle(v8::Undefined()); - QDeclarativeEngine *engine = qmlContext(this)->engine(); - QV8Engine *v8engine = QDeclarativeEnginePrivate::getV8Engine(engine); + QQmlEngine *engine = qmlContext(this)->engine(); + QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine); v8::Local<v8::Object> rv = v8::Object::New(); for (int ii = 0; ii < d->roleObjects.count(); ++ii) rv->Set(v8engine->toString(d->roleObjects[ii]->name()), v8engine->fromVariant(d->data.value(ii).value(index))); - return QDeclarativeV8Handle::fromHandle(rv); + return QQmlV8Handle::fromHandle(rv); } /*! @@ -919,9 +919,9 @@ QDeclarativeV8Handle QDeclarativeXmlListModel::get(int index) const \sa progress */ -QDeclarativeXmlListModel::Status QDeclarativeXmlListModel::status() const +QQuickXmlListModel::Status QQuickXmlListModel::status() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->status; } @@ -940,9 +940,9 @@ QDeclarativeXmlListModel::Status QDeclarativeXmlListModel::status() const \sa status, source */ -qreal QDeclarativeXmlListModel::progress() const +qreal QQuickXmlListModel::progress() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->progress; } @@ -952,27 +952,27 @@ qreal QDeclarativeXmlListModel::progress() const Returns a string description of the last error that occurred if \l status is XmlListModel::Error. */ -QString QDeclarativeXmlListModel::errorString() const +QString QQuickXmlListModel::errorString() const { - Q_D(const QDeclarativeXmlListModel); + Q_D(const QQuickXmlListModel); return d->errorString; } -void QDeclarativeXmlListModel::classBegin() +void QQuickXmlListModel::classBegin() { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); d->isComponentComplete = false; - QDeclarativeXmlQueryEngine *queryEngine = QDeclarativeXmlQueryEngine::instance(qmlEngine(this)); - connect(queryEngine, SIGNAL(queryCompleted(QDeclarativeXmlQueryResult)), - SLOT(queryCompleted(QDeclarativeXmlQueryResult))); + QQuickXmlQueryEngine *queryEngine = QQuickXmlQueryEngine::instance(qmlEngine(this)); + connect(queryEngine, SIGNAL(queryCompleted(QQuickXmlQueryResult)), + SLOT(queryCompleted(QQuickXmlQueryResult))); connect(queryEngine, SIGNAL(error(void*,QString)), SLOT(queryError(void*,QString))); } -void QDeclarativeXmlListModel::componentComplete() +void QQuickXmlListModel::componentComplete() { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); d->isComponentComplete = true; reload(); } @@ -990,14 +990,14 @@ void QDeclarativeXmlListModel::componentComplete() \sa {Using key XML roles}, XmlRole::isKey */ -void QDeclarativeXmlListModel::reload() +void QQuickXmlListModel::reload() { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); if (!d->isComponentComplete) return; - QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->abort(d->queryId); + QQuickXmlQueryEngine::instance(qmlEngine(this))->abort(d->queryId); d->queryId = -1; if (d->size < 0) @@ -1009,7 +1009,7 @@ void QDeclarativeXmlListModel::reload() } if (!d->xml.isEmpty()) { - d->queryId = QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects, d->keyRoleResultsCache); + d->queryId = QQuickXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects, d->keyRoleResultsCache); d->notifyQueryStarted(false); } else if (d->src.isEmpty()) { @@ -1030,9 +1030,9 @@ void QDeclarativeXmlListModel::reload() #define XMLLISTMODEL_MAX_REDIRECT 16 -void QDeclarativeXmlListModel::requestFinished() +void QQuickXmlListModel::requestFinished() { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); d->redirectCount++; if (d->redirectCount < XMLLISTMODEL_MAX_REDIRECT) { @@ -1067,7 +1067,7 @@ void QDeclarativeXmlListModel::requestFinished() d->queryId = XMLLISTMODEL_CLEAR_ID; QTimer::singleShot(0, this, SLOT(dataCleared())); } else { - d->queryId = QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, data, &d->roleObjects, d->keyRoleResultsCache); + d->queryId = QQuickXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, data, &d->roleObjects, d->keyRoleResultsCache); } d->deleteReply(); @@ -1076,19 +1076,19 @@ void QDeclarativeXmlListModel::requestFinished() } } -void QDeclarativeXmlListModel::requestProgress(qint64 received, qint64 total) +void QQuickXmlListModel::requestProgress(qint64 received, qint64 total) { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); if (d->status == Loading && total > 0) { d->progress = qreal(received)/total; emit progressChanged(d->progress); } } -void QDeclarativeXmlListModel::dataCleared() +void QQuickXmlListModel::dataCleared() { - Q_D(QDeclarativeXmlListModel); - QDeclarativeXmlQueryResult r; + Q_D(QQuickXmlListModel); + QQuickXmlQueryResult r; r.queryId = XMLLISTMODEL_CLEAR_ID; r.size = 0; r.removed << qMakePair(0, count()); @@ -1096,12 +1096,12 @@ void QDeclarativeXmlListModel::dataCleared() queryCompleted(r); } -void QDeclarativeXmlListModel::queryError(void* object, const QString& error) +void QQuickXmlListModel::queryError(void* object, const QString& error) { // Be extra careful, object may no longer exist, it's just an ID. - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); for (int i=0; i<d->roleObjects.count(); i++) { - if (d->roleObjects.at(i) == static_cast<QDeclarativeXmlListModelRole*>(object)) { + if (d->roleObjects.at(i) == static_cast<QQuickXmlListModelRole*>(object)) { qmlInfo(d->roleObjects.at(i)) << QObject::tr("invalid query: \"%1\"").arg(error); return; } @@ -1109,9 +1109,9 @@ void QDeclarativeXmlListModel::queryError(void* object, const QString& error) qmlInfo(this) << QObject::tr("invalid query: \"%1\"").arg(error); } -void QDeclarativeXmlListModel::queryCompleted(const QDeclarativeXmlQueryResult &result) +void QQuickXmlListModel::queryCompleted(const QQuickXmlQueryResult &result) { - Q_D(QDeclarativeXmlListModel); + Q_D(QQuickXmlListModel); if (result.queryId != d->queryId) return; @@ -1157,4 +1157,4 @@ void QDeclarativeXmlListModel::queryCompleted(const QDeclarativeXmlQueryResult & QT_END_NAMESPACE -#include <qdeclarativexmllistmodel.moc> +#include <qqmlxmllistmodel.moc> diff --git a/src/imports/xmllistmodel/qdeclarativexmllistmodel_p.h b/src/imports/xmllistmodel/qqmlxmllistmodel_p.h index f34591d0a3..5bc4c7b494 100644 --- a/src/imports/xmllistmodel/qdeclarativexmllistmodel_p.h +++ b/src/imports/xmllistmodel/qqmlxmllistmodel_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEXMLLISTMODEL_H -#define QDECLARATIVEXMLLISTMODEL_H +#ifndef QQUICKXMLLISTMODEL_H +#define QQUICKXMLLISTMODEL_H -#include <qdeclarative.h> -#include <qdeclarativeinfo.h> +#include <qqml.h> +#include <qqmlinfo.h> #include <QtCore/qurl.h> #include <QtCore/qstringlist.h> @@ -56,11 +56,11 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeContext; -class QDeclarativeXmlListModelRole; -class QDeclarativeXmlListModelPrivate; +class QQmlContext; +class QQuickXmlListModelRole; +class QQuickXmlListModelPrivate; -struct QDeclarativeXmlQueryResult { +struct QQuickXmlQueryResult { int queryId; int size; QList<QList<QVariant> > data; @@ -69,10 +69,10 @@ struct QDeclarativeXmlQueryResult { QStringList keyRoleResultsCache; }; -class QDeclarativeXmlListModel : public QListModelInterface, public QDeclarativeParserStatus +class QQuickXmlListModel : public QListModelInterface, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) Q_ENUMS(Status) Q_PROPERTY(Status status READ status NOTIFY statusChanged) @@ -81,13 +81,13 @@ class QDeclarativeXmlListModel : public QListModelInterface, public QDeclarative Q_PROPERTY(QString xml READ xml WRITE setXml NOTIFY xmlChanged) Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged) Q_PROPERTY(QString namespaceDeclarations READ namespaceDeclarations WRITE setNamespaceDeclarations NOTIFY namespaceDeclarationsChanged) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeXmlListModelRole> roles READ roleObjects) + Q_PROPERTY(QQmlListProperty<QQuickXmlListModelRole> roles READ roleObjects) Q_PROPERTY(int count READ count NOTIFY countChanged) Q_CLASSINFO("DefaultProperty", "roles") public: - QDeclarativeXmlListModel(QObject *parent = 0); - ~QDeclarativeXmlListModel(); + QQuickXmlListModel(QObject *parent = 0); + ~QQuickXmlListModel(); virtual QHash<int,QVariant> data(int index, const QList<int> &roles = (QList<int>())) const; virtual QVariant data(int index, int role) const; @@ -95,7 +95,7 @@ public: virtual QList<int> roles() const; virtual QString toString(int role) const; - QDeclarativeListProperty<QDeclarativeXmlListModelRole> roleObjects(); + QQmlListProperty<QQuickXmlListModelRole> roleObjects(); QUrl source() const; void setSource(const QUrl&); @@ -109,7 +109,7 @@ public: QString namespaceDeclarations() const; void setNamespaceDeclarations(const QString&); - Q_INVOKABLE QDeclarativeV8Handle get(int index) const; + Q_INVOKABLE QQmlV8Handle get(int index) const; enum Status { Null, Ready, Loading, Error }; Status status() const; @@ -121,7 +121,7 @@ public: virtual void componentComplete(); Q_SIGNALS: - void statusChanged(QDeclarativeXmlListModel::Status); + void statusChanged(QQuickXmlListModel::Status); void progressChanged(qreal progress); void countChanged(); void sourceChanged(); @@ -140,23 +140,23 @@ private Q_SLOTS: void requestFinished(); void requestProgress(qint64,qint64); void dataCleared(); - void queryCompleted(const QDeclarativeXmlQueryResult &); + void queryCompleted(const QQuickXmlQueryResult &); void queryError(void* object, const QString& error); private: - Q_DECLARE_PRIVATE(QDeclarativeXmlListModel) - Q_DISABLE_COPY(QDeclarativeXmlListModel) + Q_DECLARE_PRIVATE(QQuickXmlListModel) + Q_DISABLE_COPY(QQuickXmlListModel) }; -class QDeclarativeXmlListModelRole : public QObject +class QQuickXmlListModelRole : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged) Q_PROPERTY(bool isKey READ isKey WRITE setIsKey NOTIFY isKeyChanged) public: - QDeclarativeXmlListModelRole() : m_isKey(false) {} - ~QDeclarativeXmlListModelRole() {} + QQuickXmlListModelRole() : m_isKey(false) {} + ~QQuickXmlListModelRole() {} QString name() const { return m_name; } void setName(const QString &name) { @@ -204,9 +204,9 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeXmlListModel) -QML_DECLARE_TYPE(QDeclarativeXmlListModelRole) +QML_DECLARE_TYPE(QQuickXmlListModel) +QML_DECLARE_TYPE(QQuickXmlListModelRole) QT_END_HEADER -#endif // QDECLARATIVEXMLLISTMODEL_H +#endif // QQUICKXMLLISTMODEL_H diff --git a/src/imports/xmllistmodel/xmllistmodel.pro b/src/imports/xmllistmodel/xmllistmodel.pro index d8121e8db8..8c056e8448 100644 --- a/src/imports/xmllistmodel/xmllistmodel.pro +++ b/src/imports/xmllistmodel/xmllistmodel.pro @@ -2,12 +2,12 @@ TARGET = qmlxmllistmodelplugin TARGETPATH = QtQuick/XmlListModel include(../qimportbase.pri) -QT += network declarative xmlpatterns declarative-private v8-private core-private +QT += network qml xmlpatterns qml-private v8-private core-private -SOURCES += qdeclarativexmllistmodel.cpp plugin.cpp -HEADERS += qdeclarativexmllistmodel_p.h +SOURCES += qqmlxmllistmodel.cpp plugin.cpp +HEADERS += qqmlxmllistmodel_p.h -DESTDIR = $$QT.declarative.imports/$$TARGETPATH +DESTDIR = $$QT.qml.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$PWD/qmldir diff --git a/src/plugins/accessible/quick/main.cpp b/src/plugins/accessible/quick/main.cpp index 08a5fe546b..783d4674da 100644 --- a/src/plugins/accessible/quick/main.cpp +++ b/src/plugins/accessible/quick/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -40,7 +40,7 @@ ****************************************************************************/ -#include "qdeclarativeaccessible.h" +#include "qqmlaccessible.h" #include "qaccessiblequickview.h" #include "qaccessiblequickitem.h" diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.cpp b/src/plugins/accessible/quick/qaccessiblequickitem.cpp index 806a0f50c8..78e7ca86ef 100644 --- a/src/plugins/accessible/quick/qaccessiblequickitem.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickitem.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE QAccessibleQuickItem::QAccessibleQuickItem(QQuickItem *item) - : QDeclarativeAccessible(item) + : QQmlAccessible(item) { } diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.h b/src/plugins/accessible/quick/qaccessiblequickitem.h index a283f853fd..5c19666f32 100644 --- a/src/plugins/accessible/quick/qaccessiblequickitem.h +++ b/src/plugins/accessible/quick/qaccessiblequickitem.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,13 +44,13 @@ #include <QtQuick/QQuickItem> #include <QtQuick/QQuickView> -#include "qdeclarativeaccessible.h" +#include "qqmlaccessible.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_ACCESSIBILITY -class QAccessibleQuickItem : public QDeclarativeAccessible +class QAccessibleQuickItem : public QQmlAccessible { public: QAccessibleQuickItem(QQuickItem *item); diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp index 05f0b8eed9..042d8dcf06 100644 --- a/src/plugins/accessible/quick/qaccessiblequickview.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,7 +45,7 @@ #include <QtQuick/private/qquickitem_p.h> #include "qaccessiblequickitem.h" -#include "qdeclarativeaccessible.h" +#include "qqmlaccessible.h" #ifndef QT_NO_ACCESSIBILITY diff --git a/src/plugins/accessible/quick/qaccessiblequickview.h b/src/plugins/accessible/quick/qaccessiblequickview.h index 66c8a52168..3ad87df937 100644 --- a/src/plugins/accessible/quick/qaccessiblequickview.h +++ b/src/plugins/accessible/quick/qaccessiblequickview.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/accessible/quick/quick.pro b/src/plugins/accessible/quick/quick.pro index 97a1d50098..ae6ec032da 100644 --- a/src/plugins/accessible/quick/quick.pro +++ b/src/plugins/accessible/quick/quick.pro @@ -4,7 +4,7 @@ TARGET = qtaccessiblequick load(qt_plugin) include ($$PWD/../shared/qaccessiblebase.pri) -QT += core-private gui-private v8-private declarative-private quick-private +QT += core-private gui-private v8-private qml-private quick-private DESTDIR = $$QT.gui.plugins/accessible QTDIR_build:REQUIRES += "contains(QT_CONFIG, accessibility)" diff --git a/src/plugins/accessible/shared/qaccessiblebase.pri b/src/plugins/accessible/shared/qaccessiblebase.pri index 8c82705443..56a8a1c9ef 100644 --- a/src/plugins/accessible/shared/qaccessiblebase.pri +++ b/src/plugins/accessible/shared/qaccessiblebase.pri @@ -3,5 +3,5 @@ INSTALLS += target INCLUDEPATH += $$PWD DEPENDPATH += $$PWD -SOURCES += $$PWD/qdeclarativeaccessible.cpp -HEADERS += $$PWD/qdeclarativeaccessible.h +SOURCES += $$PWD/qqmlaccessible.cpp +HEADERS += $$PWD/qqmlaccessible.h diff --git a/src/plugins/accessible/shared/qdeclarativeaccessible.cpp b/src/plugins/accessible/shared/qqmlaccessible.cpp index a063dd043d..1818ebebfe 100644 --- a/src/plugins/accessible/shared/qdeclarativeaccessible.cpp +++ b/src/plugins/accessible/shared/qqmlaccessible.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -40,7 +40,7 @@ ****************************************************************************/ #include <qnamespace.h> -#include "qdeclarativeaccessible.h" +#include "qqmlaccessible.h" #ifndef QT_NO_ACCESSIBILITY @@ -54,16 +54,16 @@ QString Q_GUI_EXPORT qTextAtOffsetFromString(int offset, QAccessible2::BoundaryT QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType, int *startOffset, int *endOffset, const QString& text); -QDeclarativeAccessible::QDeclarativeAccessible(QObject *object) +QQmlAccessible::QQmlAccessible(QObject *object) :QAccessibleObject(object) { } -QDeclarativeAccessible::~QDeclarativeAccessible() +QQmlAccessible::~QQmlAccessible() { } -QAccessibleInterface *QDeclarativeAccessible::childAt(int x, int y) const +QAccessibleInterface *QQmlAccessible::childAt(int x, int y) const { // Note that this function will disregard stacking order. // (QAccessibleQuickView::childAt() does this correctly and more efficient) @@ -85,7 +85,7 @@ QAccessibleInterface *QDeclarativeAccessible::childAt(int x, int y) const return 0; } -QAccessible::State QDeclarativeAccessible::state() const +QAccessible::State QQmlAccessible::state() const { QAccessible::State state; @@ -122,7 +122,7 @@ QAccessible::State QDeclarativeAccessible::state() const return state; } -QStringList QDeclarativeAccessible::actionNames() const +QStringList QQmlAccessible::actionNames() const { QStringList actions; switch (role()) { @@ -139,7 +139,7 @@ QStringList QDeclarativeAccessible::actionNames() const return actions; } -void QDeclarativeAccessible::doAction(const QString &actionName) +void QQmlAccessible::doAction(const QString &actionName) { if (role() == QAccessible::PushButton && actionName == QAccessibleActionInterface::pressAction()) { QMetaObject::invokeMethod(object(), "accessibleAction"); @@ -150,7 +150,7 @@ void QDeclarativeAccessible::doAction(const QString &actionName) } } -QStringList QDeclarativeAccessible::keyBindingsForAction(const QString &actionName) const +QStringList QQmlAccessible::keyBindingsForAction(const QString &actionName) const { Q_UNUSED(actionName) return QStringList(); diff --git a/src/plugins/accessible/shared/qdeclarativeaccessible.h b/src/plugins/accessible/shared/qqmlaccessible.h index 924e454fc9..570a3c8c40 100644 --- a/src/plugins/accessible/shared/qdeclarativeaccessible.h +++ b/src/plugins/accessible/shared/qqmlaccessible.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEACCESSIBLE_H -#define QDECLARATIVEACCESSIBLE_H +#ifndef QQMLACCESSIBLE_H +#define QQMLACCESSIBLE_H #include <QtGui/qaccessibleobject.h> #include <QtGui/qaccessible2.h> //#include <QtQuick1/qdeclarativeview.h> //#include <QtQuick1/qdeclarativeitem.h> -#include <QtDeclarative/qdeclarativeproperty.h> +#include <QtQml/qqmlproperty.h> //#include <private/qdeclarativeaccessible_p.h> @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE * Item interface classes: QAccessibleDeclarativeItem for QtQuick1 QAccessibleQuickItem for for QtQuick2 - Common base class: QDeclarativeAccessible + Common base class: QQmlAccessible * View interface classes. @@ -70,10 +70,10 @@ QT_BEGIN_NAMESPACE QAccessbileQuickView is the root for the SceneGraph implementation */ -class QDeclarativeAccessible: public QAccessibleObject, public QAccessibleActionInterface +class QQmlAccessible: public QAccessibleObject, public QAccessibleActionInterface { public: - ~QDeclarativeAccessible(); + ~QQmlAccessible(); virtual QRect viewRect() const = 0; QAccessibleInterface *childAt(int, int) const; @@ -86,11 +86,11 @@ public: protected: virtual bool clipsChildren() const = 0; // For subclasses, use instantiateObject factory method outside the class. - QDeclarativeAccessible(QObject *object); + QQmlAccessible(QObject *object); }; #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE -#endif // QDECLARATIVEACCESSIBLE_H +#endif // QQMLACCESSIBLE_H diff --git a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro index c1ca2a5ef9..6f973bcc18 100644 --- a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro +++ b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro @@ -1,10 +1,10 @@ TARGET = qmldbg_ost -QT += declarative network +QT += qml network load(qt_plugin) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling -QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)" +QTDIR_build:REQUIRES += "contains(QT_CONFIG, qml)" SOURCES += \ qmlostplugin.cpp \ diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp index d4d9629334..9bd68e7401 100644 --- a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp +++ b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,7 +42,7 @@ #include "qmlostplugin.h" #include "qostdevice.h" -#include <private/qdeclarativedebugserver_p.h> +#include <private/qqmldebugserver_p.h> #include <private/qpacketprotocol_p.h> QT_BEGIN_NAMESPACE @@ -55,7 +55,7 @@ public: QOstDevice *ost; QPacketProtocol *protocol; - QDeclarativeDebugServer *debugServer; + QQmlDebugServer *debugServer; }; QmlOstPluginPrivate::QmlOstPluginPrivate() : @@ -75,7 +75,7 @@ QmlOstPlugin::~QmlOstPlugin() delete d_ptr; } -void QmlOstPlugin::setServer(QDeclarativeDebugServer *server) +void QmlOstPlugin::setServer(QQmlDebugServer *server) { Q_D(QmlOstPlugin); d->debugServer = server; @@ -127,12 +127,12 @@ void QmlOstPlugin::setPort(int port, bool block) if (!ok) { if (d->ost->errorString().length()) qDebug("Error from QOstDevice: %s", qPrintable(d->ost->errorString())); - qWarning("QDeclarativeDebugServer: Unable to listen on OST"); // This message is part of the signalling - do not change the format! + qWarning("QQmlDebugServer: Unable to listen on OST"); // This message is part of the signalling - do not change the format! return; } d->protocol = new QPacketProtocol(d->ost, this); QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); - qWarning("QDeclarativeDebugServer: Waiting for connection via OST"); // This message is part of the signalling - do not change the format! + qWarning("QQmlDebugServer: Waiting for connection via OST"); // This message is part of the signalling - do not change the format! } void QmlOstPlugin::readyRead() diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h index 1bbba93b94..41c3a07f25 100644 --- a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h +++ b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,26 +43,26 @@ #define QMLOSTPLUGIN_H #include <QtWidgets/QStylePlugin> -#include <QtDeclarative/private/qdeclarativedebugserverconnection_p.h> +#include <QtQml/private/qqmldebugserverconnection_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeDebugServer; +class QQmlDebugServer; class QmlOstPluginPrivate; -class QmlOstPlugin : public QObject, public QDeclarativeDebugServerConnection +class QmlOstPlugin : public QObject, public QQmlDebugServerConnection { Q_OBJECT Q_DECLARE_PRIVATE(QmlOstPlugin) Q_DISABLE_COPY(QmlOstPlugin) - Q_INTERFACES(QDeclarativeDebugServerConnection) + Q_INTERFACES(QQmlDebugServerConnection) public: QmlOstPlugin(); ~QmlOstPlugin(); - void setServer(QDeclarativeDebugServer *server); + void setServer(QQmlDebugServer *server); void setPort(int port, bool bock); bool isConnected() const; diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp b/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp index 289418cd83..2c557ac3cc 100644 --- a/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp +++ b/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h b/src/plugins/qmltooling/qmldbg_ost/qostdevice.h index 609a71897b..4b645f9c8e 100644 --- a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h +++ b/src/plugins/qmltooling/qmldbg_ost/qostdevice.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h b/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h index 246e162aee..b9bf53fbd2 100644 --- a/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h +++ b/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp index e0662da590..bb4048ee92 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/highlight.h b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.h index 82096c6abd..1b1f10c8bb 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/highlight.h +++ b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro index b9c6584afc..014f964652 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro @@ -1,11 +1,11 @@ load(qt_module) TARGET = qmldbg_qtquick2 -QT += declarative-private quick-private core-private gui-private opengl-private v8-private +QT += qml-private quick-private core-private gui-private opengl-private v8-private load(qt_plugin) -DESTDIR = $$QT.declarative.plugins/qmltooling +DESTDIR = $$QT.qml.plugins/qmltooling INCLUDEPATH *= $$PWD $$PWD/../shared @@ -24,7 +24,7 @@ HEADERS += \ qquickviewinspector.h \ ../shared/abstracttool.h \ ../shared/abstractviewinspector.h \ - ../shared/qdeclarativeinspectorprotocol.h \ + ../shared/qqmlinspectorprotocol.h \ ../shared/qmlinspectorconstants.h target.path += $$[QT_INSTALL_PLUGINS]/qmltooling diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp index b146c6e846..200c66ee35 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -41,7 +41,7 @@ #include "qquickviewinspector.h" -#include "qdeclarativeinspectorprotocol.h" +#include "qqmlinspectorprotocol.h" #include "highlight.h" #include "selectiontool.h" @@ -206,7 +206,7 @@ void QQuickViewInspector::setWindowFlags(Qt::WindowFlags flags) w->setVisible(true); } -QDeclarativeEngine *QQuickViewInspector::declarativeEngine() const +QQmlEngine *QQuickViewInspector::declarativeEngine() const { return m_view->engine(); } diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h index 07c38b1d5e..fbc3c17b87 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -71,7 +71,7 @@ public: void changeTool(InspectorProtocol::Tool tool); Qt::WindowFlags windowFlags() const; void setWindowFlags(Qt::WindowFlags flags); - QDeclarativeEngine *declarativeEngine() const; + QQmlEngine *declarativeEngine() const; QQuickView *view() const { return m_view; } QQuickItem *overlay() const { return m_overlay; } diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.cpp index 206d0b2eb9..ea52788896 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,7 +43,7 @@ #include "qquickviewinspector.h" #include <QtCore/qplugin.h> -#include <QtDeclarative/private/qdeclarativeinspectorservice_p.h> +#include <QtQml/private/qqmlinspectorservice_p.h> #include <QtQuick/QQuickView> namespace QmlJSDebugger { diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.h b/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.h index d0f814c03c..d78aac6ead 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.h +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINSPECTORPLUGIN_H -#define QDECLARATIVEINSPECTORPLUGIN_H +#ifndef QTQUICK2PLUGINPLUGIN_H +#define QTQUICK2PLUGINPLUGIN_H #include <QtCore/QPointer> -#include <QtDeclarative/private/qdeclarativeinspectorinterface_p.h> +#include <QtQml/private/qqmlinspectorinterface_p.h> namespace QmlJSDebugger { @@ -51,17 +51,17 @@ class AbstractViewInspector; namespace QtQuick2 { -class QtQuick2Plugin : public QObject, public QDeclarativeInspectorInterface +class QtQuick2Plugin : public QObject, public QQmlInspectorInterface { Q_OBJECT Q_DISABLE_COPY(QtQuick2Plugin) - Q_INTERFACES(QDeclarativeInspectorInterface) + Q_INTERFACES(QQmlInspectorInterface) public: QtQuick2Plugin(); ~QtQuick2Plugin(); - // QDeclarativeInspectorInterface + // QQmlInspectorInterface bool canHandleView(QObject *view); void activate(QObject *view); void deactivate(); @@ -74,4 +74,4 @@ private: } // namespace QtQuick2 } // namespace QmlJSDebugger -#endif // QDECLARATIVEINSPECTORPLUGIN_H +#endif // QTQUICK2PLUGINPLUGIN_H diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.cpp index efa079dcf1..5ad102a92d 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.h b/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.h index 7767317abe..c2aa26a1a7 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.h +++ b/src/plugins/qmltooling/qmldbg_qtquick2/selectiontool.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro index 8ab507c055..cb663dbc0c 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro +++ b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro @@ -1,12 +1,12 @@ load(qt_module) TARGET = qmldbg_tcp -QT += declarative-private network +QT += qml-private network load(qt_plugin) -DESTDIR = $$QT.declarative.plugins/qmltooling -QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)" +DESTDIR = $$QT.qml.plugins/qmltooling +QTDIR_build:REQUIRES += "contains(QT_CONFIG, qml)" SOURCES += \ qtcpserverconnection.cpp diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp index 529d2094bf..63a3297f37 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp +++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,7 +45,7 @@ #include <QtNetwork/qtcpserver.h> #include <QtNetwork/qtcpsocket.h> -#include <private/qdeclarativedebugserver_p.h> +#include <private/qqmldebugserver_p.h> #include <private/qpacketprotocol_p.h> QT_BEGIN_NAMESPACE @@ -60,7 +60,7 @@ public: QPacketProtocol *protocol; QTcpServer *tcpServer; - QDeclarativeDebugServer *debugServer; + QQmlDebugServer *debugServer; }; QTcpServerConnectionPrivate::QTcpServerConnectionPrivate() : @@ -84,7 +84,7 @@ QTcpServerConnection::~QTcpServerConnection() delete d_ptr; } -void QTcpServerConnection::setServer(QDeclarativeDebugServer *server) +void QTcpServerConnection::setServer(QQmlDebugServer *server) { Q_D(QTcpServerConnection); d->debugServer = server; @@ -147,9 +147,9 @@ void QTcpServerConnection::listen() d->tcpServer = new QTcpServer(this); QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); if (d->tcpServer->listen(QHostAddress::Any, d->port)) - qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); + qWarning("QQmlDebugServer: Waiting for connection on port %d...", d->port); else - qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); + qWarning("QQmlDebugServer: Unable to listen on port %d", d->port); } @@ -170,7 +170,7 @@ void QTcpServerConnection::newConnection() Q_D(QTcpServerConnection); if (d->socket && d->socket->peerPort()) { - qWarning("QDeclarativeDebugServer: Another client is already connected"); + qWarning("QQmlDebugServer: Another client is already connected"); QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection(); delete faultyConnection; return; @@ -190,7 +190,7 @@ void QTcpServerConnection::newConnection() void QTcpServerConnection::invalidPacket() { - qWarning("QDeclarativeDebugServer: Received a corrupted packet! Giving up ..."); + qWarning("QQmlDebugServer: Received a corrupted packet! Giving up ..."); } Q_EXPORT_PLUGIN2(tcpserver, QTcpServerConnection) diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h index f090c9709f..74c6b95e56 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h +++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,25 +43,25 @@ #define QTCPSERVERCONNECTION_H #include <QtWidgets/QStylePlugin> -#include <QtDeclarative/private/qdeclarativedebugserverconnection_p.h> +#include <QtQml/private/qqmldebugserverconnection_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeDebugServer; +class QQmlDebugServer; class QTcpServerConnectionPrivate; -class QTcpServerConnection : public QObject, public QDeclarativeDebugServerConnection +class QTcpServerConnection : public QObject, public QQmlDebugServerConnection { Q_OBJECT Q_DECLARE_PRIVATE(QTcpServerConnection) Q_DISABLE_COPY(QTcpServerConnection) - Q_INTERFACES(QDeclarativeDebugServerConnection) + Q_INTERFACES(QQmlDebugServerConnection) public: QTcpServerConnection(); ~QTcpServerConnection(); - void setServer(QDeclarativeDebugServer *server); + void setServer(QQmlDebugServer *server); void setPort(int port, bool bock); bool isConnected() const; diff --git a/src/plugins/qmltooling/shared/abstracttool.cpp b/src/plugins/qmltooling/shared/abstracttool.cpp index 0565537cca..69e468bd92 100644 --- a/src/plugins/qmltooling/shared/abstracttool.cpp +++ b/src/plugins/qmltooling/shared/abstracttool.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/shared/abstracttool.h b/src/plugins/qmltooling/shared/abstracttool.h index e21e3be1f8..35817064e2 100644 --- a/src/plugins/qmltooling/shared/abstracttool.h +++ b/src/plugins/qmltooling/shared/abstracttool.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.cpp b/src/plugins/qmltooling/shared/abstractviewinspector.cpp index cfa0f441cd..33e47d270d 100644 --- a/src/plugins/qmltooling/shared/abstractviewinspector.cpp +++ b/src/plugins/qmltooling/shared/abstractviewinspector.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,12 +42,12 @@ #include "abstractviewinspector.h" #include "abstracttool.h" -#include "qdeclarativeinspectorprotocol.h" +#include "qqmlinspectorprotocol.h" -#include <QtDeclarative/QDeclarativeEngine> -#include <QtDeclarative/QDeclarativeComponent> +#include <QtQml/QQmlEngine> +#include <QtQml/QQmlComponent> #include <QtCore/private/qabstractanimation_p.h> -#include <QtDeclarative/private/qdeclarativeinspectorservice_p.h> +#include <QtQml/private/qqmlinspectorservice_p.h> #include <QtGui/QMouseEvent> @@ -61,7 +61,7 @@ AbstractViewInspector::AbstractViewInspector(QObject *parent) : m_designModeBehavior(false), m_animationPaused(false), m_slowDownFactor(1.0), - m_debugService(QDeclarativeInspectorService::instance()) + m_debugService(QQmlInspectorService::instance()) { } @@ -78,8 +78,8 @@ void AbstractViewInspector::createQmlObject(const QString &qml, QObject *parent, imports += QLatin1Char('\n'); } - QDeclarativeContext *parentContext = declarativeEngine()->contextForObject(parent); - QDeclarativeComponent component(declarativeEngine()); + QQmlContext *parentContext = declarativeEngine()->contextForObject(parent); + QQmlComponent component(declarativeEngine()); QByteArray constructedQml = QString(imports + qml).toLatin1(); component.setData(constructedQml, QUrl::fromLocalFile(filename)); @@ -316,7 +316,7 @@ void AbstractViewInspector::handleMessage(const QByteArray &message) for (int i = 0; i < itemCount; ++i) { int debugId = -1; ds >> debugId; - if (QObject *obj = QDeclarativeDebugService::objectForId(debugId)) + if (QObject *obj = QQmlDebugService::objectForId(debugId)) selectedObjects << obj; } @@ -363,22 +363,22 @@ void AbstractViewInspector::handleMessage(const QByteArray &message) QString filename; QStringList imports; ds >> qml >> parentId >> imports >> filename; - createQmlObject(qml, QDeclarativeDebugService::objectForId(parentId), + createQmlObject(qml, QQmlDebugService::objectForId(parentId), imports, filename); break; } case InspectorProtocol::DestroyObject: { int debugId; ds >> debugId; - if (QObject *obj = QDeclarativeDebugService::objectForId(debugId)) + if (QObject *obj = QQmlDebugService::objectForId(debugId)) obj->deleteLater(); break; } case InspectorProtocol::MoveObject: { int debugId, newParent; ds >> debugId >> newParent; - reparentQmlObject(QDeclarativeDebugService::objectForId(debugId), - QDeclarativeDebugService::objectForId(newParent)); + reparentQmlObject(QQmlDebugService::objectForId(debugId), + QQmlDebugService::objectForId(newParent)); break; } case InspectorProtocol::ObjectIdList: { @@ -424,7 +424,7 @@ void AbstractViewInspector::sendCurrentObjects(const QList<QObject*> &objects) << objects.length(); foreach (QObject *object, objects) { - int id = QDeclarativeDebugService::idForObject(object); + int id = QQmlDebugService::idForObject(object); ds << id; } @@ -497,7 +497,7 @@ void AbstractViewInspector::sendColorChanged(const QColor &color) QString AbstractViewInspector::idStringForObject(QObject *obj) const { - const int id = QDeclarativeDebugService::idForObject(obj); + const int id = QQmlDebugService::idForObject(obj); return m_stringIdForObjectId.value(id); } diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.h b/src/plugins/qmltooling/shared/abstractviewinspector.h index 741013239f..0dacc92233 100644 --- a/src/plugins/qmltooling/shared/abstractviewinspector.h +++ b/src/plugins/qmltooling/shared/abstractviewinspector.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -47,12 +47,12 @@ #include <QtCore/QStringList> #include <QtGui/QColor> -#include "qdeclarativeinspectorprotocol.h" +#include "qqmlinspectorprotocol.h" #include "qmlinspectorconstants.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeInspectorService; +class QQmlEngine; +class QQmlInspectorService; class QKeyEvent; class QMouseEvent; class QWheelEvent; @@ -63,7 +63,7 @@ namespace QmlJSDebugger { class AbstractTool; /* - * The common code between QQuickView and QDeclarativeView inspectors lives here, + * The common code between QQuickView and QQuickView inspectors lives here, */ class AbstractViewInspector : public QObject { @@ -100,7 +100,7 @@ public: virtual void changeTool(InspectorProtocol::Tool tool) = 0; virtual Qt::WindowFlags windowFlags() const = 0; virtual void setWindowFlags(Qt::WindowFlags flags) = 0; - virtual QDeclarativeEngine *declarativeEngine() const = 0; + virtual QQmlEngine *declarativeEngine() const = 0; signals: void designModeBehaviorChanged(bool inDesignMode); @@ -159,7 +159,7 @@ private: qreal m_slowDownFactor; QHash<int, QString> m_stringIdForObjectId; - QDeclarativeInspectorService *m_debugService; + QQmlInspectorService *m_debugService; }; } // namespace QmlJSDebugger diff --git a/src/plugins/qmltooling/shared/qmlinspectorconstants.h b/src/plugins/qmltooling/shared/qmlinspectorconstants.h index 1b25486bb6..e5a0ee5450 100644 --- a/src/plugins/qmltooling/shared/qmlinspectorconstants.h +++ b/src/plugins/qmltooling/shared/qmlinspectorconstants.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,7 +42,7 @@ #ifndef QMLINSPECTORCONSTANTS_H #define QMLINSPECTORCONSTANTS_H -#include <QtDeclarative/private/qdeclarativeglobal_p.h> +#include <QtQml/private/qqmlglobal_p.h> namespace QmlJSDebugger { namespace Constants { diff --git a/src/plugins/qmltooling/shared/qdeclarativeinspectorprotocol.h b/src/plugins/qmltooling/shared/qqmlinspectorprotocol.h index 4c833b99dc..63772aa8e4 100644 --- a/src/plugins/qmltooling/shared/qdeclarativeinspectorprotocol.h +++ b/src/plugins/qmltooling/shared/qqmlinspectorprotocol.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINSPECTORPROTOCOL_H -#define QDECLARATIVEINSPECTORPROTOCOL_H +#ifndef QQMLINSPECTORPROTOCOL_H +#define QQMLINSPECTORPROTOCOL_H #include <QtCore/QDebug> #include <QtCore/QMetaType> @@ -134,4 +134,4 @@ inline QDebug operator<< (QDebug dbg, InspectorProtocol::Tool tool) } // namespace QmlJSDebugger -#endif // QDECLARATIVEINSPECTORPROTOCOL_H +#endif // QQMLINSPECTORPROTOCOL_H diff --git a/src/declarative/animations/animations.pri b/src/qml/animations/animations.pri index 01ac25af46..01ac25af46 100644 --- a/src/declarative/animations/animations.pri +++ b/src/qml/animations/animations.pri diff --git a/src/declarative/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index 4d149ce99a..2bfc66fea0 100644 --- a/src/declarative/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -50,10 +50,10 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_THREAD -Q_GLOBAL_STATIC(QThreadStorage<QDeclarativeAnimationTimer *>, animationTimer) +Q_GLOBAL_STATIC(QThreadStorage<QQmlAnimationTimer *>, animationTimer) #endif -QDeclarativeAnimationTimer::QDeclarativeAnimationTimer() : +QQmlAnimationTimer::QQmlAnimationTimer() : QAbstractAnimationTimer(), lastTick(0), lastDelta(0), currentAnimationIdx(0), insideTick(false), startAnimationPending(false), stopTimerPending(false), @@ -61,12 +61,12 @@ QDeclarativeAnimationTimer::QDeclarativeAnimationTimer() : { } -QDeclarativeAnimationTimer *QDeclarativeAnimationTimer::instance(bool create) +QQmlAnimationTimer *QQmlAnimationTimer::instance(bool create) { - QDeclarativeAnimationTimer *inst; + QQmlAnimationTimer *inst; #ifndef QT_NO_THREAD if (create && !animationTimer()->hasLocalData()) { - inst = new QDeclarativeAnimationTimer; + inst = new QQmlAnimationTimer; animationTimer()->setLocalData(inst); } else { inst = animationTimer() ? animationTimer()->localData() : 0; @@ -78,20 +78,20 @@ QDeclarativeAnimationTimer *QDeclarativeAnimationTimer::instance(bool create) return inst; } -QDeclarativeAnimationTimer *QDeclarativeAnimationTimer::instance() +QQmlAnimationTimer *QQmlAnimationTimer::instance() { return instance(true); } -void QDeclarativeAnimationTimer::ensureTimerUpdate() +void QQmlAnimationTimer::ensureTimerUpdate() { - QDeclarativeAnimationTimer *inst = QDeclarativeAnimationTimer::instance(false); + QQmlAnimationTimer *inst = QQmlAnimationTimer::instance(false); QUnifiedTimer *instU = QUnifiedTimer::instance(false); if (instU && inst && inst->isPaused) instU->updateAnimationTimers(-1); } -void QDeclarativeAnimationTimer::updateAnimationsTime(qint64 delta) +void QQmlAnimationTimer::updateAnimationsTime(qint64 delta) { //setCurrentTime can get this called again while we're the for loop. At least with pauseAnimations if (insideTick) @@ -116,14 +116,14 @@ void QDeclarativeAnimationTimer::updateAnimationsTime(qint64 delta) } } -void QDeclarativeAnimationTimer::updateAnimationTimer() +void QQmlAnimationTimer::updateAnimationTimer() { - QDeclarativeAnimationTimer *inst = QDeclarativeAnimationTimer::instance(false); + QQmlAnimationTimer *inst = QQmlAnimationTimer::instance(false); if (inst) inst->restartAnimationTimer(); } -void QDeclarativeAnimationTimer::restartAnimationTimer() +void QQmlAnimationTimer::restartAnimationTimer() { if (runningLeafAnimations == 0 && !runningPauseAnimations.isEmpty()) QUnifiedTimer::pauseAnimationTimer(this, closestPauseAnimationTimeToFinish()); @@ -133,7 +133,7 @@ void QDeclarativeAnimationTimer::restartAnimationTimer() QUnifiedTimer::startAnimationTimer(this); } -void QDeclarativeAnimationTimer::startAnimations() +void QQmlAnimationTimer::startAnimations() { startAnimationPending = false; //force timer to update, which prevents large deltas for our newly added animations @@ -147,7 +147,7 @@ void QDeclarativeAnimationTimer::startAnimations() restartAnimationTimer(); } -void QDeclarativeAnimationTimer::stopTimer() +void QQmlAnimationTimer::stopTimer() { stopTimerPending = false; if (animations.isEmpty()) { @@ -159,9 +159,9 @@ void QDeclarativeAnimationTimer::stopTimer() } } -void QDeclarativeAnimationTimer::registerAnimation(QAbstractAnimationJob *animation, bool isTopLevel) +void QQmlAnimationTimer::registerAnimation(QAbstractAnimationJob *animation, bool isTopLevel) { - QDeclarativeAnimationTimer *inst = instance(true); //we create the instance if needed + QQmlAnimationTimer *inst = instance(true); //we create the instance if needed inst->registerRunningAnimation(animation); if (isTopLevel) { Q_ASSERT(!animation->m_hasRegisteredTimer); @@ -174,9 +174,9 @@ void QDeclarativeAnimationTimer::registerAnimation(QAbstractAnimationJob *animat } } -void QDeclarativeAnimationTimer::unregisterAnimation(QAbstractAnimationJob *animation) +void QQmlAnimationTimer::unregisterAnimation(QAbstractAnimationJob *animation) { - QDeclarativeAnimationTimer *inst = QDeclarativeAnimationTimer::instance(false); + QQmlAnimationTimer *inst = QQmlAnimationTimer::instance(false); if (inst) { //at this point the unified timer should have been created //but it might also have been already destroyed in case the application is shutting down @@ -204,7 +204,7 @@ void QDeclarativeAnimationTimer::unregisterAnimation(QAbstractAnimationJob *anim animation->m_hasRegisteredTimer = false; } -void QDeclarativeAnimationTimer::registerRunningAnimation(QAbstractAnimationJob *animation) +void QQmlAnimationTimer::registerRunningAnimation(QAbstractAnimationJob *animation) { if (animation->m_isGroup) return; @@ -215,7 +215,7 @@ void QDeclarativeAnimationTimer::registerRunningAnimation(QAbstractAnimationJob runningLeafAnimations++; } -void QDeclarativeAnimationTimer::unregisterRunningAnimation(QAbstractAnimationJob *animation) +void QQmlAnimationTimer::unregisterRunningAnimation(QAbstractAnimationJob *animation) { if (animation->m_isGroup) return; @@ -227,7 +227,7 @@ void QDeclarativeAnimationTimer::unregisterRunningAnimation(QAbstractAnimationJo Q_ASSERT(runningLeafAnimations >= 0); } -int QDeclarativeAnimationTimer::closestPauseAnimationTimeToFinish() +int QQmlAnimationTimer::closestPauseAnimationTimeToFinish() { int closestTimeToFinish = INT_MAX; for (int i = 0; i < runningPauseAnimations.size(); ++i) { @@ -276,7 +276,7 @@ QAbstractAnimationJob::~QAbstractAnimationJob() m_state = Stopped; stateChanged(oldState, m_state); if (oldState == Running) - QDeclarativeAnimationTimer::unregisterAnimation(this); + QQmlAnimationTimer::unregisterAnimation(this); } if (m_group) @@ -311,11 +311,11 @@ void QAbstractAnimationJob::setState(QAbstractAnimationJob::State newState) bool isTopLevel = !m_group || m_group->isStopped(); if (oldState == Running) { if (newState == Paused && m_hasRegisteredTimer) - QDeclarativeAnimationTimer::ensureTimerUpdate(); + QQmlAnimationTimer::ensureTimerUpdate(); //the animation, is not running any more - QDeclarativeAnimationTimer::unregisterAnimation(this); + QQmlAnimationTimer::unregisterAnimation(this); } else if (newState == Running) { - QDeclarativeAnimationTimer::registerAnimation(this, isTopLevel); + QQmlAnimationTimer::registerAnimation(this, isTopLevel); } //starting an animation qualifies as a top level loop change @@ -341,7 +341,7 @@ void QAbstractAnimationJob::setState(QAbstractAnimationJob::State newState) if (oldState == Stopped) { if (isTopLevel) { // currentTime needs to be updated if pauseTimer is active - QDeclarativeAnimationTimer::ensureTimerUpdate(); + QQmlAnimationTimer::ensureTimerUpdate(); setCurrentTime(m_totalCurrentTime); } } @@ -378,14 +378,14 @@ void QAbstractAnimationJob::setDirection(Direction direction) // the commands order below is important: first we need to setCurrentTime with the old direction, // then update the direction on this and all children and finally restart the pauseTimer if needed if (m_hasRegisteredTimer) - QDeclarativeAnimationTimer::ensureTimerUpdate(); + QQmlAnimationTimer::ensureTimerUpdate(); m_direction = direction; updateDirection(direction); if (m_hasRegisteredTimer) // needed to update the timer interval in case of a pause animation - QDeclarativeAnimationTimer::updateAnimationTimer(); + QQmlAnimationTimer::updateAnimationTimer(); } void QAbstractAnimationJob::setLoopCount(int loopCount) diff --git a/src/declarative/animations/qabstractanimationjob_p.h b/src/qml/animations/qabstractanimationjob_p.h index 675082f0b7..f00090cb30 100644 --- a/src/declarative/animations/qabstractanimationjob_p.h +++ b/src/qml/animations/qabstractanimationjob_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,6 +42,7 @@ #ifndef QABSTRACTANIMATIONJOB_P_H #define QABSTRACTANIMATIONJOB_P_H +#include <QtQml/qtqmlglobal.h> #include <QtCore/QObject> #include <QtCore/private/qabstractanimation_p.h> #include "private/qpodvector_p.h" @@ -50,11 +51,11 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) +QT_MODULE(Qml) class QAnimationGroupJob; class QAnimationJobChangeListener; -class Q_DECLARATIVE_EXPORT QAbstractAnimationJob +class Q_QML_EXPORT QAbstractAnimationJob { Q_DISABLE_COPY(QAbstractAnimationJob) public: @@ -154,7 +155,7 @@ protected: QAbstractAnimationJob *m_nextSibling; QAbstractAnimationJob *m_previousSibling; - friend class QDeclarativeAnimationTimer; + friend class QQmlAnimationTimer; friend class QAnimationGroupJob; }; @@ -166,15 +167,15 @@ public: virtual void animationCurrentLoopChanged(QAbstractAnimationJob *) {} }; -class Q_DECLARATIVE_EXPORT QDeclarativeAnimationTimer : public QAbstractAnimationTimer +class Q_QML_EXPORT QQmlAnimationTimer : public QAbstractAnimationTimer { Q_OBJECT private: - QDeclarativeAnimationTimer(); + QQmlAnimationTimer(); public: - static QDeclarativeAnimationTimer *instance(); - static QDeclarativeAnimationTimer *instance(bool create); + static QQmlAnimationTimer *instance(); + static QQmlAnimationTimer *instance(bool create); static void registerAnimation(QAbstractAnimationJob *animation, bool isTopLevel); static void unregisterAnimation(QAbstractAnimationJob *animation); diff --git a/src/declarative/animations/qanimationgroupjob.cpp b/src/qml/animations/qanimationgroupjob.cpp index 7e26f9778d..83b2192313 100644 --- a/src/declarative/animations/qanimationgroupjob.cpp +++ b/src/qml/animations/qanimationgroupjob.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/animations/qanimationgroupjob_p.h b/src/qml/animations/qanimationgroupjob_p.h index d1917a5249..303dc898d9 100644 --- a/src/declarative/animations/qanimationgroupjob_p.h +++ b/src/qml/animations/qanimationgroupjob_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,9 +48,9 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) +QT_MODULE(Qml) -class Q_DECLARATIVE_EXPORT QAnimationGroupJob : public QAbstractAnimationJob +class Q_QML_EXPORT QAnimationGroupJob : public QAbstractAnimationJob { Q_DISABLE_COPY(QAnimationGroupJob) public: diff --git a/src/declarative/animations/qanimationjobutil_p.h b/src/qml/animations/qanimationjobutil_p.h index b8a627e2da..c891b8725d 100644 --- a/src/declarative/animations/qanimationjobutil_p.h +++ b/src/qml/animations/qanimationjobutil_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/animations/qparallelanimationgroupjob.cpp b/src/qml/animations/qparallelanimationgroupjob.cpp index 5a417dccf4..0472c959f4 100644 --- a/src/declarative/animations/qparallelanimationgroupjob.cpp +++ b/src/qml/animations/qparallelanimationgroupjob.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/animations/qparallelanimationgroupjob_p.h b/src/qml/animations/qparallelanimationgroupjob_p.h index 42a96b50d5..d77a8c84f9 100644 --- a/src/declarative/animations/qparallelanimationgroupjob_p.h +++ b/src/qml/animations/qparallelanimationgroupjob_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,9 +48,9 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) +QT_MODULE(Qml) -class Q_DECLARATIVE_EXPORT QParallelAnimationGroupJob : public QAnimationGroupJob +class Q_QML_EXPORT QParallelAnimationGroupJob : public QAnimationGroupJob { Q_DISABLE_COPY(QParallelAnimationGroupJob) public: diff --git a/src/declarative/animations/qpauseanimationjob.cpp b/src/qml/animations/qpauseanimationjob.cpp index c362f5ab58..40bcef7e89 100644 --- a/src/declarative/animations/qpauseanimationjob.cpp +++ b/src/qml/animations/qpauseanimationjob.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/animations/qpauseanimationjob_p.h b/src/qml/animations/qpauseanimationjob_p.h index d4af832577..82462be101 100644 --- a/src/declarative/animations/qpauseanimationjob_p.h +++ b/src/qml/animations/qpauseanimationjob_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,9 +48,9 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) +QT_MODULE(Qml) -class Q_DECLARATIVE_EXPORT QPauseAnimationJob : public QAbstractAnimationJob +class Q_QML_EXPORT QPauseAnimationJob : public QAbstractAnimationJob { Q_DISABLE_COPY(QPauseAnimationJob) public: diff --git a/src/declarative/animations/qsequentialanimationgroupjob.cpp b/src/qml/animations/qsequentialanimationgroupjob.cpp index f999ca34d7..12cce39fbc 100644 --- a/src/declarative/animations/qsequentialanimationgroupjob.cpp +++ b/src/qml/animations/qsequentialanimationgroupjob.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/animations/qsequentialanimationgroupjob_p.h b/src/qml/animations/qsequentialanimationgroupjob_p.h index 4c1fb2d55a..b406d04f6f 100644 --- a/src/declarative/animations/qsequentialanimationgroupjob_p.h +++ b/src/qml/animations/qsequentialanimationgroupjob_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,10 +48,10 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) +QT_MODULE(Qml) class QPauseAnimationJob; -class Q_DECLARATIVE_EXPORT QSequentialAnimationGroupJob : public QAnimationGroupJob +class Q_QML_EXPORT QSequentialAnimationGroupJob : public QAnimationGroupJob { Q_DISABLE_COPY(QSequentialAnimationGroupJob) public: diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri new file mode 100644 index 0000000000..10ca9706c4 --- /dev/null +++ b/src/qml/debugger/debugger.pri @@ -0,0 +1,32 @@ +SOURCES += \ + $$PWD/qpacketprotocol.cpp \ + $$PWD/qqmldebugservice.cpp \ + $$PWD/qqmldebugclient.cpp \ + $$PWD/qqmlenginedebug.cpp \ + $$PWD/qqmlprofilerservice.cpp \ + $$PWD/qqmldebughelper.cpp \ + $$PWD/qqmldebugserver.cpp \ + $$PWD/qqmlinspectorservice.cpp \ + $$PWD/qv8debugservice.cpp \ + $$PWD/qv8profilerservice.cpp \ + $$PWD/qqmlenginedebugservice.cpp \ + $$PWD/qdebugmessageservice.cpp + +HEADERS += \ + $$PWD/qpacketprotocol_p.h \ + $$PWD/qqmldebugservice_p.h \ + $$PWD/qqmldebugservice_p_p.h \ + $$PWD/qqmldebugclient_p.h \ + $$PWD/qqmlenginedebug_p.h \ + $$PWD/qqmlprofilerservice_p.h \ + $$PWD/qqmldebughelper_p.h \ + $$PWD/qqmldebugserver_p.h \ + $$PWD/qqmldebugserverconnection_p.h \ + $$PWD/qqmldebugstatesdelegate_p.h \ + $$PWD/qqmlinspectorservice_p.h \ + $$PWD/qqmlinspectorinterface_p.h \ + $$PWD/qv8debugservice_p.h \ + $$PWD/qv8profilerservice_p.h \ + $$PWD/qqmlenginedebugservice_p.h \ + $$PWD/qqmldebug.h \ + $$PWD/qdebugmessageservice_p.h diff --git a/src/declarative/debugger/qdebugmessageservice.cpp b/src/qml/debugger/qdebugmessageservice.cpp index 3f18a0fe4b..2c52809e56 100644 --- a/src/declarative/debugger/qdebugmessageservice.cpp +++ b/src/qml/debugger/qdebugmessageservice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -40,11 +40,11 @@ ****************************************************************************/ #include "qdebugmessageservice_p.h" -#include "qdeclarativedebugservice_p_p.h" +#include "qqmldebugservice_p_p.h" QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QDebugMessageService, declarativeDebugMessageService) +Q_GLOBAL_STATIC(QDebugMessageService, qmlDebugMessageService) void DebugMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, const char *buf) @@ -52,21 +52,21 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, QDebugMessageService::instance()->sendDebugMessage(type, ctxt, buf); } -class QDebugMessageServicePrivate : public QDeclarativeDebugServicePrivate +class QDebugMessageServicePrivate : public QQmlDebugServicePrivate { public: QDebugMessageServicePrivate() : oldMsgHandler(0) - , prevState(QDeclarativeDebugService::NotConnected) + , prevState(QQmlDebugService::NotConnected) { } QMessageHandler oldMsgHandler; - QDeclarativeDebugService::State prevState; + QQmlDebugService::State prevState; }; QDebugMessageService::QDebugMessageService(QObject *parent) : - QDeclarativeDebugService(*(new QDebugMessageServicePrivate()), + QQmlDebugService(*(new QDebugMessageServicePrivate()), QLatin1String("DebugMessages"), 2, parent) { Q_D(QDebugMessageService); @@ -80,7 +80,7 @@ QDebugMessageService::QDebugMessageService(QObject *parent) : QDebugMessageService *QDebugMessageService::instance() { - return declarativeDebugMessageService(); + return qmlDebugMessageService(); } void QDebugMessageService::sendDebugMessage(QtMsgType type, diff --git a/src/declarative/debugger/qdebugmessageservice_p.h b/src/qml/debugger/qdebugmessageservice_p.h index b907341541..88b918e217 100644 --- a/src/declarative/debugger/qdebugmessageservice_p.h +++ b/src/qml/debugger/qdebugmessageservice_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,7 +53,7 @@ // We mean it. // -#include "qdeclarativedebugservice_p.h" +#include "qqmldebugservice_p.h" #include <QtCore/qlogging.h> @@ -61,11 +61,11 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) +QT_MODULE(Qml) class QDebugMessageServicePrivate; -class QDebugMessageService : public QDeclarativeDebugService +class QDebugMessageService : public QQmlDebugService { Q_OBJECT public: diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/qml/debugger/qpacketprotocol.cpp index fa5d676e0a..978054a238 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/qml/debugger/qpacketprotocol.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/debugger/qpacketprotocol_p.h b/src/qml/debugger/qpacketprotocol_p.h index eda7bfbac9..c6123d2836 100644 --- a/src/declarative/debugger/qpacketprotocol_p.h +++ b/src/qml/debugger/qpacketprotocol_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,7 +56,7 @@ #include <QtCore/qobject.h> #include <QtCore/qdatastream.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qtqmlglobal_p.h> QT_BEGIN_HEADER @@ -69,7 +69,7 @@ class QPacket; class QPacketAutoSend; class QPacketProtocolPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QPacketProtocol : public QObject +class Q_QML_PRIVATE_EXPORT QPacketProtocol : public QObject { Q_OBJECT public: @@ -101,7 +101,7 @@ private: }; -class Q_DECLARATIVE_PRIVATE_EXPORT QPacket : public QDataStream +class Q_QML_PRIVATE_EXPORT QPacket : public QDataStream { public: QPacket(); @@ -119,7 +119,7 @@ protected: QBuffer *buf; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QPacketAutoSend : public QPacket +class Q_QML_PRIVATE_EXPORT QPacketAutoSend : public QPacket { public: virtual ~QPacketAutoSend(); diff --git a/src/declarative/debugger/qdeclarativedebug.h b/src/qml/debugger/qqmldebug.h index e23e4ff41a..8036032150 100644 --- a/src/declarative/debugger/qdeclarativedebug.h +++ b/src/qml/debugger/qqmldebug.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,28 +39,28 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUG_H -#define QDECLARATIVEDEBUG_H +#ifndef QQMLDEBUG_H +#define QQMLDEBUG_H -#include <QtCore/qglobal.h> +#include <QtQml/qtqmlglobal.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -struct Q_DECLARATIVE_EXPORT QDeclarativeDebuggingEnabler +struct Q_QML_EXPORT QQmlDebuggingEnabler { - QDeclarativeDebuggingEnabler(); + QQmlDebuggingEnabler(); }; -// Execute code in constructor before first QDeclarativeEngine is instantiated +// Execute code in constructor before first QQmlEngine is instantiated #if defined(QT_DECLARATIVE_DEBUG) -static QDeclarativeDebuggingEnabler qmlEnableDebuggingHelper; +static QQmlDebuggingEnabler qmlEnableDebuggingHelper; #endif QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUG_H +#endif // QQMLDEBUG_H diff --git a/src/declarative/debugger/qdeclarativedebugclient.cpp b/src/qml/debugger/qqmldebugclient.cpp index df250f3ef6..12276b48fa 100644 --- a/src/declarative/debugger/qdeclarativedebugclient.cpp +++ b/src/qml/debugger/qqmldebugclient.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativedebugclient_p.h" +#include "qqmldebugclient_p.h" #include "qpacketprotocol_p.h" @@ -52,31 +52,31 @@ QT_BEGIN_NAMESPACE const int protocolVersion = 1; -const QString serverId = QLatin1String("QDeclarativeDebugServer"); -const QString clientId = QLatin1String("QDeclarativeDebugClient"); +const QString serverId = QLatin1String("QQmlDebugServer"); +const QString clientId = QLatin1String("QQmlDebugClient"); -class QDeclarativeDebugClientPrivate : public QObjectPrivate +class QQmlDebugClientPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeDebugClient) + Q_DECLARE_PUBLIC(QQmlDebugClient) public: - QDeclarativeDebugClientPrivate(); + QQmlDebugClientPrivate(); QString name; - QDeclarativeDebugConnection *connection; + QQmlDebugConnection *connection; }; -class QDeclarativeDebugConnectionPrivate : public QObject +class QQmlDebugConnectionPrivate : public QObject { Q_OBJECT public: - QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c); - QDeclarativeDebugConnection *q; + QQmlDebugConnectionPrivate(QQmlDebugConnection *c); + QQmlDebugConnection *q; QPacketProtocol *protocol; QIODevice *device; bool gotHello; QHash <QString, float> serverPlugins; - QHash<QString, QDeclarativeDebugClient *> plugins; + QHash<QString, QQmlDebugClient *> plugins; void advertisePlugins(); void connectDeviceSignals(); @@ -87,7 +87,7 @@ public Q_SLOTS: void deviceAboutToClose(); }; -QDeclarativeDebugConnectionPrivate::QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c) +QQmlDebugConnectionPrivate::QQmlDebugConnectionPrivate(QQmlDebugConnection *c) : QObject(c), q(c), protocol(0), device(0), gotHello(false) { protocol = new QPacketProtocol(q, this); @@ -95,7 +95,7 @@ QDeclarativeDebugConnectionPrivate::QDeclarativeDebugConnectionPrivate(QDeclarat QObject::connect(protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); } -void QDeclarativeDebugConnectionPrivate::advertisePlugins() +void QQmlDebugConnectionPrivate::advertisePlugins() { if (!q->isConnected()) return; @@ -106,7 +106,7 @@ void QDeclarativeDebugConnectionPrivate::advertisePlugins() q->flush(); } -void QDeclarativeDebugConnectionPrivate::connected() +void QQmlDebugConnectionPrivate::connected() { QPacket pack; pack << serverId << 0 << protocolVersion << plugins.keys(); @@ -114,7 +114,7 @@ void QDeclarativeDebugConnectionPrivate::connected() q->flush(); } -void QDeclarativeDebugConnectionPrivate::readyRead() +void QQmlDebugConnectionPrivate::readyRead() { if (!gotHello) { QPacket pack = protocol->read(); @@ -151,17 +151,17 @@ void QDeclarativeDebugConnectionPrivate::readyRead() } if (!validHello) { - qWarning("QDeclarativeDebugConnection: Invalid hello message"); + qWarning("QQmlDebugConnection: Invalid hello message"); QObject::disconnect(protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); return; } gotHello = true; - QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin(); + QHash<QString, QQmlDebugClient *>::Iterator iter = plugins.begin(); for (; iter != plugins.end(); ++iter) { - QDeclarativeDebugClient::State newState = QDeclarativeDebugClient::Unavailable; + QQmlDebugClient::State newState = QQmlDebugClient::Unavailable; if (serverPlugins.contains(iter.key())) - newState = QDeclarativeDebugClient::Enabled; + newState = QQmlDebugClient::Enabled; iter.value()->stateChanged(newState); } } @@ -195,12 +195,12 @@ void QDeclarativeDebugConnectionPrivate::readyRead() serverPlugins.insert(pluginNames.at(i), pluginVersion); } - QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin(); + QHash<QString, QQmlDebugClient *>::Iterator iter = plugins.begin(); for (; iter != plugins.end(); ++iter) { const QString pluginName = iter.key(); - QDeclarativeDebugClient::State newSate = QDeclarativeDebugClient::Unavailable; + QQmlDebugClient::State newSate = QQmlDebugClient::Unavailable; if (serverPlugins.contains(pluginName)) - newSate = QDeclarativeDebugClient::Enabled; + newSate = QQmlDebugClient::Enabled; if (oldServerPlugins.contains(pluginName) != serverPlugins.contains(pluginName)) { @@ -208,16 +208,16 @@ void QDeclarativeDebugConnectionPrivate::readyRead() } } } else { - qWarning() << "QDeclarativeDebugConnection: Unknown control message id" << op; + qWarning() << "QQmlDebugConnection: Unknown control message id" << op; } } else { QByteArray message; pack >> message; - QHash<QString, QDeclarativeDebugClient *>::Iterator iter = + QHash<QString, QQmlDebugClient *>::Iterator iter = plugins.find(name); if (iter == plugins.end()) { - qWarning() << "QDeclarativeDebugConnection: Message received for missing plugin" << name; + qWarning() << "QQmlDebugConnection: Message received for missing plugin" << name; } else { (*iter)->messageReceived(message); } @@ -225,67 +225,67 @@ void QDeclarativeDebugConnectionPrivate::readyRead() } } -void QDeclarativeDebugConnectionPrivate::deviceAboutToClose() +void QQmlDebugConnectionPrivate::deviceAboutToClose() { // This is nasty syntax but we want to emit our own aboutToClose signal (by calling QIODevice::close()) // without calling the underlying device close fn as that would cause an infinite loop q->QIODevice::close(); } -QDeclarativeDebugConnection::QDeclarativeDebugConnection(QObject *parent) - : QIODevice(parent), d(new QDeclarativeDebugConnectionPrivate(this)) +QQmlDebugConnection::QQmlDebugConnection(QObject *parent) + : QIODevice(parent), d(new QQmlDebugConnectionPrivate(this)) { } -QDeclarativeDebugConnection::~QDeclarativeDebugConnection() +QQmlDebugConnection::~QQmlDebugConnection() { - QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin(); + QHash<QString, QQmlDebugClient*>::iterator iter = d->plugins.begin(); for (; iter != d->plugins.end(); ++iter) { iter.value()->d_func()->connection = 0; - iter.value()->stateChanged(QDeclarativeDebugClient::NotConnected); + iter.value()->stateChanged(QQmlDebugClient::NotConnected); } } -bool QDeclarativeDebugConnection::isConnected() const +bool QQmlDebugConnection::isConnected() const { return state() == QAbstractSocket::ConnectedState; } -qint64 QDeclarativeDebugConnection::readData(char *data, qint64 maxSize) +qint64 QQmlDebugConnection::readData(char *data, qint64 maxSize) { return d->device->read(data, maxSize); } -qint64 QDeclarativeDebugConnection::writeData(const char *data, qint64 maxSize) +qint64 QQmlDebugConnection::writeData(const char *data, qint64 maxSize) { return d->device->write(data, maxSize); } -qint64 QDeclarativeDebugConnection::bytesAvailable() const +qint64 QQmlDebugConnection::bytesAvailable() const { return d->device->bytesAvailable(); } -bool QDeclarativeDebugConnection::isSequential() const +bool QQmlDebugConnection::isSequential() const { return true; } -void QDeclarativeDebugConnection::close() +void QQmlDebugConnection::close() { if (isOpen()) { QIODevice::close(); d->device->close(); emit stateChanged(QAbstractSocket::UnconnectedState); - QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin(); + QHash<QString, QQmlDebugClient*>::iterator iter = d->plugins.begin(); for (; iter != d->plugins.end(); ++iter) { - iter.value()->stateChanged(QDeclarativeDebugClient::NotConnected); + iter.value()->stateChanged(QQmlDebugClient::NotConnected); } } } -bool QDeclarativeDebugConnection::waitForConnected(int msecs) +bool QQmlDebugConnection::waitForConnected(int msecs) { QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(d->device); if (socket) @@ -293,7 +293,7 @@ bool QDeclarativeDebugConnection::waitForConnected(int msecs) return false; } -QAbstractSocket::SocketState QDeclarativeDebugConnection::state() const +QAbstractSocket::SocketState QQmlDebugConnection::state() const { QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(d->device); if (socket) @@ -302,7 +302,7 @@ QAbstractSocket::SocketState QDeclarativeDebugConnection::state() const return QAbstractSocket::UnconnectedState; } -void QDeclarativeDebugConnection::flush() +void QQmlDebugConnection::flush() { QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(d->device); if (socket) { @@ -311,7 +311,7 @@ void QDeclarativeDebugConnection::flush() } } -void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16 port) +void QQmlDebugConnection::connectToHost(const QString &hostName, quint16 port) { QTcpSocket *socket = new QTcpSocket(d); socket->setProxy(QNetworkProxy::NoProxy); @@ -325,7 +325,7 @@ void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16 QIODevice::open(ReadWrite | Unbuffered); } -void QDeclarativeDebugConnectionPrivate::connectDeviceSignals() +void QQmlDebugConnectionPrivate::connectDeviceSignals() { connect(device, SIGNAL(bytesWritten(qint64)), q, SIGNAL(bytesWritten(qint64))); connect(device, SIGNAL(readyRead()), q, SIGNAL(readyRead())); @@ -334,16 +334,16 @@ void QDeclarativeDebugConnectionPrivate::connectDeviceSignals() // -QDeclarativeDebugClientPrivate::QDeclarativeDebugClientPrivate() +QQmlDebugClientPrivate::QQmlDebugClientPrivate() : connection(0) { } -QDeclarativeDebugClient::QDeclarativeDebugClient(const QString &name, - QDeclarativeDebugConnection *parent) - : QObject(*(new QDeclarativeDebugClientPrivate), parent) +QQmlDebugClient::QQmlDebugClient(const QString &name, + QQmlDebugConnection *parent) + : QObject(*(new QQmlDebugClientPrivate), parent) { - Q_D(QDeclarativeDebugClient); + Q_D(QQmlDebugClient); d->name = name; d->connection = parent; @@ -351,7 +351,7 @@ QDeclarativeDebugClient::QDeclarativeDebugClient(const QString &name, return; if (d->connection->d->plugins.contains(name)) { - qWarning() << "QDeclarativeDebugClient: Conflicting plugin name" << name; + qWarning() << "QQmlDebugClient: Conflicting plugin name" << name; d->connection = 0; } else { d->connection->d->plugins.insert(name, this); @@ -359,32 +359,32 @@ QDeclarativeDebugClient::QDeclarativeDebugClient(const QString &name, } } -QDeclarativeDebugClient::~QDeclarativeDebugClient() +QQmlDebugClient::~QQmlDebugClient() { - Q_D(QDeclarativeDebugClient); + Q_D(QQmlDebugClient); if (d->connection && d->connection->d) { d->connection->d->plugins.remove(d->name); d->connection->d->advertisePlugins(); } } -QString QDeclarativeDebugClient::name() const +QString QQmlDebugClient::name() const { - Q_D(const QDeclarativeDebugClient); + Q_D(const QQmlDebugClient); return d->name; } -float QDeclarativeDebugClient::serviceVersion() const +float QQmlDebugClient::serviceVersion() const { - Q_D(const QDeclarativeDebugClient); + Q_D(const QQmlDebugClient); if (d->connection->d->serverPlugins.contains(d->name)) return d->connection->d->serverPlugins.value(d->name); return -1; } -QDeclarativeDebugClient::State QDeclarativeDebugClient::state() const +QQmlDebugClient::State QQmlDebugClient::state() const { - Q_D(const QDeclarativeDebugClient); + Q_D(const QQmlDebugClient); if (!d->connection || !d->connection->isConnected() || !d->connection->d->gotHello) @@ -396,9 +396,9 @@ QDeclarativeDebugClient::State QDeclarativeDebugClient::state() const return Unavailable; } -void QDeclarativeDebugClient::sendMessage(const QByteArray &message) +void QQmlDebugClient::sendMessage(const QByteArray &message) { - Q_D(QDeclarativeDebugClient); + Q_D(QQmlDebugClient); if (state() != Enabled) return; @@ -408,14 +408,14 @@ void QDeclarativeDebugClient::sendMessage(const QByteArray &message) d->connection->flush(); } -void QDeclarativeDebugClient::stateChanged(State) +void QQmlDebugClient::stateChanged(State) { } -void QDeclarativeDebugClient::messageReceived(const QByteArray &) +void QQmlDebugClient::messageReceived(const QByteArray &) { } QT_END_NAMESPACE -#include <qdeclarativedebugclient.moc> +#include <qqmldebugclient.moc> diff --git a/src/declarative/debugger/qdeclarativedebugclient_p.h b/src/qml/debugger/qqmldebugclient_p.h index 93c5be9e44..064e15cf49 100644 --- a/src/declarative/debugger/qdeclarativedebugclient_p.h +++ b/src/qml/debugger/qqmldebugclient_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGCLIENT_H -#define QDECLARATIVEDEBUGCLIENT_H +#ifndef QQMLDEBUGCLIENT_H +#define QQMLDEBUGCLIENT_H // // W A R N I N G @@ -55,21 +55,21 @@ #include <QtNetwork/qtcpsocket.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qtqmlglobal_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDebugConnectionPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugConnection : public QIODevice +class QQmlDebugConnectionPrivate; +class Q_QML_PRIVATE_EXPORT QQmlDebugConnection : public QIODevice { Q_OBJECT - Q_DISABLE_COPY(QDeclarativeDebugConnection) + Q_DISABLE_COPY(QQmlDebugConnection) public: - QDeclarativeDebugConnection(QObject * = 0); - ~QDeclarativeDebugConnection(); + QQmlDebugConnection(QObject * = 0); + ~QQmlDebugConnection(); void connectToHost(const QString &hostName, quint16 port); @@ -91,23 +91,23 @@ protected: qint64 writeData(const char *data, qint64 maxSize); private: - QDeclarativeDebugConnectionPrivate *d; - friend class QDeclarativeDebugClient; - friend class QDeclarativeDebugClientPrivate; + QQmlDebugConnectionPrivate *d; + friend class QQmlDebugClient; + friend class QQmlDebugClientPrivate; }; -class QDeclarativeDebugClientPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugClient : public QObject +class QQmlDebugClientPrivate; +class Q_QML_PRIVATE_EXPORT QQmlDebugClient : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeDebugClient) - Q_DISABLE_COPY(QDeclarativeDebugClient) + Q_DECLARE_PRIVATE(QQmlDebugClient) + Q_DISABLE_COPY(QQmlDebugClient) public: enum State { NotConnected, Unavailable, Enabled }; - QDeclarativeDebugClient(const QString &, QDeclarativeDebugConnection *parent); - ~QDeclarativeDebugClient(); + QQmlDebugClient(const QString &, QQmlDebugConnection *parent); + ~QQmlDebugClient(); QString name() const; float serviceVersion() const; @@ -120,12 +120,12 @@ protected: virtual void messageReceived(const QByteArray &); private: - friend class QDeclarativeDebugConnection; - friend class QDeclarativeDebugConnectionPrivate; + friend class QQmlDebugConnection; + friend class QQmlDebugConnectionPrivate; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGCLIENT_H +#endif // QQMLDEBUGCLIENT_H diff --git a/src/declarative/debugger/qdeclarativedebughelper.cpp b/src/qml/debugger/qqmldebughelper.cpp index 45d488fe1b..7158b3609d 100644 --- a/src/declarative/debugger/qdeclarativedebughelper.cpp +++ b/src/qml/debugger/qqmldebughelper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,31 +39,31 @@ ** ****************************************************************************/ -#include "qdeclarativedebughelper_p.h" +#include "qqmldebughelper_p.h" #include <QtCore/QAbstractAnimation> -#include <QtDeclarative/QJSEngine> +#include <QtQml/QJSEngine> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> #include <private/qabstractanimation_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE -void QDeclarativeDebugHelper::setAnimationSlowDownFactor(qreal factor) +void QQmlDebugHelper::setAnimationSlowDownFactor(qreal factor) { QUnifiedTimer *timer = QUnifiedTimer::instance(); timer->setSlowModeEnabled(factor != 1.0); timer->setSlowdownFactor(factor); } -void QDeclarativeDebugHelper::enableDebugging() { - qWarning("QDeclarativeDebugHelper::enableDebugging() is deprecated! Add CONFIG += declarative_debug to your .pro file instead."); -#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL - if (!QDeclarativeEnginePrivate::qml_debugging_enabled) { +void QQmlDebugHelper::enableDebugging() { + qWarning("QQmlDebugHelper::enableDebugging() is deprecated! Add CONFIG += declarative_debug to your .pro file instead."); +#ifndef QQML_NO_DEBUG_PROTOCOL + if (!QQmlEnginePrivate::qml_debugging_enabled) { qWarning("Qml debugging is enabled. Only use this in a safe environment!"); } - QDeclarativeEnginePrivate::qml_debugging_enabled = true; + QQmlEnginePrivate::qml_debugging_enabled = true; #endif } diff --git a/src/declarative/debugger/qdeclarativedebughelper_p.h b/src/qml/debugger/qqmldebughelper_p.h index d24bc8c19f..5d2bcc2be0 100644 --- a/src/declarative/debugger/qdeclarativedebughelper_p.h +++ b/src/qml/debugger/qqmldebughelper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,12 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGHELPER_P_H -#define QDECLARATIVEDEBUGHELPER_P_H +#ifndef QQMLDEBUGHELPER_P_H +#define QQMLDEBUGHELPER_P_H -#include <QtCore/qglobal.h> - -#include <private/qdeclarativeglobal_p.h> +#include <private/qtqmlglobal_p.h> // // W A R N I N G @@ -61,15 +59,15 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; -#ifndef QT_BUILD_DECLARATIVE_LIB +#ifndef QT_BUILD_QML_LIB #warning Use of this header file is deprecated! Add CONFIG += declarative_debug to your .pro file instead. #endif // Helper methods to access private API through a stable interface // This is used in the qmljsdebugger library of QtCreator. -class Q_DECLARATIVE_EXPORT QDeclarativeDebugHelper +class Q_QML_EXPORT QQmlDebugHelper { public: static void setAnimationSlowDownFactor(qreal factor); @@ -83,4 +81,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGHELPER_P_H +#endif // QQMLDEBUGHELPER_P_H diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp index 482847c7a7..8d5c597a78 100644 --- a/src/declarative/debugger/qdeclarativedebugserver.cpp +++ b/src/qml/debugger/qqmldebugserver.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,11 @@ ** ****************************************************************************/ -#include "qdeclarativedebugserver_p.h" -#include "qdeclarativedebugservice_p.h" -#include "qdeclarativedebugservice_p_p.h" -#include <private/qdeclarativeengine_p.h> +#include "qqmldebugserver_p.h" +#include "qqmldebugservice_p.h" +#include "qqmldebugservice_p_p.h" +#include <private/qqmlengine_p.h> +#include <private/qqmlglobal_p.h> #include <QtCore/QDir> #include <QtCore/QPluginLoader> @@ -55,25 +56,25 @@ QT_BEGIN_NAMESPACE /* - QDeclarativeDebug Protocol (Version 1): + QQmlDebug Protocol (Version 1): handshake: 1. Client sends - "QDeclarativeDebugServer" 0 version pluginNames + "QQmlDebugServer" 0 version pluginNames version: an int representing the highest protocol version the client knows pluginNames: plugins available on client side 2. Server sends - "QDeclarativeDebugClient" 0 version pluginNames pluginVersions + "QQmlDebugClient" 0 version pluginNames pluginVersions version: an int representing the highest protocol version the client & server know pluginNames: plugins available on server side. plugins both in the client and server message are enabled. client plugin advertisement 1. Client sends - "QDeclarativeDebugServer" 1 pluginNames + "QQmlDebugServer" 1 pluginNames server plugin advertisement 1. Server sends - "QDeclarativeDebugClient" 1 pluginNames pluginVersions + "QQmlDebugClient" 1 pluginNames pluginVersions plugin communication: - Everything send with a header different to "QDeclarativeDebugServer" is sent to the appropriate plugin. + Everything send with a header different to "QQmlDebugServer" is sent to the appropriate plugin. */ const int protocolVersion = 1; @@ -81,19 +82,19 @@ const int protocolVersion = 1; // print detailed information about loading of plugins DEFINE_BOOL_CONFIG_OPTION(qmlDebugVerbose, QML_DEBUGGER_VERBOSE) -class QDeclarativeDebugServerThread; +class QQmlDebugServerThread; -class QDeclarativeDebugServerPrivate : public QObjectPrivate +class QQmlDebugServerPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeDebugServer) + Q_DECLARE_PUBLIC(QQmlDebugServer) public: - QDeclarativeDebugServerPrivate(); + QQmlDebugServerPrivate(); void advertisePlugins(); - QDeclarativeDebugServerConnection *loadConnectionPlugin(const QString &pluginName); + QQmlDebugServerConnection *loadConnectionPlugin(const QString &pluginName); - QDeclarativeDebugServerConnection *connection; - QHash<QString, QDeclarativeDebugService *> plugins; + QQmlDebugServerConnection *connection; + QHash<QString, QQmlDebugService *> plugins; mutable QReadWriteLock pluginsLock; QStringList clientPlugins; bool gotHello; @@ -101,7 +102,7 @@ public: QMutex messageArrivedMutex; QWaitCondition messageArrivedCondition; QStringList waitingForMessageNames; - QDeclarativeDebugServerThread *thread; + QQmlDebugServerThread *thread; QPluginLoader loader; private: @@ -109,7 +110,7 @@ private: void _q_sendMessages(const QList<QByteArray> &messages); }; -class QDeclarativeDebugServerThread : public QThread +class QQmlDebugServerThread : public QThread { public: void setPluginName(const QString &pluginName) { @@ -129,7 +130,7 @@ private: bool m_block; }; -QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() : +QQmlDebugServerPrivate::QQmlDebugServerPrivate() : connection(0), gotHello(false), thread(0) @@ -138,9 +139,9 @@ QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() : qRegisterMetaType<QList<QByteArray> >("QList<QByteArray>"); } -void QDeclarativeDebugServerPrivate::advertisePlugins() +void QQmlDebugServerPrivate::advertisePlugins() { - Q_Q(QDeclarativeDebugServer); + Q_Q(QQmlDebugServer); if (!gotHello) return; @@ -150,17 +151,17 @@ void QDeclarativeDebugServerPrivate::advertisePlugins() QDataStream out(&message, QIODevice::WriteOnly); QStringList pluginNames; QList<float> pluginVersions; - foreach (QDeclarativeDebugService *service, plugins.values()) { + foreach (QQmlDebugService *service, plugins.values()) { pluginNames << service->name(); pluginVersions << service->version(); } - out << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << pluginNames << pluginVersions; + out << QString(QLatin1String("QQmlDebugClient")) << 1 << pluginNames << pluginVersions; } QMetaObject::invokeMethod(q, "_q_sendMessages", Qt::QueuedConnection, Q_ARG(QList<QByteArray>, QList<QByteArray>() << message)); } -QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectionPlugin( +QQmlDebugServerConnection *QQmlDebugServerPrivate::loadConnectionPlugin( const QString &pluginName) { #ifndef QT_NO_LIBRARY @@ -179,26 +180,26 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio foreach (const QString &pluginPath, pluginCandidates) { if (qmlDebugVerbose()) - qDebug() << "QDeclarativeDebugServer: Trying to load plugin " << pluginPath << "..."; + qDebug() << "QQmlDebugServer: Trying to load plugin " << pluginPath << "..."; loader.setFileName(pluginPath); if (!loader.load()) { if (qmlDebugVerbose()) - qDebug() << "QDeclarativeDebugServer: Error while loading: " << loader.errorString(); + qDebug() << "QQmlDebugServer: Error while loading: " << loader.errorString(); continue; } if (QObject *instance = loader.instance()) - connection = qobject_cast<QDeclarativeDebugServerConnection*>(instance); + connection = qobject_cast<QQmlDebugServerConnection*>(instance); if (connection) { if (qmlDebugVerbose()) - qDebug() << "QDeclarativeDebugServer: Plugin successfully loaded."; + qDebug() << "QQmlDebugServer: Plugin successfully loaded."; return connection; } if (qmlDebugVerbose()) - qDebug() << "QDeclarativeDebugServer: Plugin does not implement interface QDeclarativeDebugServerConnection."; + qDebug() << "QQmlDebugServer: Plugin does not implement interface QQmlDebugServerConnection."; loader.unload(); } @@ -206,17 +207,17 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio return 0; } -void QDeclarativeDebugServerThread::run() +void QQmlDebugServerThread::run() { - QDeclarativeDebugServer *server = QDeclarativeDebugServer::instance(); - QDeclarativeDebugServerConnection *connection + QQmlDebugServer *server = QQmlDebugServer::instance(); + QQmlDebugServerConnection *connection = server->d_func()->loadConnectionPlugin(m_pluginName); if (connection) { - connection->setServer(QDeclarativeDebugServer::instance()); + connection->setServer(QQmlDebugServer::instance()); connection->setPort(m_port, m_block); } else { QCoreApplicationPrivate *appD = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(qApp)); - qWarning() << QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " + qWarning() << QString::fromAscii("QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". " "Remote debugger plugin has not been found.").arg(appD->qmljsDebugArgumentsString()); } @@ -227,24 +228,24 @@ void QDeclarativeDebugServerThread::run() eventLoop.processEvents(QEventLoop::AllEvents); } -bool QDeclarativeDebugServer::hasDebuggingClient() const +bool QQmlDebugServer::hasDebuggingClient() const { - Q_D(const QDeclarativeDebugServer); + Q_D(const QQmlDebugServer); return d->connection && d->connection->isConnected() && d->gotHello; } -static QDeclarativeDebugServer *qDeclarativeDebugServer = 0; +static QQmlDebugServer *qQmlDebugServer = 0; static void cleanup() { - delete qDeclarativeDebugServer; - qDeclarativeDebugServer = 0; + delete qQmlDebugServer; + qQmlDebugServer = 0; } -QDeclarativeDebugServer *QDeclarativeDebugServer::instance() +QQmlDebugServer *QQmlDebugServer::instance() { static bool commandLineTested = false; @@ -252,7 +253,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() commandLineTested = true; QCoreApplicationPrivate *appD = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(qApp)); -#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL +#ifndef QQML_NO_DEBUG_PROTOCOL // ### remove port definition when protocol is changed int port = 0; bool block = false; @@ -260,9 +261,9 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() // format: qmljsdebugger=port:3768[,block] OR qmljsdebugger=ost[,block] if (!appD->qmljsDebugArgumentsString().isEmpty()) { - if (!QDeclarativeEnginePrivate::qml_debugging_enabled) { + if (!QQmlEnginePrivate::qml_debugging_enabled) { qWarning() << QString::fromLatin1( - "QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " + "QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". " "Debugging has not been enabled.").arg( appD->qmljsDebugArgumentsString()); return 0; @@ -281,16 +282,16 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() block = appD->qmljsDebugArgumentsString().contains(QLatin1String("block")); if (ok) { - qDeclarativeDebugServer = new QDeclarativeDebugServer(); - QDeclarativeDebugServerThread *thread = new QDeclarativeDebugServerThread; - qDeclarativeDebugServer->d_func()->thread = thread; - qDeclarativeDebugServer->moveToThread(thread); + qQmlDebugServer = new QQmlDebugServer(); + QQmlDebugServerThread *thread = new QQmlDebugServerThread; + qQmlDebugServer->d_func()->thread = thread; + qQmlDebugServer->moveToThread(thread); thread->setPluginName(pluginName); thread->setPort(port, block); thread->start(); if (block) { - QDeclarativeDebugServerPrivate *d = qDeclarativeDebugServer->d_func(); + QQmlDebugServerPrivate *d = qQmlDebugServer->d_func(); d->messageArrivedMutex.lock(); d->messageArrivedCondition.wait(&d->messageArrivedMutex); d->messageArrivedMutex.unlock(); @@ -298,7 +299,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() } else { qWarning() << QString::fromLatin1( - "QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " + "QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". " "Format is -qmljsdebugger=port:<port>[,block]").arg( appD->qmljsDebugArgumentsString()); } @@ -306,33 +307,33 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() #else if (!appD->qmljsDebugArgumentsString().isEmpty()) { qWarning() << QString::fromLatin1( - "QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " - "QtDeclarative is not configured for debugging.").arg( + "QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". " + "QtQml is not configured for debugging.").arg( appD->qmljsDebugArgumentsString()); } #endif } - return qDeclarativeDebugServer; + return qQmlDebugServer; } -QDeclarativeDebugServer::QDeclarativeDebugServer() - : QObject(*(new QDeclarativeDebugServerPrivate)) +QQmlDebugServer::QQmlDebugServer() + : QObject(*(new QQmlDebugServerPrivate)) { qAddPostRoutine(cleanup); } -QDeclarativeDebugServer::~QDeclarativeDebugServer() +QQmlDebugServer::~QQmlDebugServer() { - Q_D(QDeclarativeDebugServer); + Q_D(QQmlDebugServer); QReadLocker(&d->pluginsLock); { - foreach (QDeclarativeDebugService *service, d->plugins.values()) { - service->stateAboutToBeChanged(QDeclarativeDebugService::NotConnected); + foreach (QQmlDebugService *service, d->plugins.values()) { + service->stateAboutToBeChanged(QQmlDebugService::NotConnected); service->d_func()->server = 0; - service->d_func()->state = QDeclarativeDebugService::NotConnected; - service->stateChanged(QDeclarativeDebugService::NotConnected); + service->d_func()->state = QQmlDebugService::NotConnected; + service->stateChanged(QQmlDebugService::NotConnected); } } @@ -344,16 +345,16 @@ QDeclarativeDebugServer::~QDeclarativeDebugServer() delete d->connection; } -void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) +void QQmlDebugServer::receiveMessage(const QByteArray &message) { - Q_D(QDeclarativeDebugServer); + Q_D(QQmlDebugServer); QDataStream in(message); QString name; in >> name; - if (name == QLatin1String("QDeclarativeDebugServer")) { + if (name == QLatin1String("QQmlDebugServer")) { int op = -1; in >> op; if (op == 0) { @@ -367,28 +368,28 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) QDataStream out(&helloAnswer, QIODevice::WriteOnly); QStringList pluginNames; QList<float> pluginVersions; - foreach (QDeclarativeDebugService *service, d->plugins.values()) { + foreach (QQmlDebugService *service, d->plugins.values()) { pluginNames << service->name(); pluginVersions << service->version(); } - out << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << pluginNames << pluginVersions; + out << QString(QLatin1String("QQmlDebugClient")) << 0 << protocolVersion << pluginNames << pluginVersions; } d->connection->send(QList<QByteArray>() << helloAnswer); d->gotHello = true; QReadLocker(&d->pluginsLock); - QHash<QString, QDeclarativeDebugService*>::ConstIterator iter = d->plugins.constBegin(); + QHash<QString, QQmlDebugService*>::ConstIterator iter = d->plugins.constBegin(); for (; iter != d->plugins.constEnd(); ++iter) { - QDeclarativeDebugService::State newState = QDeclarativeDebugService::Unavailable; + QQmlDebugService::State newState = QQmlDebugService::Unavailable; if (d->clientPlugins.contains(iter.key())) - newState = QDeclarativeDebugService::Enabled; + newState = QQmlDebugService::Enabled; iter.value()->d_func()->state = newState; iter.value()->stateChanged(newState); } - qWarning("QDeclarativeDebugServer: Connection established"); + qWarning("QQmlDebugServer: Connection established"); d->messageArrivedCondition.wakeAll(); } else if (op == 1) { @@ -398,12 +399,12 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) in >> d->clientPlugins; QReadLocker(&d->pluginsLock); - QHash<QString, QDeclarativeDebugService*>::ConstIterator iter = d->plugins.constBegin(); + QHash<QString, QQmlDebugService*>::ConstIterator iter = d->plugins.constBegin(); for (; iter != d->plugins.constEnd(); ++iter) { const QString pluginName = iter.key(); - QDeclarativeDebugService::State newState = QDeclarativeDebugService::Unavailable; + QQmlDebugService::State newState = QQmlDebugService::Unavailable; if (d->clientPlugins.contains(pluginName)) - newState = QDeclarativeDebugService::Enabled; + newState = QQmlDebugService::Enabled; if (oldClientPlugins.contains(pluginName) != d->clientPlugins.contains(pluginName)) { @@ -413,7 +414,7 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) } } else { - qWarning("QDeclarativeDebugServer: Invalid control message %d", op); + qWarning("QQmlDebugServer: Invalid control message %d", op); d->connection->disconnect(); return; } @@ -424,9 +425,9 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) in >> message; QReadLocker(&d->pluginsLock); - QHash<QString, QDeclarativeDebugService *>::Iterator iter = d->plugins.find(name); + QHash<QString, QQmlDebugService *>::Iterator iter = d->plugins.find(name); if (iter == d->plugins.end()) { - qWarning() << "QDeclarativeDebugServer: Message received for missing plugin" << name; + qWarning() << "QQmlDebugServer: Message received for missing plugin" << name; } else { (*iter)->messageReceived(message); @@ -434,35 +435,35 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) d->messageArrivedCondition.wakeAll(); } } else { - qWarning("QDeclarativeDebugServer: Invalid hello message"); + qWarning("QQmlDebugServer: Invalid hello message"); } } } -void QDeclarativeDebugServerPrivate::_q_sendMessages(const QList<QByteArray> &messages) +void QQmlDebugServerPrivate::_q_sendMessages(const QList<QByteArray> &messages) { if (connection) connection->send(messages); } -QList<QDeclarativeDebugService*> QDeclarativeDebugServer::services() const +QList<QQmlDebugService*> QQmlDebugServer::services() const { - const Q_D(QDeclarativeDebugServer); + const Q_D(QQmlDebugServer); QReadLocker(&d->pluginsLock); return d->plugins.values(); } -QStringList QDeclarativeDebugServer::serviceNames() const +QStringList QQmlDebugServer::serviceNames() const { - const Q_D(QDeclarativeDebugServer); + const Q_D(QQmlDebugServer); QReadLocker(&d->pluginsLock); return d->plugins.keys(); } -bool QDeclarativeDebugServer::addService(QDeclarativeDebugService *service) +bool QQmlDebugServer::addService(QQmlDebugService *service) { - Q_D(QDeclarativeDebugServer); + Q_D(QQmlDebugServer); { QWriteLocker(&d->pluginsLock); if (!service || d->plugins.contains(service->name())) @@ -472,17 +473,17 @@ bool QDeclarativeDebugServer::addService(QDeclarativeDebugService *service) { QReadLocker(&d->pluginsLock); d->advertisePlugins(); - QDeclarativeDebugService::State newState = QDeclarativeDebugService::Unavailable; + QQmlDebugService::State newState = QQmlDebugService::Unavailable; if (d->clientPlugins.contains(service->name())) - newState = QDeclarativeDebugService::Enabled; + newState = QQmlDebugService::Enabled; service->d_func()->state = newState; } return true; } -bool QDeclarativeDebugServer::removeService(QDeclarativeDebugService *service) +bool QQmlDebugServer::removeService(QQmlDebugService *service) { - Q_D(QDeclarativeDebugServer); + Q_D(QQmlDebugServer); { QWriteLocker(&d->pluginsLock); if (!service || !d->plugins.contains(service->name())) @@ -491,7 +492,7 @@ bool QDeclarativeDebugServer::removeService(QDeclarativeDebugService *service) } { QReadLocker(&d->pluginsLock); - QDeclarativeDebugService::State newState = QDeclarativeDebugService::NotConnected; + QQmlDebugService::State newState = QQmlDebugService::NotConnected; service->stateAboutToBeChanged(newState); d->advertisePlugins(); service->d_func()->server = 0; @@ -502,7 +503,7 @@ bool QDeclarativeDebugServer::removeService(QDeclarativeDebugService *service) return true; } -void QDeclarativeDebugServer::sendMessages(QDeclarativeDebugService *service, +void QQmlDebugServer::sendMessages(QQmlDebugService *service, const QList<QByteArray> &messages) { QList<QByteArray> prefixedMessages; @@ -516,9 +517,9 @@ void QDeclarativeDebugServer::sendMessages(QDeclarativeDebugService *service, QMetaObject::invokeMethod(this, "_q_sendMessages", Qt::QueuedConnection, Q_ARG(QList<QByteArray>, prefixedMessages)); } -bool QDeclarativeDebugServer::waitForMessage(QDeclarativeDebugService *service) +bool QQmlDebugServer::waitForMessage(QQmlDebugService *service) { - Q_D(QDeclarativeDebugServer); + Q_D(QQmlDebugServer); QReadLocker(&d->pluginsLock); if (!service @@ -536,4 +537,4 @@ bool QDeclarativeDebugServer::waitForMessage(QDeclarativeDebugService *service) QT_END_NAMESPACE -#include "moc_qdeclarativedebugserver_p.cpp" +#include "moc_qqmldebugserver_p.cpp" diff --git a/src/declarative/debugger/qdeclarativedebugserver_p.h b/src/qml/debugger/qqmldebugserver_p.h index 8f7f748761..9c6b5435c8 100644 --- a/src/declarative/debugger/qdeclarativedebugserver_p.h +++ b/src/qml/debugger/qqmldebugserver_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGSERVER_H -#define QDECLARATIVEDEBUGSERVER_H +#ifndef QQMLDEBUGSERVER_H +#define QQMLDEBUGSERVER_H -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativedebugserverconnection_p.h> +#include <QtQml/qtqmlglobal.h> +#include <private/qqmldebugserverconnection_p.h> // // W A R N I N G @@ -61,40 +61,40 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDebugService; +class QQmlDebugService; -class QDeclarativeDebugServerPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeDebugServer : public QObject +class QQmlDebugServerPrivate; +class Q_QML_EXPORT QQmlDebugServer : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeDebugServer) - Q_DISABLE_COPY(QDeclarativeDebugServer) + Q_DECLARE_PRIVATE(QQmlDebugServer) + Q_DISABLE_COPY(QQmlDebugServer) public: - ~QDeclarativeDebugServer(); + ~QQmlDebugServer(); - static QDeclarativeDebugServer *instance(); + static QQmlDebugServer *instance(); - void setConnection(QDeclarativeDebugServerConnection *connection); + void setConnection(QQmlDebugServerConnection *connection); bool hasDebuggingClient() const; - QList<QDeclarativeDebugService*> services() const; + QList<QQmlDebugService*> services() const; QStringList serviceNames() const; - bool addService(QDeclarativeDebugService *service); - bool removeService(QDeclarativeDebugService *service); + bool addService(QQmlDebugService *service); + bool removeService(QQmlDebugService *service); void receiveMessage(const QByteArray &message); - bool waitForMessage(QDeclarativeDebugService *service); - void sendMessages(QDeclarativeDebugService *service, const QList<QByteArray> &messages); + bool waitForMessage(QQmlDebugService *service); + void sendMessages(QQmlDebugService *service, const QList<QByteArray> &messages); private: - friend class QDeclarativeDebugService; - friend class QDeclarativeDebugServicePrivate; - friend class QDeclarativeDebugServerThread; - QDeclarativeDebugServer(); + friend class QQmlDebugService; + friend class QQmlDebugServicePrivate; + friend class QQmlDebugServerThread; + QQmlDebugServer(); Q_PRIVATE_SLOT(d_func(), void _q_sendMessages(QList<QByteArray>)) }; @@ -102,4 +102,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGSERVICE_H +#endif // QQMLDEBUGSERVICE_H diff --git a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h b/src/qml/debugger/qqmldebugserverconnection_p.h index aa1c8aa0f1..c9092f1911 100644 --- a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h +++ b/src/qml/debugger/qqmldebugserverconnection_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGSERVERCONNECTION_H -#define QDECLARATIVEDEBUGSERVERCONNECTION_H +#ifndef QQMLDEBUGSERVERCONNECTION_H +#define QQMLDEBUGSERVERCONNECTION_H -#include <private/qdeclarativeglobal_p.h> +#include <QtQml/qtqmlglobal.h> +#include <QtCore/QtPlugin> // // W A R N I N G @@ -60,14 +61,14 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDebugServer; -class Q_DECLARATIVE_EXPORT QDeclarativeDebugServerConnection +class QQmlDebugServer; +class Q_QML_EXPORT QQmlDebugServerConnection { public: - QDeclarativeDebugServerConnection() {} - virtual ~QDeclarativeDebugServerConnection() {} + QQmlDebugServerConnection() {} + virtual ~QQmlDebugServerConnection() {} - virtual void setServer(QDeclarativeDebugServer *server) = 0; + virtual void setServer(QQmlDebugServer *server) = 0; virtual void setPort(int port, bool bock) = 0; virtual bool isConnected() const = 0; virtual void send(const QList<QByteArray> &messages) = 0; @@ -75,10 +76,10 @@ public: virtual bool waitForMessage() = 0; }; -Q_DECLARE_INTERFACE(QDeclarativeDebugServerConnection, "com.trolltech.Qt.QDeclarativeDebugServerConnection/1.0") +Q_DECLARE_INTERFACE(QQmlDebugServerConnection, "com.trolltech.Qt.QQmlDebugServerConnection/1.0") QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGSERVERCONNECTION_H +#endif // QQMLDEBUGSERVERCONNECTION_H diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/qml/debugger/qqmldebugservice.cpp index 96344d7717..9eb9489566 100644 --- a/src/declarative/debugger/qdeclarativedebugservice.cpp +++ b/src/qml/debugger/qqmldebugservice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,55 +39,55 @@ ** ****************************************************************************/ -#include "qdeclarativedebugservice_p.h" -#include "qdeclarativedebugservice_p_p.h" -#include "qdeclarativedebugserver_p.h" +#include "qqmldebugservice_p.h" +#include "qqmldebugservice_p_p.h" +#include "qqmldebugserver_p.h" #include <QtCore/QDebug> #include <QtCore/QStringList> QT_BEGIN_NAMESPACE -QDeclarativeDebugServicePrivate::QDeclarativeDebugServicePrivate() +QQmlDebugServicePrivate::QQmlDebugServicePrivate() : server(0) { } -QDeclarativeDebugService::QDeclarativeDebugService(const QString &name, float version, QObject *parent) - : QObject(*(new QDeclarativeDebugServicePrivate), parent) +QQmlDebugService::QQmlDebugService(const QString &name, float version, QObject *parent) + : QObject(*(new QQmlDebugServicePrivate), parent) { - Q_D(QDeclarativeDebugService); + Q_D(QQmlDebugService); d->name = name; d->version = version; - d->server = QDeclarativeDebugServer::instance(); - d->state = QDeclarativeDebugService::NotConnected; + d->server = QQmlDebugServer::instance(); + d->state = QQmlDebugService::NotConnected; } -QDeclarativeDebugService::QDeclarativeDebugService(QDeclarativeDebugServicePrivate &dd, +QQmlDebugService::QQmlDebugService(QQmlDebugServicePrivate &dd, const QString &name, float version, QObject *parent) : QObject(dd, parent) { - Q_D(QDeclarativeDebugService); + Q_D(QQmlDebugService); d->name = name; d->version = version; - d->server = QDeclarativeDebugServer::instance(); - d->state = QDeclarativeDebugService::NotConnected; + d->server = QQmlDebugServer::instance(); + d->state = QQmlDebugService::NotConnected; } /** Registers the service. This should be called in the constructor of the inherited class. From then on the service might get asynchronous calls to messageReceived(). */ -QDeclarativeDebugService::State QDeclarativeDebugService::registerService() +QQmlDebugService::State QQmlDebugService::registerService() { - Q_D(QDeclarativeDebugService); + Q_D(QQmlDebugService); if (!d->server) return NotConnected; if (d->server->serviceNames().contains(d->name)) { - qWarning() << "QDeclarativeDebugService: Conflicting plugin name" << d->name; + qWarning() << "QQmlDebugService: Conflicting plugin name" << d->name; d->server = 0; } else { d->server->addService(this); @@ -95,29 +95,29 @@ QDeclarativeDebugService::State QDeclarativeDebugService::registerService() return state(); } -QDeclarativeDebugService::~QDeclarativeDebugService() +QQmlDebugService::~QQmlDebugService() { - Q_D(const QDeclarativeDebugService); + Q_D(const QQmlDebugService); if (d->server) { d->server->removeService(this); } } -QString QDeclarativeDebugService::name() const +QString QQmlDebugService::name() const { - Q_D(const QDeclarativeDebugService); + Q_D(const QQmlDebugService); return d->name; } -float QDeclarativeDebugService::version() const +float QQmlDebugService::version() const { - Q_D(const QDeclarativeDebugService); + Q_D(const QQmlDebugService); return d->version; } -QDeclarativeDebugService::State QDeclarativeDebugService::state() const +QQmlDebugService::State QQmlDebugService::state() const { - Q_D(const QDeclarativeDebugService); + Q_D(const QQmlDebugService); return d->state; } @@ -147,7 +147,7 @@ Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash); Returns a unique id for \a object. Calling this method multiple times for the same object will return the same id. */ -int QDeclarativeDebugService::idForObject(QObject *object) +int QQmlDebugService::idForObject(QObject *object) { if (!object) return -1; @@ -180,7 +180,7 @@ int QDeclarativeDebugService::idForObject(QObject *object) assigned an id, through idForObject(), then 0 is returned. If the object has been destroyed, 0 is returned. */ -QObject *QDeclarativeDebugService::objectForId(int id) +QObject *QQmlDebugService::objectForId(int id) { ObjectReferenceHash *hash = objectReferenceHash(); @@ -202,18 +202,18 @@ QObject *QDeclarativeDebugService::objectForId(int id) } } -bool QDeclarativeDebugService::isDebuggingEnabled() +bool QQmlDebugService::isDebuggingEnabled() { - return QDeclarativeDebugServer::instance() != 0; + return QQmlDebugServer::instance() != 0; } -bool QDeclarativeDebugService::hasDebuggingClient() +bool QQmlDebugService::hasDebuggingClient() { - return QDeclarativeDebugServer::instance() != 0 - && QDeclarativeDebugServer::instance()->hasDebuggingClient(); + return QQmlDebugServer::instance() != 0 + && QQmlDebugServer::instance()->hasDebuggingClient(); } -QString QDeclarativeDebugService::objectToString(QObject *obj) +QString QQmlDebugService::objectToString(QObject *obj) { if(!obj) return QLatin1String("NULL"); @@ -228,14 +228,14 @@ QString QDeclarativeDebugService::objectToString(QObject *obj) return rv; } -void QDeclarativeDebugService::sendMessage(const QByteArray &message) +void QQmlDebugService::sendMessage(const QByteArray &message) { sendMessages(QList<QByteArray>() << message); } -void QDeclarativeDebugService::sendMessages(const QList<QByteArray> &messages) +void QQmlDebugService::sendMessages(const QList<QByteArray> &messages) { - Q_D(QDeclarativeDebugService); + Q_D(QQmlDebugService); if (state() != Enabled) return; @@ -243,9 +243,9 @@ void QDeclarativeDebugService::sendMessages(const QList<QByteArray> &messages) d->server->sendMessages(this, messages); } -bool QDeclarativeDebugService::waitForMessage() +bool QQmlDebugService::waitForMessage() { - Q_D(QDeclarativeDebugService); + Q_D(QQmlDebugService); if (state() != Enabled) return false; @@ -253,15 +253,15 @@ bool QDeclarativeDebugService::waitForMessage() return d->server->waitForMessage(this); } -void QDeclarativeDebugService::stateAboutToBeChanged(State) +void QQmlDebugService::stateAboutToBeChanged(State) { } -void QDeclarativeDebugService::stateChanged(State) +void QQmlDebugService::stateChanged(State) { } -void QDeclarativeDebugService::messageReceived(const QByteArray &) +void QQmlDebugService::messageReceived(const QByteArray &) { } diff --git a/src/declarative/debugger/qdeclarativedebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h index 203e27ad09..f19b64f42b 100644 --- a/src/declarative/debugger/qdeclarativedebugservice_p.h +++ b/src/qml/debugger/qqmldebugservice_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGSERVICE_H -#define QDECLARATIVEDEBUGSERVICE_H +#ifndef QQMLDEBUGSERVICE_H +#define QQMLDEBUGSERVICE_H #include <QtCore/qobject.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qtqmlglobal_p.h> // // W A R N I N G @@ -62,16 +62,16 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDebugServicePrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugService : public QObject +class QQmlDebugServicePrivate; +class Q_QML_PRIVATE_EXPORT QQmlDebugService : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeDebugService) - Q_DISABLE_COPY(QDeclarativeDebugService) + Q_DECLARE_PRIVATE(QQmlDebugService) + Q_DISABLE_COPY(QQmlDebugService) public: - explicit QDeclarativeDebugService(const QString &, float version, QObject *parent = 0); - ~QDeclarativeDebugService(); + explicit QQmlDebugService(const QString &, float version, QObject *parent = 0); + ~QQmlDebugService(); QString name() const; float version() const; @@ -92,7 +92,7 @@ public: static bool hasDebuggingClient(); protected: - QDeclarativeDebugService(QDeclarativeDebugServicePrivate &dd, const QString &name, float version, QObject *parent = 0); + QQmlDebugService(QQmlDebugServicePrivate &dd, const QString &name, float version, QObject *parent = 0); State registerService(); @@ -101,13 +101,13 @@ protected: virtual void messageReceived(const QByteArray &); private: - friend class QDeclarativeDebugServer; - friend class QDeclarativeDebugServerPrivate; + friend class QQmlDebugServer; + friend class QQmlDebugServerPrivate; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGSERVICE_H +#endif // QQMLDEBUGSERVICE_H diff --git a/src/declarative/debugger/qdeclarativedebugservice_p_p.h b/src/qml/debugger/qqmldebugservice_p_p.h index 6638ccbec7..c066e41fe6 100644 --- a/src/declarative/debugger/qdeclarativedebugservice_p_p.h +++ b/src/qml/debugger/qqmldebugservice_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGSERVICE_P_H -#define QDECLARATIVEDEBUGSERVICE_P_H +#ifndef QQMLDEBUGSERVICE_P_H +#define QQMLDEBUGSERVICE_P_H // // W A R N I N G @@ -61,22 +61,22 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDebugServer; +class QQmlDebugServer; -class QDeclarativeDebugServicePrivate : public QObjectPrivate +class QQmlDebugServicePrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeDebugService) + Q_DECLARE_PUBLIC(QQmlDebugService) public: - QDeclarativeDebugServicePrivate(); + QQmlDebugServicePrivate(); QString name; float version; - QDeclarativeDebugServer *server; - QDeclarativeDebugService::State state; + QQmlDebugServer *server; + QQmlDebugService::State state; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGSERVICE_P_H +#endif // QQMLDEBUGSERVICE_P_H diff --git a/src/declarative/debugger/qdeclarativedebugstatesdelegate_p.h b/src/qml/debugger/qqmldebugstatesdelegate_p.h index 868357723d..6e3cc978f2 100644 --- a/src/declarative/debugger/qdeclarativedebugstatesdelegate_p.h +++ b/src/qml/debugger/qqmldebugstatesdelegate_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGSTATESDELEGATE_P_H -#define QDECLARATIVEDEBUGSTATESDELEGATE_P_H +#ifndef QQMLDEBUGSTATESDELEGATE_P_H +#define QQMLDEBUGSTATESDELEGATE_P_H // // W A R N I N G @@ -53,30 +53,30 @@ // We mean it. // -#include <private/qdeclarativeglobal_p.h> +#include <QtQml/qtqmlglobal.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeContext; -class QDeclarativeProperty; +class QQmlContext; +class QQmlProperty; class QObject; class QString; class QVariant; -class QDeclarativeDebugStatesDelegate +class QQmlDebugStatesDelegate { protected: - QDeclarativeDebugStatesDelegate() {} + QQmlDebugStatesDelegate() {} public: - virtual ~QDeclarativeDebugStatesDelegate() {} + virtual ~QQmlDebugStatesDelegate() {} - virtual void buildStatesList(QDeclarativeContext *ctxt, bool cleanList) = 0; - virtual void updateBinding(QDeclarativeContext *context, - const QDeclarativeProperty &property, + virtual void buildStatesList(QQmlContext *ctxt, bool cleanList) = 0; + virtual void updateBinding(QQmlContext *context, + const QQmlProperty &property, const QVariant &expression, bool isLiteralValue, const QString &fileName, int line, int column, bool *inBaseState) = 0; @@ -88,11 +88,11 @@ public: const QString &propertyName) = 0; private: - Q_DISABLE_COPY(QDeclarativeDebugStatesDelegate) + Q_DISABLE_COPY(QQmlDebugStatesDelegate) }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGSTATESDELEGATE_P_H +#endif // QQMLDEBUGSTATESDELEGATE_P_H diff --git a/src/qml/debugger/qqmlenginedebug.cpp b/src/qml/debugger/qqmlenginedebug.cpp new file mode 100644 index 0000000000..597e7aeb04 --- /dev/null +++ b/src/qml/debugger/qqmlenginedebug.cpp @@ -0,0 +1,1072 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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 "qqmlenginedebug_p.h" + +#include "qqmldebugclient_p.h" + +#include "qqmlenginedebugservice_p.h" + +#include <private/qobject_p.h> + +QT_BEGIN_NAMESPACE + +class QQmlEngineDebugClient : public QQmlDebugClient +{ +public: + QQmlEngineDebugClient(QQmlDebugConnection *client, QQmlEngineDebugPrivate *p); + +protected: + virtual void stateChanged(State state); + virtual void messageReceived(const QByteArray &); + +private: + QQmlEngineDebugPrivate *priv; + friend class QQmlEngineDebugPrivate; +}; + +class QQmlEngineDebugPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QQmlEngineDebug) +public: + QQmlEngineDebugPrivate(QQmlDebugConnection *); + ~QQmlEngineDebugPrivate(); + + void stateChanged(QQmlEngineDebug::State status); + void message(const QByteArray &); + + QQmlEngineDebugClient *client; + int nextId; + int getId(); + + void decode(QDataStream &, QQmlDebugContextReference &); + void decode(QDataStream &, QQmlDebugObjectReference &, bool simple); + + static void remove(QQmlEngineDebug *, QQmlDebugEnginesQuery *); + static void remove(QQmlEngineDebug *, QQmlDebugRootContextQuery *); + static void remove(QQmlEngineDebug *, QQmlDebugObjectQuery *); + static void remove(QQmlEngineDebug *, QQmlDebugExpressionQuery *); + static void remove(QQmlEngineDebug *, QQmlDebugWatch *); + + QHash<int, QQmlDebugEnginesQuery *> enginesQuery; + QHash<int, QQmlDebugRootContextQuery *> rootContextQuery; + QHash<int, QQmlDebugObjectQuery *> objectQuery; + QHash<int, QQmlDebugExpressionQuery *> expressionQuery; + + QHash<int, QQmlDebugWatch *> watched; +}; + +QQmlEngineDebugClient::QQmlEngineDebugClient(QQmlDebugConnection *client, + QQmlEngineDebugPrivate *p) + : QQmlDebugClient(QLatin1String("QQmlEngine"), client), priv(p) +{ +} + +void QQmlEngineDebugClient::stateChanged(State status) +{ + if (priv) + priv->stateChanged(static_cast<QQmlEngineDebug::State>(status)); +} + +void QQmlEngineDebugClient::messageReceived(const QByteArray &data) +{ + if (priv) + priv->message(data); +} + +QQmlEngineDebugPrivate::QQmlEngineDebugPrivate(QQmlDebugConnection *c) + : client(new QQmlEngineDebugClient(c, this)), nextId(0) +{ +} + +QQmlEngineDebugPrivate::~QQmlEngineDebugPrivate() +{ + if (client) + client->priv = 0; + delete client; + + QHash<int, QQmlDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin(); + for (; enginesIter != enginesQuery.end(); ++enginesIter) { + enginesIter.value()->m_client = 0; + if (enginesIter.value()->state() == QQmlDebugQuery::Waiting) + enginesIter.value()->setState(QQmlDebugQuery::Error); + } + + QHash<int, QQmlDebugRootContextQuery*>::iterator rootContextIter = rootContextQuery.begin(); + for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) { + rootContextIter.value()->m_client = 0; + if (rootContextIter.value()->state() == QQmlDebugQuery::Waiting) + rootContextIter.value()->setState(QQmlDebugQuery::Error); + } + + QHash<int, QQmlDebugObjectQuery*>::iterator objectIter = objectQuery.begin(); + for (; objectIter != objectQuery.end(); ++objectIter) { + objectIter.value()->m_client = 0; + if (objectIter.value()->state() == QQmlDebugQuery::Waiting) + objectIter.value()->setState(QQmlDebugQuery::Error); + } + + QHash<int, QQmlDebugExpressionQuery*>::iterator exprIter = expressionQuery.begin(); + for (; exprIter != expressionQuery.end(); ++exprIter) { + exprIter.value()->m_client = 0; + if (exprIter.value()->state() == QQmlDebugQuery::Waiting) + exprIter.value()->setState(QQmlDebugQuery::Error); + } + + QHash<int, QQmlDebugWatch*>::iterator watchIter = watched.begin(); + for (; watchIter != watched.end(); ++watchIter) { + watchIter.value()->m_client = 0; + watchIter.value()->setState(QQmlDebugWatch::Dead); + } +} + +int QQmlEngineDebugPrivate::getId() +{ + return nextId++; +} + +void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugEnginesQuery *q) +{ + if (c && q) { + QQmlEngineDebugPrivate *p = (QQmlEngineDebugPrivate *)QObjectPrivate::get(c); + p->enginesQuery.remove(q->m_queryId); + } +} + +void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, + QQmlDebugRootContextQuery *q) +{ + if (c && q) { + QQmlEngineDebugPrivate *p = (QQmlEngineDebugPrivate *)QObjectPrivate::get(c); + p->rootContextQuery.remove(q->m_queryId); + } +} + +void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugObjectQuery *q) +{ + if (c && q) { + QQmlEngineDebugPrivate *p = (QQmlEngineDebugPrivate *)QObjectPrivate::get(c); + p->objectQuery.remove(q->m_queryId); + } +} + +void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugExpressionQuery *q) +{ + if (c && q) { + QQmlEngineDebugPrivate *p = (QQmlEngineDebugPrivate *)QObjectPrivate::get(c); + p->expressionQuery.remove(q->m_queryId); + } +} + +void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugWatch *w) +{ + if (c && w) { + QQmlEngineDebugPrivate *p = (QQmlEngineDebugPrivate *)QObjectPrivate::get(c); + p->watched.remove(w->m_queryId); + } +} + +void QQmlEngineDebugPrivate::decode(QDataStream &ds, QQmlDebugObjectReference &o, + bool simple) +{ + QQmlEngineDebugService::QQmlObjectData data; + ds >> data; + o.m_debugId = data.objectId; + o.m_class = data.objectType; + o.m_idString = data.idString; + o.m_name = data.objectName; + o.m_source.m_url = data.url; + o.m_source.m_lineNumber = data.lineNumber; + o.m_source.m_columnNumber = data.columnNumber; + o.m_contextDebugId = data.contextId; + + if (simple) + return; + + int childCount; + bool recur; + ds >> childCount >> recur; + + for (int ii = 0; ii < childCount; ++ii) { + o.m_children.append(QQmlDebugObjectReference()); + decode(ds, o.m_children.last(), !recur); + } + + int propCount; + ds >> propCount; + + for (int ii = 0; ii < propCount; ++ii) { + QQmlEngineDebugService::QQmlObjectProperty data; + ds >> data; + QQmlDebugPropertyReference prop; + prop.m_objectDebugId = o.m_debugId; + prop.m_name = data.name; + prop.m_binding = data.binding; + prop.m_hasNotifySignal = data.hasNotifySignal; + prop.m_valueTypeName = data.valueTypeName; + switch (data.type) { + case QQmlEngineDebugService::QQmlObjectProperty::Basic: + case QQmlEngineDebugService::QQmlObjectProperty::List: + case QQmlEngineDebugService::QQmlObjectProperty::SignalProperty: + { + prop.m_value = data.value; + break; + } + case QQmlEngineDebugService::QQmlObjectProperty::Object: + { + QQmlDebugObjectReference obj; + obj.m_debugId = prop.m_value.toInt(); + prop.m_value = QVariant::fromValue(obj); + break; + } + case QQmlEngineDebugService::QQmlObjectProperty::Unknown: + break; + } + o.m_properties << prop; + } +} + +void QQmlEngineDebugPrivate::decode(QDataStream &ds, QQmlDebugContextReference &c) +{ + ds >> c.m_name >> c.m_debugId; + + int contextCount; + ds >> contextCount; + + for (int ii = 0; ii < contextCount; ++ii) { + c.m_contexts.append(QQmlDebugContextReference()); + decode(ds, c.m_contexts.last()); + } + + int objectCount; + ds >> objectCount; + + for (int ii = 0; ii < objectCount; ++ii) { + QQmlDebugObjectReference obj; + decode(ds, obj, true); + + obj.m_contextDebugId = c.m_debugId; + c.m_objects << obj; + } +} + +void QQmlEngineDebugPrivate::stateChanged(QQmlEngineDebug::State status) +{ + emit q_func()->stateChanged(status); +} + +void QQmlEngineDebugPrivate::message(const QByteArray &data) +{ + QDataStream ds(data); + + QByteArray type; + ds >> type; + + //qDebug() << "QQmlEngineDebugPrivate::message()" << type; + + if (type == "LIST_ENGINES_R") { + int queryId; + ds >> queryId; + + QQmlDebugEnginesQuery *query = enginesQuery.value(queryId); + if (!query) + return; + enginesQuery.remove(queryId); + + int count; + ds >> count; + + for (int ii = 0; ii < count; ++ii) { + QQmlDebugEngineReference ref; + ds >> ref.m_name; + ds >> ref.m_debugId; + query->m_engines << ref; + } + + query->m_client = 0; + query->setState(QQmlDebugQuery::Completed); + } else if (type == "LIST_OBJECTS_R") { + int queryId; + ds >> queryId; + + QQmlDebugRootContextQuery *query = rootContextQuery.value(queryId); + if (!query) + return; + rootContextQuery.remove(queryId); + + if (!ds.atEnd()) + decode(ds, query->m_context); + + query->m_client = 0; + query->setState(QQmlDebugQuery::Completed); + } else if (type == "FETCH_OBJECT_R") { + int queryId; + ds >> queryId; + + QQmlDebugObjectQuery *query = objectQuery.value(queryId); + if (!query) + return; + objectQuery.remove(queryId); + + if (!ds.atEnd()) + decode(ds, query->m_object, false); + + query->m_client = 0; + query->setState(QQmlDebugQuery::Completed); + } else if (type == "EVAL_EXPRESSION_R") { + int queryId; + QVariant result; + ds >> queryId >> result; + + QQmlDebugExpressionQuery *query = expressionQuery.value(queryId); + if (!query) + return; + expressionQuery.remove(queryId); + + query->m_result = result; + query->m_client = 0; + query->setState(QQmlDebugQuery::Completed); + } else if (type == "WATCH_PROPERTY_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QQmlDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QQmlDebugWatch::Active : QQmlDebugWatch::Inactive); + } else if (type == "WATCH_OBJECT_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QQmlDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QQmlDebugWatch::Active : QQmlDebugWatch::Inactive); + } else if (type == "WATCH_EXPR_OBJECT_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QQmlDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QQmlDebugWatch::Active : QQmlDebugWatch::Inactive); + } else if (type == "UPDATE_WATCH") { + int queryId; + int debugId; + QByteArray name; + QVariant value; + ds >> queryId >> debugId >> name >> value; + + QQmlDebugWatch *watch = watched.value(queryId, 0); + if (!watch) + return; + emit watch->valueChanged(name, value); + } else if (type == "OBJECT_CREATED") { + emit q_func()->newObjects(); + } +} + +QQmlEngineDebug::QQmlEngineDebug(QQmlDebugConnection *client, QObject *parent) + : QObject(*(new QQmlEngineDebugPrivate(client)), parent) +{ +} + +QQmlEngineDebug::~QQmlEngineDebug() +{ +} + +QQmlEngineDebug::State QQmlEngineDebug::state() const +{ + Q_D(const QQmlEngineDebug); + + return static_cast<QQmlEngineDebug::State>(d->client->state()); +} + +QQmlDebugPropertyWatch *QQmlEngineDebug::addWatch(const QQmlDebugPropertyReference &property, QObject *parent) +{ + Q_D(QQmlEngineDebug); + + QQmlDebugPropertyWatch *watch = new QQmlDebugPropertyWatch(parent); + if (d->client->state() == QQmlDebugClient::Enabled) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_client = this; + watch->m_objectDebugId = property.objectDebugId(); + watch->m_name = property.name(); + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8(); + d->client->sendMessage(message); + } else { + watch->m_state = QQmlDebugWatch::Dead; + } + + return watch; +} + +QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugContextReference &, const QString &, QObject *) +{ + qWarning("QQmlEngineDebug::addWatch(): Not implemented"); + return 0; +} + +QQmlDebugObjectExpressionWatch *QQmlEngineDebug::addWatch(const QQmlDebugObjectReference &object, const QString &expr, QObject *parent) +{ + Q_D(QQmlEngineDebug); + QQmlDebugObjectExpressionWatch *watch = new QQmlDebugObjectExpressionWatch(parent); + if (d->client->state() == QQmlDebugClient::Enabled) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_client = this; + watch->m_objectDebugId = object.debugId(); + watch->m_expr = expr; + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr; + d->client->sendMessage(message); + } else { + watch->m_state = QQmlDebugWatch::Dead; + } + return watch; +} + +QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugObjectReference &object, QObject *parent) +{ + Q_D(QQmlEngineDebug); + + QQmlDebugWatch *watch = new QQmlDebugWatch(parent); + if (d->client->state() == QQmlDebugClient::Enabled) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_client = this; + watch->m_objectDebugId = object.debugId(); + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId(); + d->client->sendMessage(message); + } else { + watch->m_state = QQmlDebugWatch::Dead; + } + + return watch; +} + +QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugFileReference &, QObject *) +{ + qWarning("QQmlEngineDebug::addWatch(): Not implemented"); + return 0; +} + +void QQmlEngineDebug::removeWatch(QQmlDebugWatch *watch) +{ + Q_D(QQmlEngineDebug); + + if (!watch || !watch->m_client) + return; + + watch->m_client = 0; + watch->setState(QQmlDebugWatch::Inactive); + + d->watched.remove(watch->queryId()); + + if (d->client && d->client->state() == QQmlDebugClient::Enabled) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("NO_WATCH") << watch->queryId(); + d->client->sendMessage(message); + } +} + +QQmlDebugEnginesQuery *QQmlEngineDebug::queryAvailableEngines(QObject *parent) +{ + Q_D(QQmlEngineDebug); + + QQmlDebugEnginesQuery *query = new QQmlDebugEnginesQuery(parent); + if (d->client->state() == QQmlDebugClient::Enabled) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->enginesQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("LIST_ENGINES") << queryId; + d->client->sendMessage(message); + } else { + query->m_state = QQmlDebugQuery::Error; + } + + return query; +} + +QQmlDebugRootContextQuery *QQmlEngineDebug::queryRootContexts(const QQmlDebugEngineReference &engine, QObject *parent) +{ + Q_D(QQmlEngineDebug); + + QQmlDebugRootContextQuery *query = new QQmlDebugRootContextQuery(parent); + if (d->client->state() == QQmlDebugClient::Enabled && engine.debugId() != -1) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->rootContextQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId(); + d->client->sendMessage(message); + } else { + query->m_state = QQmlDebugQuery::Error; + } + + return query; +} + +QQmlDebugObjectQuery *QQmlEngineDebug::queryObject(const QQmlDebugObjectReference &object, QObject *parent) +{ + Q_D(QQmlEngineDebug); + + QQmlDebugObjectQuery *query = new QQmlDebugObjectQuery(parent); + if (d->client->state() == QQmlDebugClient::Enabled && object.debugId() != -1) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->objectQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() + << false << true; + d->client->sendMessage(message); + } else { + query->m_state = QQmlDebugQuery::Error; + } + + return query; +} + +QQmlDebugObjectQuery *QQmlEngineDebug::queryObjectRecursive(const QQmlDebugObjectReference &object, QObject *parent) +{ + Q_D(QQmlEngineDebug); + + QQmlDebugObjectQuery *query = new QQmlDebugObjectQuery(parent); + if (d->client->state() == QQmlDebugClient::Enabled && object.debugId() != -1) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->objectQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() + << true << true; + d->client->sendMessage(message); + } else { + query->m_state = QQmlDebugQuery::Error; + } + + return query; +} + +QQmlDebugExpressionQuery *QQmlEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent) +{ + Q_D(QQmlEngineDebug); + + QQmlDebugExpressionQuery *query = new QQmlDebugExpressionQuery(parent); + if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) { + query->m_client = this; + query->m_expr = expr; + int queryId = d->getId(); + query->m_queryId = queryId; + d->expressionQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr; + d->client->sendMessage(message); + } else { + query->m_state = QQmlDebugQuery::Error; + } + + return query; +} + +bool QQmlEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName, + const QVariant &bindingExpression, + bool isLiteralValue, + QString source, int line) +{ + Q_D(QQmlEngineDebug); + + if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line; + d->client->sendMessage(message); + return true; + } else { + return false; + } +} + +bool QQmlEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName) +{ + Q_D(QQmlEngineDebug); + + if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName; + d->client->sendMessage(message); + return true; + } else { + return false; + } +} + +bool QQmlEngineDebug::setMethodBody(int objectDebugId, const QString &methodName, + const QString &methodBody) +{ + Q_D(QQmlEngineDebug); + + if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody; + d->client->sendMessage(message); + return true; + } else { + return false; + } +} + +QQmlDebugWatch::QQmlDebugWatch(QObject *parent) + : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1) +{ +} + +QQmlDebugWatch::~QQmlDebugWatch() +{ + if (m_client && m_queryId != -1) + QQmlEngineDebugPrivate::remove(m_client, this); +} + +int QQmlDebugWatch::queryId() const +{ + return m_queryId; +} + +int QQmlDebugWatch::objectDebugId() const +{ + return m_objectDebugId; +} + +QQmlDebugWatch::State QQmlDebugWatch::state() const +{ + return m_state; +} + +void QQmlDebugWatch::setState(State s) +{ + if (m_state == s) + return; + m_state = s; + emit stateChanged(m_state); +} + +QQmlDebugPropertyWatch::QQmlDebugPropertyWatch(QObject *parent) + : QQmlDebugWatch(parent) +{ +} + +QString QQmlDebugPropertyWatch::name() const +{ + return m_name; +} + + +QQmlDebugObjectExpressionWatch::QQmlDebugObjectExpressionWatch(QObject *parent) + : QQmlDebugWatch(parent) +{ +} + +QString QQmlDebugObjectExpressionWatch::expression() const +{ + return m_expr; +} + + +QQmlDebugQuery::QQmlDebugQuery(QObject *parent) + : QObject(parent), m_state(Waiting) +{ +} + +QQmlDebugQuery::State QQmlDebugQuery::state() const +{ + return m_state; +} + +bool QQmlDebugQuery::isWaiting() const +{ + return m_state == Waiting; +} + +void QQmlDebugQuery::setState(State s) +{ + if (m_state == s) + return; + m_state = s; + emit stateChanged(m_state); +} + +QQmlDebugEnginesQuery::QQmlDebugEnginesQuery(QObject *parent) + : QQmlDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QQmlDebugEnginesQuery::~QQmlDebugEnginesQuery() +{ + if (m_client && m_queryId != -1) + QQmlEngineDebugPrivate::remove(m_client, this); +} + +QList<QQmlDebugEngineReference> QQmlDebugEnginesQuery::engines() const +{ + return m_engines; +} + +QQmlDebugRootContextQuery::QQmlDebugRootContextQuery(QObject *parent) + : QQmlDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QQmlDebugRootContextQuery::~QQmlDebugRootContextQuery() +{ + if (m_client && m_queryId != -1) + QQmlEngineDebugPrivate::remove(m_client, this); +} + +QQmlDebugContextReference QQmlDebugRootContextQuery::rootContext() const +{ + return m_context; +} + +QQmlDebugObjectQuery::QQmlDebugObjectQuery(QObject *parent) + : QQmlDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QQmlDebugObjectQuery::~QQmlDebugObjectQuery() +{ + if (m_client && m_queryId != -1) + QQmlEngineDebugPrivate::remove(m_client, this); +} + +QQmlDebugObjectReference QQmlDebugObjectQuery::object() const +{ + return m_object; +} + +QQmlDebugExpressionQuery::QQmlDebugExpressionQuery(QObject *parent) + : QQmlDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QQmlDebugExpressionQuery::~QQmlDebugExpressionQuery() +{ + if (m_client && m_queryId != -1) + QQmlEngineDebugPrivate::remove(m_client, this); +} + +QVariant QQmlDebugExpressionQuery::expression() const +{ + return m_expr; +} + +QVariant QQmlDebugExpressionQuery::result() const +{ + return m_result; +} + +QQmlDebugEngineReference::QQmlDebugEngineReference() + : m_debugId(-1) +{ +} + +QQmlDebugEngineReference::QQmlDebugEngineReference(int debugId) + : m_debugId(debugId) +{ +} + +QQmlDebugEngineReference::QQmlDebugEngineReference(const QQmlDebugEngineReference &o) + : m_debugId(o.m_debugId), m_name(o.m_name) +{ +} + +QQmlDebugEngineReference & +QQmlDebugEngineReference::operator=(const QQmlDebugEngineReference &o) +{ + m_debugId = o.m_debugId; m_name = o.m_name; + return *this; +} + +int QQmlDebugEngineReference::debugId() const +{ + return m_debugId; +} + +QString QQmlDebugEngineReference::name() const +{ + return m_name; +} + +QQmlDebugObjectReference::QQmlDebugObjectReference() + : m_debugId(-1), m_contextDebugId(-1) +{ +} + +QQmlDebugObjectReference::QQmlDebugObjectReference(int debugId) + : m_debugId(debugId), m_contextDebugId(-1) +{ +} + +QQmlDebugObjectReference::QQmlDebugObjectReference(const QQmlDebugObjectReference &o) + : m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString), + m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId), + m_properties(o.m_properties), m_children(o.m_children) +{ +} + +QQmlDebugObjectReference & +QQmlDebugObjectReference::operator=(const QQmlDebugObjectReference &o) +{ + m_debugId = o.m_debugId; m_class = o.m_class; m_idString = o.m_idString; + m_name = o.m_name; m_source = o.m_source; m_contextDebugId = o.m_contextDebugId; + m_properties = o.m_properties; m_children = o.m_children; + return *this; +} + +int QQmlDebugObjectReference::debugId() const +{ + return m_debugId; +} + +QString QQmlDebugObjectReference::className() const +{ + return m_class; +} + +QString QQmlDebugObjectReference::idString() const +{ + return m_idString; +} + +QString QQmlDebugObjectReference::name() const +{ + return m_name; +} + +QQmlDebugFileReference QQmlDebugObjectReference::source() const +{ + return m_source; +} + +int QQmlDebugObjectReference::contextDebugId() const +{ + return m_contextDebugId; +} + +QList<QQmlDebugPropertyReference> QQmlDebugObjectReference::properties() const +{ + return m_properties; +} + +QList<QQmlDebugObjectReference> QQmlDebugObjectReference::children() const +{ + return m_children; +} + +QQmlDebugContextReference::QQmlDebugContextReference() + : m_debugId(-1) +{ +} + +QQmlDebugContextReference::QQmlDebugContextReference(const QQmlDebugContextReference &o) + : m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts) +{ +} + +QQmlDebugContextReference &QQmlDebugContextReference::operator=(const QQmlDebugContextReference &o) +{ + m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects; + m_contexts = o.m_contexts; + return *this; +} + +int QQmlDebugContextReference::debugId() const +{ + return m_debugId; +} + +QString QQmlDebugContextReference::name() const +{ + return m_name; +} + +QList<QQmlDebugObjectReference> QQmlDebugContextReference::objects() const +{ + return m_objects; +} + +QList<QQmlDebugContextReference> QQmlDebugContextReference::contexts() const +{ + return m_contexts; +} + +QQmlDebugFileReference::QQmlDebugFileReference() + : m_lineNumber(-1), m_columnNumber(-1) +{ +} + +QQmlDebugFileReference::QQmlDebugFileReference(const QQmlDebugFileReference &o) + : m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber) +{ +} + +QQmlDebugFileReference &QQmlDebugFileReference::operator=(const QQmlDebugFileReference &o) +{ + m_url = o.m_url; m_lineNumber = o.m_lineNumber; m_columnNumber = o.m_columnNumber; + return *this; +} + +QUrl QQmlDebugFileReference::url() const +{ + return m_url; +} + +void QQmlDebugFileReference::setUrl(const QUrl &u) +{ + m_url = u; +} + +int QQmlDebugFileReference::lineNumber() const +{ + return m_lineNumber; +} + +void QQmlDebugFileReference::setLineNumber(int l) +{ + m_lineNumber = l; +} + +int QQmlDebugFileReference::columnNumber() const +{ + return m_columnNumber; +} + +void QQmlDebugFileReference::setColumnNumber(int c) +{ + m_columnNumber = c; +} + +QQmlDebugPropertyReference::QQmlDebugPropertyReference() + : m_objectDebugId(-1), m_hasNotifySignal(false) +{ +} + +QQmlDebugPropertyReference::QQmlDebugPropertyReference(const QQmlDebugPropertyReference &o) + : m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value), + m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding), + m_hasNotifySignal(o.m_hasNotifySignal) +{ +} + +QQmlDebugPropertyReference &QQmlDebugPropertyReference::operator=(const QQmlDebugPropertyReference &o) +{ + m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value; + m_valueTypeName = o.m_valueTypeName; m_binding = o.m_binding; + m_hasNotifySignal = o.m_hasNotifySignal; + return *this; +} + +int QQmlDebugPropertyReference::objectDebugId() const +{ + return m_objectDebugId; +} + +QString QQmlDebugPropertyReference::name() const +{ + return m_name; +} + +QString QQmlDebugPropertyReference::valueTypeName() const +{ + return m_valueTypeName; +} + +QVariant QQmlDebugPropertyReference::value() const +{ + return m_value; +} + +QString QQmlDebugPropertyReference::binding() const +{ + return m_binding; +} + +bool QQmlDebugPropertyReference::hasNotifySignal() const +{ + return m_hasNotifySignal; +} + +QT_END_NAMESPACE + diff --git a/src/qml/debugger/qqmlenginedebug_p.h b/src/qml/debugger/qqmlenginedebug_p.h new file mode 100644 index 0000000000..0562d8755b --- /dev/null +++ b/src/qml/debugger/qqmlenginedebug_p.h @@ -0,0 +1,397 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QQMLENGINEDEBUG_H +#define QQMLENGINEDEBUG_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtCore/qobject.h> +#include <QtCore/qurl.h> +#include <QtCore/qvariant.h> + +#include <private/qtqmlglobal_p.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QQmlDebugConnection; +class QQmlDebugWatch; +class QQmlDebugPropertyWatch; +class QQmlDebugObjectExpressionWatch; +class QQmlDebugEnginesQuery; +class QQmlDebugRootContextQuery; +class QQmlDebugObjectQuery; +class QQmlDebugExpressionQuery; +class QQmlDebugPropertyReference; +class QQmlDebugContextReference; +class QQmlDebugObjectReference; +class QQmlDebugFileReference; +class QQmlDebugEngineReference; +class QQmlEngineDebugPrivate; +class Q_QML_PRIVATE_EXPORT QQmlEngineDebug : public QObject +{ + Q_OBJECT +public: + enum State { NotConnected, Unavailable, Enabled }; + + explicit QQmlEngineDebug(QQmlDebugConnection *, QObject * = 0); + ~QQmlEngineDebug(); + + State state() const; + + QQmlDebugPropertyWatch *addWatch(const QQmlDebugPropertyReference &, + QObject *parent = 0); + QQmlDebugWatch *addWatch(const QQmlDebugContextReference &, const QString &, + QObject *parent = 0); + QQmlDebugObjectExpressionWatch *addWatch(const QQmlDebugObjectReference &, const QString &, + QObject *parent = 0); + QQmlDebugWatch *addWatch(const QQmlDebugObjectReference &, + QObject *parent = 0); + QQmlDebugWatch *addWatch(const QQmlDebugFileReference &, + QObject *parent = 0); + + void removeWatch(QQmlDebugWatch *watch); + + QQmlDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0); + QQmlDebugRootContextQuery *queryRootContexts(const QQmlDebugEngineReference &, + QObject *parent = 0); + QQmlDebugObjectQuery *queryObject(const QQmlDebugObjectReference &, + QObject *parent = 0); + QQmlDebugObjectQuery *queryObjectRecursive(const QQmlDebugObjectReference &, + QObject *parent = 0); + QQmlDebugExpressionQuery *queryExpressionResult(int objectDebugId, + const QString &expr, + QObject *parent = 0); + bool setBindingForObject(int objectDebugId, const QString &propertyName, + const QVariant &bindingExpression, bool isLiteralValue, + QString source = QString(), int line = -1); + bool resetBindingForObject(int objectDebugId, const QString &propertyName); + bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody); + +Q_SIGNALS: + void newObjects(); + void stateChanged(State state); + +private: + Q_DECLARE_PRIVATE(QQmlEngineDebug) +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugWatch : public QObject +{ + Q_OBJECT +public: + enum State { Waiting, Active, Inactive, Dead }; + + QQmlDebugWatch(QObject *); + ~QQmlDebugWatch(); + + int queryId() const; + int objectDebugId() const; + State state() const; + +Q_SIGNALS: + void stateChanged(QQmlDebugWatch::State); + //void objectChanged(int, const QQmlDebugObjectReference &); + //void valueChanged(int, const QVariant &); + + // Server sends value as string if it is a user-type variant + void valueChanged(const QByteArray &name, const QVariant &value); + +private: + friend class QQmlEngineDebug; + friend class QQmlEngineDebugPrivate; + void setState(State); + State m_state; + int m_queryId; + QQmlEngineDebug *m_client; + int m_objectDebugId; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugPropertyWatch : public QQmlDebugWatch +{ + Q_OBJECT +public: + QQmlDebugPropertyWatch(QObject *parent); + + QString name() const; + +private: + friend class QQmlEngineDebug; + QString m_name; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugObjectExpressionWatch : public QQmlDebugWatch +{ + Q_OBJECT +public: + QQmlDebugObjectExpressionWatch(QObject *parent); + + QString expression() const; + +private: + friend class QQmlEngineDebug; + QString m_expr; + int m_debugId; +}; + + +class Q_QML_PRIVATE_EXPORT QQmlDebugQuery : public QObject +{ + Q_OBJECT +public: + enum State { Waiting, Error, Completed }; + + State state() const; + bool isWaiting() const; + +Q_SIGNALS: + void stateChanged(QQmlDebugQuery::State); + +protected: + QQmlDebugQuery(QObject *); + +private: + friend class QQmlEngineDebug; + friend class QQmlEngineDebugPrivate; + void setState(State); + State m_state; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugFileReference +{ +public: + QQmlDebugFileReference(); + QQmlDebugFileReference(const QQmlDebugFileReference &); + QQmlDebugFileReference &operator=(const QQmlDebugFileReference &); + + QUrl url() const; + void setUrl(const QUrl &); + int lineNumber() const; + void setLineNumber(int); + int columnNumber() const; + void setColumnNumber(int); + +private: + friend class QQmlEngineDebugPrivate; + QUrl m_url; + int m_lineNumber; + int m_columnNumber; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugEngineReference +{ +public: + QQmlDebugEngineReference(); + QQmlDebugEngineReference(int); + QQmlDebugEngineReference(const QQmlDebugEngineReference &); + QQmlDebugEngineReference &operator=(const QQmlDebugEngineReference &); + + int debugId() const; + QString name() const; + +private: + friend class QQmlEngineDebugPrivate; + int m_debugId; + QString m_name; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugObjectReference +{ +public: + QQmlDebugObjectReference(); + QQmlDebugObjectReference(int); + QQmlDebugObjectReference(const QQmlDebugObjectReference &); + QQmlDebugObjectReference &operator=(const QQmlDebugObjectReference &); + + int debugId() const; + QString className() const; + QString idString() const; + QString name() const; + + QQmlDebugFileReference source() const; + int contextDebugId() const; + + QList<QQmlDebugPropertyReference> properties() const; + QList<QQmlDebugObjectReference> children() const; + +private: + friend class QQmlEngineDebugPrivate; + int m_debugId; + QString m_class; + QString m_idString; + QString m_name; + QQmlDebugFileReference m_source; + int m_contextDebugId; + QList<QQmlDebugPropertyReference> m_properties; + QList<QQmlDebugObjectReference> m_children; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugContextReference +{ +public: + QQmlDebugContextReference(); + QQmlDebugContextReference(const QQmlDebugContextReference &); + QQmlDebugContextReference &operator=(const QQmlDebugContextReference &); + + int debugId() const; + QString name() const; + + QList<QQmlDebugObjectReference> objects() const; + QList<QQmlDebugContextReference> contexts() const; + +private: + friend class QQmlEngineDebugPrivate; + int m_debugId; + QString m_name; + QList<QQmlDebugObjectReference> m_objects; + QList<QQmlDebugContextReference> m_contexts; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugPropertyReference +{ +public: + QQmlDebugPropertyReference(); + QQmlDebugPropertyReference(const QQmlDebugPropertyReference &); + QQmlDebugPropertyReference &operator=(const QQmlDebugPropertyReference &); + + int objectDebugId() const; + QString name() const; + QVariant value() const; + QString valueTypeName() const; + QString binding() const; + bool hasNotifySignal() const; + +private: + friend class QQmlEngineDebugPrivate; + int m_objectDebugId; + QString m_name; + QVariant m_value; + QString m_valueTypeName; + QString m_binding; + bool m_hasNotifySignal; +}; + + +class Q_QML_PRIVATE_EXPORT QQmlDebugEnginesQuery : public QQmlDebugQuery +{ + Q_OBJECT +public: + virtual ~QQmlDebugEnginesQuery(); + QList<QQmlDebugEngineReference> engines() const; +private: + friend class QQmlEngineDebug; + friend class QQmlEngineDebugPrivate; + QQmlDebugEnginesQuery(QObject *); + QQmlEngineDebug *m_client; + int m_queryId; + QList<QQmlDebugEngineReference> m_engines; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugRootContextQuery : public QQmlDebugQuery +{ + Q_OBJECT +public: + virtual ~QQmlDebugRootContextQuery(); + QQmlDebugContextReference rootContext() const; +private: + friend class QQmlEngineDebug; + friend class QQmlEngineDebugPrivate; + QQmlDebugRootContextQuery(QObject *); + QQmlEngineDebug *m_client; + int m_queryId; + QQmlDebugContextReference m_context; +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugObjectQuery : public QQmlDebugQuery +{ + Q_OBJECT +public: + virtual ~QQmlDebugObjectQuery(); + QQmlDebugObjectReference object() const; +private: + friend class QQmlEngineDebug; + friend class QQmlEngineDebugPrivate; + QQmlDebugObjectQuery(QObject *); + QQmlEngineDebug *m_client; + int m_queryId; + QQmlDebugObjectReference m_object; + +}; + +class Q_QML_PRIVATE_EXPORT QQmlDebugExpressionQuery : public QQmlDebugQuery +{ + Q_OBJECT +public: + virtual ~QQmlDebugExpressionQuery(); + QVariant expression() const; + QVariant result() const; +private: + friend class QQmlEngineDebug; + friend class QQmlEngineDebugPrivate; + QQmlDebugExpressionQuery(QObject *); + QQmlEngineDebug *m_client; + int m_queryId; + QVariant m_expr; + QVariant m_result; +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QQmlDebugEngineReference) +Q_DECLARE_METATYPE(QQmlDebugObjectReference) +Q_DECLARE_METATYPE(QQmlDebugContextReference) +Q_DECLARE_METATYPE(QQmlDebugPropertyReference) + +QT_END_HEADER + +#endif // QQMLENGINEDEBUG_H diff --git a/src/declarative/debugger/qdeclarativeenginedebugservice.cpp b/src/qml/debugger/qqmlenginedebugservice.cpp index 4943959c33..be2e826bdf 100644 --- a/src/declarative/debugger/qdeclarativeenginedebugservice.cpp +++ b/src/qml/debugger/qqmlenginedebugservice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,36 +39,36 @@ ** ****************************************************************************/ -#include "qdeclarativeenginedebugservice_p.h" - -#include "qdeclarativedebugstatesdelegate_p.h" -#include <private/qdeclarativeboundsignal_p.h> -#include <qdeclarativeengine.h> -#include <private/qdeclarativemetatype_p.h> -#include <qdeclarativeproperty.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativecontext_p.h> -#include <private/qdeclarativewatcher_p.h> -#include <private/qdeclarativevaluetype_p.h> -#include <private/qdeclarativevmemetaobject_p.h> -#include <private/qdeclarativeexpression_p.h> +#include "qqmlenginedebugservice_p.h" + +#include "qqmldebugstatesdelegate_p.h" +#include <private/qqmlboundsignal_p.h> +#include <qqmlengine.h> +#include <private/qqmlmetatype_p.h> +#include <qqmlproperty.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlbinding_p.h> +#include <private/qqmlcontext_p.h> +#include <private/qqmlwatcher_p.h> +#include <private/qqmlvaluetype_p.h> +#include <private/qqmlvmemetaobject_p.h> +#include <private/qqmlexpression_p.h> #include <QtCore/qdebug.h> #include <QtCore/qmetaobject.h> QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QDeclarativeEngineDebugService, qmlEngineDebugService); +Q_GLOBAL_STATIC(QQmlEngineDebugService, qmlEngineDebugService); -QDeclarativeEngineDebugService *QDeclarativeEngineDebugService::instance() +QQmlEngineDebugService *QQmlEngineDebugService::instance() { return qmlEngineDebugService(); } -QDeclarativeEngineDebugService::QDeclarativeEngineDebugService(QObject *parent) - : QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), 1, parent), - m_watch(new QDeclarativeWatcher(this)), +QQmlEngineDebugService::QQmlEngineDebugService(QObject *parent) + : QQmlDebugService(QLatin1String("QQmlEngine"), 1, parent), + m_watch(new QQmlWatcher(this)), m_statesDelegate(0) { QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)), @@ -77,13 +77,13 @@ QDeclarativeEngineDebugService::QDeclarativeEngineDebugService(QObject *parent) registerService(); } -QDeclarativeEngineDebugService::~QDeclarativeEngineDebugService() +QQmlEngineDebugService::~QQmlEngineDebugService() { delete m_statesDelegate; } QDataStream &operator<<(QDataStream &ds, - const QDeclarativeEngineDebugService::QDeclarativeObjectData &data) + const QQmlEngineDebugService::QQmlObjectData &data) { ds << data.url << data.lineNumber << data.columnNumber << data.idString << data.objectName << data.objectType << data.objectId << data.contextId; @@ -91,7 +91,7 @@ QDataStream &operator<<(QDataStream &ds, } QDataStream &operator>>(QDataStream &ds, - QDeclarativeEngineDebugService::QDeclarativeObjectData &data) + QQmlEngineDebugService::QQmlObjectData &data) { ds >> data.url >> data.lineNumber >> data.columnNumber >> data.idString >> data.objectName >> data.objectType >> data.objectId >> data.contextId; @@ -99,7 +99,7 @@ QDataStream &operator>>(QDataStream &ds, } QDataStream &operator<<(QDataStream &ds, - const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data) + const QQmlEngineDebugService::QQmlObjectProperty &data) { ds << (int)data.type << data.name << data.value << data.valueTypeName << data.binding << data.hasNotifySignal; @@ -107,12 +107,12 @@ QDataStream &operator<<(QDataStream &ds, } QDataStream &operator>>(QDataStream &ds, - QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data) + QQmlEngineDebugService::QQmlObjectProperty &data) { int type; ds >> type >> data.name >> data.value >> data.valueTypeName >> data.binding >> data.hasNotifySignal; - data.type = (QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Type)type; + data.type = (QQmlEngineDebugService::QQmlObjectProperty::Type)type; return ds; } @@ -131,7 +131,7 @@ static bool hasValidSignal(QObject *object, const QString &propertyName) QString signalName = propertyName.mid(2); signalName[0] = signalName.at(0).toLower(); - int sigIdx = QDeclarativePropertyPrivate::findSignalByName(object->metaObject(), signalName.toLatin1()).methodIndex(); + int sigIdx = QQmlPropertyPrivate::findSignalByName(object->metaObject(), signalName.toLatin1()).methodIndex(); if (sigIdx == -1) return false; @@ -139,32 +139,32 @@ static bool hasValidSignal(QObject *object, const QString &propertyName) return true; } -QDeclarativeEngineDebugService::QDeclarativeObjectProperty -QDeclarativeEngineDebugService::propertyData(QObject *obj, int propIdx) +QQmlEngineDebugService::QQmlObjectProperty +QQmlEngineDebugService::propertyData(QObject *obj, int propIdx) { - QDeclarativeObjectProperty rv; + QQmlObjectProperty rv; QMetaProperty prop = obj->metaObject()->property(propIdx); - rv.type = QDeclarativeObjectProperty::Unknown; + rv.type = QQmlObjectProperty::Unknown; rv.valueTypeName = QString::fromUtf8(prop.typeName()); rv.name = QString::fromUtf8(prop.name()); rv.hasNotifySignal = prop.hasNotifySignal(); - QDeclarativeAbstractBinding *binding = - QDeclarativePropertyPrivate::binding(QDeclarativeProperty(obj, rv.name)); + QQmlAbstractBinding *binding = + QQmlPropertyPrivate::binding(QQmlProperty(obj, rv.name)); if (binding) rv.binding = binding->expression(); - if (QDeclarativeValueTypeFactory::isValueType(prop.userType())) { - rv.type = QDeclarativeObjectProperty::Basic; - } else if (QDeclarativeMetaType::isQObject(prop.userType())) { - rv.type = QDeclarativeObjectProperty::Object; - } else if (QDeclarativeMetaType::isList(prop.userType())) { - rv.type = QDeclarativeObjectProperty::List; + if (QQmlValueTypeFactory::isValueType(prop.userType())) { + rv.type = QQmlObjectProperty::Basic; + } else if (QQmlMetaType::isQObject(prop.userType())) { + rv.type = QQmlObjectProperty::Object; + } else if (QQmlMetaType::isList(prop.userType())) { + rv.type = QQmlObjectProperty::List; } QVariant value; - if (rv.type != QDeclarativeObjectProperty::Unknown && prop.userType() != 0) { + if (rv.type != QQmlObjectProperty::Unknown && prop.userType() != 0) { value = prop.read(obj); } rv.value = valueContents(value); @@ -172,7 +172,7 @@ QDeclarativeEngineDebugService::propertyData(QObject *obj, int propIdx) return rv; } -QVariant QDeclarativeEngineDebugService::valueContents(const QVariant &value) const +QVariant QQmlEngineDebugService::valueContents(const QVariant &value) const { int userType = value.userType(); @@ -198,11 +198,11 @@ QVariant QDeclarativeEngineDebugService::valueContents(const QVariant &value) co return contents; } - if (QDeclarativeValueTypeFactory::isValueType(userType)) + if (QQmlValueTypeFactory::isValueType(userType)) return value; - if (QDeclarativeMetaType::isQObject(userType)) { - QObject *o = QDeclarativeMetaType::toQObject(value); + if (QQmlMetaType::isQObject(userType)) { + QObject *o = QQmlMetaType::toQObject(value); if (o) { QString name = o->objectName(); if (name.isEmpty()) @@ -214,7 +214,7 @@ QVariant QDeclarativeEngineDebugService::valueContents(const QVariant &value) co return QLatin1String("<unknown value>"); } -void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message, +void QQmlEngineDebugService::buildObjectDump(QDataStream &message, QObject *object, bool recur, bool dumpProperties) { message << objectData(object); @@ -223,26 +223,26 @@ void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message, int childrenCount = children.count(); for (int ii = 0; ii < children.count(); ++ii) { - if (qobject_cast<QDeclarativeContext*>(children[ii]) || QDeclarativeBoundSignal::cast(children[ii])) + if (qobject_cast<QQmlContext*>(children[ii]) || QQmlBoundSignal::cast(children[ii])) --childrenCount; } message << childrenCount << recur; - QList<QDeclarativeObjectProperty> fakeProperties; + QList<QQmlObjectProperty> fakeProperties; for (int ii = 0; ii < children.count(); ++ii) { QObject *child = children.at(ii); - if (qobject_cast<QDeclarativeContext*>(child)) + if (qobject_cast<QQmlContext*>(child)) continue; - QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child); + QQmlBoundSignal *signal = QQmlBoundSignal::cast(child); if (signal) { if (!dumpProperties) continue; - QDeclarativeObjectProperty prop; - prop.type = QDeclarativeObjectProperty::SignalProperty; + QQmlObjectProperty prop; + prop.type = QQmlObjectProperty::SignalProperty; prop.hasNotifySignal = false; - QDeclarativeExpression *expr = signal->expression(); + QQmlExpression *expr = signal->expression(); if (expr) { prop.value = expr->expression(); QObject *scope = expr->scopeObject(); @@ -285,7 +285,7 @@ void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message, message << fakeProperties[ii]; } -void QDeclarativeEngineDebugService::prepareDeferredObjects(QObject *obj) +void QQmlEngineDebugService::prepareDeferredObjects(QObject *obj) { qmlExecuteDeferred(obj); @@ -297,18 +297,18 @@ void QDeclarativeEngineDebugService::prepareDeferredObjects(QObject *obj) } -void QDeclarativeEngineDebugService::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt) +void QQmlEngineDebugService::buildObjectList(QDataStream &message, QQmlContext *ctxt) { - QDeclarativeContextData *p = QDeclarativeContextData::get(ctxt); + QQmlContextData *p = QQmlContextData::get(ctxt); QString ctxtName = ctxt->objectName(); - int ctxtId = QDeclarativeDebugService::idForObject(ctxt); + int ctxtId = QQmlDebugService::idForObject(ctxt); message << ctxtName << ctxtId; int count = 0; - QDeclarativeContextData *child = p->childContexts; + QQmlContextData *child = p->childContexts; while (child) { ++count; child = child->nextChild; @@ -318,12 +318,12 @@ void QDeclarativeEngineDebugService::buildObjectList(QDataStream &message, QDecl child = p->childContexts; while (child) { - buildObjectList(message, child->asQDeclarativeContext()); + buildObjectList(message, child->asQQmlContext()); child = child->nextChild; } // Clean deleted objects - QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(ctxt); + QQmlContextPrivate *ctxtPriv = QQmlContextPrivate::get(ctxt); for (int ii = 0; ii < ctxtPriv->instances.count(); ++ii) { if (!ctxtPriv->instances.at(ii)) { ctxtPriv->instances.removeAt(ii); @@ -337,17 +337,17 @@ void QDeclarativeEngineDebugService::buildObjectList(QDataStream &message, QDecl } } -void QDeclarativeEngineDebugService::buildStatesList(QDeclarativeContext *ctxt, bool cleanList) +void QQmlEngineDebugService::buildStatesList(QQmlContext *ctxt, bool cleanList) { if (m_statesDelegate) m_statesDelegate->buildStatesList(ctxt, cleanList); } -QDeclarativeEngineDebugService::QDeclarativeObjectData -QDeclarativeEngineDebugService::objectData(QObject *object) +QQmlEngineDebugService::QQmlObjectData +QQmlEngineDebugService::objectData(QObject *object) { - QDeclarativeData *ddata = QDeclarativeData::get(object); - QDeclarativeObjectData rv; + QQmlData *ddata = QQmlData::get(object); + QQmlObjectData rv; if (ddata && ddata->outerContext) { rv.url = ddata->outerContext->url; rv.lineNumber = ddata->lineNumber; @@ -357,18 +357,18 @@ QDeclarativeEngineDebugService::objectData(QObject *object) rv.columnNumber = -1; } - QDeclarativeContext *context = qmlContext(object); + QQmlContext *context = qmlContext(object); if (context) { - QDeclarativeContextData *cdata = QDeclarativeContextData::get(context); + QQmlContextData *cdata = QQmlContextData::get(context); if (cdata) rv.idString = cdata->findObjectId(object); } rv.objectName = object->objectName(); - rv.objectId = QDeclarativeDebugService::idForObject(object); - rv.contextId = QDeclarativeDebugService::idForObject(qmlContext(object)); + rv.objectId = QQmlDebugService::idForObject(object); + rv.contextId = QQmlDebugService::idForObject(qmlContext(object)); - QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject()); + QQmlType *type = QQmlMetaType::qmlType(object->metaObject()); if (type) { QString typeName = type->qmlTypeName(); int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); @@ -383,12 +383,12 @@ QDeclarativeEngineDebugService::objectData(QObject *object) return rv; } -void QDeclarativeEngineDebugService::messageReceived(const QByteArray &message) +void QQmlEngineDebugService::messageReceived(const QByteArray &message) { QMetaObject::invokeMethod(this, "processMessage", Qt::QueuedConnection, Q_ARG(QByteArray, message)); } -void QDeclarativeEngineDebugService::processMessage(const QByteArray &message) +void QQmlEngineDebugService::processMessage(const QByteArray &message) { QDataStream ds(message); @@ -405,10 +405,10 @@ void QDeclarativeEngineDebugService::processMessage(const QByteArray &message) rs << queryId << m_engines.count(); for (int ii = 0; ii < m_engines.count(); ++ii) { - QDeclarativeEngine *engine = m_engines.at(ii); + QQmlEngine *engine = m_engines.at(ii); QString engineName = engine->objectName(); - int engineId = QDeclarativeDebugService::idForObject(engine); + int engineId = QQmlDebugService::idForObject(engine); rs << engineName << engineId; } @@ -419,8 +419,8 @@ void QDeclarativeEngineDebugService::processMessage(const QByteArray &message) int engineId = -1; ds >> queryId >> engineId; - QDeclarativeEngine *engine = - qobject_cast<QDeclarativeEngine *>(QDeclarativeDebugService::objectForId(engineId)); + QQmlEngine *engine = + qobject_cast<QQmlEngine *>(QQmlDebugService::objectForId(engineId)); QByteArray reply; QDataStream rs(&reply, QIODevice::WriteOnly); @@ -440,7 +440,7 @@ void QDeclarativeEngineDebugService::processMessage(const QByteArray &message) ds >> queryId >> objectId >> recurse >> dumpProperties; - QObject *object = QDeclarativeDebugService::objectForId(objectId); + QObject *object = QQmlDebugService::objectForId(objectId); QByteArray reply; QDataStream rs(&reply, QIODevice::WriteOnly); @@ -502,11 +502,11 @@ void QDeclarativeEngineDebugService::processMessage(const QByteArray &message) ds >> queryId >> objectId >> expr; - QObject *object = QDeclarativeDebugService::objectForId(objectId); - QDeclarativeContext *context = qmlContext(object); + QObject *object = QQmlDebugService::objectForId(objectId); + QQmlContext *context = qmlContext(object); QVariant result; if (object && context) { - QDeclarativeExpression exprObj(context, object, expr); + QQmlExpression exprObj(context, object, expr); bool undefined = false; QVariant value = exprObj.evaluate(&undefined); if (undefined) @@ -548,7 +548,7 @@ void QDeclarativeEngineDebugService::processMessage(const QByteArray &message) } } -void QDeclarativeEngineDebugService::setBinding(int objectId, +void QQmlEngineDebugService::setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue, @@ -557,10 +557,10 @@ void QDeclarativeEngineDebugService::setBinding(int objectId, int column) { QObject *object = objectForId(objectId); - QDeclarativeContext *context = qmlContext(object); + QQmlContext *context = qmlContext(object); if (object && context) { - QDeclarativeProperty property(object, propertyName, context); + QQmlProperty property(object, propertyName, context); if (property.isValid()) { bool inBaseState = true; @@ -573,20 +573,20 @@ void QDeclarativeEngineDebugService::setBinding(int objectId, if (isLiteralValue) { property.write(expression); } else if (hasValidSignal(object, propertyName)) { - QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString()); - QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression); - declarativeExpression->setSourceLocation(filename, line, column); + QQmlExpression *qmlExpression = new QQmlExpression(context, object, expression.toString()); + QQmlPropertyPrivate::setSignalExpression(property, qmlExpression); + qmlExpression->setSourceLocation(filename, line, column); } else if (property.isProperty()) { - QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context); + QQmlBinding *binding = new QQmlBinding(expression.toString(), object, context); binding->setTarget(property); binding->setSourceLocation(filename, line, column); binding->setNotifyOnValueChanged(true); - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::setBinding(property, binding); if (oldBinding) oldBinding->destroy(); binding->update(); } else { - qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object; + qWarning() << "QQmlEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object; } } @@ -596,37 +596,37 @@ void QDeclarativeEngineDebugService::setBinding(int objectId, if (m_statesDelegate) ok = m_statesDelegate->setBindingForInvalidProperty(object, propertyName, expression, isLiteralValue); if (!ok) - qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object; + qWarning() << "QQmlEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object; } } } -void QDeclarativeEngineDebugService::resetBinding(int objectId, const QString &propertyName) +void QQmlEngineDebugService::resetBinding(int objectId, const QString &propertyName) { QObject *object = objectForId(objectId); - QDeclarativeContext *context = qmlContext(object); + QQmlContext *context = qmlContext(object); if (object && context) { if (object->property(propertyName.toLatin1()).isValid()) { - QDeclarativeProperty property(object, propertyName); - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(property); + QQmlProperty property(object, propertyName); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(property); if (oldBinding) { - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, 0); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::setBinding(property, 0); if (oldBinding) oldBinding->destroy(); } if (property.isResettable()) { // Note: this will reset the property in any case, without regard to states - // Right now almost no QDeclarativeItem has reset methods for its properties (with the - // notable exception of QDeclarativeAnchors), so this is not a big issue + // Right now almost no QQuickItem has reset methods for its properties (with the + // notable exception of QQuickAnchors), so this is not a big issue // later on, setBinding does take states into account property.reset(); } else { // overwrite with default value - if (QDeclarativeType *objType = QDeclarativeMetaType::qmlType(object->metaObject())) { + if (QQmlType *objType = QQmlMetaType::qmlType(object->metaObject())) { if (QObject *emptyObject = objType->create()) { if (emptyObject->property(propertyName.toLatin1()).isValid()) { - QVariant defaultValue = QDeclarativeProperty(emptyObject, propertyName).read(); + QVariant defaultValue = QQmlProperty(emptyObject, propertyName).read(); if (defaultValue.isValid()) { setBinding(objectId, propertyName, defaultValue, true); } @@ -636,8 +636,8 @@ void QDeclarativeEngineDebugService::resetBinding(int objectId, const QString &p } } } else if (hasValidSignal(object, propertyName)) { - QDeclarativeProperty property(object, propertyName, context); - QDeclarativePropertyPrivate::setSignalExpression(property, 0); + QQmlProperty property(object, propertyName, context); + QQmlPropertyPrivate::setSignalExpression(property, 0); } else { if (m_statesDelegate) m_statesDelegate->resetBindingForInvalidProperty(object, propertyName); @@ -645,19 +645,19 @@ void QDeclarativeEngineDebugService::resetBinding(int objectId, const QString &p } } -void QDeclarativeEngineDebugService::setMethodBody(int objectId, const QString &method, const QString &body) +void QQmlEngineDebugService::setMethodBody(int objectId, const QString &method, const QString &body) { QObject *object = objectForId(objectId); - QDeclarativeContext *context = qmlContext(object); + QQmlContext *context = qmlContext(object); if (!object || !context || !context->engine()) return; - QDeclarativeContextData *contextData = QDeclarativeContextData::get(context); + QQmlContextData *contextData = QQmlContextData::get(context); if (!contextData) return; - QDeclarativePropertyData dummy; - QDeclarativePropertyData *prop = - QDeclarativePropertyCache::property(context->engine(), object, method, dummy); + QQmlPropertyData dummy; + QQmlPropertyData *prop = + QQmlPropertyCache::property(context->engine(), object, method, dummy); if (!prop || !prop->isVMEFunction()) return; @@ -676,15 +676,15 @@ void QDeclarativeEngineDebugService::setMethodBody(int objectId, const QString & jsfunction += body; jsfunction += QLatin1String("\n})"); - QDeclarativeVMEMetaObject *vmeMetaObject = - static_cast<QDeclarativeVMEMetaObject*>(QObjectPrivate::get(object)->metaObject); + QQmlVMEMetaObject *vmeMetaObject = + static_cast<QQmlVMEMetaObject*>(QObjectPrivate::get(object)->metaObject); Q_ASSERT(vmeMetaObject); // the fact we found the property above should guarentee this int lineNumber = vmeMetaObject->vmeMethodLineNumber(prop->coreIndex); - vmeMetaObject->setVmeMethod(prop->coreIndex, QDeclarativeExpressionPrivate::evalFunction(contextData, object, jsfunction, contextData->url.toString(), lineNumber)); + vmeMetaObject->setVmeMethod(prop->coreIndex, QQmlExpressionPrivate::evalFunction(contextData, object, jsfunction, contextData->url.toString(), lineNumber)); } -void QDeclarativeEngineDebugService::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) +void QQmlEngineDebugService::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) { QByteArray reply; QDataStream rs(&reply, QIODevice::WriteOnly); @@ -694,7 +694,7 @@ void QDeclarativeEngineDebugService::propertyChanged(int id, int objectId, const sendMessage(reply); } -void QDeclarativeEngineDebugService::addEngine(QDeclarativeEngine *engine) +void QQmlEngineDebugService::addEngine(QQmlEngine *engine) { Q_ASSERT(engine); Q_ASSERT(!m_engines.contains(engine)); @@ -702,7 +702,7 @@ void QDeclarativeEngineDebugService::addEngine(QDeclarativeEngine *engine) m_engines.append(engine); } -void QDeclarativeEngineDebugService::remEngine(QDeclarativeEngine *engine) +void QQmlEngineDebugService::remEngine(QQmlEngine *engine) { Q_ASSERT(engine); Q_ASSERT(m_engines.contains(engine)); @@ -710,13 +710,13 @@ void QDeclarativeEngineDebugService::remEngine(QDeclarativeEngine *engine) m_engines.removeAll(engine); } -void QDeclarativeEngineDebugService::objectCreated(QDeclarativeEngine *engine, QObject *object) +void QQmlEngineDebugService::objectCreated(QQmlEngine *engine, QObject *object) { Q_ASSERT(engine); Q_ASSERT(m_engines.contains(engine)); - int engineId = QDeclarativeDebugService::idForObject(engine); - int objectId = QDeclarativeDebugService::idForObject(object); + int engineId = QQmlDebugService::idForObject(engine); + int objectId = QQmlDebugService::idForObject(object); QByteArray reply; QDataStream rs(&reply, QIODevice::WriteOnly); @@ -725,7 +725,7 @@ void QDeclarativeEngineDebugService::objectCreated(QDeclarativeEngine *engine, Q sendMessage(reply); } -void QDeclarativeEngineDebugService::setStatesDelegate(QDeclarativeDebugStatesDelegate *delegate) +void QQmlEngineDebugService::setStatesDelegate(QQmlDebugStatesDelegate *delegate) { m_statesDelegate = delegate; } diff --git a/src/declarative/debugger/qdeclarativeenginedebugservice_p.h b/src/qml/debugger/qqmlenginedebugservice_p.h index d252654492..1a92801fcc 100644 --- a/src/declarative/debugger/qdeclarativeenginedebugservice_p.h +++ b/src/qml/debugger/qqmlenginedebugservice_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEENGINEDEBUGSERVICE_P_H -#define QDECLARATIVEENGINEDEBUGSERVICE_P_H +#ifndef QQMLENGINEDEBUGSERVICE_P_H +#define QQMLENGINEDEBUGSERVICE_P_H // // W A R N I N G @@ -53,27 +53,27 @@ // We mean it. // -#include <private/qdeclarativedebugservice_p.h> +#include <private/qqmldebugservice_p.h> #include <QtCore/qurl.h> #include <QtCore/qvariant.h> QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeContext; -class QDeclarativeWatcher; +class QQmlEngine; +class QQmlContext; +class QQmlWatcher; class QDataStream; -class QDeclarativeDebugStatesDelegate; +class QQmlDebugStatesDelegate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEngineDebugService : public QDeclarativeDebugService +class Q_QML_PRIVATE_EXPORT QQmlEngineDebugService : public QQmlDebugService { Q_OBJECT public: - QDeclarativeEngineDebugService(QObject * = 0); - ~QDeclarativeEngineDebugService(); + QQmlEngineDebugService(QObject * = 0); + ~QQmlEngineDebugService(); - struct QDeclarativeObjectData { + struct QQmlObjectData { QUrl url; int lineNumber; int columnNumber; @@ -84,7 +84,7 @@ public: int contextId; }; - struct QDeclarativeObjectProperty { + struct QQmlObjectProperty { enum Type { Unknown, Basic, Object, List, SignalProperty }; Type type; QString name; @@ -94,13 +94,13 @@ public: bool hasNotifySignal; }; - void addEngine(QDeclarativeEngine *); - void remEngine(QDeclarativeEngine *); - void objectCreated(QDeclarativeEngine *, QObject *); + void addEngine(QQmlEngine *); + void remEngine(QQmlEngine *); + void objectCreated(QQmlEngine *, QObject *); - void setStatesDelegate(QDeclarativeDebugStatesDelegate *); + void setStatesDelegate(QQmlDebugStatesDelegate *); - static QDeclarativeEngineDebugService *instance(); + static QQmlEngineDebugService *instance(); protected: virtual void messageReceived(const QByteArray &); @@ -111,26 +111,26 @@ private Q_SLOTS: private: void prepareDeferredObjects(QObject *); - void buildObjectList(QDataStream &, QDeclarativeContext *); + void buildObjectList(QDataStream &, QQmlContext *); void buildObjectDump(QDataStream &, QObject *, bool, bool); - void buildStatesList(QDeclarativeContext *, bool); - QDeclarativeObjectData objectData(QObject *); - QDeclarativeObjectProperty propertyData(QObject *, int); + void buildStatesList(QQmlContext *, bool); + QQmlObjectData objectData(QObject *); + QQmlObjectProperty propertyData(QObject *, int); QVariant valueContents(const QVariant &defaultValue) const; void setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue, QString filename = QString(), int line = -1, int column = 0); void resetBinding(int objectId, const QString &propertyName); void setMethodBody(int objectId, const QString &method, const QString &body); - QList<QDeclarativeEngine *> m_engines; - QDeclarativeWatcher *m_watch; - QDeclarativeDebugStatesDelegate *m_statesDelegate; + QList<QQmlEngine *> m_engines; + QQmlWatcher *m_watch; + QQmlDebugStatesDelegate *m_statesDelegate; }; -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectData &); -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectData &); -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &); -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectProperty &); +Q_QML_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QQmlEngineDebugService::QQmlObjectData &); +Q_QML_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QQmlEngineDebugService::QQmlObjectData &); +Q_QML_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QQmlEngineDebugService::QQmlObjectProperty &); +Q_QML_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QQmlEngineDebugService::QQmlObjectProperty &); QT_END_NAMESPACE -#endif // QDECLARATIVEENGINEDEBUGSERVICE_P_H +#endif // QQMLENGINEDEBUGSERVICE_P_H diff --git a/src/declarative/debugger/qdeclarativeinspectorinterface_p.h b/src/qml/debugger/qqmlinspectorinterface_p.h index e109fc015e..7f52dffa2e 100644 --- a/src/declarative/debugger/qdeclarativeinspectorinterface_p.h +++ b/src/qml/debugger/qqmlinspectorinterface_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINSPECTORINTERFACE_H -#define QDECLARATIVEINSPECTORINTERFACE_H +#ifndef QQMLINSPECTORINTERFACE_H +#define QQMLINSPECTORINTERFACE_H // // W A R N I N G @@ -53,18 +53,18 @@ // We mean it. // -#include <private/qdeclarativeglobal_p.h> +#include <QtQml/qtqmlglobal.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class Q_DECLARATIVE_EXPORT QDeclarativeInspectorInterface +class Q_QML_EXPORT QQmlInspectorInterface { public: - QDeclarativeInspectorInterface() {} - virtual ~QDeclarativeInspectorInterface() {} + QQmlInspectorInterface() {} + virtual ~QQmlInspectorInterface() {} virtual bool canHandleView(QObject *view) = 0; @@ -74,10 +74,10 @@ public: virtual void clientMessage(const QByteArray &message) = 0; }; -Q_DECLARE_INTERFACE(QDeclarativeInspectorInterface, "com.trolltech.Qt.QDeclarativeInspectorInterface/1.0") +Q_DECLARE_INTERFACE(QQmlInspectorInterface, "com.trolltech.Qt.QQmlInspectorInterface/1.0") QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEINSPECTORINTERFACE_H +#endif // QQMLINSPECTORINTERFACE_H diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/qml/debugger/qqmlinspectorservice.cpp index 94b04985ba..508d12eefa 100644 --- a/src/declarative/debugger/qdeclarativeinspectorservice.cpp +++ b/src/qml/debugger/qqmlinspectorservice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,11 @@ ** ****************************************************************************/ -#include "qdeclarativeinspectorservice_p.h" -#include "qdeclarativeinspectorinterface_p.h" -#include "qdeclarativedebugserver_p.h" +#include "qqmlinspectorservice_p.h" +#include "qqmlinspectorinterface_p.h" +#include "qqmldebugserver_p.h" + +#include <private/qqmlglobal_p.h> #include <QtCore/QCoreApplication> #include <QtCore/QDebug> @@ -53,46 +55,46 @@ DEFINE_BOOL_CONFIG_OPTION(qmlDebugVerbose, QML_DEBUGGER_VERBOSE) QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QDeclarativeInspectorService, serviceInstance) +Q_GLOBAL_STATIC(QQmlInspectorService, serviceInstance) -QDeclarativeInspectorService::QDeclarativeInspectorService() - : QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode"), 1) +QQmlInspectorService::QQmlInspectorService() + : QQmlDebugService(QLatin1String("QQmlObserverMode"), 1) , m_currentInspectorPlugin(0) { registerService(); } -QDeclarativeInspectorService *QDeclarativeInspectorService::instance() +QQmlInspectorService *QQmlInspectorService::instance() { return serviceInstance(); } -void QDeclarativeInspectorService::addView(QObject *view) +void QQmlInspectorService::addView(QObject *view) { m_views.append(view); updateState(); } -void QDeclarativeInspectorService::removeView(QObject *view) +void QQmlInspectorService::removeView(QObject *view) { m_views.removeAll(view); updateState(); } -void QDeclarativeInspectorService::sendMessage(const QByteArray &message) +void QQmlInspectorService::sendMessage(const QByteArray &message) { if (state() != Enabled) return; - QDeclarativeDebugService::sendMessage(message); + QQmlDebugService::sendMessage(message); } -void QDeclarativeInspectorService::stateChanged(State /*state*/) +void QQmlInspectorService::stateChanged(State /*state*/) { QMetaObject::invokeMethod(this, "updateState", Qt::QueuedConnection); } -void QDeclarativeInspectorService::updateState() +void QQmlInspectorService::updateState() { if (m_views.isEmpty()) { if (m_currentInspectorPlugin) { @@ -107,12 +109,12 @@ void QDeclarativeInspectorService::updateState() loadInspectorPlugins(); if (m_inspectorPlugins.isEmpty()) { - qWarning() << "QDeclarativeInspector: No plugins found."; - QDeclarativeDebugServer::instance()->removeService(this); + qWarning() << "QQmlInspector: No plugins found."; + QQmlDebugServer::instance()->removeService(this); return; } - foreach (QDeclarativeInspectorInterface *inspector, m_inspectorPlugins) { + foreach (QQmlInspectorInterface *inspector, m_inspectorPlugins) { if (inspector->canHandleView(m_views.first())) { m_currentInspectorPlugin = inspector; break; @@ -120,7 +122,7 @@ void QDeclarativeInspectorService::updateState() } if (!m_currentInspectorPlugin) { - qWarning() << "QDeclarativeInspector: No plugin available for view '" << m_views.first()->metaObject()->className() << "'."; + qWarning() << "QQmlInspector: No plugin available for view '" << m_views.first()->metaObject()->className() << "'."; return; } m_currentInspectorPlugin->activate(m_views.first()); @@ -132,18 +134,18 @@ void QDeclarativeInspectorService::updateState() } } -void QDeclarativeInspectorService::messageReceived(const QByteArray &message) +void QQmlInspectorService::messageReceived(const QByteArray &message) { QMetaObject::invokeMethod(this, "processMessage", Qt::QueuedConnection, Q_ARG(QByteArray, message)); } -void QDeclarativeInspectorService::processMessage(const QByteArray &message) +void QQmlInspectorService::processMessage(const QByteArray &message) { if (m_currentInspectorPlugin) m_currentInspectorPlugin->clientMessage(message); } -void QDeclarativeInspectorService::loadInspectorPlugins() +void QQmlInspectorService::loadInspectorPlugins() { QStringList pluginCandidates; const QStringList paths = QCoreApplication::libraryPaths(); @@ -156,25 +158,25 @@ void QDeclarativeInspectorService::loadInspectorPlugins() foreach (const QString &pluginPath, pluginCandidates) { if (qmlDebugVerbose()) - qDebug() << "QDeclarativeInspector: Trying to load plugin " << pluginPath << "..."; + qDebug() << "QQmlInspector: Trying to load plugin " << pluginPath << "..."; QPluginLoader loader(pluginPath); if (!loader.load()) { if (qmlDebugVerbose()) - qDebug() << "QDeclarativeInspector: Error while loading: " << loader.errorString(); + qDebug() << "QQmlInspector: Error while loading: " << loader.errorString(); continue; } - QDeclarativeInspectorInterface *inspector = - qobject_cast<QDeclarativeInspectorInterface*>(loader.instance()); + QQmlInspectorInterface *inspector = + qobject_cast<QQmlInspectorInterface*>(loader.instance()); if (inspector) { if (qmlDebugVerbose()) - qDebug() << "QDeclarativeInspector: Plugin successfully loaded."; + qDebug() << "QQmlInspector: Plugin successfully loaded."; m_inspectorPlugins << inspector; } else { if (qmlDebugVerbose()) - qDebug() << "QDeclarativeInspector: Plugin does not implement interface QDeclarativeInspectorInterface."; + qDebug() << "QQmlInspector: Plugin does not implement interface QQmlInspectorInterface."; loader.unload(); } diff --git a/src/declarative/debugger/qdeclarativeinspectorservice_p.h b/src/qml/debugger/qqmlinspectorservice_p.h index 7ed530adc0..557dc38aa8 100644 --- a/src/declarative/debugger/qdeclarativeinspectorservice_p.h +++ b/src/qml/debugger/qqmlinspectorservice_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINSPECTORSERVICE_H -#define QDECLARATIVEINSPECTORSERVICE_H +#ifndef QQMLINSPECTORSERVICE_H +#define QQMLINSPECTORSERVICE_H // // W A R N I N G @@ -53,9 +53,9 @@ // We mean it. // -#include "qdeclarativedebugservice_p.h" -#include <private/qdeclarativeglobal_p.h> +#include "qqmldebugservice_p.h" +#include <QtQml/qtqmlglobal.h> #include <QtCore/QList> QT_BEGIN_HEADER @@ -63,15 +63,15 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeInspectorInterface; +class QQmlInspectorInterface; -class Q_DECLARATIVE_EXPORT QDeclarativeInspectorService : public QDeclarativeDebugService +class Q_QML_EXPORT QQmlInspectorService : public QQmlDebugService { Q_OBJECT public: - QDeclarativeInspectorService(); - static QDeclarativeInspectorService *instance(); + QQmlInspectorService(); + static QQmlInspectorService *instance(); void addView(QObject *); void removeView(QObject *); @@ -90,12 +90,12 @@ private: void loadInspectorPlugins(); QList<QObject*> m_views; - QDeclarativeInspectorInterface *m_currentInspectorPlugin; - QList<QDeclarativeInspectorInterface*> m_inspectorPlugins; + QQmlInspectorInterface *m_currentInspectorPlugin; + QList<QQmlInspectorInterface*> m_inspectorPlugins; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEINSPECTORSERVICE_H +#endif // QQMLINSPECTORSERVICE_H diff --git a/src/declarative/debugger/qdeclarativeprofilerservice.cpp b/src/qml/debugger/qqmlprofilerservice.cpp index 17ee3e5836..d6a0307836 100644 --- a/src/declarative/debugger/qdeclarativeprofilerservice.cpp +++ b/src/qml/debugger/qqmlprofilerservice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativeprofilerservice_p.h" +#include "qqmlprofilerservice_p.h" #include <QtCore/qdatastream.h> #include <QtCore/qurl.h> @@ -52,45 +52,45 @@ QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QDeclarativeProfilerService, profilerInstance) +Q_GLOBAL_STATIC(QQmlProfilerService, profilerInstance) -QDeclarativeBindingProfiler::QDeclarativeBindingProfiler(const QString &url, int line, int column) +QQmlBindingProfiler::QQmlBindingProfiler(const QString &url, int line, int column) { - QDeclarativeProfilerService::startRange(QDeclarativeProfilerService::Binding); - QDeclarativeProfilerService::rangeLocation(QDeclarativeProfilerService::Binding, url, line, column); + QQmlProfilerService::startRange(QQmlProfilerService::Binding); + QQmlProfilerService::rangeLocation(QQmlProfilerService::Binding, url, line, column); } -QDeclarativeBindingProfiler::~QDeclarativeBindingProfiler() +QQmlBindingProfiler::~QQmlBindingProfiler() { - QDeclarativeProfilerService::endRange(QDeclarativeProfilerService::Binding); + QQmlProfilerService::endRange(QQmlProfilerService::Binding); } -void QDeclarativeBindingProfiler::addDetail(const QString &details) +void QQmlBindingProfiler::addDetail(const QString &details) { - QDeclarativeProfilerService::rangeData(QDeclarativeProfilerService::Binding, details); + QQmlProfilerService::rangeData(QQmlProfilerService::Binding, details); } // convert to a QByteArray that can be sent to the debug client // use of QDataStream can skew results -// (see tst_qdeclarativedebugtrace::trace() benchmark) -QByteArray QDeclarativeProfilerData::toByteArray() const +// (see tst_qqmldebugtrace::trace() benchmark) +QByteArray QQmlProfilerData::toByteArray() const { QByteArray data; //### using QDataStream is relatively expensive QDataStream ds(&data, QIODevice::WriteOnly); ds << time << messageType << detailType; - if (messageType == (int)QDeclarativeProfilerService::RangeData) + if (messageType == (int)QQmlProfilerService::RangeData) ds << detailData; - if (messageType == (int)QDeclarativeProfilerService::RangeLocation) + if (messageType == (int)QQmlProfilerService::RangeLocation) ds << detailData << line << column; - if (messageType == (int)QDeclarativeProfilerService::Event && - detailType == (int)QDeclarativeProfilerService::AnimationFrame) + if (messageType == (int)QQmlProfilerService::Event && + detailType == (int)QQmlProfilerService::AnimationFrame) ds << framerate << animationcount; return data; } -QDeclarativeProfilerService::QDeclarativeProfilerService() - : QDeclarativeDebugService(QLatin1String("CanvasFrameRate"), 1), +QQmlProfilerService::QQmlProfilerService() + : QQmlDebugService(QLatin1String("CanvasFrameRate"), 1), m_enabled(false), m_messageReceived(false) { m_timer.start(); @@ -104,77 +104,77 @@ QDeclarativeProfilerService::QDeclarativeProfilerService() } } -QDeclarativeProfilerService::~QDeclarativeProfilerService() +QQmlProfilerService::~QQmlProfilerService() { } -void QDeclarativeProfilerService::initialize() +void QQmlProfilerService::initialize() { // just make sure that the service is properly registered profilerInstance(); } -bool QDeclarativeProfilerService::startProfiling() +bool QQmlProfilerService::startProfiling() { return profilerInstance()->startProfilingImpl(); } -bool QDeclarativeProfilerService::stopProfiling() +bool QQmlProfilerService::stopProfiling() { return profilerInstance()->stopProfilingImpl(); } -void QDeclarativeProfilerService::sendStartedProfilingMessage() +void QQmlProfilerService::sendStartedProfilingMessage() { profilerInstance()->sendStartedProfilingMessageImpl(); } -void QDeclarativeProfilerService::addEvent(EventType t) +void QQmlProfilerService::addEvent(EventType t) { profilerInstance()->addEventImpl(t); } -void QDeclarativeProfilerService::startRange(RangeType t) +void QQmlProfilerService::startRange(RangeType t) { profilerInstance()->startRangeImpl(t); } -void QDeclarativeProfilerService::rangeData(RangeType t, const QString &data) +void QQmlProfilerService::rangeData(RangeType t, const QString &data) { profilerInstance()->rangeDataImpl(t, data); } -void QDeclarativeProfilerService::rangeData(RangeType t, const QUrl &data) +void QQmlProfilerService::rangeData(RangeType t, const QUrl &data) { profilerInstance()->rangeDataImpl(t, data); } -void QDeclarativeProfilerService::rangeLocation(RangeType t, const QString &fileName, int line, int column) +void QQmlProfilerService::rangeLocation(RangeType t, const QString &fileName, int line, int column) { profilerInstance()->rangeLocationImpl(t, fileName, line, column); } -void QDeclarativeProfilerService::rangeLocation(RangeType t, const QUrl &fileName, int line, int column) +void QQmlProfilerService::rangeLocation(RangeType t, const QUrl &fileName, int line, int column) { profilerInstance()->rangeLocationImpl(t, fileName, line, column); } -void QDeclarativeProfilerService::endRange(RangeType t) +void QQmlProfilerService::endRange(RangeType t) { profilerInstance()->endRangeImpl(t); } -void QDeclarativeProfilerService::animationFrame(qint64 delta) +void QQmlProfilerService::animationFrame(qint64 delta) { profilerInstance()->animationFrameImpl(delta); } -void QDeclarativeProfilerService::sendProfilingData() +void QQmlProfilerService::sendProfilingData() { profilerInstance()->sendMessages(); } -bool QDeclarativeProfilerService::startProfilingImpl() +bool QQmlProfilerService::startProfilingImpl() { bool success = false; if (!profilingEnabled()) { @@ -185,7 +185,7 @@ bool QDeclarativeProfilerService::startProfilingImpl() return success; } -bool QDeclarativeProfilerService::stopProfilingImpl() +bool QQmlProfilerService::stopProfilingImpl() { bool success = false; if (profilingEnabled()) { @@ -196,81 +196,81 @@ bool QDeclarativeProfilerService::stopProfilingImpl() return success; } -void QDeclarativeProfilerService::sendStartedProfilingMessageImpl() +void QQmlProfilerService::sendStartedProfilingMessageImpl() { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)StartTrace, QString(), -1, -1, 0, 0}; - QDeclarativeDebugService::sendMessage(ed.toByteArray()); + QQmlProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)StartTrace, QString(), -1, -1, 0, 0}; + QQmlDebugService::sendMessage(ed.toByteArray()); } -void QDeclarativeProfilerService::addEventImpl(EventType event) +void QQmlProfilerService::addEventImpl(EventType event) { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)event, QString(), -1, -1, 0, 0}; + QQmlProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)event, QString(), -1, -1, 0, 0}; processMessage(ed); } -void QDeclarativeProfilerService::startRangeImpl(RangeType range) +void QQmlProfilerService::startRangeImpl(RangeType range) { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeStart, (int)range, QString(), -1, -1, 0, 0}; + QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeStart, (int)range, QString(), -1, -1, 0, 0}; processMessage(rd); } -void QDeclarativeProfilerService::rangeDataImpl(RangeType range, const QString &rData) +void QQmlProfilerService::rangeDataImpl(RangeType range, const QString &rData) { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeData, (int)range, rData, -1, -1, 0, 0}; + QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeData, (int)range, rData, -1, -1, 0, 0}; processMessage(rd); } -void QDeclarativeProfilerService::rangeDataImpl(RangeType range, const QUrl &rData) +void QQmlProfilerService::rangeDataImpl(RangeType range, const QUrl &rData) { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeData, (int)range, rData.toString(QUrl::FormattingOption(0x100)), -1, -1, 0, 0}; + QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeData, (int)range, rData.toString(QUrl::FormattingOption(0x100)), -1, -1, 0, 0}; processMessage(rd); } -void QDeclarativeProfilerService::rangeLocationImpl(RangeType range, const QString &fileName, int line, int column) +void QQmlProfilerService::rangeLocationImpl(RangeType range, const QString &fileName, int line, int column) { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeLocation, (int)range, fileName, line, column, 0, 0}; + QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeLocation, (int)range, fileName, line, column, 0, 0}; processMessage(rd); } -void QDeclarativeProfilerService::rangeLocationImpl(RangeType range, const QUrl &fileName, int line, int column) +void QQmlProfilerService::rangeLocationImpl(RangeType range, const QUrl &fileName, int line, int column) { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeLocation, (int)range, fileName.toString(QUrl::FormattingOption(0x100)), line, column, 0, 0}; + QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeLocation, (int)range, fileName.toString(QUrl::FormattingOption(0x100)), line, column, 0, 0}; processMessage(rd); } -void QDeclarativeProfilerService::endRangeImpl(RangeType range) +void QQmlProfilerService::endRangeImpl(RangeType range) { - if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) + if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled) return; - QDeclarativeProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeEnd, (int)range, QString(), -1, -1, 0, 0}; + QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeEnd, (int)range, QString(), -1, -1, 0, 0}; processMessage(rd); } -void QDeclarativeProfilerService::animationFrameImpl(qint64 delta) +void QQmlProfilerService::animationFrameImpl(qint64 delta) { - Q_ASSERT(QDeclarativeDebugService::isDebuggingEnabled()); + Q_ASSERT(QQmlDebugService::isDebuggingEnabled()); if (!m_enabled) return; @@ -279,7 +279,7 @@ void QDeclarativeProfilerService::animationFrameImpl(qint64 delta) if (animCount > 0 && delta > 0) { // trim fps to integer int fps = 1000 / delta; - QDeclarativeProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)AnimationFrame, QString(), -1, -1, fps, animCount}; + QQmlProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)AnimationFrame, QString(), -1, -1, fps, animCount}; processMessage(ed); } } @@ -288,18 +288,18 @@ void QDeclarativeProfilerService::animationFrameImpl(qint64 delta) Either send the message directly, or queue up a list of messages to send later (via sendMessages) */ -void QDeclarativeProfilerService::processMessage(const QDeclarativeProfilerData &message) +void QQmlProfilerService::processMessage(const QQmlProfilerData &message) { QMutexLocker locker(&m_mutex); m_data.append(message); } -bool QDeclarativeProfilerService::profilingEnabled() +bool QQmlProfilerService::profilingEnabled() { return m_enabled; } -void QDeclarativeProfilerService::setProfilingEnabled(bool enable) +void QQmlProfilerService::setProfilingEnabled(bool enable) { m_enabled = enable; } @@ -307,7 +307,7 @@ void QDeclarativeProfilerService::setProfilingEnabled(bool enable) /* Send the messages queued up by processMessage */ -void QDeclarativeProfilerService::sendMessages() +void QQmlProfilerService::sendMessages() { QMutexLocker locker(&m_mutex); QList<QByteArray> messages; @@ -321,10 +321,10 @@ void QDeclarativeProfilerService::sendMessages() ds << (qint64)-1 << (int)Complete; messages << data; - QDeclarativeDebugService::sendMessages(messages); + QQmlDebugService::sendMessages(messages); } -void QDeclarativeProfilerService::stateAboutToBeChanged(QDeclarativeDebugService::State newState) +void QQmlProfilerService::stateAboutToBeChanged(QQmlDebugService::State newState) { if (state() == newState) return; @@ -336,7 +336,7 @@ void QDeclarativeProfilerService::stateAboutToBeChanged(QDeclarativeDebugService } } -void QDeclarativeProfilerService::messageReceived(const QByteArray &message) +void QQmlProfilerService::messageReceived(const QByteArray &message) { QByteArray rwData = message; QDataStream stream(&rwData, QIODevice::ReadOnly); diff --git a/src/declarative/debugger/qdeclarativeprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h index d29690b6d6..a74ce10c74 100644 --- a/src/declarative/debugger/qdeclarativeprofilerservice_p.h +++ b/src/qml/debugger/qqmlprofilerservice_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROFILERSERVICE_P_H -#define QDECLARATIVEPROFILERSERVICE_P_H +#ifndef QQMLPROFILERSERVICE_P_H +#define QQMLPROFILERSERVICE_P_H // // W A R N I N G @@ -53,7 +53,7 @@ // We mean it. // -#include <private/qdeclarativedebugservice_p.h> +#include <private/qqmldebugservice_p.h> #include <QtCore/qelapsedtimer.h> #include <QtCore/qmutex.h> #include <QtCore/qvector.h> @@ -62,7 +62,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -struct Q_AUTOTEST_EXPORT QDeclarativeProfilerData +struct Q_AUTOTEST_EXPORT QQmlProfilerData { qint64 time; int messageType; @@ -78,20 +78,20 @@ struct Q_AUTOTEST_EXPORT QDeclarativeProfilerData QByteArray toByteArray() const; }; -Q_DECLARE_TYPEINFO(QDeclarativeProfilerData, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO(QQmlProfilerData, Q_MOVABLE_TYPE); class QUrl; -class QDeclarativeEngine; +class QQmlEngine; // RAII -class Q_AUTOTEST_EXPORT QDeclarativeBindingProfiler { +class Q_AUTOTEST_EXPORT QQmlBindingProfiler { public: - QDeclarativeBindingProfiler(const QString &url, int line, int column); - ~QDeclarativeBindingProfiler(); + QQmlBindingProfiler(const QString &url, int line, int column); + ~QQmlBindingProfiler(); void addDetail(const QString &details); }; -class Q_DECLARATIVE_EXPORT QDeclarativeProfilerService : public QDeclarativeDebugService +class Q_QML_EXPORT QQmlProfilerService : public QQmlDebugService { public: enum Message { @@ -142,8 +142,8 @@ public: static void sendProfilingData(); - QDeclarativeProfilerService(); - ~QDeclarativeProfilerService(); + QQmlProfilerService(); + ~QQmlProfilerService(); protected: virtual void stateAboutToBeChanged(State state); @@ -165,13 +165,13 @@ private: bool profilingEnabled(); void setProfilingEnabled(bool enable); void sendMessages(); - void processMessage(const QDeclarativeProfilerData &); + void processMessage(const QQmlProfilerData &); private: QElapsedTimer m_timer; bool m_enabled; bool m_messageReceived; - QVector<QDeclarativeProfilerData> m_data; + QVector<QQmlProfilerData> m_data; QMutex m_mutex; }; @@ -179,5 +179,5 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEPROFILERSERVICE_P_H +#endif // QQMLPROFILERSERVICE_P_H diff --git a/src/declarative/debugger/qv8debugservice.cpp b/src/qml/debugger/qv8debugservice.cpp index 389c465420..ee60bff742 100644 --- a/src/declarative/debugger/qv8debugservice.cpp +++ b/src/qml/debugger/qv8debugservice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qv8debugservice_p.h" -#include "qdeclarativedebugservice_p_p.h" +#include "qqmldebugservice_p_p.h" #include <private/qjsconverter_impl_p.h> #include <private/qv8engine_p.h> @@ -97,7 +97,7 @@ void DebugMessageHandler(const v8::Debug::Message& message) v8ServiceInstancePtr->debugMessageHandler(QJSConverter::toString(message.GetJSON()), event); } -class QV8DebugServicePrivate : public QDeclarativeDebugServicePrivate +class QV8DebugServicePrivate : public QQmlDebugServicePrivate { public: QV8DebugServicePrivate() @@ -119,7 +119,7 @@ public: }; QV8DebugService::QV8DebugService(QObject *parent) - : QDeclarativeDebugService(*(new QV8DebugServicePrivate()), + : QQmlDebugService(*(new QV8DebugServicePrivate()), QLatin1String("V8Debugger"), 2, parent) { Q_D(QV8DebugService); @@ -169,7 +169,7 @@ void QV8DebugService::debugMessageHandler(const QString &message, const v8::Debu void QV8DebugService::signalEmitted(const QString &signal) { - //This function is only called by QDeclarativeBoundSignal + //This function is only called by QQmlBoundSignal //only if there is a slot connected to the signal. Hence, there //is no need for additional check. Q_D(QV8DebugService); @@ -205,7 +205,7 @@ void QV8DebugService::scheduledDebugBreak(bool schedule) } // executed in the debugger thread -void QV8DebugService::stateChanged(QDeclarativeDebugService::State newState) +void QV8DebugService::stateChanged(QQmlDebugService::State newState) { Q_D(QV8DebugService); if (newState == Enabled) { diff --git a/src/declarative/debugger/qv8debugservice_p.h b/src/qml/debugger/qv8debugservice_p.h index 3f1d1ca177..8ff4adc778 100644 --- a/src/declarative/debugger/qv8debugservice_p.h +++ b/src/qml/debugger/qv8debugservice_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,7 +53,7 @@ // We mean it. // -#include "qdeclarativedebugservice_p.h" +#include "qqmldebugservice_p.h" #include <private/qv8debug_p.h> QT_BEGIN_HEADER @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE class QV8Engine; class QV8DebugServicePrivate; -class QV8DebugService : public QDeclarativeDebugService +class QV8DebugService : public QQmlDebugService { Q_OBJECT public: diff --git a/src/declarative/debugger/qv8profilerservice.cpp b/src/qml/debugger/qv8profilerservice.cpp index 5ae2d01cc2..eba8b0feef 100644 --- a/src/declarative/debugger/qv8profilerservice.cpp +++ b/src/qml/debugger/qv8profilerservice.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qv8profilerservice_p.h" -#include "qdeclarativedebugservice_p_p.h" +#include "qqmldebugservice_p_p.h" #include "private/qjsconverter_impl_p.h" #include <private/qv8profiler_p.h> @@ -52,9 +52,9 @@ Q_GLOBAL_STATIC(QV8ProfilerService, v8ProfilerInstance) class DebugServiceOutputStream : public v8::OutputStream { - QDeclarativeDebugService &_service; + QQmlDebugService &_service; public: - DebugServiceOutputStream(QDeclarativeDebugService &service) + DebugServiceOutputStream(QQmlDebugService &service) : v8::OutputStream(), _service(service) {} void EndOfStream() {} @@ -79,7 +79,7 @@ QByteArray QV8ProfilerData::toByteArray() const return data; } -class QV8ProfilerServicePrivate : public QDeclarativeDebugServicePrivate +class QV8ProfilerServicePrivate : public QQmlDebugServicePrivate { Q_DECLARE_PUBLIC(QV8ProfilerService) @@ -101,7 +101,7 @@ public: }; QV8ProfilerService::QV8ProfilerService(QObject *parent) - : QDeclarativeDebugService(*(new QV8ProfilerServicePrivate()), QLatin1String("V8Profiler"), 1, parent) + : QQmlDebugService(*(new QV8ProfilerServicePrivate()), QLatin1String("V8Profiler"), 1, parent) { Q_D(QV8ProfilerService); @@ -127,7 +127,7 @@ void QV8ProfilerService::initialize() v8ProfilerInstance(); } -void QV8ProfilerService::stateAboutToBeChanged(QDeclarativeDebugService::State newState) +void QV8ProfilerService::stateAboutToBeChanged(QQmlDebugService::State newState) { Q_D(QV8ProfilerService); @@ -171,7 +171,7 @@ void QV8ProfilerService::messageReceived(const QByteArray &message) } } - QDeclarativeDebugService::messageReceived(message); + QQmlDebugService::messageReceived(message); } void QV8ProfilerService::startProfiling(const QString &title) diff --git a/src/declarative/debugger/qv8profilerservice_p.h b/src/qml/debugger/qv8profilerservice_p.h index 706907ae23..d408d9ed0e 100644 --- a/src/declarative/debugger/qv8profilerservice_p.h +++ b/src/qml/debugger/qv8profilerservice_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,7 +53,7 @@ // We mean it. // -#include <private/qdeclarativedebugservice_p.h> +#include <private/qqmldebugservice_p.h> QT_BEGIN_HEADER @@ -73,10 +73,10 @@ struct Q_AUTOTEST_EXPORT QV8ProfilerData QByteArray toByteArray() const; }; -class QDeclarativeEngine; +class QQmlEngine; class QV8ProfilerServicePrivate; -class Q_AUTOTEST_EXPORT QV8ProfilerService : public QDeclarativeDebugService +class Q_AUTOTEST_EXPORT QV8ProfilerService : public QQmlDebugService { Q_OBJECT public: diff --git a/src/declarative/declarative.pro b/src/qml/qml.pro index 1da58ce5d9..0bbfc9ff74 100644 --- a/src/declarative/declarative.pro +++ b/src/qml/qml.pro @@ -1,28 +1,31 @@ load(qt_module) -TARGET = QtDeclarative +TARGET = QtQml QPRO_PWD = $$PWD CONFIG += module -MODULE_PRI += ../../modules/qt_declarative.pri +MODULE_PRI += ../../modules/qt_qml.pri QT = core-private gui gui-private network v8-private -DEFINES += QT_BUILD_DECLARATIVE_LIB QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES +DEFINES += QT_BUILD_QML_LIB QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES + win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000 win32-msvc*:DEFINES *= _CRT_SECURE_NO_WARNINGS solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui -exists("qdeclarative_enable_gcov") { +exists("qqml_enable_gcov") { QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors LIBS += -lgcov } load(qt_module_config) -HEADERS += qtdeclarativeversion.h +HEADERS += qtqmlversion.h \ + qtqmlglobal.h \ + qtqmlglobal_p.h #INCLUDEPATH -= $$QMAKE_INCDIR_QT/$$TARGET #DESTDIR=. @@ -31,4 +34,4 @@ HEADERS += qtdeclarativeversion.h include(util/util.pri) include(qml/qml.pri) include(debugger/debugger.pri) -include(animations/animations.pri)
\ No newline at end of file +include(animations/animations.pri) diff --git a/src/declarative/qml/ftw/ftw.pri b/src/qml/qml/ftw/ftw.pri index 26343422c5..f2fec4e2dd 100644 --- a/src/declarative/qml/ftw/ftw.pri +++ b/src/qml/qml/ftw/ftw.pri @@ -3,27 +3,27 @@ HEADERS += \ $$PWD/qintrusivelist_p.h \ $$PWD/qpodvector_p.h \ $$PWD/qhashedstring_p.h \ - $$PWD/qdeclarativerefcount_p.h \ - $$PWD/qdeclarativepool_p.h \ + $$PWD/qqmlrefcount_p.h \ + $$PWD/qqmlpool_p.h \ $$PWD/qfieldlist_p.h \ $$PWD/qfastmetabuilder_p.h \ $$PWD/qhashfield_p.h \ - $$PWD/qdeclarativethread_p.h \ + $$PWD/qqmlthread_p.h \ $$PWD/qfinitestack_p.h \ $$PWD/qrecursionwatcher_p.h \ $$PWD/qdeletewatcher_p.h \ $$PWD/qrecyclepool_p.h \ $$PWD/qflagpointer_p.h \ - $$PWD/qdeclarativetrace_p.h \ + $$PWD/qqmltrace_p.h \ $$PWD/qpointervaluepair_p.h \ $$PWD/qlazilyallocated_p.h \ SOURCES += \ $$PWD/qintrusivelist.cpp \ $$PWD/qhashedstring.cpp \ - $$PWD/qdeclarativepool.cpp \ + $$PWD/qqmlpool.cpp \ $$PWD/qfastmetabuilder.cpp \ - $$PWD/qdeclarativethread.cpp \ - $$PWD/qdeclarativetrace.cpp \ + $$PWD/qqmlthread.cpp \ + $$PWD/qqmltrace.cpp \ contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri) diff --git a/src/declarative/qml/ftw/qbitfield_p.h b/src/qml/qml/ftw/qbitfield_p.h index addd21c96d..75f80dd896 100644 --- a/src/declarative/qml/ftw/qbitfield_p.h +++ b/src/qml/qml/ftw/qbitfield_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qdeletewatcher_p.h b/src/qml/qml/ftw/qdeletewatcher_p.h index 020907aa65..9f7b100429 100644 --- a/src/declarative/qml/ftw/qdeletewatcher_p.h +++ b/src/qml/qml/ftw/qdeletewatcher_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qfastmetabuilder.cpp b/src/qml/qml/ftw/qfastmetabuilder.cpp index 0395ab3309..9663c1e944 100644 --- a/src/declarative/qml/ftw/qfastmetabuilder.cpp +++ b/src/qml/qml/ftw/qfastmetabuilder.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qfastmetabuilder_p.h b/src/qml/qml/ftw/qfastmetabuilder_p.h index e8b7394fe4..c1f6a3de5c 100644 --- a/src/declarative/qml/ftw/qfastmetabuilder_p.h +++ b/src/qml/qml/ftw/qfastmetabuilder_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qfieldlist_p.h b/src/qml/qml/ftw/qfieldlist_p.h index 4253779e78..da5074b3cd 100644 --- a/src/declarative/qml/ftw/qfieldlist_p.h +++ b/src/qml/qml/ftw/qfieldlist_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qfinitestack_p.h b/src/qml/qml/ftw/qfinitestack_p.h index 8161b042c2..c5a9fbaedb 100644 --- a/src/declarative/qml/ftw/qfinitestack_p.h +++ b/src/qml/qml/ftw/qfinitestack_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qflagpointer_p.h b/src/qml/qml/ftw/qflagpointer_p.h index ac462cbe30..a4b20d9e2a 100644 --- a/src/declarative/qml/ftw/qflagpointer_p.h +++ b/src/qml/qml/ftw/qflagpointer_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qhashedstring.cpp b/src/qml/qml/ftw/qhashedstring.cpp index f3b5a9ebc9..1f09d50ed3 100644 --- a/src/declarative/qml/ftw/qhashedstring.cpp +++ b/src/qml/qml/ftw/qhashedstring.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h index b778dd4df2..f575285ff6 100644 --- a/src/declarative/qml/ftw/qhashedstring_p.h +++ b/src/qml/qml/ftw/qhashedstring_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qhashfield_p.h b/src/qml/qml/ftw/qhashfield_p.h index a11e8d9486..46df9a176c 100644 --- a/src/declarative/qml/ftw/qhashfield_p.h +++ b/src/qml/qml/ftw/qhashfield_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qintrusivelist.cpp b/src/qml/qml/ftw/qintrusivelist.cpp index 1893eef8cd..5a1624f1f4 100644 --- a/src/declarative/qml/ftw/qintrusivelist.cpp +++ b/src/qml/qml/ftw/qintrusivelist.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qintrusivelist_p.h b/src/qml/qml/ftw/qintrusivelist_p.h index fb7524c6ab..489b02d656 100644 --- a/src/declarative/qml/ftw/qintrusivelist_p.h +++ b/src/qml/qml/ftw/qintrusivelist_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qlazilyallocated_p.h b/src/qml/qml/ftw/qlazilyallocated_p.h index d5a9dcc3ec..960d84d5e7 100644 --- a/src/declarative/qml/ftw/qlazilyallocated_p.h +++ b/src/qml/qml/ftw/qlazilyallocated_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qpodvector_p.h b/src/qml/qml/ftw/qpodvector_p.h index 66f970f100..c96692667a 100644 --- a/src/declarative/qml/ftw/qpodvector_p.h +++ b/src/qml/qml/ftw/qpodvector_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qpointervaluepair_p.h b/src/qml/qml/ftw/qpointervaluepair_p.h index fd1a77004e..7b0caf49bc 100644 --- a/src/declarative/qml/ftw/qpointervaluepair_p.h +++ b/src/qml/qml/ftw/qpointervaluepair_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qdeclarativepool.cpp b/src/qml/qml/ftw/qqmlpool.cpp index d816e5bb95..6fd11d4b1e 100644 --- a/src/declarative/qml/ftw/qdeclarativepool.cpp +++ b/src/qml/qml/ftw/qqmlpool.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#include "qdeclarativepool_p.h" +#include "qqmlpool_p.h" // #define POOL_DEBUG QT_BEGIN_NAMESPACE -void QDeclarativePool::newpage() +void QQmlPool::newpage() { #ifdef POOL_DEBUG - qWarning("QDeclarativePool: Allocating page"); + qWarning("QQmlPool: Allocating page"); #endif Page *page = (Page *)malloc(sizeof(Page)); @@ -57,7 +57,7 @@ void QDeclarativePool::newpage() _page = page; } -void QDeclarativePool::clear() +void QQmlPool::clear() { #ifdef POOL_DEBUG int count = 0; @@ -74,7 +74,7 @@ void QDeclarativePool::clear() } #ifdef POOL_DEBUG - qWarning("QDeclarativePool: Destroyed %d objects", count); + qWarning("QQmlPool: Destroyed %d objects", count); #endif Page *p = _page; diff --git a/src/declarative/qml/ftw/qdeclarativepool_p.h b/src/qml/qml/ftw/qqmlpool_p.h index d04c0e9eef..e4fa03ce34 100644 --- a/src/declarative/qml/ftw/qdeclarativepool_p.h +++ b/src/qml/qml/ftw/qqmlpool_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPOOL_P_H -#define QDECLARATIVEPOOL_P_H +#ifndef QQMLPOOL_P_H +#define QQMLPOOL_P_H // // W A R N I N G @@ -53,27 +53,27 @@ // We mean it. // -#include <QtCore/qglobal.h> +#include <QtQml/qtqmlglobal.h> #include <QtCore/qstring.h> #include <QtCore/qurl.h> QT_BEGIN_NAMESPACE // Exported for QtQuick1 -class Q_DECLARATIVE_EXPORT QDeclarativePool +class Q_QML_EXPORT QQmlPool { public: // The class has a destructor that needs to be called class Class { public: - inline QDeclarativePool *pool() const; + inline QQmlPool *pool() const; private: void *operator new(size_t); void *operator new(size_t, void *m) { return m; } - friend class QDeclarativePool; + friend class QQmlPool; - QDeclarativePool *_pool; + QQmlPool *_pool; Class *_next; void (*_destroy)(Class *); }; @@ -82,18 +82,18 @@ public: // be called class POD { public: - inline QDeclarativePool *pool() const; + inline QQmlPool *pool() const; private: void *operator new(size_t); void *operator new(size_t, void *m) { return m; } - friend class QDeclarativePool; + friend class QQmlPool; - QDeclarativePool *_pool; + QQmlPool *_pool; }; - inline QDeclarativePool(); - inline ~QDeclarativePool(); + inline QQmlPool(); + inline ~QQmlPool(); void clear(); @@ -133,7 +133,7 @@ public: return m_data[index]; }; private: - friend class QDeclarativePool; + friend class QQmlPool; List(T *d, int l) : m_length(l), m_data(d) {} int m_length; T *m_data; @@ -175,18 +175,18 @@ private: Class *_classList; }; -QDeclarativePool::QDeclarativePool() +QQmlPool::QQmlPool() : _page(0), _classList(0) { } -QDeclarativePool::~QDeclarativePool() +QQmlPool::~QQmlPool() { clear(); } template<typename T> -T *QDeclarativePool::New() +T *QQmlPool::New() { T *rv = new (allocate(sizeof(T))) T; initialize<T>(rv); @@ -195,45 +195,45 @@ T *QDeclarativePool::New() } template<typename T> -T *QDeclarativePool::NewRaw() +T *QQmlPool::NewRaw() { return (T*)allocate(sizeof(T)); } template<typename T> -T *QDeclarativePool::NewRawArray(int length) +T *QQmlPool::NewRawArray(int length) { return (T*)allocate(length * sizeof(T)); } template<typename T> -QDeclarativePool::List<T> QDeclarativePool::NewRawList(int length) +QQmlPool::List<T> QQmlPool::NewRawList(int length) { return List<T>(NewRawArray<T>(length), length); } -QString *QDeclarativePool::NewString(const QString &s) +QString *QQmlPool::NewString(const QString &s) { QString *rv = New<StringClass>(); *rv = s; return rv; } -QByteArray *QDeclarativePool::NewByteArray(const QByteArray &s) +QByteArray *QQmlPool::NewByteArray(const QByteArray &s) { QByteArray *rv = New<ByteArrayClass>(); *rv = s; return rv; } -QUrl *QDeclarativePool::NewUrl(const QUrl &s) +QUrl *QQmlPool::NewUrl(const QUrl &s) { QUrl *rv = New<UrlClass>(); *rv = s; return rv; } -void *QDeclarativePool::allocate(int size) +void *QQmlPool::allocate(int size) { if (!_page || (_page->header.free + size) > (_page->memory + Page::pageSize)) newpage(); @@ -244,12 +244,12 @@ void *QDeclarativePool::allocate(int size) } template<typename T> -void QDeclarativePool::initialize(QDeclarativePool::POD *) +void QQmlPool::initialize(QQmlPool::POD *) { } template<typename T> -void QDeclarativePool::initialize(QDeclarativePool::Class *c) +void QQmlPool::initialize(QQmlPool::Class *c) { c->_next = _classList; c->_destroy = &destroy<T>; @@ -257,22 +257,22 @@ void QDeclarativePool::initialize(QDeclarativePool::Class *c) } template<typename T> -void QDeclarativePool::destroy(Class *c) +void QQmlPool::destroy(Class *c) { static_cast<T *>(c)->~T(); } -QDeclarativePool *QDeclarativePool::Class::pool() const +QQmlPool *QQmlPool::Class::pool() const { return _pool; } -QDeclarativePool *QDeclarativePool::POD::pool() const +QQmlPool *QQmlPool::POD::pool() const { return _pool; } QT_END_NAMESPACE -#endif // QDECLARATIVEPOOL_P_H +#endif // QQMLPOOL_P_H diff --git a/src/declarative/qml/ftw/qdeclarativerefcount_p.h b/src/qml/qml/ftw/qqmlrefcount_p.h index 05aede4534..497f4ecc0f 100644 --- a/src/declarative/qml/ftw/qdeclarativerefcount_p.h +++ b/src/qml/qml/ftw/qqmlrefcount_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEREFCOUNT_P_H -#define QDECLARATIVEREFCOUNT_P_H +#ifndef QQMLREFCOUNT_P_H +#define QQMLREFCOUNT_P_H // // W A R N I N G @@ -61,11 +61,11 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeRefCount +class QQmlRefCount { public: - inline QDeclarativeRefCount(); - inline virtual ~QDeclarativeRefCount(); + inline QQmlRefCount(); + inline virtual ~QQmlRefCount(); inline void addref(); inline void release(); @@ -77,16 +77,16 @@ private: }; template<class T> -class QDeclarativeRefPointer +class QQmlRefPointer { public: - inline QDeclarativeRefPointer(); - inline QDeclarativeRefPointer(T *); - inline QDeclarativeRefPointer(const QDeclarativeRefPointer<T> &); - inline ~QDeclarativeRefPointer(); + inline QQmlRefPointer(); + inline QQmlRefPointer(T *); + inline QQmlRefPointer(const QQmlRefPointer<T> &); + inline ~QQmlRefPointer(); - inline QDeclarativeRefPointer<T> &operator=(const QDeclarativeRefPointer<T> &o); - inline QDeclarativeRefPointer<T> &operator=(T *); + inline QQmlRefPointer<T> &operator=(const QQmlRefPointer<T> &o); + inline QQmlRefPointer<T> &operator=(T *); inline bool isNull() const { return !o; } @@ -95,68 +95,68 @@ public: inline operator T*() const { return o; } inline T* data() const { return o; } - inline QDeclarativeRefPointer<T> &take(T *); + inline QQmlRefPointer<T> &take(T *); private: T *o; }; -QDeclarativeRefCount::QDeclarativeRefCount() +QQmlRefCount::QQmlRefCount() : refCount(1) { } -QDeclarativeRefCount::~QDeclarativeRefCount() +QQmlRefCount::~QQmlRefCount() { Q_ASSERT(refCount.load() == 0); } -void QDeclarativeRefCount::addref() +void QQmlRefCount::addref() { Q_ASSERT(refCount.load() > 0); refCount.ref(); } -void QDeclarativeRefCount::release() +void QQmlRefCount::release() { Q_ASSERT(refCount.load() > 0); if (!refCount.deref()) destroy(); } -void QDeclarativeRefCount::destroy() +void QQmlRefCount::destroy() { delete this; } template<class T> -QDeclarativeRefPointer<T>::QDeclarativeRefPointer() +QQmlRefPointer<T>::QQmlRefPointer() : o(0) { } template<class T> -QDeclarativeRefPointer<T>::QDeclarativeRefPointer(T *o) +QQmlRefPointer<T>::QQmlRefPointer(T *o) : o(o) { if (o) o->addref(); } template<class T> -QDeclarativeRefPointer<T>::QDeclarativeRefPointer(const QDeclarativeRefPointer<T> &other) +QQmlRefPointer<T>::QQmlRefPointer(const QQmlRefPointer<T> &other) : o(other.o) { if (o) o->addref(); } template<class T> -QDeclarativeRefPointer<T>::~QDeclarativeRefPointer() +QQmlRefPointer<T>::~QQmlRefPointer() { if (o) o->release(); } template<class T> -QDeclarativeRefPointer<T> &QDeclarativeRefPointer<T>::operator=(const QDeclarativeRefPointer<T> &other) +QQmlRefPointer<T> &QQmlRefPointer<T>::operator=(const QQmlRefPointer<T> &other) { if (other.o) other.o->addref(); if (o) o->release(); @@ -165,7 +165,7 @@ QDeclarativeRefPointer<T> &QDeclarativeRefPointer<T>::operator=(const QDeclarati } template<class T> -QDeclarativeRefPointer<T> &QDeclarativeRefPointer<T>::operator=(T *other) +QQmlRefPointer<T> &QQmlRefPointer<T>::operator=(T *other) { if (other) other->addref(); if (o) o->release(); @@ -178,7 +178,7 @@ Takes ownership of \a other. take() does *not* add a reference, as it assumes o of the callers reference of other. */ template<class T> -QDeclarativeRefPointer<T> &QDeclarativeRefPointer<T>::take(T *other) +QQmlRefPointer<T> &QQmlRefPointer<T>::take(T *other) { if (o) o->release(); o = other; @@ -189,4 +189,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEREFCOUNT_P_H +#endif // QQMLREFCOUNT_P_H diff --git a/src/declarative/qml/ftw/qdeclarativethread.cpp b/src/qml/qml/ftw/qqmlthread.cpp index be51a09f8d..423012b934 100644 --- a/src/declarative/qml/ftw/qdeclarativethread.cpp +++ b/src/qml/qml/ftw/qqmlthread.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativethread_p.h" +#include "qqmlthread_p.h" #include <private/qfieldlist_p.h> @@ -51,11 +51,11 @@ QT_BEGIN_NAMESPACE -class QDeclarativeThreadPrivate : public QThread +class QQmlThreadPrivate : public QThread { public: - QDeclarativeThreadPrivate(QDeclarativeThread *); - QDeclarativeThread *q; + QQmlThreadPrivate(QQmlThread *); + QQmlThread *q; virtual void run(); @@ -70,11 +70,11 @@ public: quint32 m_shutdown:1; // Set by main thread to request a shutdown quint32 m_mainThreadWaiting:1; // Set by main thread if it is waiting for the message queue to empty - typedef QFieldList<QDeclarativeThread::Message, &QDeclarativeThread::Message::next> MessageList; + typedef QFieldList<QQmlThread::Message, &QQmlThread::Message::next> MessageList; MessageList threadList; MessageList mainList; - QDeclarativeThread::Message *mainSync; + QQmlThread::Message *mainSync; void triggerMainEvent(); void triggerThreadEvent(); @@ -87,9 +87,9 @@ protected: private: struct MainObject : public QObject { - MainObject(QDeclarativeThreadPrivate *p); + MainObject(QQmlThreadPrivate *p); virtual bool event(QEvent *e); - QDeclarativeThreadPrivate *p; + QQmlThreadPrivate *p; }; MainObject m_mainObject; @@ -97,46 +97,46 @@ private: QWaitCondition _wait; }; -QDeclarativeThreadPrivate::MainObject::MainObject(QDeclarativeThreadPrivate *p) +QQmlThreadPrivate::MainObject::MainObject(QQmlThreadPrivate *p) : p(p) { } // Trigger mainEvent in main thread. Must be called from thread. -void QDeclarativeThreadPrivate::triggerMainEvent() +void QQmlThreadPrivate::triggerMainEvent() { Q_ASSERT(q->isThisThread()); QCoreApplication::postEvent(&m_mainObject, new QEvent(QEvent::User)); } // Trigger even in thread. Must be called from main thread. -void QDeclarativeThreadPrivate::triggerThreadEvent() +void QQmlThreadPrivate::triggerThreadEvent() { Q_ASSERT(!q->isThisThread()); QCoreApplication::postEvent(this, new QEvent(QEvent::User)); } -bool QDeclarativeThreadPrivate::MainObject::event(QEvent *e) +bool QQmlThreadPrivate::MainObject::event(QEvent *e) { if (e->type() == QEvent::User) p->mainEvent(); return QObject::event(e); } -QDeclarativeThreadPrivate::QDeclarativeThreadPrivate(QDeclarativeThread *q) +QQmlThreadPrivate::QQmlThreadPrivate(QQmlThread *q) : q(q), m_threadProcessing(false), m_mainProcessing(false), m_shutdown(false), m_mainThreadWaiting(false), mainSync(0), m_mainObject(this) { } -bool QDeclarativeThreadPrivate::event(QEvent *e) +bool QQmlThreadPrivate::event(QEvent *e) { if (e->type() == QEvent::User) threadEvent(); return QThread::event(e); } -void QDeclarativeThreadPrivate::run() +void QQmlThreadPrivate::run() { lock(); @@ -148,7 +148,7 @@ void QDeclarativeThreadPrivate::run() exec(); } -void QDeclarativeThreadPrivate::mainEvent() +void QQmlThreadPrivate::mainEvent() { lock(); @@ -156,7 +156,7 @@ void QDeclarativeThreadPrivate::mainEvent() while (!mainList.isEmpty() || mainSync) { bool isSync = mainSync != 0; - QDeclarativeThread::Message *message = isSync?mainSync:mainList.takeFirst(); + QQmlThread::Message *message = isSync?mainSync:mainList.takeFirst(); unlock(); message->call(q); @@ -175,7 +175,7 @@ void QDeclarativeThreadPrivate::mainEvent() unlock(); } -void QDeclarativeThreadPrivate::threadEvent() +void QQmlThreadPrivate::threadEvent() { lock(); @@ -188,7 +188,7 @@ void QDeclarativeThreadPrivate::threadEvent() m_threadProcessing = true; while (!threadList.isEmpty()) { - QDeclarativeThread::Message *message = threadList.first(); + QQmlThread::Message *message = threadList.first(); unlock(); @@ -207,8 +207,8 @@ void QDeclarativeThreadPrivate::threadEvent() } } -QDeclarativeThread::QDeclarativeThread() -: d(new QDeclarativeThreadPrivate(this)) +QQmlThread::QQmlThread() +: d(new QQmlThreadPrivate(this)) { d->lock(); d->start(); @@ -218,12 +218,12 @@ QDeclarativeThread::QDeclarativeThread() } -QDeclarativeThread::~QDeclarativeThread() +QQmlThread::~QQmlThread() { delete d; } -void QDeclarativeThread::shutdown() +void QQmlThread::shutdown() { d->lock(); Q_ASSERT(!d->m_shutdown); @@ -235,52 +235,52 @@ void QDeclarativeThread::shutdown() d->QThread::wait(); } -void QDeclarativeThread::lock() +void QQmlThread::lock() { d->lock(); } -void QDeclarativeThread::unlock() +void QQmlThread::unlock() { d->unlock(); } -void QDeclarativeThread::wakeOne() +void QQmlThread::wakeOne() { d->wakeOne(); } -void QDeclarativeThread::wakeAll() +void QQmlThread::wakeAll() { d->wakeAll(); } -void QDeclarativeThread::wait() +void QQmlThread::wait() { d->wait(); } -bool QDeclarativeThread::isThisThread() const +bool QQmlThread::isThisThread() const { return QThread::currentThread() == d; } -QThread *QDeclarativeThread::thread() const +QThread *QQmlThread::thread() const { return const_cast<QThread *>(static_cast<const QThread *>(d)); } // Called when the thread starts. Do startup stuff in here. -void QDeclarativeThread::startupThread() +void QQmlThread::startupThread() { } // Called when the thread shuts down. Do cleanup in here. -void QDeclarativeThread::shutdownThread() +void QQmlThread::shutdownThread() { } -void QDeclarativeThread::internalCallMethodInThread(Message *message) +void QQmlThread::internalCallMethodInThread(Message *message) { Q_ASSERT(!isThisThread()); d->lock(); @@ -295,7 +295,7 @@ void QDeclarativeThread::internalCallMethodInThread(Message *message) do { if (d->mainSync) { - QDeclarativeThread::Message *message = d->mainSync; + QQmlThread::Message *message = d->mainSync; unlock(); message->call(this); delete message; @@ -311,7 +311,7 @@ void QDeclarativeThread::internalCallMethodInThread(Message *message) d->unlock(); } -void QDeclarativeThread::internalCallMethodInMain(Message *message) +void QQmlThread::internalCallMethodInMain(Message *message) { Q_ASSERT(isThisThread()); @@ -334,7 +334,7 @@ void QDeclarativeThread::internalCallMethodInMain(Message *message) d->unlock(); } -void QDeclarativeThread::internalPostMethodToThread(Message *message) +void QQmlThread::internalPostMethodToThread(Message *message) { Q_ASSERT(!isThisThread()); d->lock(); @@ -345,7 +345,7 @@ void QDeclarativeThread::internalPostMethodToThread(Message *message) d->unlock(); } -void QDeclarativeThread::internalPostMethodToMain(Message *message) +void QQmlThread::internalPostMethodToMain(Message *message) { Q_ASSERT(isThisThread()); d->lock(); diff --git a/src/declarative/qml/ftw/qdeclarativethread_p.h b/src/qml/qml/ftw/qqmlthread_p.h index ce9eb1d88f..8a0ec6ceaa 100644 --- a/src/declarative/qml/ftw/qdeclarativethread_p.h +++ b/src/qml/qml/ftw/qqmlthread_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETHREAD_P_H -#define QDECLARATIVETHREAD_P_H +#ifndef QQMLTHREAD_P_H +#define QQMLTHREAD_P_H // // W A R N I N G @@ -62,12 +62,12 @@ QT_BEGIN_NAMESPACE class QThread; -class QDeclarativeThreadPrivate; -class QDeclarativeThread +class QQmlThreadPrivate; +class QQmlThread { public: - QDeclarativeThread(); - virtual ~QDeclarativeThread(); + QQmlThread(); + virtual ~QQmlThread(); void shutdown(); void lock(); @@ -118,28 +118,28 @@ protected: virtual void shutdownThread(); private: - friend class QDeclarativeThreadPrivate; + friend class QQmlThreadPrivate; struct Message { Message() : next(0) {} virtual ~Message() {} Message *next; - virtual void call(QDeclarativeThread *) = 0; + virtual void call(QQmlThread *) = 0; }; void internalCallMethodInThread(Message *); void internalCallMethodInMain(Message *); void internalPostMethodToThread(Message *); void internalPostMethodToMain(Message *); - QDeclarativeThreadPrivate *d; + QQmlThreadPrivate *d; }; template<class O> -void QDeclarativeThread::callMethodInThread(void (O::*Member)()) +void QQmlThread::callMethodInThread(void (O::*Member)()) { struct I : public Message { void (O::*Member)(); I(void (O::*Member)()) : Member(Member) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(); } @@ -148,13 +148,13 @@ void QDeclarativeThread::callMethodInThread(void (O::*Member)()) } template<typename T, class V, class O> -void QDeclarativeThread::callMethodInThread(void (O::*Member)(V), const T &arg) +void QQmlThread::callMethodInThread(void (O::*Member)(V), const T &arg) { struct I : public Message { void (O::*Member)(V); T arg; I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg); } @@ -163,14 +163,14 @@ void QDeclarativeThread::callMethodInThread(void (O::*Member)(V), const T &arg) } template<typename T, typename T2, class V, class V2, class O> -void QDeclarativeThread::callMethodInThread(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) +void QQmlThread::callMethodInThread(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) { struct I : public Message { void (O::*Member)(V, V2); T arg; T2 arg2; I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg, arg2); } @@ -179,12 +179,12 @@ void QDeclarativeThread::callMethodInThread(void (O::*Member)(V, V2), const T &a } template<class O> -void QDeclarativeThread::callMethodInMain(void (O::*Member)()) +void QQmlThread::callMethodInMain(void (O::*Member)()) { struct I : public Message { void (O::*Member)(); I(void (O::*Member)()) : Member(Member) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(); } @@ -193,13 +193,13 @@ void QDeclarativeThread::callMethodInMain(void (O::*Member)()) } template<typename T, class V, class O> -void QDeclarativeThread::callMethodInMain(void (O::*Member)(V), const T &arg) +void QQmlThread::callMethodInMain(void (O::*Member)(V), const T &arg) { struct I : public Message { void (O::*Member)(V); T arg; I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg); } @@ -208,14 +208,14 @@ void QDeclarativeThread::callMethodInMain(void (O::*Member)(V), const T &arg) } template<typename T, typename T2, class V, class V2, class O> -void QDeclarativeThread::callMethodInMain(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) +void QQmlThread::callMethodInMain(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) { struct I : public Message { void (O::*Member)(V, V2); T arg; T2 arg2; I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg, arg2); } @@ -224,12 +224,12 @@ void QDeclarativeThread::callMethodInMain(void (O::*Member)(V, V2), const T &arg } template<class O> -void QDeclarativeThread::postMethodToThread(void (O::*Member)()) +void QQmlThread::postMethodToThread(void (O::*Member)()) { struct I : public Message { void (O::*Member)(); I(void (O::*Member)()) : Member(Member) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(); } @@ -238,13 +238,13 @@ void QDeclarativeThread::postMethodToThread(void (O::*Member)()) } template<typename T, class V, class O> -void QDeclarativeThread::postMethodToThread(void (O::*Member)(V), const T &arg) +void QQmlThread::postMethodToThread(void (O::*Member)(V), const T &arg) { struct I : public Message { void (O::*Member)(V); T arg; I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg); } @@ -253,14 +253,14 @@ void QDeclarativeThread::postMethodToThread(void (O::*Member)(V), const T &arg) } template<typename T, typename T2, class V, class V2, class O> -void QDeclarativeThread::postMethodToThread(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) +void QQmlThread::postMethodToThread(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) { struct I : public Message { void (O::*Member)(V, V2); T arg; T2 arg2; I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg, arg2); } @@ -269,12 +269,12 @@ void QDeclarativeThread::postMethodToThread(void (O::*Member)(V, V2), const T &a } template<class O> -void QDeclarativeThread::postMethodToMain(void (O::*Member)()) +void QQmlThread::postMethodToMain(void (O::*Member)()) { struct I : public Message { void (O::*Member)(); I(void (O::*Member)()) : Member(Member) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(); } @@ -283,13 +283,13 @@ void QDeclarativeThread::postMethodToMain(void (O::*Member)()) } template<typename T, class V, class O> -void QDeclarativeThread::postMethodToMain(void (O::*Member)(V), const T &arg) +void QQmlThread::postMethodToMain(void (O::*Member)(V), const T &arg) { struct I : public Message { void (O::*Member)(V); T arg; I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg); } @@ -298,14 +298,14 @@ void QDeclarativeThread::postMethodToMain(void (O::*Member)(V), const T &arg) } template<typename T, typename T2, class V, class V2, class O> -void QDeclarativeThread::postMethodToMain(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) +void QQmlThread::postMethodToMain(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) { struct I : public Message { void (O::*Member)(V, V2); T arg; T2 arg2; I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {} - virtual void call(QDeclarativeThread *thread) { + virtual void call(QQmlThread *thread) { O *me = static_cast<O *>(thread); (me->*Member)(arg, arg2); } @@ -315,4 +315,4 @@ void QDeclarativeThread::postMethodToMain(void (O::*Member)(V, V2), const T &arg QT_END_NAMESPACE -#endif // QDECLARATIVETHREAD_P_H +#endif // QQMLTHREAD_P_H diff --git a/src/declarative/qml/ftw/qdeclarativetrace.cpp b/src/qml/qml/ftw/qqmltrace.cpp index 7c814e37c1..e044dc654f 100644 --- a/src/declarative/qml/ftw/qdeclarativetrace.cpp +++ b/src/qml/qml/ftw/qqmltrace.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativetrace_p.h" +#include "qqmltrace_p.h" #ifdef QML_ENABLE_TRACE #include <stdio.h> @@ -49,11 +49,11 @@ QT_BEGIN_NAMESPACE #ifdef QML_ENABLE_TRACE -QDeclarativeTrace::Pool QDeclarativeTrace::logPool; -QDeclarativeTrace::Entry *QDeclarativeTrace::first = 0; -QDeclarativeTrace::Entry *QDeclarativeTrace::last = 0; +QQmlTrace::Pool QQmlTrace::logPool; +QQmlTrace::Entry *QQmlTrace::first = 0; +QQmlTrace::Entry *QQmlTrace::last = 0; -static qint64 toNsecs(QDeclarativeTrace::TimeType time) +static qint64 toNsecs(QQmlTrace::TimeType time) { #ifdef Q_OS_MAC static mach_timebase_info_data_t info = {0,0}; @@ -66,13 +66,13 @@ static qint64 toNsecs(QDeclarativeTrace::TimeType time) #endif } -QDeclarativeTrace::Pool::Pool() +QQmlTrace::Pool::Pool() { first = New<Entry>(); last = first; } -QDeclarativeTrace::Pool::~Pool() +QQmlTrace::Pool::~Pool() { char buffer[128]; sprintf(buffer, "qml.%d.log", ::getpid()); @@ -84,7 +84,7 @@ QDeclarativeTrace::Pool::~Pool() fprintf (stderr, "QML Log: Writing log to %s\n", buffer); } - QDeclarativeTrace::Entry *cur = QDeclarativeTrace::first; + QQmlTrace::Entry *cur = QQmlTrace::first; QByteArray indent; int depth = -1; @@ -93,8 +93,8 @@ QDeclarativeTrace::Pool::~Pool() while (cur) { switch (cur->type) { - case QDeclarativeTrace::Entry::RangeStart: { - RangeStart *rs = static_cast<QDeclarativeTrace::RangeStart *>(cur); + case QQmlTrace::Entry::RangeStart: { + RangeStart *rs = static_cast<QQmlTrace::RangeStart *>(cur); qint64 nsecs = toNsecs(rs->time); @@ -108,38 +108,38 @@ QDeclarativeTrace::Pool::~Pool() fprintf(out, "%s%s @%lld (%lld ns)\n", indent.constData(), rs->description, nsecs, toNsecs(rs->end->time) - nsecs - firstTime); } break; - case QDeclarativeTrace::Entry::RangeEnd: + case QQmlTrace::Entry::RangeEnd: depth--; indent = QByteArray(depth * 4, ' '); break; - case QDeclarativeTrace::Entry::Detail: + case QQmlTrace::Entry::Detail: fprintf(out, "%s %s\n", indent.constData(), - static_cast<QDeclarativeTrace::Detail *>(cur)->description); + static_cast<QQmlTrace::Detail *>(cur)->description); break; - case QDeclarativeTrace::Entry::IntDetail: + case QQmlTrace::Entry::IntDetail: fprintf(out, "%s %s: %d\n", indent.constData(), - static_cast<QDeclarativeTrace::Detail *>(cur)->description, - static_cast<QDeclarativeTrace::IntDetail *>(cur)->value); + static_cast<QQmlTrace::Detail *>(cur)->description, + static_cast<QQmlTrace::IntDetail *>(cur)->value); break; - case QDeclarativeTrace::Entry::StringDetail: { - QByteArray vLatin1 = static_cast<QDeclarativeTrace::StringDetail *>(cur)->value->toLatin1(); + case QQmlTrace::Entry::StringDetail: { + QByteArray vLatin1 = static_cast<QQmlTrace::StringDetail *>(cur)->value->toLatin1(); fprintf(out, "%s %s: %s\n", indent.constData(), - static_cast<QDeclarativeTrace::Detail *>(cur)->description, + static_cast<QQmlTrace::Detail *>(cur)->description, vLatin1.constData()); } break; - case QDeclarativeTrace::Entry::UrlDetail: { - QByteArray vLatin1 = static_cast<QDeclarativeTrace::UrlDetail *>(cur)->value->toString().toLatin1(); + case QQmlTrace::Entry::UrlDetail: { + QByteArray vLatin1 = static_cast<QQmlTrace::UrlDetail *>(cur)->value->toString().toLatin1(); fprintf(out, "%s %s: %s\n", indent.constData(), - static_cast<QDeclarativeTrace::Detail *>(cur)->description, + static_cast<QQmlTrace::Detail *>(cur)->description, vLatin1.constData()); } break; - case QDeclarativeTrace::Entry::Event: { - Event *ev = static_cast<QDeclarativeTrace::Event *>(cur); + case QQmlTrace::Entry::Event: { + Event *ev = static_cast<QQmlTrace::Event *>(cur); qint64 nsecs = toNsecs(ev->time) - firstTime; fprintf(out, "%s + %s @%lld +%lld ns\n", indent.constData(), ev->description, nsecs, nsecs - (toNsecs(ev->start->time) - firstTime)); } break; - case QDeclarativeTrace::Entry::Null: + case QQmlTrace::Entry::Null: default: break; } diff --git a/src/declarative/qml/ftw/qdeclarativetrace_p.h b/src/qml/qml/ftw/qqmltrace_p.h index 89ed26e925..965baff3a3 100644 --- a/src/declarative/qml/ftw/qdeclarativetrace_p.h +++ b/src/qml/qml/ftw/qqmltrace_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETRACE_P_H -#define QDECLARATIVETRACE_P_H +#ifndef QQMLTRACE_P_H +#define QQMLTRACE_P_H // // W A R N I N G @@ -54,7 +54,7 @@ // #include <QtCore/qglobal.h> -#include <private/qdeclarativepool_p.h> +#include <private/qqmlpool_p.h> // #define QML_ENABLE_TRACE @@ -65,11 +65,11 @@ QT_BEGIN_NAMESPACE class QUrl; -class QDeclarativeTrace +class QQmlTrace { public: - inline QDeclarativeTrace(const char *desc); - inline ~QDeclarativeTrace(); + inline QQmlTrace(const char *desc); + inline ~QQmlTrace(); inline void addDetail(const char *); inline void addDetail(const char *, int); @@ -86,7 +86,7 @@ public: typedef timespec TimeType; #endif - struct Entry : public QDeclarativePool::POD { + struct Entry : public QQmlPool::POD { enum Type { Null, RangeStart, RangeEnd, Detail, IntDetail, StringDetail, UrlDetail, Event }; inline Entry(); inline Entry(Type); @@ -101,7 +101,7 @@ public: inline RangeStart(); const char *description; TimeType time; - QDeclarativeTrace::RangeEnd *end; + QQmlTrace::RangeEnd *end; }; struct Detail : public Entry { inline Detail(); @@ -124,10 +124,10 @@ public: inline Event(); const char *description; TimeType time; - QDeclarativeTrace::RangeStart *start; + QQmlTrace::RangeStart *start; }; - struct Pool : public QDeclarativePool { + struct Pool : public QQmlPool { Pool(); ~Pool(); }; @@ -152,67 +152,67 @@ private: }; #ifdef QML_ENABLE_TRACE -QDeclarativeTrace::Entry::Entry() +QQmlTrace::Entry::Entry() : type(Null), next(0) { } -QDeclarativeTrace::Entry::Entry(Type type) +QQmlTrace::Entry::Entry(Type type) : type(type), next(0) { - QDeclarativeTrace::last->next = this; - QDeclarativeTrace::last = this; + QQmlTrace::last->next = this; + QQmlTrace::last = this; } -QDeclarativeTrace::RangeEnd::RangeEnd() -: QDeclarativeTrace::Entry(QDeclarativeTrace::Entry::RangeEnd), +QQmlTrace::RangeEnd::RangeEnd() +: QQmlTrace::Entry(QQmlTrace::Entry::RangeEnd), time(gettime()) { } -QDeclarativeTrace::RangeStart::RangeStart() -: QDeclarativeTrace::Entry(QDeclarativeTrace::Entry::RangeStart), +QQmlTrace::RangeStart::RangeStart() +: QQmlTrace::Entry(QQmlTrace::Entry::RangeStart), description(0), time(gettime()) { } -QDeclarativeTrace::Detail::Detail() -: QDeclarativeTrace::Entry(QDeclarativeTrace::Entry::Detail), +QQmlTrace::Detail::Detail() +: QQmlTrace::Entry(QQmlTrace::Entry::Detail), description(0) { } -QDeclarativeTrace::Detail::Detail(Type type) -: QDeclarativeTrace::Entry(type), description(0) +QQmlTrace::Detail::Detail(Type type) +: QQmlTrace::Entry(type), description(0) { } -QDeclarativeTrace::IntDetail::IntDetail() -: QDeclarativeTrace::Detail(QDeclarativeTrace::Entry::IntDetail), +QQmlTrace::IntDetail::IntDetail() +: QQmlTrace::Detail(QQmlTrace::Entry::IntDetail), value(0) { } -QDeclarativeTrace::StringDetail::StringDetail() -: QDeclarativeTrace::Detail(QDeclarativeTrace::Entry::StringDetail), +QQmlTrace::StringDetail::StringDetail() +: QQmlTrace::Detail(QQmlTrace::Entry::StringDetail), value(0) { } -QDeclarativeTrace::UrlDetail::UrlDetail() -: QDeclarativeTrace::Detail(QDeclarativeTrace::Entry::UrlDetail), +QQmlTrace::UrlDetail::UrlDetail() +: QQmlTrace::Detail(QQmlTrace::Entry::UrlDetail), value(0) { } -QDeclarativeTrace::Event::Event() -: QDeclarativeTrace::Entry(QDeclarativeTrace::Entry::Event), +QQmlTrace::Event::Event() +: QQmlTrace::Entry(QQmlTrace::Entry::Event), description(0), time(gettime()), start(0) { } #endif -QDeclarativeTrace::QDeclarativeTrace(const char *desc) +QQmlTrace::QQmlTrace(const char *desc) { #ifdef QML_ENABLE_TRACE RangeStart *e = logPool.New<RangeStart>(); @@ -224,7 +224,7 @@ QDeclarativeTrace::QDeclarativeTrace(const char *desc) #endif } -QDeclarativeTrace::~QDeclarativeTrace() +QQmlTrace::~QQmlTrace() { #ifdef QML_ENABLE_TRACE RangeEnd *e = logPool.New<RangeEnd>(); @@ -232,7 +232,7 @@ QDeclarativeTrace::~QDeclarativeTrace() #endif } -void QDeclarativeTrace::addDetail(const char *desc) +void QQmlTrace::addDetail(const char *desc) { #ifdef QML_ENABLE_TRACE Detail *e = logPool.New<Detail>(); @@ -242,7 +242,7 @@ void QDeclarativeTrace::addDetail(const char *desc) #endif } -void QDeclarativeTrace::addDetail(const char *desc, int v) +void QQmlTrace::addDetail(const char *desc, int v) { #ifdef QML_ENABLE_TRACE IntDetail *e = logPool.New<IntDetail>(); @@ -254,7 +254,7 @@ void QDeclarativeTrace::addDetail(const char *desc, int v) #endif } -void QDeclarativeTrace::addDetail(const char *desc, const QString &v) +void QQmlTrace::addDetail(const char *desc, const QString &v) { #ifdef QML_ENABLE_TRACE StringDetail *e = logPool.New<StringDetail>(); @@ -266,7 +266,7 @@ void QDeclarativeTrace::addDetail(const char *desc, const QString &v) #endif } -void QDeclarativeTrace::addDetail(const char *desc, const QUrl &v) +void QQmlTrace::addDetail(const char *desc, const QUrl &v) { #ifdef QML_ENABLE_TRACE UrlDetail *e = logPool.New<UrlDetail>(); @@ -278,7 +278,7 @@ void QDeclarativeTrace::addDetail(const char *desc, const QUrl &v) #endif } -void QDeclarativeTrace::event(const char *desc) +void QQmlTrace::event(const char *desc) { #ifdef QML_ENABLE_TRACE Event *e = logPool.New<Event>(); @@ -291,4 +291,4 @@ void QDeclarativeTrace::event(const char *desc) QT_END_NAMESPACE -#endif // QDECLARATIVETRACE_P_H +#endif // QQMLTRACE_P_H diff --git a/src/declarative/qml/ftw/qrecursionwatcher_p.h b/src/qml/qml/ftw/qrecursionwatcher_p.h index e68ec424aa..16886edf12 100644 --- a/src/declarative/qml/ftw/qrecursionwatcher_p.h +++ b/src/qml/qml/ftw/qrecursionwatcher_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/ftw/qrecyclepool_p.h b/src/qml/qml/ftw/qrecyclepool_p.h index ed0bbbdd27..8d0f060ab3 100644 --- a/src/declarative/qml/ftw/qrecyclepool_p.h +++ b/src/qml/qml/ftw/qrecyclepool_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/qml/qml/parser/parser.pri b/src/qml/qml/parser/parser.pri new file mode 100644 index 0000000000..6be85ba85a --- /dev/null +++ b/src/qml/qml/parser/parser.pri @@ -0,0 +1,19 @@ +HEADERS += \ + $$PWD/qqmljsast_p.h \ + $$PWD/qqmljsastfwd_p.h \ + $$PWD/qqmljsastvisitor_p.h \ + $$PWD/qqmljsengine_p.h \ + $$PWD/qqmljsgrammar_p.h \ + $$PWD/qqmljslexer_p.h \ + $$PWD/qqmljsmemorypool_p.h \ + $$PWD/qqmljsparser_p.h \ + $$PWD/qqmljsglobal_p.h \ + $$PWD/qqmljskeywords_p.h + +SOURCES += \ + $$PWD/qqmljsast.cpp \ + $$PWD/qqmljsastvisitor.cpp \ + $$PWD/qqmljsengine_p.cpp \ + $$PWD/qqmljsgrammar.cpp \ + $$PWD/qqmljslexer.cpp \ + $$PWD/qqmljsparser.cpp diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/qml/qml/parser/qqmljs.g index b87f9f8a65..746fcb24df 100644 --- a/src/declarative/qml/parser/qdeclarativejs.g +++ b/src/qml/qml/parser/qqmljs.g @@ -3,7 +3,7 @@ -- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -- Contact: http://www.qt-project.org/ -- --- This file is part of the QtDeclarative module of the Qt Toolkit. +-- This file is part of the QtQml module of the Qt Toolkit. -- -- $QT_BEGIN_LICENSE:LGPL-ONLY$ -- GNU Lesser General Public License Usage @@ -21,8 +21,8 @@ -- ---------------------------------------------------------------------------- -%parser QDeclarativeJSGrammar -%decl qdeclarativejsparser_p.h +%parser QQmlJSGrammar +%decl qqmljsparser_p.h %impl qdeclarativejsparser.cpp %expect 2 %expect-rr 2 @@ -88,7 +88,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -129,10 +129,10 @@ #include <string.h> -#include "qdeclarativejsengine_p.h" -#include "qdeclarativejslexer_p.h" -#include "qdeclarativejsast_p.h" -#include "qdeclarativejsmemorypool_p.h" +#include "qqmljsengine_p.h" +#include "qqmljslexer_p.h" +#include "qqmljsast_p.h" +#include "qqmljsmemorypool_p.h" ./ @@ -141,7 +141,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -197,17 +197,17 @@ #ifndef QDECLARATIVEJSPARSER_P_H #define QDECLARATIVEJSPARSER_P_H -#include "qdeclarativejsglobal_p.h" -#include "qdeclarativejsgrammar_p.h" -#include "qdeclarativejsast_p.h" -#include "qdeclarativejsengine_p.h" +#include "qqmljsglobal_p.h" +#include "qqmljsgrammar_p.h" +#include "qqmljsast_p.h" +#include "qqmljsengine_p.h" #include <QtCore/QList> #include <QtCore/QString> QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { class Engine; @@ -371,7 +371,7 @@ protected: QList<DiagnosticMessage> diagnostic_messages; }; -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS :/ @@ -379,7 +379,7 @@ protected: /. -#include "qdeclarativejsparser_p.h" +#include "qqmljsparser_p.h" #include <QVarLengthArray> // @@ -387,7 +387,7 @@ protected: // Changes will be lost. // -using namespace QDeclarativeJS; +using namespace QQmlJS; QT_QML_BEGIN_NAMESPACE @@ -2899,7 +2899,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; yylloc.startColumn += yylloc.length; yylloc.length = 0; - //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'"); + //const QString msg = qApp->translate("QQmlParser", "Missing `;'"); //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg)); first_token = &token_buffer[0]; @@ -2929,9 +2929,9 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; QString msg; int token = token_buffer[0].token; if (token < 0 || token >= TERMINAL_COUNT) - msg = qApp->translate("QDeclarativeParser", "Syntax error"); + msg = qApp->translate("QQmlParser", "Syntax error"); else - msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token])); + msg = qApp->translate("QQmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; @@ -2959,7 +2959,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk])); + const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = *tk; @@ -2983,7 +2983,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk])); + const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = tk; @@ -2996,7 +2996,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; } } - const QString msg = qApp->translate("QDeclarativeParser", "Syntax error"); + const QString msg = qApp->translate("QQmlParser", "Syntax error"); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); } diff --git a/src/declarative/qml/parser/qdeclarativejsast.cpp b/src/qml/qml/parser/qqmljsast.cpp index 8654c4392f..d0b984fc9e 100644 --- a/src/declarative/qml/parser/qdeclarativejsast.cpp +++ b/src/qml/qml/parser/qqmljsast.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "qdeclarativejsast_p.h" +#include "qqmljsast_p.h" -#include "qdeclarativejsastvisitor_p.h" +#include "qqmljsastvisitor_p.h" QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { namespace AST { +namespace QQmlJS { namespace AST { void Node::accept(Visitor *visitor) { @@ -924,7 +924,7 @@ void UiSourceElement::accept0(Visitor *visitor) visitor->endVisit(this); } -} } // namespace QDeclarativeJS::AST +} } // namespace QQmlJS::AST QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qdeclarativejsast_p.h b/src/qml/qml/parser/qqmljsast_p.h index 04bf3ce122..f85eb4ca5f 100644 --- a/src/declarative/qml/parser/qdeclarativejsast_p.h +++ b/src/qml/qml/parser/qqmljsast_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSAST_P_H -#define QDECLARATIVEJSAST_P_H +#ifndef QQMLJSAST_P_H +#define QQMLJSAST_P_H // // W A R N I N G @@ -53,15 +53,15 @@ // We mean it. // -#include "qdeclarativejsastvisitor_p.h" -#include "qdeclarativejsglobal_p.h" -#include "qdeclarativejsmemorypool_p.h" +#include "qqmljsastvisitor_p.h" +#include "qqmljsglobal_p.h" +#include "qqmljsmemorypool_p.h" #include <QtCore/QString> QT_QML_BEGIN_NAMESPACE -#define QDECLARATIVEJS_DECLARE_AST_NODE(name) \ +#define QQMLJS_DECLARE_AST_NODE(name) \ enum { K = Kind_##name }; namespace QSOperator // ### rename @@ -107,7 +107,7 @@ enum Op { } // namespace QSOperator -namespace QDeclarativeJS { +namespace QQmlJS { namespace AST { @@ -265,7 +265,7 @@ public: class QML_PARSER_EXPORT NestedExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(NestedExpression) + QQMLJS_DECLARE_AST_NODE(NestedExpression) NestedExpression(ExpressionNode *expression) : expression(expression) @@ -288,7 +288,7 @@ public: class QML_PARSER_EXPORT ThisExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ThisExpression) + QQMLJS_DECLARE_AST_NODE(ThisExpression) ThisExpression() { kind = K; } @@ -307,7 +307,7 @@ public: class QML_PARSER_EXPORT IdentifierExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierExpression) + QQMLJS_DECLARE_AST_NODE(IdentifierExpression) IdentifierExpression(const QStringRef &n): name (n) { kind = K; } @@ -328,7 +328,7 @@ public: class QML_PARSER_EXPORT NullExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(NullExpression) + QQMLJS_DECLARE_AST_NODE(NullExpression) NullExpression() { kind = K; } @@ -347,7 +347,7 @@ public: class QML_PARSER_EXPORT TrueLiteral: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(TrueLiteral) + QQMLJS_DECLARE_AST_NODE(TrueLiteral) TrueLiteral() { kind = K; } @@ -366,7 +366,7 @@ public: class QML_PARSER_EXPORT FalseLiteral: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(FalseLiteral) + QQMLJS_DECLARE_AST_NODE(FalseLiteral) FalseLiteral() { kind = K; } @@ -385,7 +385,7 @@ public: class QML_PARSER_EXPORT NumericLiteral: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteral) + QQMLJS_DECLARE_AST_NODE(NumericLiteral) NumericLiteral(double v): value(v) { kind = K; } @@ -406,7 +406,7 @@ public: class QML_PARSER_EXPORT StringLiteral: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteral) + QQMLJS_DECLARE_AST_NODE(StringLiteral) StringLiteral(const QStringRef &v): value (v) { kind = K; } @@ -427,7 +427,7 @@ public: class QML_PARSER_EXPORT RegExpLiteral: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(RegExpLiteral) + QQMLJS_DECLARE_AST_NODE(RegExpLiteral) RegExpLiteral(const QStringRef &p, int f): pattern (p), flags (f) { kind = K; } @@ -449,7 +449,7 @@ public: class QML_PARSER_EXPORT ArrayLiteral: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ArrayLiteral) + QQMLJS_DECLARE_AST_NODE(ArrayLiteral) ArrayLiteral(Elision *e): elements (0), elision (e) @@ -482,7 +482,7 @@ public: class QML_PARSER_EXPORT ObjectLiteral: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ObjectLiteral) + QQMLJS_DECLARE_AST_NODE(ObjectLiteral) ObjectLiteral(): properties (0) { kind = K; } @@ -507,7 +507,7 @@ public: class QML_PARSER_EXPORT Elision: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(Elision) + QQMLJS_DECLARE_AST_NODE(Elision) Elision(): next (this) { kind = K; } @@ -542,7 +542,7 @@ public: class QML_PARSER_EXPORT ElementList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ElementList) + QQMLJS_DECLARE_AST_NODE(ElementList) ElementList(Elision *e, ExpressionNode *expr): elision (e), expression (expr), next (this) @@ -589,7 +589,7 @@ public: class QML_PARSER_EXPORT PropertyName: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(PropertyName) + QQMLJS_DECLARE_AST_NODE(PropertyName) PropertyName() { kind = K; } @@ -606,7 +606,7 @@ public: class QML_PARSER_EXPORT PropertyNameAndValueList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(PropertyNameAndValueList) + QQMLJS_DECLARE_AST_NODE(PropertyNameAndValueList) PropertyNameAndValueList(PropertyName *n, ExpressionNode *v): name (n), value (v), next (this) @@ -650,7 +650,7 @@ public: class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName { public: - QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierPropertyName) + QQMLJS_DECLARE_AST_NODE(IdentifierPropertyName) IdentifierPropertyName(const QStringRef &n): id (n) { kind = K; } @@ -664,7 +664,7 @@ public: class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName { public: - QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteralPropertyName) + QQMLJS_DECLARE_AST_NODE(StringLiteralPropertyName) StringLiteralPropertyName(const QStringRef &n): id (n) { kind = K; } @@ -678,7 +678,7 @@ public: class QML_PARSER_EXPORT NumericLiteralPropertyName: public PropertyName { public: - QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteralPropertyName) + QQMLJS_DECLARE_AST_NODE(NumericLiteralPropertyName) NumericLiteralPropertyName(double n): id (n) { kind = K; } @@ -692,7 +692,7 @@ public: class QML_PARSER_EXPORT ArrayMemberExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ArrayMemberExpression) + QQMLJS_DECLARE_AST_NODE(ArrayMemberExpression) ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e): base (b), expression (e) @@ -716,7 +716,7 @@ public: class QML_PARSER_EXPORT FieldMemberExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(FieldMemberExpression) + QQMLJS_DECLARE_AST_NODE(FieldMemberExpression) FieldMemberExpression(ExpressionNode *b, const QStringRef &n): base (b), name (n) @@ -740,7 +740,7 @@ public: class QML_PARSER_EXPORT NewMemberExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(NewMemberExpression) + QQMLJS_DECLARE_AST_NODE(NewMemberExpression) NewMemberExpression(ExpressionNode *b, ArgumentList *a): base (b), arguments (a) @@ -765,7 +765,7 @@ public: class QML_PARSER_EXPORT NewExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(NewExpression) + QQMLJS_DECLARE_AST_NODE(NewExpression) NewExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -786,7 +786,7 @@ public: class QML_PARSER_EXPORT CallExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(CallExpression) + QQMLJS_DECLARE_AST_NODE(CallExpression) CallExpression(ExpressionNode *b, ArgumentList *a): base (b), arguments (a) @@ -810,7 +810,7 @@ public: class QML_PARSER_EXPORT ArgumentList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ArgumentList) + QQMLJS_DECLARE_AST_NODE(ArgumentList) ArgumentList(ExpressionNode *e): expression (e), next (this) @@ -852,7 +852,7 @@ public: class QML_PARSER_EXPORT PostIncrementExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(PostIncrementExpression) + QQMLJS_DECLARE_AST_NODE(PostIncrementExpression) PostIncrementExpression(ExpressionNode *b): base (b) { kind = K; } @@ -873,7 +873,7 @@ public: class QML_PARSER_EXPORT PostDecrementExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(PostDecrementExpression) + QQMLJS_DECLARE_AST_NODE(PostDecrementExpression) PostDecrementExpression(ExpressionNode *b): base (b) { kind = K; } @@ -894,7 +894,7 @@ public: class QML_PARSER_EXPORT DeleteExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(DeleteExpression) + QQMLJS_DECLARE_AST_NODE(DeleteExpression) DeleteExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -915,7 +915,7 @@ public: class QML_PARSER_EXPORT VoidExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(VoidExpression) + QQMLJS_DECLARE_AST_NODE(VoidExpression) VoidExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -936,7 +936,7 @@ public: class QML_PARSER_EXPORT TypeOfExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(TypeOfExpression) + QQMLJS_DECLARE_AST_NODE(TypeOfExpression) TypeOfExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -957,7 +957,7 @@ public: class QML_PARSER_EXPORT PreIncrementExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(PreIncrementExpression) + QQMLJS_DECLARE_AST_NODE(PreIncrementExpression) PreIncrementExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -978,7 +978,7 @@ public: class QML_PARSER_EXPORT PreDecrementExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(PreDecrementExpression) + QQMLJS_DECLARE_AST_NODE(PreDecrementExpression) PreDecrementExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -999,7 +999,7 @@ public: class QML_PARSER_EXPORT UnaryPlusExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UnaryPlusExpression) + QQMLJS_DECLARE_AST_NODE(UnaryPlusExpression) UnaryPlusExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1020,7 +1020,7 @@ public: class QML_PARSER_EXPORT UnaryMinusExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UnaryMinusExpression) + QQMLJS_DECLARE_AST_NODE(UnaryMinusExpression) UnaryMinusExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1041,7 +1041,7 @@ public: class QML_PARSER_EXPORT TildeExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(TildeExpression) + QQMLJS_DECLARE_AST_NODE(TildeExpression) TildeExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1062,7 +1062,7 @@ public: class QML_PARSER_EXPORT NotExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(NotExpression) + QQMLJS_DECLARE_AST_NODE(NotExpression) NotExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1083,7 +1083,7 @@ public: class QML_PARSER_EXPORT BinaryExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(BinaryExpression) + QQMLJS_DECLARE_AST_NODE(BinaryExpression) BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r): left (l), op (o), right (r) @@ -1109,7 +1109,7 @@ public: class QML_PARSER_EXPORT ConditionalExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ConditionalExpression) + QQMLJS_DECLARE_AST_NODE(ConditionalExpression) ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f): expression (e), ok (t), ko (f) @@ -1134,7 +1134,7 @@ public: class QML_PARSER_EXPORT Expression: public ExpressionNode // ### rename { public: - QDECLARATIVEJS_DECLARE_AST_NODE(Expression) + QQMLJS_DECLARE_AST_NODE(Expression) Expression(ExpressionNode *l, ExpressionNode *r): left (l), right (r) { kind = K; } @@ -1156,7 +1156,7 @@ public: class QML_PARSER_EXPORT Block: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(Block) + QQMLJS_DECLARE_AST_NODE(Block) Block(StatementList *slist): statements (slist) { kind = K; } @@ -1178,7 +1178,7 @@ public: class QML_PARSER_EXPORT StatementList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(StatementList) + QQMLJS_DECLARE_AST_NODE(StatementList) StatementList(Statement *stmt): statement (stmt), next (this) @@ -1215,7 +1215,7 @@ public: class QML_PARSER_EXPORT VariableStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(VariableStatement) + QQMLJS_DECLARE_AST_NODE(VariableStatement) VariableStatement(VariableDeclarationList *vlist): declarations (vlist) @@ -1238,7 +1238,7 @@ public: class QML_PARSER_EXPORT VariableDeclaration: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclaration) + QQMLJS_DECLARE_AST_NODE(VariableDeclaration) VariableDeclaration(const QStringRef &n, ExpressionNode *e): name (n), expression (e), readOnly(false) @@ -1262,7 +1262,7 @@ public: class QML_PARSER_EXPORT VariableDeclarationList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclarationList) + QQMLJS_DECLARE_AST_NODE(VariableDeclarationList) VariableDeclarationList(VariableDeclaration *decl): declaration (decl), next (this) @@ -1309,7 +1309,7 @@ public: class QML_PARSER_EXPORT EmptyStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(EmptyStatement) + QQMLJS_DECLARE_AST_NODE(EmptyStatement) EmptyStatement() { kind = K; } @@ -1328,7 +1328,7 @@ public: class QML_PARSER_EXPORT ExpressionStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ExpressionStatement) + QQMLJS_DECLARE_AST_NODE(ExpressionStatement) ExpressionStatement(ExpressionNode *e): expression (e) { kind = K; } @@ -1349,7 +1349,7 @@ public: class QML_PARSER_EXPORT IfStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(IfStatement) + QQMLJS_DECLARE_AST_NODE(IfStatement) IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0): expression (e), ok (t), ko (f) @@ -1381,7 +1381,7 @@ public: class QML_PARSER_EXPORT DoWhileStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(DoWhileStatement) + QQMLJS_DECLARE_AST_NODE(DoWhileStatement) DoWhileStatement(Statement *stmt, ExpressionNode *e): statement (stmt), expression (e) @@ -1408,7 +1408,7 @@ public: class QML_PARSER_EXPORT WhileStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(WhileStatement) + QQMLJS_DECLARE_AST_NODE(WhileStatement) WhileStatement(ExpressionNode *e, Statement *stmt): expression (e), statement (stmt) @@ -1433,7 +1433,7 @@ public: class QML_PARSER_EXPORT ForStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ForStatement) + QQMLJS_DECLARE_AST_NODE(ForStatement) ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt): initialiser (i), condition (c), expression (e), statement (stmt) @@ -1462,7 +1462,7 @@ public: class QML_PARSER_EXPORT LocalForStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(LocalForStatement) + QQMLJS_DECLARE_AST_NODE(LocalForStatement) LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt): declarations (vlist), condition (c), expression (e), statement (stmt) @@ -1492,7 +1492,7 @@ public: class QML_PARSER_EXPORT ForEachStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ForEachStatement) + QQMLJS_DECLARE_AST_NODE(ForEachStatement) ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt): initialiser (i), expression (e), statement (stmt) @@ -1519,7 +1519,7 @@ public: class QML_PARSER_EXPORT LocalForEachStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(LocalForEachStatement) + QQMLJS_DECLARE_AST_NODE(LocalForEachStatement) LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt): declaration (v), expression (e), statement (stmt) @@ -1547,7 +1547,7 @@ public: class QML_PARSER_EXPORT ContinueStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ContinueStatement) + QQMLJS_DECLARE_AST_NODE(ContinueStatement) ContinueStatement(const QStringRef &l = QStringRef()): label (l) { kind = K; } @@ -1570,7 +1570,7 @@ public: class QML_PARSER_EXPORT BreakStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(BreakStatement) + QQMLJS_DECLARE_AST_NODE(BreakStatement) BreakStatement(const QStringRef &l): label (l) { kind = K; } @@ -1593,7 +1593,7 @@ public: class QML_PARSER_EXPORT ReturnStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ReturnStatement) + QQMLJS_DECLARE_AST_NODE(ReturnStatement) ReturnStatement(ExpressionNode *e): expression (e) { kind = K; } @@ -1615,7 +1615,7 @@ public: class QML_PARSER_EXPORT WithStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(WithStatement) + QQMLJS_DECLARE_AST_NODE(WithStatement) WithStatement(ExpressionNode *e, Statement *stmt): expression (e), statement (stmt) @@ -1640,7 +1640,7 @@ public: class QML_PARSER_EXPORT CaseBlock: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(CaseBlock) + QQMLJS_DECLARE_AST_NODE(CaseBlock) CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0): clauses (c), defaultClause (d), moreClauses (r) @@ -1665,7 +1665,7 @@ public: class QML_PARSER_EXPORT SwitchStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(SwitchStatement) + QQMLJS_DECLARE_AST_NODE(SwitchStatement) SwitchStatement(ExpressionNode *e, CaseBlock *b): expression (e), block (b) @@ -1690,7 +1690,7 @@ public: class QML_PARSER_EXPORT CaseClause: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(CaseClause) + QQMLJS_DECLARE_AST_NODE(CaseClause) CaseClause(ExpressionNode *e, StatementList *slist): expression (e), statements (slist) @@ -1714,7 +1714,7 @@ public: class QML_PARSER_EXPORT CaseClauses: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(CaseClauses) + QQMLJS_DECLARE_AST_NODE(CaseClauses) CaseClauses(CaseClause *c): clause (c), next (this) @@ -1751,7 +1751,7 @@ public: class QML_PARSER_EXPORT DefaultClause: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(DefaultClause) + QQMLJS_DECLARE_AST_NODE(DefaultClause) DefaultClause(StatementList *slist): statements (slist) @@ -1774,7 +1774,7 @@ public: class QML_PARSER_EXPORT LabelledStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(LabelledStatement) + QQMLJS_DECLARE_AST_NODE(LabelledStatement) LabelledStatement(const QStringRef &l, Statement *stmt): label (l), statement (stmt) @@ -1798,7 +1798,7 @@ public: class QML_PARSER_EXPORT ThrowStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(ThrowStatement) + QQMLJS_DECLARE_AST_NODE(ThrowStatement) ThrowStatement(ExpressionNode *e): expression (e) { kind = K; } @@ -1820,7 +1820,7 @@ public: class QML_PARSER_EXPORT Catch: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(Catch) + QQMLJS_DECLARE_AST_NODE(Catch) Catch(const QStringRef &n, Block *stmt): name (n), statement (stmt) @@ -1846,7 +1846,7 @@ public: class QML_PARSER_EXPORT Finally: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(Finally) + QQMLJS_DECLARE_AST_NODE(Finally) Finally(Block *stmt): statement (stmt) @@ -1868,7 +1868,7 @@ public: class QML_PARSER_EXPORT TryStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(TryStatement) + QQMLJS_DECLARE_AST_NODE(TryStatement) TryStatement(Statement *stmt, Catch *c, Finally *f): statement (stmt), catchExpression (c), finallyExpression (f) @@ -1907,7 +1907,7 @@ public: class QML_PARSER_EXPORT FunctionExpression: public ExpressionNode { public: - QDECLARATIVEJS_DECLARE_AST_NODE(FunctionExpression) + QQMLJS_DECLARE_AST_NODE(FunctionExpression) FunctionExpression(const QStringRef &n, FormalParameterList *f, FunctionBody *b): name (n), formals (f), body (b) @@ -1936,7 +1936,7 @@ public: class QML_PARSER_EXPORT FunctionDeclaration: public FunctionExpression { public: - QDECLARATIVEJS_DECLARE_AST_NODE(FunctionDeclaration) + QQMLJS_DECLARE_AST_NODE(FunctionDeclaration) FunctionDeclaration(const QStringRef &n, FormalParameterList *f, FunctionBody *b): FunctionExpression(n, f, b) @@ -1948,7 +1948,7 @@ public: class QML_PARSER_EXPORT FormalParameterList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(FormalParameterList) + QQMLJS_DECLARE_AST_NODE(FormalParameterList) FormalParameterList(const QStringRef &n): name (n), next (this) @@ -1987,7 +1987,7 @@ public: class QML_PARSER_EXPORT SourceElement: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(SourceElement) + QQMLJS_DECLARE_AST_NODE(SourceElement) inline SourceElement() { kind = K; } @@ -1996,7 +1996,7 @@ public: class QML_PARSER_EXPORT SourceElements: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(SourceElements) + QQMLJS_DECLARE_AST_NODE(SourceElements) SourceElements(SourceElement *elt): element (elt), next (this) @@ -2033,7 +2033,7 @@ public: class QML_PARSER_EXPORT FunctionBody: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(FunctionBody) + QQMLJS_DECLARE_AST_NODE(FunctionBody) FunctionBody(SourceElements *elts): elements (elts) @@ -2054,7 +2054,7 @@ public: class QML_PARSER_EXPORT Program: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(Program) + QQMLJS_DECLARE_AST_NODE(Program) Program(SourceElements *elts): elements (elts) @@ -2075,7 +2075,7 @@ public: class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(FunctionSourceElement) + QQMLJS_DECLARE_AST_NODE(FunctionSourceElement) FunctionSourceElement(FunctionDeclaration *f): declaration (f) @@ -2096,7 +2096,7 @@ public: class QML_PARSER_EXPORT StatementSourceElement: public SourceElement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(StatementSourceElement) + QQMLJS_DECLARE_AST_NODE(StatementSourceElement) StatementSourceElement(Statement *stmt): statement (stmt) @@ -2117,7 +2117,7 @@ public: class QML_PARSER_EXPORT DebuggerStatement: public Statement { public: - QDECLARATIVEJS_DECLARE_AST_NODE(DebuggerStatement) + QQMLJS_DECLARE_AST_NODE(DebuggerStatement) DebuggerStatement() { kind = K; } @@ -2138,7 +2138,7 @@ public: class QML_PARSER_EXPORT UiQualifiedId: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiQualifiedId) + QQMLJS_DECLARE_AST_NODE(UiQualifiedId) UiQualifiedId(const QStringRef &name) : next(this), name(name) @@ -2176,7 +2176,7 @@ public: class QML_PARSER_EXPORT UiImport: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiImport) + QQMLJS_DECLARE_AST_NODE(UiImport) UiImport(const QStringRef &fileName) : fileName(fileName), importUri(0) @@ -2209,7 +2209,7 @@ public: class QML_PARSER_EXPORT UiImportList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiImportList) + QQMLJS_DECLARE_AST_NODE(UiImportList) UiImportList(UiImport *import) : import(import), @@ -2256,7 +2256,7 @@ public: class QML_PARSER_EXPORT UiObjectMemberList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectMemberList) + QQMLJS_DECLARE_AST_NODE(UiObjectMemberList) UiObjectMemberList(UiObjectMember *member) : next(this), member(member) @@ -2293,7 +2293,7 @@ public: class QML_PARSER_EXPORT UiProgram: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiProgram) + QQMLJS_DECLARE_AST_NODE(UiProgram) UiProgram(UiImportList *imports, UiObjectMemberList *members) : imports(imports), members(members) @@ -2327,7 +2327,7 @@ public: class QML_PARSER_EXPORT UiArrayMemberList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayMemberList) + QQMLJS_DECLARE_AST_NODE(UiArrayMemberList) UiArrayMemberList(UiObjectMember *member) : next(this), member(member) @@ -2365,7 +2365,7 @@ public: class QML_PARSER_EXPORT UiObjectInitializer: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectInitializer) + QQMLJS_DECLARE_AST_NODE(UiObjectInitializer) UiObjectInitializer(UiObjectMemberList *members) : members(members) @@ -2388,7 +2388,7 @@ public: class QML_PARSER_EXPORT UiParameterList: public Node { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiParameterList) + QQMLJS_DECLARE_AST_NODE(UiParameterList) UiParameterList(const QStringRef &t, const QStringRef &n): type (t), name (n), next (this) @@ -2429,7 +2429,7 @@ public: class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiPublicMember) + QQMLJS_DECLARE_AST_NODE(UiPublicMember) UiPublicMember(const QStringRef &memberType, const QStringRef &name) @@ -2487,7 +2487,7 @@ public: class QML_PARSER_EXPORT UiObjectDefinition: public UiObjectMember { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectDefinition) + QQMLJS_DECLARE_AST_NODE(UiObjectDefinition) UiObjectDefinition(UiQualifiedId *qualifiedTypeNameId, UiObjectInitializer *initializer) @@ -2510,7 +2510,7 @@ public: class QML_PARSER_EXPORT UiSourceElement: public UiObjectMember { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiSourceElement) + QQMLJS_DECLARE_AST_NODE(UiSourceElement) UiSourceElement(Node *sourceElement) : sourceElement(sourceElement) @@ -2546,7 +2546,7 @@ public: class QML_PARSER_EXPORT UiObjectBinding: public UiObjectMember { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectBinding) + QQMLJS_DECLARE_AST_NODE(UiObjectBinding) UiObjectBinding(UiQualifiedId *qualifiedId, UiQualifiedId *qualifiedTypeNameId, @@ -2582,7 +2582,7 @@ public: class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiScriptBinding) + QQMLJS_DECLARE_AST_NODE(UiScriptBinding) UiScriptBinding(UiQualifiedId *qualifiedId, Statement *statement) @@ -2607,7 +2607,7 @@ public: class QML_PARSER_EXPORT UiArrayBinding: public UiObjectMember { public: - QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayBinding) + QQMLJS_DECLARE_AST_NODE(UiArrayBinding) UiArrayBinding(UiQualifiedId *qualifiedId, UiArrayMemberList *members) diff --git a/src/declarative/qml/parser/qdeclarativejsastfwd_p.h b/src/qml/qml/parser/qqmljsastfwd_p.h index 9c7d0a51e6..dec1cbc599 100644 --- a/src/declarative/qml/parser/qdeclarativejsastfwd_p.h +++ b/src/qml/qml/parser/qqmljsastfwd_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSAST_FWD_P_H -#define QDECLARATIVEJSAST_FWD_P_H +#ifndef QQMLJSAST_FWD_P_H +#define QQMLJSAST_FWD_P_H -#include "qdeclarativejsglobal_p.h" +#include "qqmljsglobal_p.h" #include <QtCore/qglobal.h> @@ -59,7 +59,7 @@ QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { namespace AST { +namespace QQmlJS { namespace AST { class SourceLocation { diff --git a/src/declarative/qml/parser/qdeclarativejsastvisitor.cpp b/src/qml/qml/parser/qqmljsastvisitor.cpp index 671abd76db..2d854dc735 100644 --- a/src/declarative/qml/parser/qdeclarativejsastvisitor.cpp +++ b/src/qml/qml/parser/qqmljsastvisitor.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qdeclarativejsastvisitor_p.h" +#include "qqmljsastvisitor_p.h" QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { namespace AST { +namespace QQmlJS { namespace AST { Visitor::Visitor() { @@ -53,6 +53,6 @@ Visitor::~Visitor() { } -} } // namespace QDeclarativeJS::AST +} } // namespace QQmlJS::AST QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h b/src/qml/qml/parser/qqmljsastvisitor_p.h index 639cb33d49..991580309d 100644 --- a/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h +++ b/src/qml/qml/parser/qqmljsastvisitor_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSASTVISITOR_P_H -#define QDECLARATIVEJSASTVISITOR_P_H +#ifndef QQMLJSASTVISITOR_P_H +#define QQMLJSASTVISITOR_P_H // // W A R N I N G @@ -53,12 +53,12 @@ // We mean it. // -#include "qdeclarativejsastfwd_p.h" -#include "qdeclarativejsglobal_p.h" +#include "qqmljsastfwd_p.h" +#include "qqmljsglobal_p.h" QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { namespace AST { +namespace QQmlJS { namespace AST { class QML_PARSER_EXPORT Visitor { @@ -98,7 +98,7 @@ public: virtual void endVisit(UiArrayMemberList *) {} virtual void endVisit(UiQualifiedId *) {} - // QDeclarativeJS + // QQmlJS virtual bool visit(ThisExpression *) { return true; } virtual void endVisit(ThisExpression *) {} @@ -326,4 +326,4 @@ public: QT_QML_END_NAMESPACE -#endif // QDECLARATIVEJSASTVISITOR_P_H +#endif // QQMLJSASTVISITOR_P_H diff --git a/src/declarative/qml/parser/qdeclarativejsengine_p.cpp b/src/qml/qml/parser/qqmljsengine_p.cpp index 534849cd53..459ba8d7dc 100644 --- a/src/declarative/qml/parser/qdeclarativejsengine_p.cpp +++ b/src/qml/qml/parser/qqmljsengine_p.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qdeclarativejsengine_p.h" -#include "qdeclarativejsglobal_p.h" +#include "qqmljsengine_p.h" +#include "qqmljsglobal_p.h" #include <qnumeric.h> #include <QHash> @@ -48,7 +48,7 @@ QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { static int toDigit(char c) { @@ -132,9 +132,9 @@ void Engine::setCode(const QString &code) { _code = code; } void Engine::addComment(int pos, int len, int line, int col) -{ if (len > 0) _comments.append(QDeclarativeJS::AST::SourceLocation(pos, len, line, col)); } +{ if (len > 0) _comments.append(QQmlJS::AST::SourceLocation(pos, len, line, col)); } -QList<QDeclarativeJS::AST::SourceLocation> Engine::comments() const +QList<QQmlJS::AST::SourceLocation> Engine::comments() const { return _comments; } Lexer *Engine::lexer() const @@ -156,6 +156,6 @@ QStringRef Engine::newStringRef(const QString &text) QStringRef Engine::newStringRef(const QChar *chars, int size) { return newStringRef(QString(chars, size)); } -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qdeclarativejsengine_p.h b/src/qml/qml/parser/qqmljsengine_p.h index db8a462d3f..3cb78de4eb 100644 --- a/src/declarative/qml/parser/qdeclarativejsengine_p.h +++ b/src/qml/qml/parser/qqmljsengine_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSENGINE_P_H -#define QDECLARATIVEJSENGINE_P_H +#ifndef QQMLJSENGINE_P_H +#define QQMLJSENGINE_P_H // // W A R N I N G @@ -53,16 +53,16 @@ // We mean it. // -#include "qdeclarativejsglobal_p.h" -#include "qdeclarativejsastfwd_p.h" -#include "qdeclarativejsmemorypool_p.h" +#include "qqmljsglobal_p.h" +#include "qqmljsastfwd_p.h" +#include "qqmljsmemorypool_p.h" #include <QString> #include <QSet> QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { class Lexer; class MemoryPool; @@ -119,8 +119,8 @@ public: double integerFromString(const char *buf, int size, int radix); -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS QT_QML_END_NAMESPACE -#endif // QDECLARATIVEJSENGINE_P_H +#endif // QQMLJSENGINE_P_H diff --git a/src/declarative/qml/parser/qdeclarativejsglobal_p.h b/src/qml/qml/parser/qqmljsglobal_p.h index 993f4ae3dc..81c90310ad 100644 --- a/src/declarative/qml/parser/qdeclarativejsglobal_p.h +++ b/src/qml/qml/parser/qqmljsglobal_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -38,8 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSGLOBAL_P_H -#define QDECLARATIVEJSGLOBAL_P_H +#ifndef QQMLJSGLOBAL_P_H +#define QQMLJSGLOBAL_P_H #include <QtCore/qglobal.h> @@ -53,7 +53,7 @@ # define QML_PARSER_EXPORT # else # define QML_PARSER_EXPORT Q_DECL_IMPORT -# endif // QDECLARATIVEJS_BUILD_DIR +# endif // QQMLJS_BUILD_DIR #else // !QT_CREATOR # define QT_QML_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE @@ -66,4 +66,4 @@ # endif #endif // QT_CREATOR -#endif // QDECLARATIVEJSGLOBAL_P_H +#endif // QQMLJSGLOBAL_P_H diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp b/src/qml/qml/parser/qqmljsgrammar.cpp index 1e509e5651..f69f809ee3 100644 --- a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp +++ b/src/qml/qml/parser/qqmljsgrammar.cpp @@ -40,11 +40,11 @@ ****************************************************************************/ // This file was generated by qlalr - DO NOT EDIT! -#include "qdeclarativejsgrammar_p.h" +#include "qqmljsgrammar_p.h" QT_BEGIN_NAMESPACE -const char *const QDeclarativeJSGrammar::spell [] = { +const char *const QQmlJSGrammar::spell [] = { "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ",", "continue", "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===", "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier", @@ -57,7 +57,7 @@ const char *const QDeclarativeJSGrammar::spell [] = { "import", "as", "on", 0, 0, 0, 0, 0, 0, 0, 0, 0}; -const short QDeclarativeJSGrammar::lhs [] = { +const short QQmlJSGrammar::lhs [] = { 102, 102, 102, 102, 102, 102, 103, 109, 109, 112, 112, 114, 113, 113, 113, 113, 113, 113, 113, 113, 116, 111, 110, 119, 119, 120, 120, 121, 121, 118, @@ -94,7 +94,7 @@ const short QDeclarativeJSGrammar::lhs [] = { 145, 205, 205, 202, 202, 203, 203, 206, 108, 108, 207, 207, 106, 106, 204, 204, 139, 139, 208}; -const short QDeclarativeJSGrammar::rhs [] = { +const short QQmlJSGrammar::rhs [] = { 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 3, 3, 5, 5, 4, 4, 2, 0, 1, 1, 2, 1, 3, 2, 3, 2, @@ -131,7 +131,7 @@ const short QDeclarativeJSGrammar::rhs [] = { 8, 1, 3, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 2}; -const short QDeclarativeJSGrammar::action_default [] = { +const short QQmlJSGrammar::action_default [] = { 0, 0, 22, 0, 0, 0, 22, 0, 175, 242, 206, 214, 210, 154, 226, 202, 3, 139, 73, 155, 218, 222, 143, 172, 153, 158, 138, 192, 179, 0, @@ -198,7 +198,7 @@ const short QDeclarativeJSGrammar::action_default [] = { 0, 14, 0, 19, 20, 0, 15, 16, 0, 17, 18, 11, 23, 7, 349}; -const short QDeclarativeJSGrammar::goto_default [] = { +const short QQmlJSGrammar::goto_default [] = { 7, 625, 207, 196, 205, 508, 496, 624, 643, 495, 623, 621, 626, 22, 622, 18, 507, 549, 539, 546, 541, 526, 191, 195, 197, 201, 233, 208, 230, 530, @@ -211,7 +211,7 @@ const short QDeclarativeJSGrammar::goto_default [] = { 324, 464, 323, 419, 423, 426, 422, 421, 441, 442, 185, 199, 181, 184, 198, 206, 0}; -const short QDeclarativeJSGrammar::action_index [] = { +const short QQmlJSGrammar::action_index [] = { 404, 1275, 2411, 2411, 2509, 1000, 68, 92, 90, -102, 88, 62, 60, 256, -102, 298, 86, -102, -102, 638, 83, 134, 172, 219, -102, -102, -102, 454, 194, 1275, @@ -344,7 +344,7 @@ const short QDeclarativeJSGrammar::action_index [] = { -107, -107, -107, -107, -107, -4, -107, -107, -107, -107, -107, -107, -107, -107, -107}; -const short QDeclarativeJSGrammar::action_info [] = { +const short QQmlJSGrammar::action_info [] = { 416, 257, 533, -132, 403, -113, 346, -102, 575, 348, 572, -121, 531, -103, -121, 545, 345, 430, 342, 348, 340, 343, 440, 401, 391, 545, 563, 389, 538, 446, @@ -677,7 +677,7 @@ const short QDeclarativeJSGrammar::action_info [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -const short QDeclarativeJSGrammar::action_check [] = { +const short QQmlJSGrammar::action_check [] = { 36, 36, 24, 7, 55, 7, 7, 7, 60, 36, 8, 7, 37, 7, 7, 33, 55, 55, 60, 36, 36, 33, 33, 55, 8, 33, 7, 7, 34, 36, diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar_p.h b/src/qml/qml/parser/qqmljsgrammar_p.h index 5503ff763f..455391a862 100644 --- a/src/declarative/qml/parser/qdeclarativejsgrammar_p.h +++ b/src/qml/qml/parser/qqmljsgrammar_p.h @@ -51,14 +51,14 @@ // // This file was generated by qlalr - DO NOT EDIT! -#ifndef QDECLARATIVEJSGRAMMAR_P_H -#define QDECLARATIVEJSGRAMMAR_P_H +#ifndef QQMLJSGRAMMAR_P_H +#define QQMLJSGRAMMAR_P_H #include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QDeclarativeJSGrammar +class QQmlJSGrammar { public: enum VariousConstants { @@ -207,5 +207,5 @@ public: QT_END_NAMESPACE -#endif // QDECLARATIVEJSGRAMMAR_P_H +#endif // QQMLJSGRAMMAR_P_H diff --git a/src/declarative/qml/parser/qdeclarativejskeywords_p.h b/src/qml/qml/parser/qqmljskeywords_p.h index fac5b7b5f6..bbcc4855a3 100644 --- a/src/declarative/qml/parser/qdeclarativejskeywords_p.h +++ b/src/qml/qml/parser/qqmljskeywords_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSKEYWORDS_P_H -#define QDECLARATIVEJSKEYWORDS_P_H +#ifndef QQMLJSKEYWORDS_P_H +#define QQMLJSKEYWORDS_P_H // // W A R N I N G @@ -857,4 +857,4 @@ int Lexer::classify(const QChar *s, int n, bool qmlMode) { } // switch } -#endif // QDECLARATIVEJSKEYWORDS_P_H +#endif // QQMLJSKEYWORDS_P_H diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/qml/qml/parser/qqmljslexer.cpp index e292490499..c34fc81163 100644 --- a/src/declarative/qml/parser/qdeclarativejslexer.cpp +++ b/src/qml/qml/parser/qqmljslexer.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qdeclarativejslexer_p.h" -#include "qdeclarativejsengine_p.h" -#include "qdeclarativejsmemorypool_p.h" +#include "qqmljslexer_p.h" +#include "qqmljsengine_p.h" +#include "qqmljsmemorypool_p.h" #include <QtCore/QCoreApplication> #include <QtCore/QVarLengthArray> @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok); QT_END_NAMESPACE -using namespace QDeclarativeJS; +using namespace QQmlJS; static int regExpFlagFromChar(const QChar &ch) { @@ -464,7 +464,7 @@ again: if (end - begin != chars.size() - 1) { _errorCode = IllegalExponentIndicator; - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Illegal syntax for exponential number"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal syntax for exponential number"); return T_ERROR; } @@ -668,7 +668,7 @@ again: } _errorCode = UnclosedStringLiteral; - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Unclosed string at end of line"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Unclosed string at end of line"); return T_ERROR; } @@ -683,7 +683,7 @@ again: _validTokenText = true; if (! ok) { _errorCode = IllegalUnicodeEscapeSequence; - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence"); return T_ERROR; } } @@ -706,7 +706,7 @@ again: _tokenText += decodeUnicodeEscapeCharacter(&ok); if (! ok) { _errorCode = IllegalUnicodeEscapeSequence; - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence"); return T_ERROR; } } else { @@ -828,7 +828,7 @@ again: if (end - begin != chars.size() - 1) { _errorCode = IllegalExponentIndicator; - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Illegal syntax for exponential number"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal syntax for exponential number"); return T_ERROR; } @@ -854,7 +854,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix) switch (_char.unicode()) { case 0: // eof case '\n': case '\r': // line terminator - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression literal"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression literal"); return false; case '/': @@ -865,7 +865,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix) while (isIdentLetter(_char)) { int flag = regExpFlagFromChar(_char); if (flag == 0) { - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Invalid regular expression flag '%0'") + _errorMessage = QCoreApplication::translate("QQmlParser", "Invalid regular expression flag '%0'") .arg(QChar(_char)); return false; } @@ -882,7 +882,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix) scanChar(); if (_char.isNull() || isLineTerminator()) { - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression backslash sequence"); return false; } @@ -904,7 +904,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix) scanChar(); if (_char.isNull() || isLineTerminator()) { - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression backslash sequence"); return false; } @@ -917,7 +917,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix) } if (_char != QLatin1Char(']')) { - _errorMessage = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression class"); + _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression class"); return false; } @@ -1163,4 +1163,4 @@ bool Lexer::scanDirectives(Directives *directives) return true; } -#include "qdeclarativejskeywords_p.h" +#include "qqmljskeywords_p.h" diff --git a/src/declarative/qml/parser/qdeclarativejslexer_p.h b/src/qml/qml/parser/qqmljslexer_p.h index 806603e022..6b51852f5f 100644 --- a/src/declarative/qml/parser/qdeclarativejslexer_p.h +++ b/src/qml/qml/parser/qqmljslexer_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSLEXER_P_H -#define QDECLARATIVEJSLEXER_P_H +#ifndef QQMLJSLEXER_P_H +#define QQMLJSLEXER_P_H // // W A R N I N G @@ -53,13 +53,13 @@ // We mean it. // -#include "qdeclarativejsglobal_p.h" -#include "qdeclarativejsgrammar_p.h" +#include "qqmljsglobal_p.h" +#include "qqmljsgrammar_p.h" #include <QtCore/QString> QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { class Engine; @@ -85,7 +85,7 @@ public: } }; -class QML_PARSER_EXPORT Lexer: public QDeclarativeJSGrammar +class QML_PARSER_EXPORT Lexer: public QQmlJSGrammar { public: enum { @@ -241,7 +241,7 @@ private: bool _qmlMode; }; -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h b/src/qml/qml/parser/qqmljsmemorypool_p.h index 22baff2254..fd52fd25e4 100644 --- a/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h +++ b/src/qml/qml/parser/qqmljsmemorypool_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEJSMEMORYPOOL_P_H -#define QDECLARATIVEJSMEMORYPOOL_P_H +#ifndef QQMLJSMEMORYPOOL_P_H +#define QQMLJSMEMORYPOOL_P_H // // W A R N I N G @@ -53,7 +53,7 @@ // We mean it. // -#include "qdeclarativejsglobal_p.h" +#include "qqmljsglobal_p.h" #include <QtCore/qglobal.h> #include <QtCore/qshareddata.h> @@ -63,7 +63,7 @@ QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { class QML_PARSER_EXPORT MemoryPool : public QSharedData { @@ -166,7 +166,7 @@ public: void operator delete(void *, MemoryPool *) {} }; -} // namespace QDeclarativeJS +} // namespace QQmlJS QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/qml/qml/parser/qqmljsparser.cpp index 384544afe4..bc89b2ac84 100644 --- a/src/declarative/qml/parser/qdeclarativejsparser.cpp +++ b/src/qml/qml/parser/qqmljsparser.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,14 +44,14 @@ #include <string.h> -#include "qdeclarativejsengine_p.h" -#include "qdeclarativejslexer_p.h" -#include "qdeclarativejsast_p.h" -#include "qdeclarativejsmemorypool_p.h" +#include "qqmljsengine_p.h" +#include "qqmljslexer_p.h" +#include "qqmljsast_p.h" +#include "qqmljsmemorypool_p.h" -#include "qdeclarativejsparser_p.h" +#include "qqmljsparser_p.h" #include <QVarLengthArray> // @@ -59,7 +59,7 @@ // Changes will be lost. // -using namespace QDeclarativeJS; +using namespace QQmlJS; QT_QML_BEGIN_NAMESPACE @@ -1703,7 +1703,7 @@ case 346: { yylloc.startColumn += yylloc.length; yylloc.length = 0; - //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'"); + //const QString msg = qApp->translate("QQmlParser", "Missing `;'"); //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg)); first_token = &token_buffer[0]; @@ -1733,9 +1733,9 @@ case 346: { QString msg; int token = token_buffer[0].token; if (token < 0 || token >= TERMINAL_COUNT) - msg = qApp->translate("QDeclarativeParser", "Syntax error"); + msg = qApp->translate("QQmlParser", "Syntax error"); else - msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token])); + msg = qApp->translate("QQmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; @@ -1763,7 +1763,7 @@ case 346: { for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk])); + const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = *tk; @@ -1787,7 +1787,7 @@ case 346: { int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk])); + const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = tk; @@ -1800,7 +1800,7 @@ case 346: { } } - const QString msg = qApp->translate("QDeclarativeParser", "Syntax error"); + const QString msg = qApp->translate("QQmlParser", "Syntax error"); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); } diff --git a/src/declarative/qml/parser/qdeclarativejsparser_p.h b/src/qml/qml/parser/qqmljsparser_p.h index 1e6da5944b..ad532c32c7 100644 --- a/src/declarative/qml/parser/qdeclarativejsparser_p.h +++ b/src/qml/qml/parser/qqmljsparser_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,24 +56,24 @@ // Changes will be lost. // -#ifndef QDECLARATIVEJSPARSER_P_H -#define QDECLARATIVEJSPARSER_P_H +#ifndef QQMLJSPARSER_P_H +#define QQMLJSPARSER_P_H -#include "qdeclarativejsglobal_p.h" -#include "qdeclarativejsgrammar_p.h" -#include "qdeclarativejsast_p.h" -#include "qdeclarativejsengine_p.h" +#include "qqmljsglobal_p.h" +#include "qqmljsgrammar_p.h" +#include "qqmljsast_p.h" +#include "qqmljsengine_p.h" #include <QtCore/QList> #include <QtCore/QString> QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { class Engine; -class QML_PARSER_EXPORT Parser: protected QDeclarativeJSGrammar +class QML_PARSER_EXPORT Parser: protected QQmlJSGrammar { public: union Value { @@ -233,7 +233,7 @@ protected: QList<DiagnosticMessage> diagnostic_messages; }; -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS @@ -245,4 +245,4 @@ QT_QML_END_NAMESPACE -#endif // QDECLARATIVEJSPARSER_P_H +#endif // QQMLJSPARSER_P_H diff --git a/src/declarative/qml/qlistmodelinterface.cpp b/src/qml/qml/qlistmodelinterface.cpp index 32d8ee60b7..3ea0d3f155 100644 --- a/src/declarative/qml/qlistmodelinterface.cpp +++ b/src/qml/qml/qlistmodelinterface.cpp @@ -46,11 +46,11 @@ QT_BEGIN_NAMESPACE /*! \internal \class QListModelInterface - \brief The QListModelInterface class can be subclassed to provide C++ models to QDeclarativeGraphics Views + \brief The QListModelInterface class can be subclassed to provide C++ models to QQuickGraphics Views This class is comprised primarily of pure virtual functions which you must implement in a subclass. You can then use the subclass - as a model for a QDeclarativeGraphics view, such as a QDeclarativeListView. + as a model for a QQuickGraphics view, such as a QQuickListView. */ /*! \fn QListModelInterface::QListModelInterface(QObject *parent) diff --git a/src/declarative/qml/qlistmodelinterface_p.h b/src/qml/qml/qlistmodelinterface_p.h index d653699dff..c644ce88e6 100644 --- a/src/declarative/qml/qlistmodelinterface_p.h +++ b/src/qml/qml/qlistmodelinterface_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,14 +45,14 @@ #include <QtCore/QHash> #include <QtCore/QVariant> -#include <private/qdeclarativeglobal_p.h> +#include <private/qtqmlglobal_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class Q_DECLARATIVE_PRIVATE_EXPORT QListModelInterface : public QObject +class Q_QML_PRIVATE_EXPORT QListModelInterface : public QObject { Q_OBJECT public: diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri new file mode 100644 index 0000000000..0ce7c7ed5c --- /dev/null +++ b/src/qml/qml/qml.pri @@ -0,0 +1,125 @@ +SOURCES += \ + $$PWD/qquickapplication.cpp \ + $$PWD/qqmlinstruction.cpp \ + $$PWD/qquicklistmodel.cpp \ + $$PWD/qquicklistmodelworkeragent.cpp \ + $$PWD/qqmlopenmetaobject.cpp \ + $$PWD/qqmlvmemetaobject.cpp \ + $$PWD/qqmlengine.cpp \ + $$PWD/qqmlexpression.cpp \ + $$PWD/qqmlbinding.cpp \ + $$PWD/qqmlproperty.cpp \ + $$PWD/qqmlcomponent.cpp \ + $$PWD/qqmlincubator.cpp \ + $$PWD/qqmlcontext.cpp \ + $$PWD/qqmlcustomparser.cpp \ + $$PWD/qqmlpropertyvaluesource.cpp \ + $$PWD/qqmlpropertyvalueinterceptor.cpp \ + $$PWD/qqmlproxymetaobject.cpp \ + $$PWD/qqmlvme.cpp \ + $$PWD/qqmlcompiler.cpp \ + $$PWD/qqmlcompileddata.cpp \ + $$PWD/qqmlboundsignal.cpp \ + $$PWD/qqmlmetatype.cpp \ + $$PWD/qqmlstringconverters.cpp \ + $$PWD/qqmlparserstatus.cpp \ + $$PWD/qqmltypeloader.cpp \ + $$PWD/qqmlinfo.cpp \ + $$PWD/qqmlerror.cpp \ + $$PWD/qqmlscript.cpp \ + $$PWD/qqmlrewrite.cpp \ + $$PWD/qqmlvaluetype.cpp \ + $$PWD/qqmlaccessors.cpp \ + $$PWD/qqmlxmlhttprequest.cpp \ + $$PWD/qqmlwatcher.cpp \ + $$PWD/qqmlcleanup.cpp \ + $$PWD/qqmlpropertycache.cpp \ + $$PWD/qqmlnotifier.cpp \ + $$PWD/qqmlintegercache.cpp \ + $$PWD/qqmltypenotavailable.cpp \ + $$PWD/qqmltypenamecache.cpp \ + $$PWD/qqmlscriptstring.cpp \ + $$PWD/qquickworkerscript.cpp \ + $$PWD/qqmlimageprovider.cpp \ + $$PWD/qqmlnetworkaccessmanagerfactory.cpp \ + $$PWD/qqmldirparser.cpp \ + $$PWD/qqmlextensionplugin.cpp \ + $$PWD/qqmlimport.cpp \ + $$PWD/qqmllist.cpp \ + $$PWD/qqmllocale.cpp \ + $$PWD/qlistmodelinterface.cpp + +HEADERS += \ + $$PWD/qqmlglobal_p.h \ + $$PWD/qqmlinstruction_p.h \ + $$PWD/qquicklistmodel_p.h\ + $$PWD/qquicklistmodel_p_p.h\ + $$PWD/qquicklistmodelworkeragent_p.h \ + $$PWD/qqmlopenmetaobject_p.h \ + $$PWD/qqmlvmemetaobject_p.h \ + $$PWD/qqml.h \ + $$PWD/qquickapplication_p.h \ + $$PWD/qqmlbinding_p.h \ + $$PWD/qqmlbinding_p_p.h \ + $$PWD/qqmlproperty.h \ + $$PWD/qqmlcomponent.h \ + $$PWD/qqmlcomponent_p.h \ + $$PWD/qqmlincubator.h \ + $$PWD/qqmlincubator_p.h \ + $$PWD/qqmlcustomparser_p.h \ + $$PWD/qqmlcustomparser_p_p.h \ + $$PWD/qqmlpropertyvaluesource.h \ + $$PWD/qqmlpropertyvalueinterceptor_p.h \ + $$PWD/qqmlboundsignal_p.h \ + $$PWD/qqmlparserstatus.h \ + $$PWD/qqmlproxymetaobject_p.h \ + $$PWD/qqmlvme_p.h \ + $$PWD/qqmlcompiler_p.h \ + $$PWD/qqmlengine_p.h \ + $$PWD/qqmlexpression_p.h \ + $$PWD/qqmlprivate.h \ + $$PWD/qqmlmetatype_p.h \ + $$PWD/qqmlengine.h \ + $$PWD/qqmlcontext.h \ + $$PWD/qqmlexpression.h \ + $$PWD/qqmlstringconverters_p.h \ + $$PWD/qqmlinfo.h \ + $$PWD/qqmlproperty_p.h \ + $$PWD/qqmlcontext_p.h \ + $$PWD/qqmltypeloader_p.h \ + $$PWD/qqmllist.h \ + $$PWD/qqmllist_p.h \ + $$PWD/qqmldata_p.h \ + $$PWD/qqmlerror.h \ + $$PWD/qqmlscript_p.h \ + $$PWD/qqmlrewrite_p.h \ + $$PWD/qqmlvaluetype_p.h \ + $$PWD/qqmlaccessors_p.h \ + $$PWD/qqmlxmlhttprequest_p.h \ + $$PWD/qqmlwatcher_p.h \ + $$PWD/qqmlcleanup_p.h \ + $$PWD/qqmlpropertycache_p.h \ + $$PWD/qqmlnotifier_p.h \ + $$PWD/qqmlintegercache_p.h \ + $$PWD/qqmltypenotavailable_p.h \ + $$PWD/qqmltypenamecache_p.h \ + $$PWD/qqmlscriptstring.h \ + $$PWD/qquickworkerscript_p.h \ + $$PWD/qqmlguard_p.h \ + $$PWD/qqmlimageprovider.h \ + $$PWD/qqmlnetworkaccessmanagerfactory.h \ + $$PWD/qqmldirparser_p.h \ + $$PWD/qqmlextensioninterface.h \ + $$PWD/qqmlimport_p.h \ + $$PWD/qqmlextensionplugin.h \ + $$PWD/qqmlnullablevalue_p_p.h \ + $$PWD/qqmlscriptstring_p.h \ + $$PWD/qqmllocale_p.h \ + $$PWD/qlistmodelinterface_p.h \ + $$PWD/qqmlcomponentattached_p.h + +include(parser/parser.pri) +include(rewriter/rewriter.pri) +include(ftw/ftw.pri) +include(v4/v4.pri) +include(v8/v8.pri) diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h new file mode 100644 index 0000000000..32da2c616e --- /dev/null +++ b/src/qml/qml/qqml.h @@ -0,0 +1,451 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QQML_H +#define QQML_H + +#include <QtQml/qqmlprivate.h> +#include <QtQml/qqmlparserstatus.h> +#include <QtQml/qqmlpropertyvaluesource.h> +#include <QtQml/qqmllist.h> + +#include <QtCore/qbytearray.h> +#include <QtCore/qmetaobject.h> + +QT_BEGIN_HEADER + +#define QML_VERSION 0x020000 +#define QML_VERSION_STR "2.0" + +#define QML_DECLARE_TYPE(TYPE) \ + Q_DECLARE_METATYPE(TYPE *) \ + Q_DECLARE_METATYPE(QQmlListProperty<TYPE>) + +#define QML_DECLARE_TYPE_HASMETATYPE(TYPE) \ + Q_DECLARE_METATYPE(QQmlListProperty<TYPE>) + +#define QML_DECLARE_INTERFACE(INTERFACE) \ + QML_DECLARE_TYPE(INTERFACE) + +#define QML_DECLARE_INTERFACE_HASMETATYPE(INTERFACE) \ + QML_DECLARE_TYPE_HASMETATYPE(INTERFACE) + +enum { /* TYPEINFO flags */ + QML_HAS_ATTACHED_PROPERTIES = 0x01 +}; + +#define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \ +QT_BEGIN_NAMESPACE \ +template <> \ +class QQmlTypeInfo<TYPE > \ +{ \ +public: \ + enum { \ + hasAttachedProperties = (((FLAGS) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) \ + }; \ +}; \ +QT_END_NAMESPACE + +QT_BEGIN_NAMESPACE + + +class QQmlPropertyValueInterceptor; + +template<typename T> +int qmlRegisterType() +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterType type = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + 0, 0, + QString(), + + 0, 0, 0, 0, &T::staticMetaObject, + + QQmlPrivate::attachedPropertiesFunc<T>(), + QQmlPrivate::attachedPropertiesMetaObject<T>(), + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + 0, 0, + + 0, + 0 + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + +int Q_QML_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message); + +template<typename T> +int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterType type = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + 0, 0, + reason, + + uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, + + QQmlPrivate::attachedPropertiesFunc<T>(), + QQmlPrivate::attachedPropertiesMetaObject<T>(), + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + 0, 0, + + 0, + 0 + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + +template<typename T> +int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterType type = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + sizeof(T), QQmlPrivate::createInto<T>, + QString(), + + uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, + + QQmlPrivate::attachedPropertiesFunc<T>(), + QQmlPrivate::attachedPropertiesMetaObject<T>(), + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + 0, 0, + + 0, + 0 + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + +template<typename T, int metaObjectRevision> +int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterType type = { + 1, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + sizeof(T), QQmlPrivate::createInto<T>, + QString(), + + uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, + + QQmlPrivate::attachedPropertiesFunc<T>(), + QQmlPrivate::attachedPropertiesMetaObject<T>(), + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + 0, 0, + + 0, + metaObjectRevision + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + +template<typename T, int metaObjectRevision> +int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterType type = { + 1, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + sizeof(T), QQmlPrivate::createInto<T>, + QString(), + + uri, versionMajor, versionMinor, 0, &T::staticMetaObject, + + QQmlPrivate::attachedPropertiesFunc<T>(), + QQmlPrivate::attachedPropertiesMetaObject<T>(), + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + 0, 0, + + 0, + metaObjectRevision + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + + +template<typename T, typename E> +int qmlRegisterExtendedType() +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterType type = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + 0, 0, + QString(), + + 0, 0, 0, 0, &T::staticMetaObject, + + QQmlPrivate::attachedPropertiesFunc<T>(), + QQmlPrivate::attachedPropertiesMetaObject<T>(), + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + QQmlPrivate::createParent<E>, &E::staticMetaObject, + + 0, + 0 + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + +template<typename T, typename E> +int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor, + const char *qmlName) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlAttachedPropertiesFunc attached = QQmlPrivate::attachedPropertiesFunc<E>(); + const QMetaObject * attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<E>(); + if (!attached) { + attached = QQmlPrivate::attachedPropertiesFunc<T>(); + attachedMetaObject = QQmlPrivate::attachedPropertiesMetaObject<T>(); + } + + QQmlPrivate::RegisterType type = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + sizeof(T), QQmlPrivate::createInto<T>, + QString(), + + uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, + + attached, + attachedMetaObject, + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + QQmlPrivate::createParent<E>, &E::staticMetaObject, + + 0, + 0 + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + +template<typename T> +int qmlRegisterInterface(const char *typeName) +{ + QByteArray name(typeName); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterInterface qmlInterface = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + + qobject_interface_iid<T *>() + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::InterfaceRegistration, &qmlInterface); +} + +template<typename T> +int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, + const char *qmlName, QQmlCustomParser *parser) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QQmlListProperty<" + name + ">"); + + QQmlPrivate::RegisterType type = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QQmlListProperty<T> >(listName.constData()), + sizeof(T), QQmlPrivate::createInto<T>, + QString(), + + uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, + + QQmlPrivate::attachedPropertiesFunc<T>(), + QQmlPrivate::attachedPropertiesMetaObject<T>(), + + QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), + QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), + + 0, 0, + + parser, + 0 + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); +} + +class QQmlContext; +class QQmlEngine; +class QJSValue; +class QJSEngine; +Q_QML_EXPORT void qmlExecuteDeferred(QObject *); +Q_QML_EXPORT QQmlContext *qmlContext(const QObject *); +Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *); +Q_QML_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true); +Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create); + +template<typename T> +QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true) +{ + static int idx = -1; + return qmlAttachedPropertiesObject(&idx, obj, &T::staticMetaObject, create); +} + +// For the use of QtQuick1 module +Q_QML_EXPORT void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor); + +inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, + QJSValue (*callback)(QQmlEngine *, QJSEngine *)) +{ + QQmlPrivate::RegisterModuleApi api = { + 0, + + uri, versionMajor, versionMinor, + + callback, 0 + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::ModuleApiRegistration, &api); +} + +inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, + QObject *(*callback)(QQmlEngine *, QJSEngine *)) +{ + QQmlPrivate::RegisterModuleApi api = { + 0, + + uri, versionMajor, versionMinor, + + 0, callback + }; + + return QQmlPrivate::qmlregister(QQmlPrivate::ModuleApiRegistration, &api); +} + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QObject) +Q_DECLARE_METATYPE(QVariant) + +QT_END_HEADER + +#endif // QQML_H diff --git a/src/declarative/qml/qdeclarativeaccessors.cpp b/src/qml/qml/qqmlaccessors.cpp index 5659c2d550..ceb4f44789 100644 --- a/src/declarative/qml/qdeclarativeaccessors.cpp +++ b/src/qml/qml/qqmlaccessors.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include "qdeclarativeaccessors_p.h" +#include "qqmlaccessors_p.h" -#include "qdeclarativedata_p.h" -#include "qdeclarativenotifier_p.h" +#include "qqmldata_p.h" +#include "qqmlnotifier_p.h" QT_BEGIN_NAMESPACE @@ -50,26 +50,26 @@ struct AccessorProperties { AccessorProperties(); QReadWriteLock lock; - QHash<const QMetaObject *, QDeclarativeAccessorProperties::Properties> properties; + QHash<const QMetaObject *, QQmlAccessorProperties::Properties> properties; }; Q_GLOBAL_STATIC(AccessorProperties, accessorProperties) QML_PRIVATE_ACCESSOR(QObject, QString, objectName, objectName) -static void QObject_objectNameNotifier(QObject *object, intptr_t, QDeclarativeNotifier **notifier) +static void QObject_objectNameNotifier(QObject *object, intptr_t, QQmlNotifier **notifier) { - *notifier = QDeclarativeData::get(object, true)->objectNameNotifier(); + *notifier = QQmlData::get(object, true)->objectNameNotifier(); } -static QDeclarativeAccessors QObject_objectName = { QObject_objectNameRead, +static QQmlAccessors QObject_objectName = { QObject_objectNameRead, QObject_objectNameNotifier }; QML_DECLARE_PROPERTIES(QObject) { { QML_PROPERTY_NAME(objectName), 0, &QObject_objectName } }; -static void buildNameMask(QDeclarativeAccessorProperties::Properties &properties) +static void buildNameMask(QQmlAccessorProperties::Properties &properties) { quint32 mask = 0; @@ -86,21 +86,21 @@ static void buildNameMask(QDeclarativeAccessorProperties::Properties &properties AccessorProperties::AccessorProperties() { // Pre-seed QObject::objectName accessor - typedef QDeclarativeAccessorProperties::Properties P; + typedef QQmlAccessorProperties::Properties P; properties.insert(&QObject::staticMetaObject, - P(qdeclarative_accessor_properties_QObject, - sizeof(qdeclarative_accessor_properties_QObject) / - sizeof(QDeclarativeAccessorProperties::Property))); + P(qqml_accessor_properties_QObject, + sizeof(qqml_accessor_properties_QObject) / + sizeof(QQmlAccessorProperties::Property))); } -QDeclarativeAccessorProperties::Properties::Properties(Property *properties, int count) +QQmlAccessorProperties::Properties::Properties(Property *properties, int count) : count(count), properties(properties) { buildNameMask(*this); } -QDeclarativeAccessorProperties::Properties -QDeclarativeAccessorProperties::properties(const QMetaObject *mo) +QQmlAccessorProperties::Properties +QQmlAccessorProperties::properties(const QMetaObject *mo) { AccessorProperties *This = accessorProperties(); @@ -108,7 +108,7 @@ QDeclarativeAccessorProperties::properties(const QMetaObject *mo) return This->properties.value(mo); } -void QDeclarativeAccessorProperties::registerProperties(const QMetaObject *mo, int count, +void QQmlAccessorProperties::registerProperties(const QMetaObject *mo, int count, Property *props) { Q_ASSERT(count > 0); diff --git a/src/declarative/qml/qdeclarativeaccessors_p.h b/src/qml/qml/qqmlaccessors_p.h index c52dc537ef..a603bede9f 100644 --- a/src/declarative/qml/qdeclarativeaccessors_p.h +++ b/src/qml/qml/qqmlaccessors_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEACCESSORS_P_H -#define QDECLARATIVEACCESSORS_P_H +#ifndef QQMLACCESSORS_P_H +#define QQMLACCESSORS_P_H +#include <QtQml/qtqmlglobal.h> #include <QtCore/qvector.h> #include <QtCore/qhash.h> #include <QtCore/QReadWriteLock> @@ -51,7 +52,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QObject; -class QDeclarativeNotifier; +class QQmlNotifier; // QML "accessor properties" allow V4 and V8 to bypass Qt's meta system to read and, more // importantly, subscribe to properties directly. Any property that is primarily read @@ -60,7 +61,7 @@ class QDeclarativeNotifier; // To define accessor properties, use the QML_DECLARE_PROPERTIES() and QML_DEFINE_PROPERTIES() // macros. The QML_DECLARE_PROPERTIES() macro is used to specify the properties, and the // QML_DEFINE_PROPERTIES() macro to register the properties with the -// QDeclarativeAccessorProperties singleton. +// QQmlAccessorProperties singleton. // // A class with accessor properties must also add the Q_CLASSINFO("qt_HasQmlAccessors", "true") // tag to its declaration. This is essential for QML to maintain internal consistency, @@ -74,17 +75,17 @@ class QDeclarativeNotifier; // if registration has already occurred. #define QML_DECLARE_PROPERTIES(type) \ - static volatile bool qdeclarative_accessor_properties_isregistered_ ## type = false; \ - static QDeclarativeAccessorProperties::Property qdeclarative_accessor_properties_ ## type[] = + static volatile bool qqml_accessor_properties_isregistered_ ## type = false; \ + static QQmlAccessorProperties::Property qqml_accessor_properties_ ## type[] = #define QML_DEFINE_PROPERTIES(type) \ do { \ - if (!qdeclarative_accessor_properties_isregistered_ ## type) { \ - int count = sizeof(qdeclarative_accessor_properties_ ## type) / \ - sizeof(QDeclarativeAccessorProperties::Property); \ - QDeclarativeAccessorProperties::registerProperties(&type::staticMetaObject, count, \ - qdeclarative_accessor_properties_ ## type);\ - qdeclarative_accessor_properties_isregistered_ ## type = true; \ + if (!qqml_accessor_properties_isregistered_ ## type) { \ + int count = sizeof(qqml_accessor_properties_ ## type) / \ + sizeof(QQmlAccessorProperties::Property); \ + QQmlAccessorProperties::registerProperties(&type::staticMetaObject, count, \ + qqml_accessor_properties_ ## type);\ + qqml_accessor_properties_isregistered_ ## type = true; \ } \ } while (false); @@ -97,19 +98,19 @@ class QDeclarativeNotifier; #define QML_PROPERTY_NAME(name) #name, sizeof #name - 1 -class QDeclarativeAccessors +class QQmlAccessors { public: void (*read)(QObject *object, intptr_t property, void *output); - void (*notifier)(QObject *object, intptr_t property, QDeclarativeNotifier **notifier); + void (*notifier)(QObject *object, intptr_t property, QQmlNotifier **notifier); }; -namespace QDeclarativeAccessorProperties { +namespace QQmlAccessorProperties { struct Property { const char *name; unsigned int nameLength; intptr_t data; - QDeclarativeAccessors *accessors; + QQmlAccessors *accessors; }; struct Properties { @@ -128,11 +129,11 @@ namespace QDeclarativeAccessorProperties { }; Properties properties(const QMetaObject *); - void Q_DECLARATIVE_EXPORT registerProperties(const QMetaObject *, int, Property *); + void Q_QML_EXPORT registerProperties(const QMetaObject *, int, Property *); }; -QDeclarativeAccessorProperties::Property * -QDeclarativeAccessorProperties::Properties::property(const char *name) +QQmlAccessorProperties::Property * +QQmlAccessorProperties::Properties::property(const char *name) { if (count == 0) return 0; @@ -153,7 +154,7 @@ QDeclarativeAccessorProperties::Properties::property(const char *name) return 0; } -QDeclarativeAccessorProperties::Properties::Properties() +QQmlAccessorProperties::Properties::Properties() : count(0), properties(0), nameMask(0) { } @@ -162,4 +163,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEACCESSORS_P_H +#endif // QQMLACCESSORS_P_H diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/qml/qml/qqmlbinding.cpp index 39032e0ca6..a19644fb3e 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,28 +39,28 @@ ** ****************************************************************************/ -#include "qdeclarativebinding_p.h" -#include "qdeclarativebinding_p_p.h" +#include "qqmlbinding_p.h" +#include "qqmlbinding_p_p.h" -#include "qdeclarative.h" -#include "qdeclarativecontext.h" -#include "qdeclarativeinfo.h" -#include "qdeclarativecompiler_p.h" -#include "qdeclarativedata_p.h" -#include <private/qdeclarativeprofilerservice_p.h> -#include <private/qdeclarativetrace_p.h> +#include "qqml.h" +#include "qqmlcontext.h" +#include "qqmlinfo.h" +#include "qqmlcompiler_p.h" +#include "qqmldata_p.h" +#include <private/qqmlprofilerservice_p.h> +#include <private/qqmltrace_p.h> #include <QVariant> #include <QtCore/qdebug.h> QT_BEGIN_NAMESPACE -QDeclarativeAbstractBinding::QDeclarativeAbstractBinding() +QQmlAbstractBinding::QQmlAbstractBinding() : m_prevBinding(0), m_nextBinding(0) { } -QDeclarativeAbstractBinding::~QDeclarativeAbstractBinding() +QQmlAbstractBinding::~QQmlAbstractBinding() { Q_ASSERT(m_prevBinding == 0); Q_ASSERT(*m_mePtr == 0); @@ -73,7 +73,7 @@ Bindings are free to implement their own memory management, so the delete operat necessarily safe. The default implementation clears the binding, removes it from the object and calls delete. */ -void QDeclarativeAbstractBinding::destroy() +void QQmlAbstractBinding::destroy() { removeFromObject(); clear(); @@ -89,7 +89,7 @@ being bound. However, it does not enable the binding itself or call update() on it. */ -void QDeclarativeAbstractBinding::addToObject() +void QQmlAbstractBinding::addToObject() { Q_ASSERT(!m_prevBinding); @@ -98,7 +98,7 @@ void QDeclarativeAbstractBinding::addToObject() int index = propertyIndex(); - QDeclarativeData *data = QDeclarativeData::get(obj, true); + QQmlData *data = QQmlData::get(obj, true); if (index & 0xFF000000) { // Value type @@ -106,17 +106,17 @@ void QDeclarativeAbstractBinding::addToObject() int coreIndex = index & 0xFFFFFF; // Find the value type proxy (if there is one) - QDeclarativeValueTypeProxyBinding *proxy = 0; + QQmlValueTypeProxyBinding *proxy = 0; if (data->hasBindingBit(coreIndex)) { - QDeclarativeAbstractBinding *b = data->bindings; + QQmlAbstractBinding *b = data->bindings; while (b && b->propertyIndex() != coreIndex) b = b->m_nextBinding; - Q_ASSERT(b && b->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy); - proxy = static_cast<QDeclarativeValueTypeProxyBinding *>(b); + Q_ASSERT(b && b->bindingType() == QQmlAbstractBinding::ValueTypeProxy); + proxy = static_cast<QQmlValueTypeProxyBinding *>(b); } if (!proxy) { - proxy = new QDeclarativeValueTypeProxyBinding(obj, coreIndex); + proxy = new QQmlValueTypeProxyBinding(obj, coreIndex); Q_ASSERT(proxy->propertyIndex() == coreIndex); Q_ASSERT(proxy->object() == obj); @@ -142,7 +142,7 @@ void QDeclarativeAbstractBinding::addToObject() /*! Remove the binding from the object. */ -void QDeclarativeAbstractBinding::removeFromObject() +void QQmlAbstractBinding::removeFromObject() { if (m_prevBinding) { int index = propertyIndex(); @@ -157,25 +157,25 @@ void QDeclarativeAbstractBinding::removeFromObject() // doing nothing until it is removed by a write, a binding change or it is reused // to hold more sub-bindings. } else if (QObject *obj = object()) { - QDeclarativeData *data = QDeclarativeData::get(obj, false); + QQmlData *data = QQmlData::get(obj, false); if (data) data->clearBindingBit(index); } } } -static void bindingDummyDeleter(QDeclarativeAbstractBinding *) +static void bindingDummyDeleter(QQmlAbstractBinding *) { } -QDeclarativeAbstractBinding::Pointer QDeclarativeAbstractBinding::weakPointer() +QQmlAbstractBinding::Pointer QQmlAbstractBinding::weakPointer() { if (m_mePtr.value().isNull()) - m_mePtr.value() = QSharedPointer<QDeclarativeAbstractBinding>(this, bindingDummyDeleter); + m_mePtr.value() = QSharedPointer<QQmlAbstractBinding>(this, bindingDummyDeleter); return m_mePtr.value().toWeakRef(); } -void QDeclarativeAbstractBinding::clear() +void QQmlAbstractBinding::clear() { if (!m_mePtr.isNull()) { **m_mePtr = 0; @@ -183,55 +183,55 @@ void QDeclarativeAbstractBinding::clear() } } -void QDeclarativeAbstractBinding::retargetBinding(QObject *, int) +void QQmlAbstractBinding::retargetBinding(QObject *, int) { - qFatal("QDeclarativeAbstractBinding::retargetBinding() called on illegal binding."); + qFatal("QQmlAbstractBinding::retargetBinding() called on illegal binding."); } -QString QDeclarativeAbstractBinding::expression() const +QString QQmlAbstractBinding::expression() const { return QLatin1String("<Unknown>"); } -void QDeclarativeAbstractBinding::setEnabled(bool enabled, QDeclarativePropertyPrivate::WriteFlags flags) +void QQmlAbstractBinding::setEnabled(bool enabled, QQmlPropertyPrivate::WriteFlags flags) { if (enabled) update(flags); } -QDeclarativeBinding::Identifier QDeclarativeBinding::Invalid = -1; +QQmlBinding::Identifier QQmlBinding::Invalid = -1; -void QDeclarativeBindingPrivate::refresh() +void QQmlBindingPrivate::refresh() { - Q_Q(QDeclarativeBinding); + Q_Q(QQmlBinding); q->update(); } -QDeclarativeBindingPrivate::QDeclarativeBindingPrivate() +QQmlBindingPrivate::QQmlBindingPrivate() : updating(false), enabled(false), target(), targetProperty(0) { } -QDeclarativeBindingPrivate::~QDeclarativeBindingPrivate() +QQmlBindingPrivate::~QQmlBindingPrivate() { } -QDeclarativeBinding * -QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeContext *ctxt, +QQmlBinding * +QQmlBinding::createBinding(Identifier id, QObject *obj, QQmlContext *ctxt, const QString &url, int lineNumber, QObject *parent) { if (id < 0) return 0; - QDeclarativeContextData *ctxtdata = QDeclarativeContextData::get(ctxt); + QQmlContextData *ctxtdata = QQmlContextData::get(ctxt); - QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(ctxt->engine()); - QDeclarativeCompiledData *cdata = 0; - QDeclarativeTypeData *typeData = 0; + QQmlEnginePrivate *engine = QQmlEnginePrivate::get(ctxt->engine()); + QQmlCompiledData *cdata = 0; + QQmlTypeData *typeData = 0; if (engine && ctxtdata && !ctxtdata->url.isEmpty()) { typeData = engine->typeLoader.get(ctxtdata->url); cdata = typeData->compiledData(); } - QDeclarativeBinding *rv = cdata ? new QDeclarativeBinding(cdata->primitives.at(id), true, obj, ctxtdata, url, lineNumber, 0, parent) : 0; + QQmlBinding *rv = cdata ? new QQmlBinding(cdata->primitives.at(id), true, obj, ctxtdata, url, lineNumber, 0, parent) : 0; if (cdata) cdata->release(); if (typeData) @@ -239,27 +239,27 @@ QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeCont return rv; } -QDeclarativeBinding::QDeclarativeBinding(const QString &str, QObject *obj, QDeclarativeContext *ctxt, +QQmlBinding::QQmlBinding(const QString &str, QObject *obj, QQmlContext *ctxt, QObject *parent) -: QDeclarativeExpression(QDeclarativeContextData::get(ctxt), obj, str, *new QDeclarativeBindingPrivate) +: QQmlExpression(QQmlContextData::get(ctxt), obj, str, *new QQmlBindingPrivate) { setParent(parent); setNotifyOnValueChanged(true); } -QDeclarativeBinding::QDeclarativeBinding(const QString &str, QObject *obj, QDeclarativeContextData *ctxt, +QQmlBinding::QQmlBinding(const QString &str, QObject *obj, QQmlContextData *ctxt, QObject *parent) -: QDeclarativeExpression(ctxt, obj, str, *new QDeclarativeBindingPrivate) +: QQmlExpression(ctxt, obj, str, *new QQmlBindingPrivate) { setParent(parent); setNotifyOnValueChanged(true); } -QDeclarativeBinding::QDeclarativeBinding(const QString &str, bool isRewritten, QObject *obj, - QDeclarativeContextData *ctxt, +QQmlBinding::QQmlBinding(const QString &str, bool isRewritten, QObject *obj, + QQmlContextData *ctxt, const QString &url, int lineNumber, int columnNumber, QObject *parent) -: QDeclarativeExpression(ctxt, obj, str, isRewritten, url, lineNumber, columnNumber, *new QDeclarativeBindingPrivate) +: QQmlExpression(ctxt, obj, str, isRewritten, url, lineNumber, columnNumber, *new QQmlBindingPrivate) { setParent(parent); setNotifyOnValueChanged(true); @@ -271,85 +271,85 @@ QDeclarativeBinding::QDeclarativeBinding(const QString &str, bool isRewritten, Q To avoid exposing v8 in the public API, functionPtr must be a pointer to a v8::Handle<v8::Function>. For example: v8::Handle<v8::Function> function; - new QDeclarativeBinding(&function, scope, ctxt); + new QQmlBinding(&function, scope, ctxt); */ -QDeclarativeBinding::QDeclarativeBinding(void *functionPtr, QObject *obj, QDeclarativeContextData *ctxt, +QQmlBinding::QQmlBinding(void *functionPtr, QObject *obj, QQmlContextData *ctxt, QObject *parent) -: QDeclarativeExpression(ctxt, obj, functionPtr, *new QDeclarativeBindingPrivate) +: QQmlExpression(ctxt, obj, functionPtr, *new QQmlBindingPrivate) { setParent(parent); setNotifyOnValueChanged(true); } -QDeclarativeBinding::~QDeclarativeBinding() +QQmlBinding::~QQmlBinding() { } -void QDeclarativeBinding::setTarget(const QDeclarativeProperty &prop) +void QQmlBinding::setTarget(const QQmlProperty &prop) { - Q_D(QDeclarativeBinding); + Q_D(QQmlBinding); d->property = prop; d->target = d->property.object(); - d->targetProperty = QDeclarativePropertyPrivate::get(d->property)->core.encodedIndex(); + d->targetProperty = QQmlPropertyPrivate::get(d->property)->core.encodedIndex(); update(); } -void QDeclarativeBinding::setTarget(QObject *object, - const QDeclarativePropertyData &core, - QDeclarativeContextData *ctxt) +void QQmlBinding::setTarget(QObject *object, + const QQmlPropertyData &core, + QQmlContextData *ctxt) { - Q_D(QDeclarativeBinding); - d->property = QDeclarativePropertyPrivate::restore(object, core, ctxt); + Q_D(QQmlBinding); + d->property = QQmlPropertyPrivate::restore(object, core, ctxt); d->target = d->property.object(); - d->targetProperty = QDeclarativePropertyPrivate::get(d->property)->core.encodedIndex(); + d->targetProperty = QQmlPropertyPrivate::get(d->property)->core.encodedIndex(); update(); } -QDeclarativeProperty QDeclarativeBinding::property() const +QQmlProperty QQmlBinding::property() const { - Q_D(const QDeclarativeBinding); + Q_D(const QQmlBinding); return d->property; } -void QDeclarativeBinding::setEvaluateFlags(EvaluateFlags flags) +void QQmlBinding::setEvaluateFlags(EvaluateFlags flags) { - Q_D(QDeclarativeBinding); + Q_D(QQmlBinding); d->setRequiresThisObject(flags & RequiresThisObject); } -QDeclarativeBinding::EvaluateFlags QDeclarativeBinding::evaluateFlags() const +QQmlBinding::EvaluateFlags QQmlBinding::evaluateFlags() const { - Q_D(const QDeclarativeBinding); + Q_D(const QQmlBinding); return d->requiresThisObject()?RequiresThisObject:None; } -void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) +void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) { - Q_D(QDeclarativeBinding); + Q_D(QQmlBinding); if (!d->enabled || !d->context() || !d->context()->isValid()) return; - QDeclarativeTrace trace("General Binding Update"); + QQmlTrace trace("General Binding Update"); trace.addDetail("URL", d->url); trace.addDetail("Line", d->line); trace.addDetail("Column", d->columnNumber); if (!d->updating) { - QDeclarativeBindingProfiler prof(d->url, d->line, d->column); + QQmlBindingProfiler prof(d->url, d->line, d->column); prof.addDetail(expression()); d->updating = true; - QDeclarativeAbstractExpression::DeleteWatcher watcher(d); + QQmlAbstractExpression::DeleteWatcher watcher(d); - if (d->property.propertyType() == qMetaTypeId<QDeclarativeBinding *>()) { + if (d->property.propertyType() == qMetaTypeId<QQmlBinding *>()) { int idx = d->property.index(); Q_ASSERT(idx != -1); - QDeclarativeBinding *t = this; + QQmlBinding *t = this; int status = -1; void *a[] = { &t, 0, &status, &flags }; QMetaObject::metacall(d->property.object(), @@ -357,7 +357,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) idx, a); } else { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(d->context()->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(d->context()->engine); ep->referenceScarceResources(); bool isUndefined = false; @@ -370,7 +370,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) bool needsErrorData = false; if (!watcher.wasDeleted() && !d->hasError()) - needsErrorData = !QDeclarativePropertyPrivate::writeBinding(d->property, d->context(), + needsErrorData = !QQmlPropertyPrivate::writeBinding(d->property, d->context(), d, result, isUndefined, flags); @@ -400,24 +400,24 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) if (!watcher.wasDeleted()) d->updating = false; } else { - QDeclarativeBindingPrivate::printBindingLoopError(d->property); + QQmlBindingPrivate::printBindingLoopError(d->property); } } -void QDeclarativeBindingPrivate::printBindingLoopError(QDeclarativeProperty &prop) +void QQmlBindingPrivate::printBindingLoopError(QQmlProperty &prop) { - qmlInfo(prop.object()) << QDeclarativeBinding::tr("Binding loop detected for property \"%1\"").arg(prop.name()); + qmlInfo(prop.object()) << QQmlBinding::tr("Binding loop detected for property \"%1\"").arg(prop.name()); } -void QDeclarativeBindingPrivate::expressionChanged() +void QQmlBindingPrivate::expressionChanged() { - Q_Q(QDeclarativeBinding); + Q_Q(QQmlBinding); q->update(); } -void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) +void QQmlBinding::setEnabled(bool e, QQmlPropertyPrivate::WriteFlags flags) { - Q_D(QDeclarativeBinding); + Q_D(QQmlBinding); d->enabled = e; setNotifyOnValueChanged(e); @@ -425,63 +425,63 @@ void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteF update(flags); } -bool QDeclarativeBinding::enabled() const +bool QQmlBinding::enabled() const { - Q_D(const QDeclarativeBinding); + Q_D(const QQmlBinding); return d->enabled; } -QString QDeclarativeBinding::expression() const +QString QQmlBinding::expression() const { - return QDeclarativeExpression::expression(); + return QQmlExpression::expression(); } -int QDeclarativeBinding::propertyIndex() const +int QQmlBinding::propertyIndex() const { - Q_D(const QDeclarativeBinding); + Q_D(const QQmlBinding); return d->targetProperty; } -QObject *QDeclarativeBinding::object() const +QObject *QQmlBinding::object() const { - Q_D(const QDeclarativeBinding); + Q_D(const QQmlBinding); return d->target; } -void QDeclarativeBinding::retargetBinding(QObject *t, int i) +void QQmlBinding::retargetBinding(QObject *t, int i) { - Q_D(QDeclarativeBinding); + Q_D(QQmlBinding); d->target = t; d->targetProperty = i; } -QDeclarativeValueTypeProxyBinding::QDeclarativeValueTypeProxyBinding(QObject *o, int index) +QQmlValueTypeProxyBinding::QQmlValueTypeProxyBinding(QObject *o, int index) : m_object(o), m_index(index), m_bindings(0) { } -QDeclarativeValueTypeProxyBinding::~QDeclarativeValueTypeProxyBinding() +QQmlValueTypeProxyBinding::~QQmlValueTypeProxyBinding() { while (m_bindings) { - QDeclarativeAbstractBinding *binding = m_bindings; + QQmlAbstractBinding *binding = m_bindings; binding->setEnabled(false, 0); binding->destroy(); } } -void QDeclarativeValueTypeProxyBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) +void QQmlValueTypeProxyBinding::setEnabled(bool e, QQmlPropertyPrivate::WriteFlags flags) { if (e) { - QDeclarativeAbstractBinding *bindings = m_bindings; + QQmlAbstractBinding *bindings = m_bindings; recursiveEnable(bindings, flags); } else { - QDeclarativeAbstractBinding *bindings = m_bindings; + QQmlAbstractBinding *bindings = m_bindings; recursiveDisable(bindings); } } -void QDeclarativeValueTypeProxyBinding::recursiveEnable(QDeclarativeAbstractBinding *b, QDeclarativePropertyPrivate::WriteFlags flags) +void QQmlValueTypeProxyBinding::recursiveEnable(QQmlAbstractBinding *b, QQmlPropertyPrivate::WriteFlags flags) { if (!b) return; @@ -492,7 +492,7 @@ void QDeclarativeValueTypeProxyBinding::recursiveEnable(QDeclarativeAbstractBind b->setEnabled(true, flags); } -void QDeclarativeValueTypeProxyBinding::recursiveDisable(QDeclarativeAbstractBinding *b) +void QQmlValueTypeProxyBinding::recursiveDisable(QQmlAbstractBinding *b) { if (!b) return; @@ -503,13 +503,13 @@ void QDeclarativeValueTypeProxyBinding::recursiveDisable(QDeclarativeAbstractBin b->setEnabled(false, 0); } -void QDeclarativeValueTypeProxyBinding::update(QDeclarativePropertyPrivate::WriteFlags) +void QQmlValueTypeProxyBinding::update(QQmlPropertyPrivate::WriteFlags) { } -QDeclarativeAbstractBinding *QDeclarativeValueTypeProxyBinding::binding(int propertyIndex) +QQmlAbstractBinding *QQmlValueTypeProxyBinding::binding(int propertyIndex) { - QDeclarativeAbstractBinding *binding = m_bindings; + QQmlAbstractBinding *binding = m_bindings; while (binding && binding->propertyIndex() != propertyIndex) binding = binding->m_nextBinding; @@ -520,12 +520,12 @@ QDeclarativeAbstractBinding *QDeclarativeValueTypeProxyBinding::binding(int prop /*! Removes a collection of bindings, corresponding to the set bits in \a mask. */ -void QDeclarativeValueTypeProxyBinding::removeBindings(quint32 mask) +void QQmlValueTypeProxyBinding::removeBindings(quint32 mask) { - QDeclarativeAbstractBinding *binding = m_bindings; + QQmlAbstractBinding *binding = m_bindings; while (binding) { if (mask & (1 << (binding->propertyIndex() >> 24))) { - QDeclarativeAbstractBinding *remove = binding; + QQmlAbstractBinding *remove = binding; binding = remove->m_nextBinding; *remove->m_prevBinding = remove->m_nextBinding; if (remove->m_nextBinding) remove->m_nextBinding->m_prevBinding = remove->m_prevBinding; @@ -538,12 +538,12 @@ void QDeclarativeValueTypeProxyBinding::removeBindings(quint32 mask) } } -int QDeclarativeValueTypeProxyBinding::propertyIndex() const +int QQmlValueTypeProxyBinding::propertyIndex() const { return m_index; } -QObject *QDeclarativeValueTypeProxyBinding::object() const +QObject *QQmlValueTypeProxyBinding::object() const { return m_object; } diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/qml/qml/qqmlbinding_p.h index 61cf7dd550..33823d7e7e 100644 --- a/src/declarative/qml/qdeclarativebinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEBINDING_P_H -#define QDECLARATIVEBINDING_P_H +#ifndef QQMLBINDING_P_H +#define QQMLBINDING_P_H // // W A R N I N G @@ -53,11 +53,11 @@ // We mean it. // -#include "qdeclarative.h" -#include "qdeclarativepropertyvaluesource.h" -#include "qdeclarativeexpression.h" -#include "qdeclarativeproperty.h" -#include "qdeclarativeproperty_p.h" +#include "qqml.h" +#include "qqmlpropertyvaluesource.h" +#include "qqmlexpression.h" +#include "qqmlproperty.h" +#include "qqmlproperty_p.h" #include <QtCore/QObject> #include <QtCore/QMetaProperty> @@ -66,12 +66,12 @@ QT_BEGIN_NAMESPACE -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAbstractBinding +class Q_QML_PRIVATE_EXPORT QQmlAbstractBinding { public: - typedef QWeakPointer<QDeclarativeAbstractBinding> Pointer; + typedef QWeakPointer<QQmlAbstractBinding> Pointer; - QDeclarativeAbstractBinding(); + QQmlAbstractBinding(); virtual void destroy(); @@ -88,101 +88,101 @@ public: // binding is not enabled or added to the object. virtual QObject *object() const = 0; - void setEnabled(bool e) { setEnabled(e, QDeclarativePropertyPrivate::DontRemoveBinding); } - virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags) = 0; + void setEnabled(bool e) { setEnabled(e, QQmlPropertyPrivate::DontRemoveBinding); } + virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags) = 0; - void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); } - virtual void update(QDeclarativePropertyPrivate::WriteFlags) = 0; + void update() { update(QQmlPropertyPrivate::DontRemoveBinding); } + virtual void update(QQmlPropertyPrivate::WriteFlags) = 0; void addToObject(); void removeFromObject(); - static inline Pointer getPointer(QDeclarativeAbstractBinding *p); + static inline Pointer getPointer(QQmlAbstractBinding *p); protected: - virtual ~QDeclarativeAbstractBinding(); + virtual ~QQmlAbstractBinding(); void clear(); - // Called by QDeclarativePropertyPrivate to "move" a binding to a different property. - // This is only used for alias properties, and only used by QDeclarativeBinding not + // Called by QQmlPropertyPrivate to "move" a binding to a different property. + // This is only used for alias properties, and only used by QQmlBinding not // V8 or V4 bindings. The default implementation qFatal()'s to ensure that the // method is never called for V4 or V8 bindings. virtual void retargetBinding(QObject *, int); private: Pointer weakPointer(); - friend class QDeclarativeData; - friend class QDeclarativeComponentPrivate; - friend class QDeclarativeValueTypeProxyBinding; - friend class QDeclarativePropertyPrivate; - friend class QDeclarativeVME; - friend class QtSharedPointer::ExternalRefCount<QDeclarativeAbstractBinding>; + friend class QQmlData; + friend class QQmlComponentPrivate; + friend class QQmlValueTypeProxyBinding; + friend class QQmlPropertyPrivate; + friend class QQmlVME; + friend class QtSharedPointer::ExternalRefCount<QQmlAbstractBinding>; - typedef QSharedPointer<QDeclarativeAbstractBinding> SharedPointer; + typedef QSharedPointer<QQmlAbstractBinding> SharedPointer; // To save memory, we also store the rarely used weakPointer() instance in here - QPointerValuePair<QDeclarativeAbstractBinding*, SharedPointer> m_mePtr; + QPointerValuePair<QQmlAbstractBinding*, SharedPointer> m_mePtr; - QDeclarativeAbstractBinding **m_prevBinding; - QDeclarativeAbstractBinding *m_nextBinding; + QQmlAbstractBinding **m_prevBinding; + QQmlAbstractBinding *m_nextBinding; }; -class QDeclarativeValueTypeProxyBinding : public QDeclarativeAbstractBinding +class QQmlValueTypeProxyBinding : public QQmlAbstractBinding { public: - QDeclarativeValueTypeProxyBinding(QObject *o, int coreIndex); + QQmlValueTypeProxyBinding(QObject *o, int coreIndex); virtual Type bindingType() const { return ValueTypeProxy; } - virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags); - virtual void update(QDeclarativePropertyPrivate::WriteFlags); + virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags); + virtual void update(QQmlPropertyPrivate::WriteFlags); virtual int propertyIndex() const; virtual QObject *object() const; - QDeclarativeAbstractBinding *binding(int propertyIndex); + QQmlAbstractBinding *binding(int propertyIndex); void removeBindings(quint32 mask); protected: - ~QDeclarativeValueTypeProxyBinding(); + ~QQmlValueTypeProxyBinding(); private: - void recursiveEnable(QDeclarativeAbstractBinding *, QDeclarativePropertyPrivate::WriteFlags); - void recursiveDisable(QDeclarativeAbstractBinding *); + void recursiveEnable(QQmlAbstractBinding *, QQmlPropertyPrivate::WriteFlags); + void recursiveDisable(QQmlAbstractBinding *); - friend class QDeclarativeAbstractBinding; + friend class QQmlAbstractBinding; QObject *m_object; int m_index; - QDeclarativeAbstractBinding *m_bindings; + QQmlAbstractBinding *m_bindings; }; -class QDeclarativeContext; -class QDeclarativeBindingPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeBinding : public QDeclarativeExpression, - public QDeclarativeAbstractBinding +class QQmlContext; +class QQmlBindingPrivate; +class Q_QML_PRIVATE_EXPORT QQmlBinding : public QQmlExpression, + public QQmlAbstractBinding { Q_OBJECT public: enum EvaluateFlag { None = 0x00, RequiresThisObject = 0x01 }; Q_DECLARE_FLAGS(EvaluateFlags, EvaluateFlag) - QDeclarativeBinding(const QString &, QObject *, QDeclarativeContext *, QObject *parent=0); - QDeclarativeBinding(const QString &, QObject *, QDeclarativeContextData *, QObject *parent=0); - QDeclarativeBinding(const QString &, bool isRewritten, QObject *, QDeclarativeContextData *, + QQmlBinding(const QString &, QObject *, QQmlContext *, QObject *parent=0); + QQmlBinding(const QString &, QObject *, QQmlContextData *, QObject *parent=0); + QQmlBinding(const QString &, bool isRewritten, QObject *, QQmlContextData *, const QString &url, int lineNumber, int columnNumber = 0, QObject *parent=0); - QDeclarativeBinding(void *, QObject *, QDeclarativeContextData *, QObject *parent=0); + QQmlBinding(void *, QObject *, QQmlContextData *, QObject *parent=0); - void setTarget(const QDeclarativeProperty &); - void setTarget(QObject *, const QDeclarativePropertyData &, QDeclarativeContextData *); - QDeclarativeProperty property() const; + void setTarget(const QQmlProperty &); + void setTarget(QObject *, const QQmlPropertyData &, QQmlContextData *); + QQmlProperty property() const; void setEvaluateFlags(EvaluateFlags flags); EvaluateFlags evaluateFlags() const; bool enabled() const; - // Inherited from QDeclarativeAbstractBinding - virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags); - virtual void update(QDeclarativePropertyPrivate::WriteFlags flags); + // Inherited from QQmlAbstractBinding + virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags flags); + virtual void update(QQmlPropertyPrivate::WriteFlags flags); virtual QString expression() const; virtual int propertyIndex() const; virtual QObject *object() const; @@ -190,30 +190,30 @@ public: typedef int Identifier; static Identifier Invalid; - static QDeclarativeBinding *createBinding(Identifier, QObject *, QDeclarativeContext *, + static QQmlBinding *createBinding(Identifier, QObject *, QQmlContext *, const QString &, int, QObject *parent=0); public Q_SLOTS: - void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); } + void update() { update(QQmlPropertyPrivate::DontRemoveBinding); } protected: - ~QDeclarativeBinding(); + ~QQmlBinding(); private: - Q_DECLARE_PRIVATE(QDeclarativeBinding) + Q_DECLARE_PRIVATE(QQmlBinding) }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeBinding::EvaluateFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlBinding::EvaluateFlags) -QDeclarativeAbstractBinding::Pointer -QDeclarativeAbstractBinding::getPointer(QDeclarativeAbstractBinding *p) +QQmlAbstractBinding::Pointer +QQmlAbstractBinding::getPointer(QQmlAbstractBinding *p) { return p ? p->weakPointer() : Pointer(); } QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeBinding*) +Q_DECLARE_METATYPE(QQmlBinding*) -#endif // QDECLARATIVEBINDING_P_H +#endif // QQMLBINDING_P_H diff --git a/src/declarative/qml/qdeclarativebinding_p_p.h b/src/qml/qml/qqmlbinding_p_p.h index 030bd32ef3..b53c903916 100644 --- a/src/declarative/qml/qdeclarativebinding_p_p.h +++ b/src/qml/qml/qqmlbinding_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEBINDING_P_P_H -#define QDECLARATIVEBINDING_P_P_H +#ifndef QQMLBINDING_P_P_H +#define QQMLBINDING_P_P_H // // W A R N I N G @@ -53,23 +53,23 @@ // We mean it. // -#include "qdeclarativebinding_p.h" +#include "qqmlbinding_p.h" -#include "qdeclarativeproperty.h" -#include "qdeclarativeexpression_p.h" +#include "qqmlproperty.h" +#include "qqmlexpression_p.h" QT_BEGIN_NAMESPACE -class QDeclarativeBindingPrivate : public QDeclarativeExpressionPrivate +class QQmlBindingPrivate : public QQmlExpressionPrivate { - Q_DECLARE_PUBLIC(QDeclarativeBinding) + Q_DECLARE_PUBLIC(QQmlBinding) public: - QDeclarativeBindingPrivate(); - ~QDeclarativeBindingPrivate(); + QQmlBindingPrivate(); + ~QQmlBindingPrivate(); virtual void expressionChanged(); - static void printBindingLoopError(QDeclarativeProperty &prop); + static void printBindingLoopError(QQmlProperty &prop); protected: virtual void refresh(); @@ -78,7 +78,7 @@ private: bool updating:1; bool enabled:1; int columnNumber; - QDeclarativeProperty property; + QQmlProperty property; QObject *target; int targetProperty; @@ -86,4 +86,4 @@ private: QT_END_NAMESPACE -#endif // QDECLARATIVEBINDING_P_P_H +#endif // QQMLBINDING_P_P_H diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index 5d1c28b095..6f552450ef 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativeboundsignal_p.h" +#include "qqmlboundsignal_p.h" #include <private/qmetaobjectbuilder_p.h> -#include "qdeclarativeengine_p.h" -#include "qdeclarativeexpression_p.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativemetatype_p.h" -#include "qdeclarative.h" -#include "qdeclarativecontext.h" -#include "qdeclarativeglobal_p.h" -#include <private/qdeclarativeprofilerservice_p.h> +#include "qqmlengine_p.h" +#include "qqmlexpression_p.h" +#include "qqmlcontext_p.h" +#include "qqmlmetatype_p.h" +#include "qqml.h" +#include "qqmlcontext.h" +#include "qqmlglobal_p.h" +#include <private/qqmlprofilerservice_p.h> #include <private/qv8debugservice_p.h> #include <QtCore/qstringbuilder.h> @@ -57,12 +57,12 @@ QT_BEGIN_NAMESPACE -class QDeclarativeBoundSignalParameters : public QObject +class QQmlBoundSignalParameters : public QObject { Q_OBJECT public: - QDeclarativeBoundSignalParameters(const QMetaMethod &, QObject * = 0); - ~QDeclarativeBoundSignalParameters(); + QQmlBoundSignalParameters(const QMetaMethod &, QObject * = 0); + ~QQmlBoundSignalParameters(); void setValues(void **); void clearValues(); @@ -71,13 +71,13 @@ private: friend class MetaObject; int metaCall(QMetaObject::Call, int _id, void **); struct MetaObject : public QAbstractDynamicMetaObject { - MetaObject(QDeclarativeBoundSignalParameters *b) + MetaObject(QQmlBoundSignalParameters *b) : parent(b) {} int metaCall(QMetaObject::Call c, int id, void **a) { return parent->metaCall(c, id, a); } - QDeclarativeBoundSignalParameters *parent; + QQmlBoundSignalParameters *parent; }; int *types; @@ -87,16 +87,16 @@ private: static int evaluateIdx = -1; -QDeclarativeAbstractBoundSignal::QDeclarativeAbstractBoundSignal(QObject *parent) +QQmlAbstractBoundSignal::QQmlAbstractBoundSignal(QObject *parent) : QObject(parent) { } -QDeclarativeAbstractBoundSignal::~QDeclarativeAbstractBoundSignal() +QQmlAbstractBoundSignal::~QQmlAbstractBoundSignal() { } -QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal, +QQmlBoundSignal::QQmlBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent) : m_expression(0), m_signal(signal), m_paramsValid(false), m_isEvaluating(false), m_params(0) { @@ -105,11 +105,11 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMeth // is that they both do the work to figure it out. Boo hoo. if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount(); - QDeclarative_setParent_noEvent(this, parent); - QDeclarativePropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx); + QQml_setParent_noEvent(this, parent); + QQmlPropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx); } -QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val, +QQmlBoundSignal::QQmlBoundSignal(QQmlContext *ctxt, const QString &val, QObject *scope, const QMetaMethod &signal, QObject *parent) : m_expression(0), m_signal(signal), m_paramsValid(false), m_isEvaluating(false), m_params(0) @@ -119,19 +119,19 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, cons // is that they both do the work to figure it out. Boo hoo. if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount(); - QDeclarative_setParent_noEvent(this, parent); - QDeclarativePropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx); + QQml_setParent_noEvent(this, parent); + QQmlPropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx); - m_expression = new QDeclarativeExpression(ctxt, scope, val); + m_expression = new QQmlExpression(ctxt, scope, val); } -QDeclarativeBoundSignal::~QDeclarativeBoundSignal() +QQmlBoundSignal::~QQmlBoundSignal() { delete m_expression; m_expression = 0; } -int QDeclarativeBoundSignal::index() const +int QQmlBoundSignal::index() const { return m_signal.methodIndex(); } @@ -139,7 +139,7 @@ int QDeclarativeBoundSignal::index() const /*! Returns the signal expression. */ -QDeclarativeExpression *QDeclarativeBoundSignal::expression() const +QQmlExpression *QQmlBoundSignal::expression() const { return m_expression; } @@ -148,57 +148,57 @@ QDeclarativeExpression *QDeclarativeBoundSignal::expression() const Sets the signal expression to \a e. Returns the current signal expression, or null if there is no signal expression. - The QDeclarativeBoundSignal instance takes ownership of \a e. The caller is - assumes ownership of the returned QDeclarativeExpression. + The QQmlBoundSignal instance takes ownership of \a e. The caller is + assumes ownership of the returned QQmlExpression. */ -QDeclarativeExpression *QDeclarativeBoundSignal::setExpression(QDeclarativeExpression *e) +QQmlExpression *QQmlBoundSignal::setExpression(QQmlExpression *e) { - QDeclarativeExpression *rv = m_expression; + QQmlExpression *rv = m_expression; m_expression = e; if (m_expression) m_expression->setNotifyOnValueChanged(false); return rv; } -QDeclarativeBoundSignal *QDeclarativeBoundSignal::cast(QObject *o) +QQmlBoundSignal *QQmlBoundSignal::cast(QObject *o) { - QDeclarativeAbstractBoundSignal *s = qobject_cast<QDeclarativeAbstractBoundSignal*>(o); - return static_cast<QDeclarativeBoundSignal *>(s); + QQmlAbstractBoundSignal *s = qobject_cast<QQmlAbstractBoundSignal*>(o); + return static_cast<QQmlBoundSignal *>(s); } -int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) +int QQmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) { if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) { if (!m_expression) return -1; - if (QDeclarativeDebugService::isDebuggingEnabled()) { - QDeclarativeProfilerService::startRange(QDeclarativeProfilerService::HandlingSignal); - QDeclarativeProfilerService::rangeData(QDeclarativeProfilerService::HandlingSignal, QLatin1String(m_signal.signature()) % QLatin1String(": ") % m_expression->expression()); - QDeclarativeProfilerService::rangeLocation(QDeclarativeProfilerService::HandlingSignal, m_expression->sourceFile(), m_expression->lineNumber(), m_expression->columnNumber()); + if (QQmlDebugService::isDebuggingEnabled()) { + QQmlProfilerService::startRange(QQmlProfilerService::HandlingSignal); + QQmlProfilerService::rangeData(QQmlProfilerService::HandlingSignal, QLatin1String(m_signal.signature()) % QLatin1String(": ") % m_expression->expression()); + QQmlProfilerService::rangeLocation(QQmlProfilerService::HandlingSignal, m_expression->sourceFile(), m_expression->lineNumber(), m_expression->columnNumber()); QV8DebugService::instance()->signalEmitted(QString::fromAscii(m_signal.signature())); } m_isEvaluating = true; if (!m_paramsValid) { if (!m_signal.parameterTypes().isEmpty()) - m_params = new QDeclarativeBoundSignalParameters(m_signal, this); + m_params = new QQmlBoundSignalParameters(m_signal, this); m_paramsValid = true; } if (m_params) m_params->setValues(a); if (m_expression && m_expression->engine()) { - QDeclarativeExpressionPrivate::get(m_expression)->value(m_params); + QQmlExpressionPrivate::get(m_expression)->value(m_params); if (m_expression && m_expression->hasError()) - QDeclarativeEnginePrivate::warning(m_expression->engine(), m_expression->error()); + QQmlEnginePrivate::warning(m_expression->engine(), m_expression->error()); } if (m_params) m_params->clearValues(); m_isEvaluating = false; - QDeclarativeProfilerService::endRange(QDeclarativeProfilerService::HandlingSignal); + QQmlProfilerService::endRange(QQmlProfilerService::HandlingSignal); return -1; } else { return QObject::qt_metacall(c, id, a); } } -QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMetaMethod &method, +QQmlBoundSignalParameters::QQmlBoundSignalParameters(const QMetaMethod &method, QObject *parent) : QObject(parent), types(0), values(0) { @@ -206,8 +206,8 @@ QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMeta // ### Optimize! QMetaObjectBuilder mob; - mob.setSuperClass(&QDeclarativeBoundSignalParameters::staticMetaObject); - mob.setClassName("QDeclarativeBoundSignalParameters"); + mob.setSuperClass(&QQmlBoundSignalParameters::staticMetaObject); + mob.setClassName("QQmlBoundSignalParameters"); QList<QByteArray> paramTypes = method.parameterTypes(); QList<QByteArray> paramNames = method.parameterNames(); @@ -222,7 +222,7 @@ QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMeta } QVariant::Type t = (QVariant::Type)QMetaType::type(type.constData()); - if (QDeclarativeMetaType::isQObject(t)) { + if (QQmlMetaType::isQObject(t)) { types[ii] = QMetaType::QObjectStar; QMetaPropertyBuilder prop = mob.addProperty(name, "QObject*"); prop.setWritable(false); @@ -263,23 +263,23 @@ QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMeta d_ptr->metaObject = mo; } -QDeclarativeBoundSignalParameters::~QDeclarativeBoundSignalParameters() +QQmlBoundSignalParameters::~QQmlBoundSignalParameters() { delete [] types; free(myMetaObject); } -void QDeclarativeBoundSignalParameters::setValues(void **v) +void QQmlBoundSignalParameters::setValues(void **v) { values = v; } -void QDeclarativeBoundSignalParameters::clearValues() +void QQmlBoundSignalParameters::clearValues() { values = 0; } -int QDeclarativeBoundSignalParameters::metaCall(QMetaObject::Call c, int id, void **a) +int QQmlBoundSignalParameters::metaCall(QMetaObject::Call c, int id, void **a) { if (!values) return -1; @@ -297,4 +297,4 @@ int QDeclarativeBoundSignalParameters::metaCall(QMetaObject::Call c, int id, voi QT_END_NAMESPACE -#include <qdeclarativeboundsignal.moc> +#include <qqmlboundsignal.moc> diff --git a/src/declarative/qml/qdeclarativeboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h index b747d9d7a5..11386159cb 100644 --- a/src/declarative/qml/qdeclarativeboundsignal_p.h +++ b/src/qml/qml/qqmlboundsignal_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEBOUNDSIGNAL_P_H -#define QDECLARATIVEBOUNDSIGNAL_P_H +#ifndef QQMLBOUNDSIGNAL_P_H +#define QQMLBOUNDSIGNAL_P_H // // W A R N I N G @@ -53,7 +53,7 @@ // We mean it. // -#include "qdeclarativeexpression.h" +#include "qqmlexpression.h" #include <QtCore/qmetaobject.h> @@ -61,43 +61,43 @@ QT_BEGIN_NAMESPACE -class Q_DECLARATIVE_EXPORT QDeclarativeAbstractBoundSignal : public QObject +class Q_QML_EXPORT QQmlAbstractBoundSignal : public QObject { Q_OBJECT public: - QDeclarativeAbstractBoundSignal(QObject *parent = 0); - virtual ~QDeclarativeAbstractBoundSignal() = 0; + QQmlAbstractBoundSignal(QObject *parent = 0); + virtual ~QQmlAbstractBoundSignal() = 0; }; -class QDeclarativeBoundSignalParameters; -class Q_DECLARATIVE_EXPORT QDeclarativeBoundSignal : public QDeclarativeAbstractBoundSignal +class QQmlBoundSignalParameters; +class Q_QML_EXPORT QQmlBoundSignal : public QQmlAbstractBoundSignal { public: - QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent); - QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val, QObject *scope, + QQmlBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent); + QQmlBoundSignal(QQmlContext *ctxt, const QString &val, QObject *scope, const QMetaMethod &signal, QObject *parent); - virtual ~QDeclarativeBoundSignal(); + virtual ~QQmlBoundSignal(); int index() const; - QDeclarativeExpression *expression() const; - QDeclarativeExpression *setExpression(QDeclarativeExpression *); + QQmlExpression *expression() const; + QQmlExpression *setExpression(QQmlExpression *); bool isEvaluating() const { return m_isEvaluating; } - static QDeclarativeBoundSignal *cast(QObject *); + static QQmlBoundSignal *cast(QObject *); protected: virtual int qt_metacall(QMetaObject::Call c, int id, void **a); private: - QDeclarativeExpression *m_expression; + QQmlExpression *m_expression; QMetaMethod m_signal; bool m_paramsValid : 1; bool m_isEvaluating : 1; - QDeclarativeBoundSignalParameters *m_params; + QQmlBoundSignalParameters *m_params; }; QT_END_NAMESPACE -#endif // QDECLARATIVEBOUNDSIGNAL_P_H +#endif // QQMLBOUNDSIGNAL_P_H diff --git a/src/declarative/qml/qdeclarativecleanup.cpp b/src/qml/qml/qqmlcleanup.cpp index aa7a1e3254..21ea02ee17 100644 --- a/src/declarative/qml/qdeclarativecleanup.cpp +++ b/src/qml/qml/qqmlcleanup.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,35 +39,35 @@ ** ****************************************************************************/ -#include "qdeclarativecleanup_p.h" +#include "qqmlcleanup_p.h" -#include "qdeclarativeengine_p.h" +#include "qqmlengine_p.h" QT_BEGIN_NAMESPACE /*! \internal -\class QDeclarativeCleanup -\brief The QDeclarativeCleanup provides a callback when a QDeclarativeEngine is deleted. +\class QQmlCleanup +\brief The QQmlCleanup provides a callback when a QQmlEngine is deleted. -Any object that needs cleanup to occur before the QDeclarativeEngine's V8 engine is -destroyed should inherit from QDeclarativeCleanup. The clear() virtual method will be -called by QDeclarativeEngine just before it destroys the context. +Any object that needs cleanup to occur before the QQmlEngine's V8 engine is +destroyed should inherit from QQmlCleanup. The clear() virtual method will be +called by QQmlEngine just before it destroys the context. */ /* -Create a QDeclarativeCleanup that is not associated with any engine. +Create a QQmlCleanup that is not associated with any engine. */ -QDeclarativeCleanup::QDeclarativeCleanup() +QQmlCleanup::QQmlCleanup() : prev(0), next(0), engine(0) { } /*! -Create a QDeclarativeCleanup for \a engine +Create a QQmlCleanup for \a engine */ -QDeclarativeCleanup::QDeclarativeCleanup(QDeclarativeEngine *engine) +QQmlCleanup::QQmlCleanup(QQmlEngine *engine) : prev(0), next(0), engine(0) { if (!engine) @@ -80,14 +80,14 @@ QDeclarativeCleanup::QDeclarativeCleanup(QDeclarativeEngine *engine) Adds this object to \a engine's cleanup list. hasEngine() must be false before calling this method. */ -void QDeclarativeCleanup::addToEngine(QDeclarativeEngine *engine) +void QQmlCleanup::addToEngine(QQmlEngine *engine) { Q_ASSERT(engine); - Q_ASSERT(QDeclarativeEnginePrivate::isEngineThread(engine)); + Q_ASSERT(QQmlEnginePrivate::isEngineThread(engine)); this->engine = engine; - QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine); + QQmlEnginePrivate *p = QQmlEnginePrivate::get(engine); if (p->cleanup) next = p->cleanup; p->cleanup = this; @@ -96,18 +96,18 @@ void QDeclarativeCleanup::addToEngine(QDeclarativeEngine *engine) } /*! -\fn bool QDeclarativeCleanup::hasEngine() const +\fn bool QQmlCleanup::hasEngine() const -Returns true if this QDeclarativeCleanup is associated with an engine, otherwise false. +Returns true if this QQmlCleanup is associated with an engine, otherwise false. */ /*! \internal */ -QDeclarativeCleanup::~QDeclarativeCleanup() +QQmlCleanup::~QQmlCleanup() { Q_ASSERT(!prev || engine); - Q_ASSERT(!prev || QDeclarativeEnginePrivate::isEngineThread(engine)); + Q_ASSERT(!prev || QQmlEnginePrivate::isEngineThread(engine)); if (prev) *prev = next; if (next) next->prev = prev; diff --git a/src/declarative/qml/qdeclarativecleanup_p.h b/src/qml/qml/qqmlcleanup_p.h index bf84269698..2b7747d630 100644 --- a/src/declarative/qml/qdeclarativecleanup_p.h +++ b/src/qml/qml/qqmlcleanup_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECLEANUP_P_H -#define QDECLARATIVECLEANUP_P_H +#ifndef QQMLCLEANUP_P_H +#define QQMLCLEANUP_P_H -#include <QtCore/qglobal.h> +#include <QtQml/qtqmlglobal.h> // // W A R N I N G @@ -57,31 +57,31 @@ QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; // Exported for QtQuick1 -class Q_DECLARATIVE_EXPORT QDeclarativeCleanup +class Q_QML_EXPORT QQmlCleanup { public: - QDeclarativeCleanup(); - QDeclarativeCleanup(QDeclarativeEngine *); - virtual ~QDeclarativeCleanup(); + QQmlCleanup(); + QQmlCleanup(QQmlEngine *); + virtual ~QQmlCleanup(); bool hasEngine() const { return prev != 0; } - void addToEngine(QDeclarativeEngine *); + void addToEngine(QQmlEngine *); protected: virtual void clear() = 0; private: - friend class QDeclarativeEnginePrivate; - QDeclarativeCleanup **prev; - QDeclarativeCleanup *next; + friend class QQmlEnginePrivate; + QQmlCleanup **prev; + QQmlCleanup *next; // Only used for asserts - QDeclarativeEngine *engine; + QQmlEngine *engine; }; QT_END_NAMESPACE -#endif // QDECLARATIVECLEANUP_P_H +#endif // QQMLCLEANUP_P_H diff --git a/src/declarative/qml/qdeclarativecompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp index 6ace1d3042..6a68784219 100644 --- a/src/declarative/qml/qdeclarativecompileddata.cpp +++ b/src/qml/qml/qqmlcompileddata.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#include "qdeclarativecompiler_p.h" -#include "qdeclarativeengine.h" -#include "qdeclarativecomponent.h" -#include "qdeclarativecomponent_p.h" -#include "qdeclarativecontext.h" -#include "qdeclarativecontext_p.h" +#include "qqmlcompiler_p.h" +#include "qqmlengine.h" +#include "qqmlcomponent.h" +#include "qqmlcomponent_p.h" +#include "qqmlcontext.h" +#include "qqmlcontext_p.h" #ifdef QML_THREADED_VME_INTERPRETER -#include "qdeclarativevme_p.h" +#include "qqmlvme_p.h" #endif #include <QtCore/qdebug.h> @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE -int QDeclarativeCompiledData::pack(const char *data, size_t size) +int QQmlCompiledData::pack(const char *data, size_t size) { const char *p = packData.constData(); unsigned int ps = packData.size(); @@ -70,7 +70,7 @@ int QDeclarativeCompiledData::pack(const char *data, size_t size) return rv; } -int QDeclarativeCompiledData::indexForString(const QString &data) +int QQmlCompiledData::indexForString(const QString &data) { int idx = primitives.indexOf(data); if (idx == -1) { @@ -80,7 +80,7 @@ int QDeclarativeCompiledData::indexForString(const QString &data) return idx; } -int QDeclarativeCompiledData::indexForByteArray(const QByteArray &data) +int QQmlCompiledData::indexForByteArray(const QByteArray &data) { int idx = datas.indexOf(data); if (idx == -1) { @@ -90,7 +90,7 @@ int QDeclarativeCompiledData::indexForByteArray(const QByteArray &data) return idx; } -int QDeclarativeCompiledData::indexForUrl(const QUrl &data) +int QQmlCompiledData::indexForUrl(const QUrl &data) { int idx = urls.indexOf(data); if (idx == -1) { @@ -100,7 +100,7 @@ int QDeclarativeCompiledData::indexForUrl(const QUrl &data) return idx; } -QDeclarativeCompiledData::QDeclarativeCompiledData(QDeclarativeEngine *engine) +QQmlCompiledData::QQmlCompiledData(QQmlEngine *engine) : engine(engine), importCache(0), root(0), rootPropertyCache(0) { Q_ASSERT(engine); @@ -108,15 +108,15 @@ QDeclarativeCompiledData::QDeclarativeCompiledData(QDeclarativeEngine *engine) bytecode.reserve(1024); } -void QDeclarativeCompiledData::destroy() +void QQmlCompiledData::destroy() { if (engine && hasEngine()) - QDeclarativeEnginePrivate::deleteInEngineThread(engine, this); + QQmlEnginePrivate::deleteInEngineThread(engine, this); else delete this; } -QDeclarativeCompiledData::~QDeclarativeCompiledData() +QQmlCompiledData::~QQmlCompiledData() { clear(); @@ -143,13 +143,13 @@ QDeclarativeCompiledData::~QDeclarativeCompiledData() rootPropertyCache->release(); } -void QDeclarativeCompiledData::clear() +void QQmlCompiledData::clear() { for (int ii = 0; ii < programs.count(); ++ii) qPersistentDispose(programs[ii].bindings); } -const QMetaObject *QDeclarativeCompiledData::TypeReference::metaObject() const +const QMetaObject *QQmlCompiledData::TypeReference::metaObject() const { if (type) { return type->metaObject(); @@ -162,7 +162,7 @@ const QMetaObject *QDeclarativeCompiledData::TypeReference::metaObject() const /*! Returns the property cache, if one alread exists. The cache is not referenced. */ -QDeclarativePropertyCache *QDeclarativeCompiledData::TypeReference::propertyCache() const +QQmlPropertyCache *QQmlCompiledData::TypeReference::propertyCache() const { if (type) return typePropertyCache; @@ -173,12 +173,12 @@ QDeclarativePropertyCache *QDeclarativeCompiledData::TypeReference::propertyCach /*! Returns the property cache, creating one if it doesn't already exist. The cache is not referenced. */ -QDeclarativePropertyCache *QDeclarativeCompiledData::TypeReference::createPropertyCache(QDeclarativeEngine *engine) +QQmlPropertyCache *QQmlCompiledData::TypeReference::createPropertyCache(QQmlEngine *engine) { if (typePropertyCache) { return typePropertyCache; } else if (type) { - typePropertyCache = QDeclarativeEnginePrivate::get(engine)->cache(type->metaObject()); + typePropertyCache = QQmlEnginePrivate::get(engine)->cache(type->metaObject()); typePropertyCache->addref(); return typePropertyCache; } else { @@ -187,7 +187,7 @@ QDeclarativePropertyCache *QDeclarativeCompiledData::TypeReference::createProper } -void QDeclarativeCompiledData::dumpInstructions() +void QQmlCompiledData::dumpInstructions() { if (!name.isEmpty()) qWarning() << name; @@ -199,63 +199,63 @@ void QDeclarativeCompiledData::dumpInstructions() int instructionCount = 0; while (instructionStream < endInstructionStream) { - QDeclarativeInstruction *instr = (QDeclarativeInstruction *)instructionStream; + QQmlInstruction *instr = (QQmlInstruction *)instructionStream; dump(instr, instructionCount); - instructionStream += QDeclarativeInstruction::size(instructionType(instr)); + instructionStream += QQmlInstruction::size(instructionType(instr)); instructionCount++; } qWarning().nospace() << "-------------------------------------------------------------------------------"; } -int QDeclarativeCompiledData::addInstructionHelper(QDeclarativeInstruction::Type type, QDeclarativeInstruction &instr) +int QQmlCompiledData::addInstructionHelper(QQmlInstruction::Type type, QQmlInstruction &instr) { #ifdef QML_THREADED_VME_INTERPRETER - instr.common.code = QDeclarativeVME::instructionJumpTable()[static_cast<int>(type)]; + instr.common.code = QQmlVME::instructionJumpTable()[static_cast<int>(type)]; #else instr.common.instructionType = type; #endif int ptrOffset = bytecode.size(); - int size = QDeclarativeInstruction::size(type); + int size = QQmlInstruction::size(type); if (bytecode.capacity() <= bytecode.size() + size) bytecode.reserve(bytecode.size() + size + 512); bytecode.append(reinterpret_cast<const char *>(&instr), size); return ptrOffset; } -int QDeclarativeCompiledData::nextInstructionIndex() +int QQmlCompiledData::nextInstructionIndex() { return bytecode.size(); } -QDeclarativeInstruction *QDeclarativeCompiledData::instruction(int index) +QQmlInstruction *QQmlCompiledData::instruction(int index) { - return (QDeclarativeInstruction *)(bytecode.constData() + index); + return (QQmlInstruction *)(bytecode.constData() + index); } -QDeclarativeInstruction::Type QDeclarativeCompiledData::instructionType(const QDeclarativeInstruction *instr) +QQmlInstruction::Type QQmlCompiledData::instructionType(const QQmlInstruction *instr) { #ifdef QML_THREADED_VME_INTERPRETER - void **jumpTable = QDeclarativeVME::instructionJumpTable(); + void **jumpTable = QQmlVME::instructionJumpTable(); void *code = instr->common.code; # define QML_CHECK_INSTR_CODE(I, FMT) \ - if (jumpTable[static_cast<int>(QDeclarativeInstruction::I)] == code) \ - return QDeclarativeInstruction::I; + if (jumpTable[static_cast<int>(QQmlInstruction::I)] == code) \ + return QQmlInstruction::I; FOR_EACH_QML_INSTR(QML_CHECK_INSTR_CODE) Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid instruction address"); - return static_cast<QDeclarativeInstruction::Type>(0); + return static_cast<QQmlInstruction::Type>(0); # undef QML_CHECK_INSTR_CODE #else - return static_cast<QDeclarativeInstruction::Type>(instr->common.instructionType); + return static_cast<QQmlInstruction::Type>(instr->common.instructionType); #endif } -void QDeclarativeCompiledData::initialize(QDeclarativeEngine *engine) +void QQmlCompiledData::initialize(QQmlEngine *engine) { Q_ASSERT(!hasEngine()); - QDeclarativeCleanup::addToEngine(engine); + QQmlCleanup::addToEngine(engine); } QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index c4efc85461..65247e1e80 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,28 +39,28 @@ ** ****************************************************************************/ -#include "qdeclarativecompiler_p.h" +#include "qqmlcompiler_p.h" -#include "qdeclarativepropertyvaluesource.h" -#include "qdeclarativecomponent.h" +#include "qqmlpropertyvaluesource.h" +#include "qqmlcomponent.h" #include <private/qmetaobjectbuilder_p.h> #include <private/qfastmetabuilder_p.h> -#include "qdeclarativestringconverters_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativeengine.h" -#include "qdeclarativecontext.h" -#include "qdeclarativemetatype_p.h" -#include "qdeclarativecustomparser_p_p.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativecomponent_p.h" -#include <private/qdeclarativejsast_p.h> -#include "qdeclarativevmemetaobject_p.h" -#include "qdeclarativeexpression_p.h" -#include "qdeclarativeproperty_p.h" -#include "qdeclarativerewrite_p.h" -#include "qdeclarativescriptstring.h" -#include "qdeclarativeglobal_p.h" -#include "qdeclarativebinding_p.h" +#include "qqmlstringconverters_p.h" +#include "qqmlengine_p.h" +#include "qqmlengine.h" +#include "qqmlcontext.h" +#include "qqmlmetatype_p.h" +#include "qqmlcustomparser_p_p.h" +#include "qqmlcontext_p.h" +#include "qqmlcomponent_p.h" +#include <private/qqmljsast_p.h> +#include "qqmlvmemetaobject_p.h" +#include "qqmlexpression_p.h" +#include "qqmlproperty_p.h" +#include "qqmlrewrite_p.h" +#include "qqmlscriptstring.h" +#include "qqmlglobal_p.h" +#include "qqmlbinding_p.h" #include <private/qv4compiler_p.h> #include <QColor> @@ -83,9 +83,9 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP); DEFINE_BOOL_CONFIG_OPTION(compilerStatDump, QML_COMPILER_STATS); -using namespace QDeclarativeJS; -using namespace QDeclarativeScript; -using namespace QDeclarativeCompilerTypes; +using namespace QQmlJS; +using namespace QQmlScript; +using namespace QQmlCompilerTypes; static QString id_string(QLatin1String("id")); static QString on_string(QLatin1String("on")); @@ -96,9 +96,9 @@ static QString qsTr_string(QLatin1String("qsTr")); static QString qsTrId_string(QLatin1String("qsTrId")); /*! - Instantiate a new QDeclarativeCompiler. + Instantiate a new QQmlCompiler. */ -QDeclarativeCompiler::QDeclarativeCompiler(QDeclarativePool *pool) +QQmlCompiler::QQmlCompiler(QQmlPool *pool) : pool(pool), output(0), engine(0), unitRoot(0), unit(0), cachedComponentTypeRef(-1), cachedTranslationContextIndex(-1), componentStats(0) { @@ -111,7 +111,7 @@ QDeclarativeCompiler::QDeclarativeCompiler(QDeclarativePool *pool) \sa errors() */ -bool QDeclarativeCompiler::isError() const +bool QQmlCompiler::isError() const { return !exceptions.isEmpty(); } @@ -120,7 +120,7 @@ bool QDeclarativeCompiler::isError() const Return the list of errors from the last call to compile(), or an empty list if there were no errors. */ -QList<QDeclarativeError> QDeclarativeCompiler::errors() const +QList<QQmlError> QQmlCompiler::errors() const { return exceptions; } @@ -130,12 +130,12 @@ QList<QDeclarativeError> QDeclarativeCompiler::errors() const Attached property names are those that start with a capital letter. */ -bool QDeclarativeCompiler::isAttachedPropertyName(const QString &name) +bool QQmlCompiler::isAttachedPropertyName(const QString &name) { return isAttachedPropertyName(QHashedStringRef(&name)); } -bool QDeclarativeCompiler::isAttachedPropertyName(const QHashedStringRef &name) +bool QQmlCompiler::isAttachedPropertyName(const QHashedStringRef &name) { return !name.isEmpty() && name.at(0).isUpper(); } @@ -151,12 +151,12 @@ bool QDeclarativeCompiler::isAttachedPropertyName(const QHashedStringRef &name) character codes in property names, for simplicity and performance reasons QML only supports letters, numbers and underscores. */ -bool QDeclarativeCompiler::isSignalPropertyName(const QString &name) +bool QQmlCompiler::isSignalPropertyName(const QString &name) { return isSignalPropertyName(QStringRef(&name)); } -bool QDeclarativeCompiler::isSignalPropertyName(const QHashedStringRef &name) +bool QQmlCompiler::isSignalPropertyName(const QHashedStringRef &name) { if (name.length() < 3) return false; if (!name.startsWith(on_string)) return false; @@ -173,7 +173,7 @@ bool QDeclarativeCompiler::isSignalPropertyName(const QHashedStringRef &name) /*! \macro COMPILE_EXCEPTION \internal - Inserts an error into the QDeclarativeCompiler error list, and returns false + Inserts an error into the QQmlCompiler error list, and returns false (failure). \a token is used to source the error line and column, and \a desc is the @@ -187,7 +187,7 @@ bool QDeclarativeCompiler::isSignalPropertyName(const QHashedStringRef &name) */ #define COMPILE_EXCEPTION_LOCATION(line, column, desc) \ { \ - QDeclarativeError error; \ + QQmlError error; \ error.setUrl(output->url); \ error.setLine(line); \ error.setColumn(column); \ @@ -216,10 +216,10 @@ bool QDeclarativeCompiler::isSignalPropertyName(const QHashedStringRef &name) This test corresponds to action taken by genLiteralAssignment(). Any change made here, must have a corresponding action in genLiteralAssigment(). */ -bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Value *v) +bool QQmlCompiler::testLiteralAssignment(QQmlScript::Property *prop, + QQmlScript::Value *v) { - const QDeclarativeScript::Variant &value = v->value; + const QQmlScript::Variant &value = v->value; if (!prop->core.isWritable() && !prop->isReadOnlyDeclaration) COMPILE_EXCEPTION(v, tr("Invalid property assignment: \"%1\" is a read-only property").arg(prop->name().toString())); @@ -236,7 +236,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: unknown enumeration")); - v->value = QDeclarativeScript::Variant((double)enumValue); + v->value = QQmlScript::Variant((double)enumValue); return true; } @@ -291,7 +291,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::Color: { bool ok; - QDeclarativeStringConverters::colorFromString(value.asString(), &ok); + QQmlStringConverters::colorFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: color expected")); } break; @@ -299,21 +299,21 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::Date: { bool ok; - QDeclarativeStringConverters::dateFromString(value.asString(), &ok); + QQmlStringConverters::dateFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: date expected")); } break; case QVariant::Time: { bool ok; - QDeclarativeStringConverters::timeFromString(value.asString(), &ok); + QQmlStringConverters::timeFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: time expected")); } break; case QVariant::DateTime: { bool ok; - QDeclarativeStringConverters::dateTimeFromString(value.asString(), &ok); + QQmlStringConverters::dateTimeFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: datetime expected")); } break; @@ -322,7 +322,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::PointF: { bool ok; - QDeclarativeStringConverters::pointFFromString(value.asString(), &ok); + QQmlStringConverters::pointFFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: point expected")); } break; @@ -330,7 +330,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::SizeF: { bool ok; - QDeclarativeStringConverters::sizeFFromString(value.asString(), &ok); + QQmlStringConverters::sizeFFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: size expected")); } break; @@ -338,7 +338,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::RectF: { bool ok; - QDeclarativeStringConverters::rectFFromString(value.asString(), &ok); + QQmlStringConverters::rectFFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: rect expected")); } break; @@ -350,14 +350,14 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::Vector3D: { bool ok; - QDeclarativeStringConverters::vector3DFromString(value.asString(), &ok); + QQmlStringConverters::vector3DFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: 3D vector expected")); } break; case QVariant::Vector4D: { bool ok; - QDeclarativeStringConverters::vector4DFromString(value.asString(), &ok); + QQmlStringConverters::vector4DFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: 4D vector expected")); } break; @@ -398,7 +398,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p } // otherwise, check for existence of string converter to custom type - QDeclarativeMetaType::StringConverter converter = QDeclarativeMetaType::customStringConverter(type); + QQmlMetaType::StringConverter converter = QQmlMetaType::customStringConverter(type); if (!converter) COMPILE_EXCEPTION(v, tr("Invalid property assignment: unsupported type \"%1\"").arg(QString::fromLatin1(QVariant::typeToName((QVariant::Type)type)))); } @@ -421,8 +421,8 @@ static QUrl urlFromUserString(const QString &data) Any literal assignment that is approved in testLiteralAssignment() must have a corresponding action in this method. */ -void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Value *v) +void QQmlCompiler::genLiteralAssignment(QQmlScript::Property *prop, + QQmlScript::Value *v) { if (prop->core.isEnum()) { Q_ASSERT(v->value.isNumber()); @@ -563,7 +563,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr case QVariant::Color: { Instruction::StoreColor instr; - QColor c = QDeclarativeStringConverters::colorFromString(v->value.asString()); + QColor c = QQmlStringConverters::colorFromString(v->value.asString()); instr.propertyIndex = prop->index; instr.value = c.rgba(); output->addInstruction(instr); @@ -573,7 +573,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr case QVariant::Date: { Instruction::StoreDate instr; - QDate d = QDeclarativeStringConverters::dateFromString(v->value.asString()); + QDate d = QQmlStringConverters::dateFromString(v->value.asString()); instr.propertyIndex = prop->index; instr.value = d.toJulianDay(); output->addInstruction(instr); @@ -582,7 +582,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr case QVariant::Time: { Instruction::StoreTime instr; - QTime time = QDeclarativeStringConverters::timeFromString(v->value.asString()); + QTime time = QQmlStringConverters::timeFromString(v->value.asString()); instr.propertyIndex = prop->index; Q_ASSERT(sizeof(instr.time) == sizeof(QTime)); ::memcpy(&instr.time, &time, sizeof(QTime)); @@ -592,7 +592,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr case QVariant::DateTime: { Instruction::StoreDateTime instr; - QDateTime dateTime = QDeclarativeStringConverters::dateTimeFromString(v->value.asString()); + QDateTime dateTime = QQmlStringConverters::dateTimeFromString(v->value.asString()); QTime time = dateTime.time(); instr.propertyIndex = prop->index; instr.date = dateTime.date().toJulianDay(); @@ -606,7 +606,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StorePoint instr; bool ok; - QPoint point = QDeclarativeStringConverters::pointFFromString(v->value.asString(), &ok).toPoint(); + QPoint point = QQmlStringConverters::pointFFromString(v->value.asString(), &ok).toPoint(); instr.propertyIndex = prop->index; instr.point.xp = point.x(); instr.point.yp = point.y(); @@ -617,7 +617,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StorePointF instr; bool ok; - QPointF point = QDeclarativeStringConverters::pointFFromString(v->value.asString(), &ok); + QPointF point = QQmlStringConverters::pointFFromString(v->value.asString(), &ok); instr.propertyIndex = prop->index; instr.point.xp = point.x(); instr.point.yp = point.y(); @@ -628,7 +628,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StoreSize instr; bool ok; - QSize size = QDeclarativeStringConverters::sizeFFromString(v->value.asString(), &ok).toSize(); + QSize size = QQmlStringConverters::sizeFFromString(v->value.asString(), &ok).toSize(); instr.propertyIndex = prop->index; instr.size.wd = size.width(); instr.size.ht = size.height(); @@ -639,7 +639,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StoreSizeF instr; bool ok; - QSizeF size = QDeclarativeStringConverters::sizeFFromString(v->value.asString(), &ok); + QSizeF size = QQmlStringConverters::sizeFFromString(v->value.asString(), &ok); instr.propertyIndex = prop->index; instr.size.wd = size.width(); instr.size.ht = size.height(); @@ -650,7 +650,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StoreRect instr; bool ok; - QRect rect = QDeclarativeStringConverters::rectFFromString(v->value.asString(), &ok).toRect(); + QRect rect = QQmlStringConverters::rectFFromString(v->value.asString(), &ok).toRect(); instr.propertyIndex = prop->index; instr.rect.x1 = rect.left(); instr.rect.y1 = rect.top(); @@ -663,7 +663,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StoreRectF instr; bool ok; - QRectF rect = QDeclarativeStringConverters::rectFFromString(v->value.asString(), &ok); + QRectF rect = QQmlStringConverters::rectFFromString(v->value.asString(), &ok); instr.propertyIndex = prop->index; instr.rect.xp = rect.left(); instr.rect.yp = rect.top(); @@ -685,7 +685,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StoreVector3D instr; bool ok; - QVector3D vector = QDeclarativeStringConverters::vector3DFromString(v->value.asString(), &ok); + QVector3D vector = QQmlStringConverters::vector3DFromString(v->value.asString(), &ok); instr.propertyIndex = prop->index; instr.vector.xp = vector.x(); instr.vector.yp = vector.y(); @@ -697,7 +697,7 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr { Instruction::StoreVector4D instr; bool ok; - QVector4D vector = QDeclarativeStringConverters::vector4DFromString(v->value.asString(), &ok); + QVector4D vector = QQmlStringConverters::vector4DFromString(v->value.asString(), &ok); instr.propertyIndex = prop->index; instr.vector.xp = vector.x(); instr.vector.yp = vector.y(); @@ -756,9 +756,9 @@ void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *pr } /*! - Resets data by clearing the lists that the QDeclarativeCompiler modifies. + Resets data by clearing the lists that the QQmlCompiler modifies. */ -void QDeclarativeCompiler::reset(QDeclarativeCompiledData *data) +void QQmlCompiler::reset(QQmlCompiledData *data) { data->types.clear(); data->primitives.clear(); @@ -767,8 +767,8 @@ void QDeclarativeCompiler::reset(QDeclarativeCompiledData *data) } /*! - Compile \a unit, and store the output in \a out. \a engine is the QDeclarativeEngine - with which the QDeclarativeCompiledData will be associated. + Compile \a unit, and store the output in \a out. \a engine is the QQmlEngine + with which the QQmlCompiledData will be associated. Returns true on success, false on failure. On failure, the compile errors are available from errors(). @@ -777,33 +777,33 @@ void QDeclarativeCompiler::reset(QDeclarativeCompiledData *data) (eg. QML_COMPILER_DUMP=1) the compiled instructions will be dumped to stderr on a successful compiler. */ -bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine, - QDeclarativeTypeData *unit, - QDeclarativeCompiledData *out) +bool QQmlCompiler::compile(QQmlEngine *engine, + QQmlTypeData *unit, + QQmlCompiledData *out) { exceptions.clear(); Q_ASSERT(out); reset(out); - QDeclarativeScript::Object *root = unit->parser().tree(); + QQmlScript::Object *root = unit->parser().tree(); Q_ASSERT(root); this->engine = engine; - this->enginePrivate = QDeclarativeEnginePrivate::get(engine); + this->enginePrivate = QQmlEnginePrivate::get(engine); this->unit = unit; this->unitRoot = root; this->output = out; // Compile types - const QList<QDeclarativeTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes(); - QList<QDeclarativeScript::TypeReference *> referencedTypes = unit->parser().referencedTypes(); + const QList<QQmlTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes(); + QList<QQmlScript::TypeReference *> referencedTypes = unit->parser().referencedTypes(); for (int ii = 0; ii < resolvedTypes.count(); ++ii) { - QDeclarativeCompiledData::TypeReference ref; + QQmlCompiledData::TypeReference ref; - const QDeclarativeTypeData::TypeReference &tref = resolvedTypes.at(ii); - QDeclarativeScript::TypeReference *parserRef = referencedTypes.at(ii); + const QQmlTypeData::TypeReference &tref = resolvedTypes.at(ii); + QQmlScript::TypeReference *parserRef = referencedTypes.at(ii); if (tref.type) { ref.type = tref.type; @@ -815,7 +815,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine, } if (ref.type->containsRevisionedAttributes()) { - QDeclarativeError cacheError; + QQmlError cacheError; ref.typePropertyCache = enginePrivate->cache(ref.type, resolvedTypes.at(ii).minorVersion, cacheError); if (!ref.typePropertyCache) @@ -854,7 +854,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine, return !isError(); } -void QDeclarativeCompiler::compileTree(QDeclarativeScript::Object *tree) +void QQmlCompiler::compileTree(QQmlScript::Object *tree) { compileState = pool->New<ComponentCompileState>(); @@ -865,13 +865,13 @@ void QDeclarativeCompiler::compileTree(QDeclarativeScript::Object *tree) // We generate the importCache before we build the tree so that // it can be used in the binding compiler. Given we "expect" the // QML compilation to succeed, this isn't a waste. - output->importCache = new QDeclarativeTypeNameCache(); + output->importCache = new QQmlTypeNameCache(); foreach (const QString &ns, unit->namespaces()) { output->importCache->add(ns); } int scriptIndex = 0; - foreach (const QDeclarativeTypeData::ScriptReference &script, unit->resolvedScripts()) { + foreach (const QQmlTypeData::ScriptReference &script, unit->resolvedScripts()) { QString qualifier = script.qualifier; QString enclosingNamespace; @@ -901,11 +901,11 @@ void QDeclarativeCompiler::compileTree(QDeclarativeScript::Object *tree) init.compiledBinding = output->indexForByteArray(compileState->compiledBindingData); output->addInstruction(init); - foreach (const QDeclarativeTypeData::ScriptReference &script, unit->resolvedScripts()) { + foreach (const QQmlTypeData::ScriptReference &script, unit->resolvedScripts()) { Instruction::StoreImportedScript import; import.value = output->scripts.count(); - QDeclarativeScriptData *scriptData = script.script->scriptData(); + QQmlScriptData *scriptData = script.script->scriptData(); scriptData->addref(); output->scripts << scriptData; output->addInstruction(import); @@ -915,7 +915,7 @@ void QDeclarativeCompiler::compileTree(QDeclarativeScript::Object *tree) Instruction::InitV8Bindings bindings; int index = output->programs.count(); - typedef QDeclarativeCompiledData::V8Program V8Program; + typedef QQmlCompiledData::V8Program V8Program; output->programs.append(V8Program(compileState->v8BindingProgram, output)); bindings.programIndex = index; @@ -952,28 +952,28 @@ static bool QStringList_contains(const QStringList &list, const QHashedStringRef return false; } -bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const BindingContext &ctxt) +bool QQmlCompiler::buildObject(QQmlScript::Object *obj, const BindingContext &ctxt) { if (componentStats) componentStats->componentStat.objects++; Q_ASSERT (obj->type != -1); - const QDeclarativeCompiledData::TypeReference &tr = output->types.at(obj->type); + const QQmlCompiledData::TypeReference &tr = output->types.at(obj->type); obj->metatype = tr.metaObject(); if (tr.type) obj->typeName = tr.type->qmlTypeName(); // This object is a "Component" element - if (tr.type && obj->metatype == &QDeclarativeComponent::staticMetaObject) { + if (tr.type && obj->metatype == &QQmlComponent::staticMetaObject) { COMPILE_CHECK(buildComponent(obj, ctxt)); return true; } if (tr.component) { - typedef QDeclarativeInstruction I; + typedef QQmlInstruction I; const I *init = ((const I *)tr.component->bytecode.constData()); - Q_ASSERT(init && tr.component->instructionType(init) == QDeclarativeInstruction::Init); + Q_ASSERT(init && tr.component->instructionType(init) == QQmlInstruction::Init); // Adjust stack depths to include nested components compileState->objectDepth.pushPop(init->init.objectStackSize); @@ -992,8 +992,8 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const Bi COMPILE_CHECK(mergeDynamicMetaProperties(obj)); COMPILE_CHECK(buildDynamicMeta(obj, IgnoreAliases)); - // Find the native type and check for the QDeclarativeParserStatus interface - QDeclarativeType *type = toQmlType(obj); + // Find the native type and check for the QQmlParserStatus interface + QQmlType *type = toQmlType(obj); Q_ASSERT(type); obj->parserStatusCast = type->parserStatusCast(); if (obj->parserStatusCast != -1) @@ -1004,7 +1004,7 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const Bi // compiled by the type. bool isCustomParser = output->types.at(obj->type).type && output->types.at(obj->type).type->customParser() != 0; - QList<QDeclarativeCustomParserProperty> customProps; + QList<QQmlCustomParserProperty> customProps; // Fetch the list of deferred properties QStringList deferredList = deferredProperties(obj); @@ -1094,7 +1094,7 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const Bi } } - QDeclarativeCustomParser *cp = 0; + QQmlCustomParser *cp = 0; if (isCustomParser) cp = output->types.at(obj->type).type->customParser(); @@ -1109,16 +1109,16 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const Bi bool canDefer = false; if (isCustomParser) { if (doesPropertyExist(prop, obj) && - (!(cp->flags() & QDeclarativeCustomParser::AcceptsAttachedProperties) || + (!(cp->flags() & QQmlCustomParser::AcceptsAttachedProperties) || !isAttachedPropertyName(prop->name()))) { int ids = compileState->ids.count(); COMPILE_CHECK(buildProperty(prop, obj, objCtxt)); canDefer = ids == compileState->ids.count(); } else if (isSignalPropertyName(prop->name()) && - (cp->flags() & QDeclarativeCustomParser::AcceptsSignalHandlers)) { + (cp->flags() & QQmlCustomParser::AcceptsSignalHandlers)) { COMPILE_CHECK(buildSignal(prop,obj,objCtxt)); } else { - customProps << QDeclarativeCustomParserNodePrivate::fromProperty(prop); + customProps << QQmlCustomParserNodePrivate::fromProperty(prop); } } else { if (isSignalPropertyName(prop->name())) { @@ -1146,7 +1146,7 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const Bi COMPILE_CHECK(buildProperty(prop, obj, objCtxt)); canDefer = ids == compileState->ids.count(); } else { - customProps << QDeclarativeCustomParserNodePrivate::fromProperty(prop); + customProps << QQmlCustomParserNodePrivate::fromProperty(prop); } } else { int ids = compileState->ids.count(); @@ -1166,7 +1166,7 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const Bi obj->custom = cp->compile(customProps); cp->compiler = 0; cp->object = 0; - foreach (QDeclarativeError err, cp->errors()) { + foreach (QQmlError err, cp->errors()) { err.setUrl(output->url); exceptions << err; } @@ -1177,10 +1177,10 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const Bi return true; } -void QDeclarativeCompiler::genObject(QDeclarativeScript::Object *obj) +void QQmlCompiler::genObject(QQmlScript::Object *obj) { - QDeclarativeCompiledData::TypeReference &tr = output->types[obj->type]; - if (tr.type && obj->metatype == &QDeclarativeComponent::staticMetaObject) { + QQmlCompiledData::TypeReference &tr = output->types[obj->type]; + if (tr.type && obj->metatype == &QQmlComponent::staticMetaObject) { genComponent(obj); return; } @@ -1237,18 +1237,18 @@ void QDeclarativeCompiler::genObject(QDeclarativeScript::Object *obj) meta.aliasData = output->indexForByteArray(obj->synthdata); meta.propertyCache = output->propertyCaches.count(); - QDeclarativePropertyCache *propertyCache = obj->synthCache; + QQmlPropertyCache *propertyCache = obj->synthCache; Q_ASSERT(propertyCache); propertyCache->addref(); // Add flag for alias properties if (!obj->synthdata.isEmpty()) { - const QDeclarativeVMEMetaData *vmeMetaData = - reinterpret_cast<const QDeclarativeVMEMetaData *>(obj->synthdata.constData()); + const QQmlVMEMetaData *vmeMetaData = + reinterpret_cast<const QQmlVMEMetaData *>(obj->synthdata.constData()); for (int ii = 0; ii < vmeMetaData->aliasCount; ++ii) { int index = obj->metaObject()->propertyOffset() + vmeMetaData->propertyCount + ii; - QDeclarativePropertyData *data = propertyCache->property(index); - data->setFlags(data->getFlags() | QDeclarativePropertyData::IsAlias); + QQmlPropertyData *data = propertyCache->property(index); + data->setFlags(data->getFlags() | QQmlPropertyData::IsAlias); } } @@ -1282,7 +1282,7 @@ void QDeclarativeCompiler::genObject(QDeclarativeScript::Object *obj) genObjectBody(obj); } -void QDeclarativeCompiler::genObjectBody(QDeclarativeScript::Object *obj) +void QQmlCompiler::genObjectBody(QQmlScript::Object *obj) { for (Property *prop = obj->scriptStringProperties.first(); prop; prop = Object::PropertyList::next(prop)) { Q_ASSERT(prop->scriptStringScope != -1); @@ -1335,7 +1335,7 @@ void QDeclarativeCompiler::genObjectBody(QDeclarativeScript::Object *obj) for (Property *prop = obj->signalProperties.first(); prop; prop = Object::PropertyList::next(prop)) { - QDeclarativeScript::Value *v = prop->values.first(); + QQmlScript::Value *v = prop->values.first(); if (v->type == Value::SignalObject) { @@ -1411,7 +1411,7 @@ void QDeclarativeCompiler::genObjectBody(QDeclarativeScript::Object *obj) } } -void QDeclarativeCompiler::genValueTypeProperty(QDeclarativeScript::Object *obj,QDeclarativeScript::Property *prop) +void QQmlCompiler::genValueTypeProperty(QQmlScript::Object *obj,QQmlScript::Property *prop) { Instruction::FetchValueType fetch; fetch.property = prop->index; @@ -1442,9 +1442,9 @@ void QDeclarativeCompiler::genValueTypeProperty(QDeclarativeScript::Object *obj, output->addInstruction(pop); } -void QDeclarativeCompiler::genComponent(QDeclarativeScript::Object *obj) +void QQmlCompiler::genComponent(QQmlScript::Object *obj) { - QDeclarativeScript::Object *root = obj->defaultProperty->values.first()->object; + QQmlScript::Object *root = obj->defaultProperty->values.first()->object; Q_ASSERT(root); Instruction::CreateComponent create; @@ -1474,7 +1474,7 @@ void QDeclarativeCompiler::genComponent(QDeclarativeScript::Object *obj) Instruction::InitV8Bindings bindings; int index = output->programs.count(); - typedef QDeclarativeCompiledData::V8Program V8Program; + typedef QQmlCompiledData::V8Program V8Program; output->programs.append(V8Program(compileState->v8BindingProgram, output)); bindings.programIndex = index; @@ -1508,7 +1508,7 @@ void QDeclarativeCompiler::genComponent(QDeclarativeScript::Object *obj) } } -bool QDeclarativeCompiler::buildComponent(QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildComponent(QQmlScript::Object *obj, const BindingContext &ctxt) { // The special "Component" element can only have the id property and a @@ -1552,7 +1552,7 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeScript::Object *obj, if (!obj->dynamicSlots.isEmpty()) COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new functions.")); - QDeclarativeScript::Object *root = 0; + QQmlScript::Object *root = 0; if (obj->defaultProperty && !obj->defaultProperty->values.isEmpty()) root = obj->defaultProperty->values.first()->object; @@ -1567,7 +1567,7 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeScript::Object *obj, return true; } -bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildComponentFromRoot(QQmlScript::Object *obj, const BindingContext &ctxt) { ComponentCompileState *oldComponentCompileState = compileState; @@ -1603,7 +1603,7 @@ bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeScript::Object *ob // Build a sub-object. A sub-object is one that was not created directly by // QML - such as a grouped property object, or an attached object. Sub-object's // can't have an id, involve a custom parser, have attached properties etc. -bool QDeclarativeCompiler::buildSubObject(QDeclarativeScript::Object *obj, const BindingContext &ctxt) +bool QQmlCompiler::buildSubObject(QQmlScript::Object *obj, const BindingContext &ctxt) { Q_ASSERT(obj->metatype); Q_ASSERT(!obj->defaultProperty); @@ -1621,17 +1621,17 @@ bool QDeclarativeCompiler::buildSubObject(QDeclarativeScript::Object *obj, const return true; } -int QDeclarativeCompiler::componentTypeRef() +int QQmlCompiler::componentTypeRef() { if (cachedComponentTypeRef == -1) { - QDeclarativeType *t = QDeclarativeMetaType::qmlType(Component_import_string,1,0); + QQmlType *t = QQmlMetaType::qmlType(Component_import_string,1,0); for (int ii = output->types.count() - 1; ii >= 0; --ii) { if (output->types.at(ii).type == t) { cachedComponentTypeRef = ii; return ii; } } - QDeclarativeCompiledData::TypeReference ref; + QQmlCompiledData::TypeReference ref; ref.className = Component_string; ref.type = t; output->types << ref; @@ -1640,7 +1640,7 @@ int QDeclarativeCompiler::componentTypeRef() return cachedComponentTypeRef; } -int QDeclarativeCompiler::translationContextIndex() +int QQmlCompiler::translationContextIndex() { if (cachedTranslationContextIndex == -1) { // This code must match that in the qsTr() implementation @@ -1654,7 +1654,7 @@ int QDeclarativeCompiler::translationContextIndex() return cachedTranslationContextIndex; } -bool QDeclarativeCompiler::buildSignal(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildSignal(QQmlScript::Property *prop, QQmlScript::Object *obj, const BindingContext &ctxt) { Q_ASSERT(obj->metaObject()); @@ -1675,14 +1675,14 @@ bool QDeclarativeCompiler::buildSignal(QDeclarativeScript::Property *prop, QDecl bool notInRevision = false; - QDeclarativePropertyData *sig = signal(obj, QStringRef(&name), ¬InRevision); + QQmlPropertyData *sig = signal(obj, QStringRef(&name), ¬InRevision); if (sig == 0) { if (notInRevision && 0 == property(obj, propName, 0)) { Q_ASSERT(obj->type != -1); - const QList<QDeclarativeTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes(); - const QDeclarativeTypeData::TypeReference &type = resolvedTypes.at(obj->type); + const QList<QQmlTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes(); + const QQmlTypeData::TypeReference &type = resolvedTypes.at(obj->type); if (type.type) { COMPILE_EXCEPTION(prop, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(elementName(obj)).arg(prop->name().toString()).arg(type.type->module()).arg(type.majorVersion).arg(type.minorVersion)); } else { @@ -1728,8 +1728,8 @@ bool QDeclarativeCompiler::buildSignal(QDeclarativeScript::Property *prop, QDecl /*! Returns true if (value) property \a prop exists on obj, false otherwise. */ -bool QDeclarativeCompiler::doesPropertyExist(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj) +bool QQmlCompiler::doesPropertyExist(QQmlScript::Property *prop, + QQmlScript::Object *obj) { if (prop->name().isEmpty()) return false; @@ -1739,8 +1739,8 @@ bool QDeclarativeCompiler::doesPropertyExist(QDeclarativeScript::Property *prop, return property(obj, prop->name()) != 0; } -bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, const BindingContext &ctxt) { if (prop->isEmpty()) @@ -1759,8 +1759,8 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, COMPILE_EXCEPTION(prop, tr("Attached properties cannot be used here")); } - QDeclarativeType *type = 0; - QDeclarativeImportedNamespace *typeNamespace = 0; + QQmlType *type = 0; + QQmlImportedNamespace *typeNamespace = 0; unit->imports().resolveType(prop->name().toString(), &type, 0, 0, 0, &typeNamespace); if (typeNamespace) { @@ -1780,12 +1780,12 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, } else { // Setup regular property data bool notInRevision = false; - QDeclarativePropertyData *d = + QQmlPropertyData *d = prop->name().isEmpty()?0:property(obj, prop->name(), ¬InRevision); if (d == 0 && notInRevision) { - const QList<QDeclarativeTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes(); - const QDeclarativeTypeData::TypeReference &type = resolvedTypes.at(obj->type); + const QList<QQmlTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes(); + const QQmlTypeData::TypeReference &type = resolvedTypes.at(obj->type); if (type.type) { COMPILE_EXCEPTION(prop, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(elementName(obj)).arg(prop->name().toString()).arg(type.type->module()).arg(type.majorVersion).arg(type.minorVersion)); } else { @@ -1795,8 +1795,8 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, prop->index = d->coreIndex; prop->core = *d; } else if (prop->isDefault) { - QMetaProperty p = QDeclarativeMetaType::defaultProperty(metaObject); - QDeclarativePropertyData defaultPropertyData; + QMetaProperty p = QQmlMetaType::defaultProperty(metaObject); + QQmlPropertyData defaultPropertyData; defaultPropertyData.load(p, engine); if (p.name()) prop->setName(QLatin1String(p.name())); @@ -1815,7 +1815,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, prop->parent->type != -1 && output->types.at(prop->parent->type).component) { - QDeclarativePropertyCache *cache = output->types.at(prop->parent->type).component->rootPropertyCache; + QQmlPropertyCache *cache = output->types.at(prop->parent->type).component->rootPropertyCache; if (cache && cache->property(prop->index) && cache->property(prop->index)->isAlias()) prop->isAlias = true; } @@ -1854,7 +1854,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, COMPILE_CHECK(buildListProperty(prop, obj, ctxt)); - } else if (prop->type == qMetaTypeId<QDeclarativeScriptString>()) { + } else if (prop->type == qMetaTypeId<QQmlScriptString>()) { COMPILE_CHECK(buildScriptStringProperty(prop, obj, ctxt)); @@ -1867,9 +1867,9 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, return true; } -bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespace *ns, - QDeclarativeScript::Property *nsProp, - QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildPropertyInNamespace(QQmlImportedNamespace *ns, + QQmlScript::Property *nsProp, + QQmlScript::Object *obj, const BindingContext &ctxt) { if (!nsProp->value) @@ -1882,7 +1882,7 @@ bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespac // Setup attached property data - QDeclarativeType *type = 0; + QQmlType *type = 0; unit->imports().resolveType(ns, prop->name().toString(), &type, 0, 0, 0); if (!type || !type->attachedPropertiesType()) @@ -1901,8 +1901,8 @@ bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespac return true; } -void QDeclarativeCompiler::genValueProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj) +void QQmlCompiler::genValueProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj) { if (prop->core.isQList()) { genListProperty(prop, obj); @@ -1911,14 +1911,14 @@ void QDeclarativeCompiler::genValueProperty(QDeclarativeScript::Property *prop, } } -void QDeclarativeCompiler::genListProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj) +void QQmlCompiler::genListProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj) { int listType = enginePrivate->listType(prop->type); Instruction::FetchQList fetch; fetch.property = prop->index; - bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType); + bool listTypeIsInterface = QQmlMetaType::isInterface(listType); fetch.type = listType; output->addInstruction(fetch); @@ -1948,9 +1948,9 @@ void QDeclarativeCompiler::genListProperty(QDeclarativeScript::Property *prop, output->addInstruction(pop); } -void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Property *valueTypeProperty) +void QQmlCompiler::genPropertyAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Property *valueTypeProperty) { for (Value *v = prop->values.first(); v; v = Property::ValueList::next(v)) { @@ -1962,7 +1962,7 @@ void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeScript::Property *p genObject(v->object); - if (QDeclarativeMetaType::isInterface(prop->type)) { + if (QQmlMetaType::isInterface(prop->type)) { Instruction::StoreInterface store; store.line = v->object->location.start.line; @@ -2020,7 +2020,7 @@ void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeScript::Property *p store.property = prop->core; store.owner = 0; } - QDeclarativeType *valueType = toQmlType(v->object); + QQmlType *valueType = toQmlType(v->object); store.castValue = valueType->propertyValueSourceCast(); output->addInstruction(store); @@ -2035,7 +2035,7 @@ void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeScript::Property *p store.property = prop->core; store.owner = 0; } - QDeclarativeType *valueType = toQmlType(v->object); + QQmlType *valueType = toQmlType(v->object); store.castValue = valueType->propertyValueInterceptorCast(); output->addInstruction(store); } @@ -2043,15 +2043,15 @@ void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeScript::Property *p } } -bool QDeclarativeCompiler::buildIdProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj) +bool QQmlCompiler::buildIdProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj) { if (prop->value || prop->values.isMany() || prop->values.first()->object) COMPILE_EXCEPTION(prop, tr("Invalid use of id property")); - QDeclarativeScript::Value *idValue = prop->values.first(); + QQmlScript::Value *idValue = prop->values.first(); QString val = idValue->primitive(); COMPILE_CHECK(checkValidId(idValue, val)); @@ -2067,7 +2067,7 @@ bool QDeclarativeCompiler::buildIdProperty(QDeclarativeScript::Property *prop, return true; } -void QDeclarativeCompiler::addId(const QString &id, QDeclarativeScript::Object *obj) +void QQmlCompiler::addId(const QString &id, QQmlScript::Object *obj) { Q_UNUSED(id); Q_ASSERT(!compileState->ids.value(id)); @@ -2076,7 +2076,7 @@ void QDeclarativeCompiler::addId(const QString &id, QDeclarativeScript::Object * compileState->ids.append(obj); } -void QDeclarativeCompiler::addBindingReference(JSBindingReference *ref) +void QQmlCompiler::addBindingReference(JSBindingReference *ref) { Q_ASSERT(ref->value && !ref->value->bindingReference); ref->value->bindingReference = ref; @@ -2084,7 +2084,7 @@ void QDeclarativeCompiler::addBindingReference(JSBindingReference *ref) compileState->bindings.prepend(ref); } -void QDeclarativeCompiler::saveComponentState() +void QQmlCompiler::saveComponentState() { Q_ASSERT(compileState->root); Q_ASSERT(compileState->root->componentCompileState == 0); @@ -2095,8 +2095,8 @@ void QDeclarativeCompiler::saveComponentState() componentStats->savedComponentStats.append(componentStats->componentStat); } -QDeclarativeCompilerTypes::ComponentCompileState * -QDeclarativeCompiler::componentState(QDeclarativeScript::Object *obj) +QQmlCompilerTypes::ComponentCompileState * +QQmlCompiler::componentState(QQmlScript::Object *obj) { Q_ASSERT(obj->componentCompileState); return obj->componentCompileState; @@ -2107,8 +2107,8 @@ QDeclarativeCompiler::componentState(QDeclarativeScript::Object *obj) // GridView.row: 10 // } // GridView is an attached property object. -bool QDeclarativeCompiler::buildAttachedProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildAttachedProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, const BindingContext &ctxt) { Q_ASSERT(prop->value); @@ -2132,14 +2132,14 @@ bool QDeclarativeCompiler::buildAttachedProperty(QDeclarativeScript::Property *p // font.family: "Helvetica" // } // font is a nested property. pointSize and family are not. -bool QDeclarativeCompiler::buildGroupedProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildGroupedProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, const BindingContext &ctxt) { Q_ASSERT(prop->type != 0); Q_ASSERT(prop->index != -1); - if (QDeclarativeValueTypeFactory::isValueType(prop->type)) { + if (QQmlValueTypeFactory::isValueType(prop->type)) { if (prop->type >= 0 && enginePrivate->valueTypes[prop->type]) { if (!prop->values.isEmpty()) { @@ -2189,9 +2189,9 @@ bool QDeclarativeCompiler::buildGroupedProperty(QDeclarativeScript::Property *pr return true; } -bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Object *baseObj, +bool QQmlCompiler::buildValueTypeProperty(QObject *type, + QQmlScript::Object *obj, + QQmlScript::Object *baseObj, const BindingContext &ctxt) { compileState->objectDepth.push(); @@ -2202,7 +2202,7 @@ bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type, for (Property *prop = obj->properties.first(); prop; prop = obj->properties.next(prop)) { - QDeclarativePropertyData *d = property(obj, prop->name()); + QQmlPropertyData *d = property(obj, prop->name()); if (d == 0) COMPILE_EXCEPTION(prop, tr("Cannot assign to non-existent property \"%1\"").arg(prop->name().toString())); @@ -2217,7 +2217,7 @@ bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type, if (prop->values.isMany()) { COMPILE_EXCEPTION(prop, tr("Single property assignment expected")); } else if (!prop->values.isEmpty()) { - QDeclarativeScript::Value *value = prop->values.first(); + QQmlScript::Value *value = prop->values.first(); if (value->object) { COMPILE_EXCEPTION(prop, tr("Unexpected object assignment")); @@ -2263,10 +2263,10 @@ bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type, } // Build assignments to QML lists. QML lists are properties of type -// QDeclarativeListProperty<T>. List properties can accept a list of +// QQmlListProperty<T>. List properties can accept a list of // objects, or a single binding. -bool QDeclarativeCompiler::buildListProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildListProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, const BindingContext &ctxt) { Q_ASSERT(prop->core.isQList()); @@ -2278,7 +2278,7 @@ bool QDeclarativeCompiler::buildListProperty(QDeclarativeScript::Property *prop, obj->addValueProperty(prop); int listType = enginePrivate->listType(t); - bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType); + bool listTypeIsInterface = QQmlMetaType::isInterface(listType); bool assignedBinding = false; for (Value *v = prop->values.first(); v; v = Property::ValueList::next(v)) { @@ -2311,9 +2311,9 @@ bool QDeclarativeCompiler::buildListProperty(QDeclarativeScript::Property *prop, return true; } -// Compiles an assignment to a QDeclarativeScriptString property -bool QDeclarativeCompiler::buildScriptStringProperty(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, +// Compiles an assignment to a QQmlScriptString property +bool QQmlCompiler::buildScriptStringProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, const BindingContext &ctxt) { if (prop->values.isMany()) @@ -2329,8 +2329,8 @@ bool QDeclarativeCompiler::buildScriptStringProperty(QDeclarativeScript::Propert } // Compile regular property assignments of the form "property: <value>" -bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, +bool QQmlCompiler::buildPropertyAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, const BindingContext &ctxt) { obj->addValueProperty(prop); @@ -2359,9 +2359,9 @@ bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeScript::Property } // Compile assigning a single object instance to a regular property -bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Value *v, +bool QQmlCompiler::buildPropertyObjectAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Value *v, const BindingContext &ctxt) { Q_ASSERT(prop->index != -1); @@ -2370,7 +2370,7 @@ bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeScript::Pro if (!prop->core.isWritable() && !prop->isReadOnlyDeclaration) COMPILE_EXCEPTION(v, tr("Invalid property assignment: \"%1\" is a read-only property").arg(prop->name().toString())); - if (QDeclarativeMetaType::isInterface(prop->type)) { + if (QQmlMetaType::isInterface(prop->type)) { // Assigning an object to an interface ptr property COMPILE_CHECK(buildObject(v->object, ctxt)); @@ -2402,7 +2402,7 @@ bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeScript::Pro if (propertyMetaObject) { const QMetaObject *c = v->object->metatype; while(c) { - isAssignable |= (QDeclarativePropertyPrivate::equal(c, propertyMetaObject)); + isAssignable |= (QQmlPropertyPrivate::equal(c, propertyMetaObject)); c = c->superClass(); } } @@ -2412,15 +2412,15 @@ bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeScript::Pro COMPILE_CHECK(buildObject(v->object, ctxt)); v->type = Value::CreatedObject; - } else if (propertyMetaObject == &QDeclarativeComponent::staticMetaObject) { + } else if (propertyMetaObject == &QQmlComponent::staticMetaObject) { // Automatic "Component" insertion - QDeclarativeScript::Object *root = v->object; - QDeclarativeScript::Object *component = pool->New<Object>(); + QQmlScript::Object *root = v->object; + QQmlScript::Object *component = pool->New<Object>(); component->type = componentTypeRef(); component->typeName = QStringLiteral("Qt/Component"); - component->metatype = &QDeclarativeComponent::staticMetaObject; + component->metatype = &QQmlComponent::staticMetaObject; component->location = root->location; - QDeclarativeScript::Value *componentValue = pool->New<Value>(); + QQmlScript::Value *componentValue = pool->New<Value>(); componentValue->object = root; component->getDefaultProperty()->addValue(componentValue); v->object = component; @@ -2439,10 +2439,10 @@ bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeScript::Pro // Item { // NumberAnimation on x { } // } -bool QDeclarativeCompiler::buildPropertyOnAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Object *baseObj, - QDeclarativeScript::Value *v, +bool QQmlCompiler::buildPropertyOnAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Object *baseObj, + QQmlScript::Value *v, const BindingContext &ctxt) { Q_ASSERT(prop->index != -1); @@ -2461,11 +2461,11 @@ bool QDeclarativeCompiler::buildPropertyOnAssignment(QDeclarativeScript::Propert v->object->metatype = output->types.at(v->object->type).metaObject(); Q_ASSERT(v->object->metaObject()); - // Will be true if the assigned type inherits QDeclarativePropertyValueSource + // Will be true if the assigned type inherits QQmlPropertyValueSource bool isPropertyValue = false; - // Will be true if the assigned type inherits QDeclarativePropertyValueInterceptor + // Will be true if the assigned type inherits QQmlPropertyValueInterceptor bool isPropertyInterceptor = false; - if (QDeclarativeType *valueType = toQmlType(v->object)) { + if (QQmlType *valueType = toQmlType(v->object)) { isPropertyValue = valueType->propertyValueSourceCast() != -1; isPropertyInterceptor = valueType->propertyValueInterceptorCast() != -1; } @@ -2485,9 +2485,9 @@ bool QDeclarativeCompiler::buildPropertyOnAssignment(QDeclarativeScript::Propert } // Compile assigning a literal or binding to a regular property -bool QDeclarativeCompiler::buildPropertyLiteralAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Value *v, +bool QQmlCompiler::buildPropertyLiteralAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Value *v, const BindingContext &ctxt) { Q_ASSERT(prop->index != -1); @@ -2520,9 +2520,9 @@ bool QDeclarativeCompiler::buildPropertyLiteralAssignment(QDeclarativeScript::Pr return true; } -bool QDeclarativeCompiler::testQualifiedEnumAssignment(QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Value *v, +bool QQmlCompiler::testQualifiedEnumAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Value *v, bool *isAssignment) { *isAssignment = false; @@ -2543,13 +2543,13 @@ bool QDeclarativeCompiler::testQualifiedEnumAssignment(QDeclarativeScript::Prope return true; QString typeName = parts.at(0); - QDeclarativeType *type = 0; + QQmlType *type = 0; unit->imports().resolveType(typeName, &type, 0, 0, 0, 0); //handle enums on value types (where obj->typeName is empty) QString objTypeName = obj->typeName; if (objTypeName.isEmpty()) { - QDeclarativeType *objType = toQmlType(obj); + QQmlType *objType = toQmlType(obj); if (objType) objTypeName = objType->qmlTypeName(); } @@ -2584,7 +2584,7 @@ bool QDeclarativeCompiler::testQualifiedEnumAssignment(QDeclarativeScript::Prope return true; v->type = Value::Literal; - v->value = QDeclarativeScript::Variant((double)value); + v->value = QQmlScript::Variant((double)value); *isAssignment = true; return true; @@ -2597,12 +2597,12 @@ struct StaticQtMetaObject : public QObject }; // Similar logic to above, but not knowing target property. -int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const +int QQmlCompiler::evaluateEnum(const QByteArray& script) const { int dot = script.indexOf('.'); if (dot > 0) { const QByteArray &scope = script.left(dot); - QDeclarativeType *type = 0; + QQmlType *type = 0; unit->imports().resolveType(QString::fromUtf8(script.left(dot)), &type, 0, 0, 0, 0); if (!type && scope != "Qt") return -1; @@ -2619,9 +2619,9 @@ int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const return -1; } -const QMetaObject *QDeclarativeCompiler::resolveType(const QString& name) const +const QMetaObject *QQmlCompiler::resolveType(const QString& name) const { - QDeclarativeType *qmltype = 0; + QQmlType *qmltype = 0; if (!unit->imports().resolveType(name, &qmltype, 0, 0, 0, 0)) return 0; if (!qmltype) @@ -2631,9 +2631,9 @@ const QMetaObject *QDeclarativeCompiler::resolveType(const QString& name) const // similar to logic of completeComponentBuild, but also sticks data // into primitives at the end -int QDeclarativeCompiler::rewriteBinding(const QDeclarativeScript::Variant& value, const QString& name) +int QQmlCompiler::rewriteBinding(const QQmlScript::Variant& value, const QString& name) { - QDeclarativeRewrite::RewriteBinding rewriteBinding; + QQmlRewrite::RewriteBinding rewriteBinding; rewriteBinding.setName(QLatin1Char('$') + name.mid(name.lastIndexOf(QLatin1Char('.')) + 1)); QString rewrite = rewriteBinding(value.asAST(), value.asScript(), 0); @@ -2641,14 +2641,14 @@ int QDeclarativeCompiler::rewriteBinding(const QDeclarativeScript::Variant& valu return output->indexForString(rewrite); } -QString QDeclarativeCompiler::rewriteSignalHandler(const QDeclarativeScript::Variant& value, const QString &name) +QString QQmlCompiler::rewriteSignalHandler(const QQmlScript::Variant& value, const QString &name) { - QDeclarativeRewrite::RewriteSignalHandler rewriteSignalHandler; + QQmlRewrite::RewriteSignalHandler rewriteSignalHandler; return rewriteSignalHandler(value.asAST(), value.asScript(), name); } // Ensures that the dynamic meta specification on obj is valid -bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeScript::Object *obj) +bool QQmlCompiler::checkDynamicMeta(QQmlScript::Object *obj) { bool seenDefaultProperty = false; @@ -2660,7 +2660,7 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeScript::Object *obj) // Check properties for (Object::DynamicProperty *p = obj->dynamicProperties.first(); p; p = obj->dynamicProperties.next(p)) { - const QDeclarativeScript::Object::DynamicProperty &prop = *p; + const QQmlScript::Object::DynamicProperty &prop = *p; if (prop.isDefaultProperty) { if (seenDefaultProperty) @@ -2693,7 +2693,7 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeScript::Object *obj) } for (Object::DynamicSignal *s = obj->dynamicSignals.first(); s; s = obj->dynamicSignals.next(s)) { - const QDeclarativeScript::Object::DynamicSignal &currSig = *s; + const QQmlScript::Object::DynamicSignal &currSig = *s; if (methodNames.testAndSet(currSig.name.hash())) { for (Object::DynamicSignal *s2 = obj->dynamicSignals.first(); s2 != s; @@ -2710,7 +2710,7 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeScript::Object *obj) } for (Object::DynamicSlot *s = obj->dynamicSlots.first(); s; s = obj->dynamicSlots.next(s)) { - const QDeclarativeScript::Object::DynamicSlot &currSlot = *s; + const QQmlScript::Object::DynamicSlot &currSlot = *s; if (methodNames.testAndSet(currSlot.name.hash())) { for (Object::DynamicSignal *s2 = obj->dynamicSignals.first(); s2; @@ -2734,7 +2734,7 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeScript::Object *obj) return true; } -bool QDeclarativeCompiler::mergeDynamicMetaProperties(QDeclarativeScript::Object *obj) +bool QQmlCompiler::mergeDynamicMetaProperties(QQmlScript::Object *obj) { for (Object::DynamicProperty *p = obj->dynamicProperties.first(); p; p = obj->dynamicProperties.next(p)) { @@ -2764,7 +2764,7 @@ bool QDeclarativeCompiler::mergeDynamicMetaProperties(QDeclarativeScript::Object Q_GLOBAL_STATIC(QAtomicInt, classIndexCounter) -bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, DynamicMetaMode mode) +bool QQmlCompiler::buildDynamicMeta(QQmlScript::Object *obj, DynamicMetaMode mode) { Q_ASSERT(obj); Q_ASSERT(obj->metatype); @@ -2796,7 +2796,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn if (!resolveAlias) { // No point doing this for both the alias and non alias cases - QDeclarativePropertyData *d = property(obj, p->name); + QQmlPropertyData *d = property(obj, p->name); if (d && d->isFinal()) COMPILE_EXCEPTION(p, tr("Cannot override FINAL property")); } @@ -2806,9 +2806,9 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn QByteArray dynamicData; if (buildData) { - typedef QDeclarativeVMEMetaData VMD; + typedef QQmlVMEMetaData VMD; - dynamicData = QByteArray(sizeof(QDeclarativeVMEMetaData) + + dynamicData = QByteArray(sizeof(QQmlVMEMetaData) + (obj->dynamicProperties.count() - aliasCount) * sizeof(VMD::PropertyData) + obj->dynamicSlots.count() * sizeof(VMD::MethodData) + aliasCount * sizeof(VMD::AliasData), 0); @@ -2859,7 +2859,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn // Reserve dynamic properties if (obj->dynamicProperties.count()) { - typedef QDeclarativeVMEMetaData VMD; + typedef QQmlVMEMetaData VMD; int effectivePropertyIndex = 0; for (Object::DynamicProperty *p = obj->dynamicProperties.first(); p; p = obj->dynamicProperties.next(p)) { @@ -2887,17 +2887,17 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn // XXX don't double resolve this in the case of an alias run QByteArray customTypeName; - QDeclarativeType *qmltype = 0; + QQmlType *qmltype = 0; QString url; if (!unit->imports().resolveType(p->customType.toString(), &qmltype, &url, 0, 0, 0)) COMPILE_EXCEPTION(p, tr("Invalid property type")); if (!qmltype) { - QDeclarativeTypeData *tdata = enginePrivate->typeLoader.get(QUrl(url)); + QQmlTypeData *tdata = enginePrivate->typeLoader.get(QUrl(url)); Q_ASSERT(tdata); Q_ASSERT(tdata->isComplete()); - QDeclarativeCompiledData *data = tdata->compiledData(); + QQmlCompiledData *data = tdata->compiledData(); customTypeName = data->root->className(); data->release(); tdata->release(); @@ -2910,8 +2910,8 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn propertyType = QMetaType::QObjectStar; } else { readonly = true; - customTypeName = QByteArray("QDeclarativeListProperty<") + customTypeName + QByteArray(">"); - propertyType = qMetaTypeId<QDeclarativeListProperty<QObject> >(); + customTypeName = QByteArray("QQmlListProperty<") + customTypeName + QByteArray(">"); + propertyType = qMetaTypeId<QQmlListProperty<QObject> >(); } p->resolvedCustomTypeName = pool->NewByteArray(customTypeName); @@ -2926,7 +2926,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn readonly = true; if (buildData) { - VMD *vmd = (QDeclarativeVMEMetaData *)dynamicData.data(); + VMD *vmd = (QQmlVMEMetaData *)dynamicData.data(); vmd->propertyCount++; (vmd->propertyData() + effectivePropertyIndex)->propertyType = propertyType; } @@ -2947,7 +2947,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn } if (varPropCount) { - VMD *vmd = (QDeclarativeVMEMetaData *)dynamicData.data(); + VMD *vmd = (QQmlVMEMetaData *)dynamicData.data(); if (buildData) vmd->varPropertyCount = varPropCount; firstPropertyVarIndex = effectivePropertyIndex; @@ -2979,7 +2979,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn if (p->type == Object::DynamicProperty::Alias) { if (resolveAlias) { Q_ASSERT(buildData); - ((QDeclarativeVMEMetaData *)dynamicData.data())->aliasCount++; + ((QQmlVMEMetaData *)dynamicData.data())->aliasCount++; COMPILE_CHECK(compileAlias(builder, dynamicData, obj, effectivePropertyIndex, aliasIndex, *p)); } @@ -3016,7 +3016,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn if (namesSize) s->parameterNamesRef = builder.newString(namesSize); if (buildData) - ((QDeclarativeVMEMetaData *)dynamicData.data())->signalCount++; + ((QQmlVMEMetaData *)dynamicData.data())->signalCount++; builder.setSignal(signalIndex + obj->dynamicProperties.count(), s->signatureRef, s->parameterNamesRef); ++signalIndex; @@ -3029,7 +3029,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn if (typeRefs[0].isEmpty()) typeRefs[0] = builder.newString(strlen(builtinTypes[0].cppType)); - typedef QDeclarativeVMEMetaData VMD; + typedef QQmlVMEMetaData VMD; int methodIndex = 0; for (Object::DynamicSlot *s = obj->dynamicSlots.first(); s; s = obj->dynamicSlots.next(s)) { @@ -3061,7 +3061,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn utf8.length(), s->location.start.line }; - VMD *vmd = (QDeclarativeVMEMetaData *)dynamicData.data(); + VMD *vmd = (QQmlVMEMetaData *)dynamicData.data(); vmd->methodCount++; VMD::MethodData &md = *(vmd->methodData() + methodIndex); @@ -3159,19 +3159,19 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn } if (obj->type != -1) { - QDeclarativePropertyCache *superCache = output->types[obj->type].createPropertyCache(engine); - QDeclarativePropertyCache *cache = + QQmlPropertyCache *superCache = output->types[obj->type].createPropertyCache(engine); + QQmlPropertyCache *cache = superCache->copyAndAppend(engine, &obj->extObject, - QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::IsVMEFunction, - QDeclarativePropertyData::IsVMESignal); + QQmlPropertyData::NoFlags, + QQmlPropertyData::IsVMEFunction, + QQmlPropertyData::IsVMESignal); // now we modify the flags appropriately for var properties. int propertyOffset = obj->extObject.propertyOffset(); - QDeclarativePropertyData *currPropData = 0; + QQmlPropertyData *currPropData = 0; for (int pvi = firstPropertyVarIndex; pvi < totalPropCount; ++pvi) { currPropData = cache->property(pvi + propertyOffset); - currPropData->setFlags(currPropData->getFlags() | QDeclarativePropertyData::IsVMEProperty); + currPropData->setFlags(currPropData->getFlags() | QQmlPropertyData::IsVMEProperty); } obj->synthCache = cache; @@ -3180,7 +3180,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn return true; } -bool QDeclarativeCompiler::checkValidId(QDeclarativeScript::Value *v, const QString &val) +bool QQmlCompiler::checkValidId(QQmlScript::Value *v, const QString &val) { if (val.isEmpty()) COMPILE_EXCEPTION(v, tr( "Invalid empty ID")); @@ -3205,16 +3205,16 @@ bool QDeclarativeCompiler::checkValidId(QDeclarativeScript::Value *v, const QStr return true; } -#include <private/qdeclarativejsparser_p.h> +#include <private/qqmljsparser_p.h> -static QStringList astNodeToStringList(QDeclarativeJS::AST::Node *node) +static QStringList astNodeToStringList(QQmlJS::AST::Node *node) { - if (node->kind == QDeclarativeJS::AST::Node::Kind_IdentifierExpression) { + if (node->kind == QQmlJS::AST::Node::Kind_IdentifierExpression) { QString name = - static_cast<QDeclarativeJS::AST::IdentifierExpression *>(node)->name.toString(); + static_cast<QQmlJS::AST::IdentifierExpression *>(node)->name.toString(); return QStringList() << name; - } else if (node->kind == QDeclarativeJS::AST::Node::Kind_FieldMemberExpression) { - QDeclarativeJS::AST::FieldMemberExpression *expr = static_cast<QDeclarativeJS::AST::FieldMemberExpression *>(node); + } else if (node->kind == QQmlJS::AST::Node::Kind_FieldMemberExpression) { + QQmlJS::AST::FieldMemberExpression *expr = static_cast<QQmlJS::AST::FieldMemberExpression *>(node); QStringList rv = astNodeToStringList(expr->base); if (rv.isEmpty()) @@ -3225,9 +3225,9 @@ static QStringList astNodeToStringList(QDeclarativeJS::AST::Node *node) return QStringList(); } -bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder, +bool QQmlCompiler::compileAlias(QFastMetaBuilder &builder, QByteArray &data, - QDeclarativeScript::Object *obj, + QQmlScript::Object *obj, int propIndex, int aliasIndex, Object::DynamicProperty &prop) { @@ -3239,7 +3239,7 @@ bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder, !prop.defaultValue->values.first()->value.isScript()) COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location")); - QDeclarativeJS::AST::Node *node = prop.defaultValue->values.first()->value.asAST(); + QQmlJS::AST::Node *node = prop.defaultValue->values.first()->value.asAST(); if (!node) COMPILE_EXCEPTION(obj, tr("No property alias location")); // ### Can this happen? @@ -3248,7 +3248,7 @@ bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder, if (alias.count() < 1 || alias.count() > 3) COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property>")); - QDeclarativeScript::Object *idObject = compileState->ids.value(alias.at(0)); + QQmlScript::Object *idObject = compileState->ids.value(alias.at(0)); if (!idObject) COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0))); @@ -3280,7 +3280,7 @@ bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder, type = aliasProperty.type(); if (alias.count() == 3) { - QDeclarativeValueType *valueType = enginePrivate->valueTypes[aliasProperty.type()]; + QQmlValueType *valueType = enginePrivate->valueTypes[aliasProperty.type()]; if (!valueType) COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location")); @@ -3307,7 +3307,7 @@ bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder, } else { Q_ASSERT(idObject->type != -1); // How else did it get an id? - const QDeclarativeCompiledData::TypeReference &ref = output->types.at(idObject->type); + const QQmlCompiledData::TypeReference &ref = output->types.at(idObject->type); if (ref.type) typeName = ref.type->typeName(); else @@ -3319,10 +3319,10 @@ bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder, if (typeName.endsWith('*')) flags |= QML_ALIAS_FLAG_PTR; - QDeclarativeVMEMetaData::AliasData aliasData = { idObject->idIndex, propIdx, flags }; + QQmlVMEMetaData::AliasData aliasData = { idObject->idIndex, propIdx, flags }; - typedef QDeclarativeVMEMetaData VMD; - VMD *vmd = (QDeclarativeVMEMetaData *)data.data(); + typedef QQmlVMEMetaData VMD; + VMD *vmd = (QQmlVMEMetaData *)data.data(); *(vmd->aliasData() + aliasIndex) = aliasData; prop.nameRef = builder.newString(prop.name.utf8length()); @@ -3342,8 +3342,8 @@ bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder, return true; } -bool QDeclarativeCompiler::buildBinding(QDeclarativeScript::Value *value, - QDeclarativeScript::Property *prop, +bool QQmlCompiler::buildBinding(QQmlScript::Value *value, + QQmlScript::Property *prop, const BindingContext &ctxt) { Q_ASSERT(prop->index != -1); @@ -3363,9 +3363,9 @@ bool QDeclarativeCompiler::buildBinding(QDeclarativeScript::Value *value, return true; } -bool QDeclarativeCompiler::buildLiteralBinding(QDeclarativeScript::Value *v, - QDeclarativeScript::Property *prop, - const QDeclarativeCompilerTypes::BindingContext &) +bool QQmlCompiler::buildLiteralBinding(QQmlScript::Value *v, + QQmlScript::Property *prop, + const QQmlCompilerTypes::BindingContext &) { Q_ASSERT(v->value.isScript()); @@ -3436,10 +3436,10 @@ bool QDeclarativeCompiler::buildLiteralBinding(QDeclarativeScript::Value *v, return false; } -void QDeclarativeCompiler::genBindingAssignment(QDeclarativeScript::Value *binding, - QDeclarativeScript::Property *prop, - QDeclarativeScript::Object *obj, - QDeclarativeScript::Property *valueTypeProperty) +void QQmlCompiler::genBindingAssignment(QQmlScript::Value *binding, + QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Property *valueTypeProperty) { Q_UNUSED(obj); Q_ASSERT(binding->bindingReference); @@ -3509,7 +3509,7 @@ void QDeclarativeCompiler::genBindingAssignment(QDeclarativeScript::Value *bindi } else if (ref.dataType == BindingReference::QtScript) { const JSBindingReference &js = static_cast<const JSBindingReference &>(ref); - QDeclarativeInstruction store; + QQmlInstruction store; store.assignBinding.value = output->indexForString(js.rewrittenExpression); store.assignBinding.context = js.bindingContext.stack; store.assignBinding.owner = js.bindingContext.owner; @@ -3530,20 +3530,20 @@ void QDeclarativeCompiler::genBindingAssignment(QDeclarativeScript::Value *bindi store.assignBinding.property = prop->core; } output->addInstructionHelper( - !prop->isAlias ? QDeclarativeInstruction::StoreBinding - : QDeclarativeInstruction::StoreBindingOnAlias + !prop->isAlias ? QQmlInstruction::StoreBinding + : QQmlInstruction::StoreBindingOnAlias , store); } else { Q_ASSERT(!"Unhandled BindingReference::DataType type"); } } -int QDeclarativeCompiler::genContextCache() +int QQmlCompiler::genContextCache() { if (compileState->ids.count() == 0) return -1; - QDeclarativeIntegerCache *cache = new QDeclarativeIntegerCache(); + QQmlIntegerCache *cache = new QQmlIntegerCache(); cache->reserve(compileState->ids.count()); for (Object *o = compileState->ids.first(); o; o = compileState->ids.next(o)) cache->add(o->id, o->idIndex); @@ -3552,17 +3552,17 @@ int QDeclarativeCompiler::genContextCache() return output->contextCaches.count() - 1; } -QDeclarativePropertyData -QDeclarativeCompiler::genValueTypeData(QDeclarativeScript::Property *valueTypeProp, - QDeclarativeScript::Property *prop) +QQmlPropertyData +QQmlCompiler::genValueTypeData(QQmlScript::Property *valueTypeProp, + QQmlScript::Property *prop) { - typedef QDeclarativePropertyPrivate QDPP; + typedef QQmlPropertyPrivate QDPP; return QDPP::saveValueType(prop->parent->metaObject(), prop->index, enginePrivate->valueTypes[prop->type]->metaObject(), valueTypeProp->index, engine); } -bool QDeclarativeCompiler::completeComponentBuild() +bool QQmlCompiler::completeComponentBuild() { if (componentStats) componentStats->componentStat.ids = compileState->ids.count(); @@ -3604,13 +3604,13 @@ bool QDeclarativeCompiler::completeComponentBuild() // Pre-rewrite the expression QString expression = binding.expression.asScript(); - QDeclarativeRewrite::RewriteBinding rewriteBinding; + QQmlRewrite::RewriteBinding rewriteBinding; rewriteBinding.setName(QLatin1Char('$')+binding.property->name().toString()); bool isSharable = false; binding.rewrittenExpression = rewriteBinding(binding.expression.asAST(), expression, &isSharable); if (isSharable && !binding.property->isValueTypeSubProperty && !binding.property->isAlias /* See above re alias */ && - binding.property->type != qMetaTypeId<QDeclarativeBinding*>()) { + binding.property->type != qMetaTypeId<QQmlBinding*>()) { binding.dataType = BindingReference::V8; sharedBindings.append(b); } else { @@ -3638,7 +3638,7 @@ bool QDeclarativeCompiler::completeComponentBuild() for (int ii = 0; ii < sharedBindings.count(); ++ii) { JSBindingReference *reference = sharedBindings.at(ii); - QDeclarativeScript::Value *value = reference->value; + QQmlScript::Value *value = reference->value; const QString &expression = reference->rewrittenExpression; if (ii != 0) functionArray.append(",", 1); @@ -3670,7 +3670,7 @@ bool QDeclarativeCompiler::completeComponentBuild() return true; } -void QDeclarativeCompiler::dumpStats() +void QQmlCompiler::dumpStats() { Q_ASSERT(componentStats); qWarning().nospace() << "QML Document: " << output->url.toString(); @@ -3724,13 +3724,13 @@ void QDeclarativeCompiler::dumpStats() Returns true if from can be assigned to a (QObject) property of type to. */ -bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeScript::Object *from) +bool QQmlCompiler::canCoerce(int to, QQmlScript::Object *from) { const QMetaObject *toMo = enginePrivate->rawMetaObjectForType(to); const QMetaObject *fromMo = from->metaObject(); while (fromMo) { - if (QDeclarativePropertyPrivate::equal(fromMo, toMo)) + if (QQmlPropertyPrivate::equal(fromMo, toMo)) return true; fromMo = fromMo->superClass(); } @@ -3740,7 +3740,7 @@ bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeScript::Object *from) /*! Returns the element name, as written in the QML file, for o. */ -QString QDeclarativeCompiler::elementName(QDeclarativeScript::Object *o) +QString QQmlCompiler::elementName(QQmlScript::Object *o) { Q_ASSERT(o); if (o->type != -1) { @@ -3750,19 +3750,19 @@ QString QDeclarativeCompiler::elementName(QDeclarativeScript::Object *o) } } -QDeclarativeType *QDeclarativeCompiler::toQmlType(QDeclarativeScript::Object *from) +QQmlType *QQmlCompiler::toQmlType(QQmlScript::Object *from) { // ### Optimize const QMetaObject *mo = from->metatype; - QDeclarativeType *type = 0; + QQmlType *type = 0; while (!type && mo) { - type = QDeclarativeMetaType::qmlType(mo); + type = QQmlMetaType::qmlType(mo); mo = mo->superClass(); } return type; } -QStringList QDeclarativeCompiler::deferredProperties(QDeclarativeScript::Object *obj) +QStringList QQmlCompiler::deferredProperties(QQmlScript::Object *obj) { const QMetaObject *mo = obj->metatype; @@ -3775,36 +3775,36 @@ QStringList QDeclarativeCompiler::deferredProperties(QDeclarativeScript::Object return rv; } -QDeclarativePropertyData * -QDeclarativeCompiler::property(QDeclarativeScript::Object *object, int index) +QQmlPropertyData * +QQmlCompiler::property(QQmlScript::Object *object, int index) { - QDeclarativePropertyCache *cache = 0; + QQmlPropertyCache *cache = 0; if (object->synthCache) cache = object->synthCache; else if (object->type != -1) cache = output->types[object->type].createPropertyCache(engine); else - cache = QDeclarativeEnginePrivate::get(engine)->cache(object->metaObject()); + cache = QQmlEnginePrivate::get(engine)->cache(object->metaObject()); return cache->property(index); } -QDeclarativePropertyData * -QDeclarativeCompiler::property(QDeclarativeScript::Object *object, const QHashedStringRef &name, bool *notInRevision) +QQmlPropertyData * +QQmlCompiler::property(QQmlScript::Object *object, const QHashedStringRef &name, bool *notInRevision) { if (notInRevision) *notInRevision = false; - QDeclarativePropertyCache *cache = 0; + QQmlPropertyCache *cache = 0; if (object->synthCache) cache = object->synthCache; else if (object->type != -1) cache = output->types[object->type].createPropertyCache(engine); else - cache = QDeclarativeEnginePrivate::get(engine)->cache(object->metaObject()); + cache = QQmlEnginePrivate::get(engine)->cache(object->metaObject()); - QDeclarativePropertyData *d = cache->property(name); + QQmlPropertyData *d = cache->property(name); // Find the first property while (d && d->isFunction()) @@ -3818,23 +3818,23 @@ QDeclarativeCompiler::property(QDeclarativeScript::Object *object, const QHashed } } -// This code must match the semantics of QDeclarativePropertyPrivate::findSignalByName -QDeclarativePropertyData * -QDeclarativeCompiler::signal(QDeclarativeScript::Object *object, const QHashedStringRef &name, bool *notInRevision) +// This code must match the semantics of QQmlPropertyPrivate::findSignalByName +QQmlPropertyData * +QQmlCompiler::signal(QQmlScript::Object *object, const QHashedStringRef &name, bool *notInRevision) { if (notInRevision) *notInRevision = false; - QDeclarativePropertyCache *cache = 0; + QQmlPropertyCache *cache = 0; if (object->synthCache) cache = object->synthCache; else if (object->type != -1) cache = output->types[object->type].createPropertyCache(engine); else - cache = QDeclarativeEnginePrivate::get(engine)->cache(object->metaObject()); + cache = QQmlEnginePrivate::get(engine)->cache(object->metaObject()); - QDeclarativePropertyData *d = cache->property(name); + QQmlPropertyData *d = cache->property(name); if (notInRevision) *notInRevision = false; while (d && !(d->isFunction())) @@ -3858,24 +3858,24 @@ QDeclarativeCompiler::signal(QDeclarativeScript::Object *object, const QHashedSt return 0; } -// This code must match the semantics of QDeclarativePropertyPrivate::findSignalByName -int QDeclarativeCompiler::indexOfSignal(QDeclarativeScript::Object *object, const QString &name, +// This code must match the semantics of QQmlPropertyPrivate::findSignalByName +int QQmlCompiler::indexOfSignal(QQmlScript::Object *object, const QString &name, bool *notInRevision) { - QDeclarativePropertyData *d = signal(object, QStringRef(&name), notInRevision); + QQmlPropertyData *d = signal(object, QStringRef(&name), notInRevision); return d?d->coreIndex:-1; } -int QDeclarativeCompiler::indexOfProperty(QDeclarativeScript::Object *object, const QString &name, +int QQmlCompiler::indexOfProperty(QQmlScript::Object *object, const QString &name, bool *notInRevision) { return indexOfProperty(object, QStringRef(&name), notInRevision); } -int QDeclarativeCompiler::indexOfProperty(QDeclarativeScript::Object *object, const QHashedStringRef &name, +int QQmlCompiler::indexOfProperty(QQmlScript::Object *object, const QHashedStringRef &name, bool *notInRevision) { - QDeclarativePropertyData *d = property(object, name, notInRevision); + QQmlPropertyData *d = property(object, name, notInRevision); return d?d->coreIndex:-1; } diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h new file mode 100644 index 0000000000..9b13b7e63b --- /dev/null +++ b/src/qml/qml/qqmlcompiler_p.h @@ -0,0 +1,466 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QQMLCOMPILER_P_H +#define QQMLCOMPILER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qqml.h" +#include "qqmlerror.h" +#include <private/qv8_p.h> +#include "qqmlinstruction_p.h" +#include "qqmlscript_p.h" +#include "qqmlengine_p.h" +#include <private/qbitfield_p.h> +#include "qqmlpropertycache_p.h" +#include "qqmlintegercache_p.h" +#include "qqmltypenamecache_p.h" +#include "qqmltypeloader_p.h" + +#include <QtCore/qbytearray.h> +#include <QtCore/qset.h> +#include <QtCore/QCoreApplication> + +QT_BEGIN_NAMESPACE + +class QQmlEngine; +class QQmlComponent; +class QQmlContext; +class QQmlContextData; + +class Q_AUTOTEST_EXPORT QQmlCompiledData : public QQmlRefCount, + public QQmlCleanup +{ +public: + QQmlCompiledData(QQmlEngine *engine); + virtual ~QQmlCompiledData(); + + QQmlEngine *engine; + + QString name; + QUrl url; + QQmlTypeNameCache *importCache; + + struct TypeReference + { + TypeReference() + : type(0), typePropertyCache(0), component(0) {} + + QString className; + QQmlType *type; + QQmlPropertyCache *typePropertyCache; + QQmlCompiledData *component; + + const QMetaObject *metaObject() const; + QQmlPropertyCache *propertyCache() const; + QQmlPropertyCache *createPropertyCache(QQmlEngine *); + }; + QList<TypeReference> types; + + struct V8Program { + V8Program(const QByteArray &p, QQmlCompiledData *c) + : program(p), cdata(c) {} + + QByteArray program; + v8::Persistent<v8::Array> bindings; + QQmlCompiledData *cdata; + }; + + QList<V8Program> programs; + + const QMetaObject *root; + QAbstractDynamicMetaObject rootData; + QQmlPropertyCache *rootPropertyCache; + QList<QString> primitives; + QList<QByteArray> datas; + QByteArray bytecode; + QList<QQmlPropertyCache *> propertyCaches; + QList<QQmlIntegerCache *> contextCaches; + QList<QQmlScriptData *> scripts; + QList<QUrl> urls; + + struct Instruction { +#define QML_INSTR_DATA_TYPEDEF(I, FMT) typedef QQmlInstructionData<QQmlInstruction::I> I; + FOR_EACH_QML_INSTR(QML_INSTR_DATA_TYPEDEF) +#undef QML_INSTR_DATA_TYPEDEF + private: + Instruction(); + }; + + void dumpInstructions(); + + template <int Instr> + int addInstruction(const QQmlInstructionData<Instr> &data) + { + QQmlInstruction genericInstr; + QQmlInstructionMeta<Instr>::setData(genericInstr, data); + return addInstructionHelper(static_cast<QQmlInstruction::Type>(Instr), genericInstr); + } + int nextInstructionIndex(); + QQmlInstruction *instruction(int index); + QQmlInstruction::Type instructionType(const QQmlInstruction *instr); + + bool isInitialized() const { return hasEngine(); } + void initialize(QQmlEngine *); + +protected: + virtual void destroy(); // From QQmlRefCount + virtual void clear(); // From QQmlCleanup + +private: + friend class QQmlCompiler; + + int addInstructionHelper(QQmlInstruction::Type type, QQmlInstruction &instr); + void dump(QQmlInstruction *, int idx = -1); + QQmlCompiledData(const QQmlCompiledData &other); + QQmlCompiledData &operator=(const QQmlCompiledData &other); + QByteArray packData; + int pack(const char *, size_t); + + int indexForString(const QString &); + int indexForByteArray(const QByteArray &); + int indexForUrl(const QUrl &); +}; + +namespace QQmlCompilerTypes { + struct BindingContext + { + BindingContext() + : stack(0), owner(0), object(0) {} + BindingContext(QQmlScript::Object *o) + : stack(0), owner(0), object(o) {} + BindingContext incr() const { + BindingContext rv(object); + rv.stack = stack + 1; + return rv; + } + bool isSubContext() const { return stack != 0; } + int stack; + int owner; + QQmlScript::Object *object; + }; + + struct BindingReference + { + enum DataType { QtScript, V4, V8, + Tr, TrId }; + DataType dataType; + }; + + struct JSBindingReference : public QQmlPool::Class, + public BindingReference + { + JSBindingReference() : nextReference(0) {} + + QQmlScript::Variant expression; + QQmlScript::Property *property; + QQmlScript::Value *value; + + int compiledIndex; + + QString rewrittenExpression; + BindingContext bindingContext; + + JSBindingReference *nextReference; + }; + + struct TrBindingReference : public QQmlPool::POD, + public BindingReference + { + QStringRef text; + QStringRef comment; + int n; + }; + + struct IdList : public QFieldList<QQmlScript::Object, + &QQmlScript::Object::nextIdObject> + { + QQmlScript::Object *value(const QString &id) const { + for (QQmlScript::Object *o = first(); o; o = next(o)) { + if (o->id == id) + return o; + } + return 0; + } + }; + + struct DepthStack { + DepthStack() : _depth(0), _maxDepth(0) {} + DepthStack(const DepthStack &o) : _depth(o._depth), _maxDepth(o._maxDepth) {} + DepthStack &operator=(const DepthStack &o) { _depth = o._depth; _maxDepth = o._maxDepth; return *this; } + + int depth() const { return _depth; } + int maxDepth() const { return _maxDepth; } + + void push() { ++_depth; _maxDepth = qMax(_depth, _maxDepth); } + void pop() { --_depth; Q_ASSERT(_depth >= 0); Q_ASSERT(_maxDepth > _depth); } + + void pushPop(int count) { _maxDepth = qMax(_depth + count, _maxDepth); } + private: + int _depth; + int _maxDepth; + }; + + // Contains all the incremental compiler state about a component. As + // a single QML file can have multiple components defined, there may be + // more than one of these for each compile + struct ComponentCompileState : public QQmlPool::Class + { + ComponentCompileState() + : parserStatusCount(0), totalBindingsCount(0), pushedProperties(0), nested(false), + v8BindingProgramLine(-1), root(0) {} + + IdList ids; + int parserStatusCount; + int totalBindingsCount; + int pushedProperties; + bool nested; + + QByteArray compiledBindingData; + QByteArray v8BindingProgram; + int v8BindingProgramLine; + + DepthStack objectDepth; + DepthStack listDepth; + + typedef QQmlCompilerTypes::JSBindingReference B; + typedef QFieldList<B, &B::nextReference> JSBindingReferenceList; + JSBindingReferenceList bindings; + typedef QQmlScript::Object O; + typedef QFieldList<O, &O::nextAliasingObject> AliasingObjectsList; + AliasingObjectsList aliasingObjects; + QQmlScript::Object *root; + }; +}; + +class QMetaObjectBuilder; +class Q_AUTOTEST_EXPORT QQmlCompiler +{ + Q_DECLARE_TR_FUNCTIONS(QQmlCompiler) +public: + QQmlCompiler(QQmlPool *); + + bool compile(QQmlEngine *, QQmlTypeData *, QQmlCompiledData *); + + bool isError() const; + QList<QQmlError> errors() const; + + static bool isAttachedPropertyName(const QString &); + static bool isSignalPropertyName(const QString &); + static bool isAttachedPropertyName(const QHashedStringRef &); + static bool isSignalPropertyName(const QHashedStringRef &); + + int evaluateEnum(const QByteArray& script) const; // for QQmlCustomParser::evaluateEnum + const QMetaObject *resolveType(const QString& name) const; // for QQmlCustomParser::resolveType + int rewriteBinding(const QQmlScript::Variant& value, const QString& name); // for QQmlCustomParser::rewriteBinding + QString rewriteSignalHandler(const QQmlScript::Variant& value, const QString &name); // for QQmlCustomParser::rewriteSignalHandler + +private: + typedef QQmlCompiledData::Instruction Instruction; + + static void reset(QQmlCompiledData *); + + void compileTree(QQmlScript::Object *tree); + + + bool buildObject(QQmlScript::Object *obj, const QQmlCompilerTypes::BindingContext &); + bool buildComponent(QQmlScript::Object *obj, const QQmlCompilerTypes::BindingContext &); + bool buildSubObject(QQmlScript::Object *obj, const QQmlCompilerTypes::BindingContext &); + bool buildSignal(QQmlScript::Property *prop, QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &); + bool buildProperty(QQmlScript::Property *prop, QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &); + bool buildPropertyInNamespace(QQmlImportedNamespace *ns, + QQmlScript::Property *prop, + QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &); + bool buildIdProperty(QQmlScript::Property *prop, QQmlScript::Object *obj); + bool buildAttachedProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildGroupedProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildValueTypeProperty(QObject *type, + QQmlScript::Object *obj, + QQmlScript::Object *baseObj, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildListProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildScriptStringProperty(QQmlScript::Property *prop, + QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildPropertyAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildPropertyObjectAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Value *value, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildPropertyOnAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Object *baseObj, + QQmlScript::Value *value, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildPropertyLiteralAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Value *value, + const QQmlCompilerTypes::BindingContext &ctxt); + bool doesPropertyExist(QQmlScript::Property *prop, QQmlScript::Object *obj); + bool testLiteralAssignment(QQmlScript::Property *prop, + QQmlScript::Value *value); + bool testQualifiedEnumAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Value *value, + bool *isAssignment); + enum DynamicMetaMode { IgnoreAliases, ResolveAliases, ForceCreation }; + bool mergeDynamicMetaProperties(QQmlScript::Object *obj); + bool buildDynamicMeta(QQmlScript::Object *obj, DynamicMetaMode mode); + bool checkDynamicMeta(QQmlScript::Object *obj); + bool buildBinding(QQmlScript::Value *, QQmlScript::Property *prop, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildLiteralBinding(QQmlScript::Value *, QQmlScript::Property *prop, + const QQmlCompilerTypes::BindingContext &ctxt); + bool buildComponentFromRoot(QQmlScript::Object *obj, const QQmlCompilerTypes::BindingContext &); + bool compileAlias(QFastMetaBuilder &, + QByteArray &data, + QQmlScript::Object *obj, + int propIndex, int aliasIndex, + QQmlScript::Object::DynamicProperty &); + bool completeComponentBuild(); + bool checkValidId(QQmlScript::Value *, const QString &); + + + void genObject(QQmlScript::Object *obj); + void genObjectBody(QQmlScript::Object *obj); + void genValueTypeProperty(QQmlScript::Object *obj,QQmlScript::Property *); + void genComponent(QQmlScript::Object *obj); + void genValueProperty(QQmlScript::Property *prop, QQmlScript::Object *obj); + void genListProperty(QQmlScript::Property *prop, QQmlScript::Object *obj); + void genPropertyAssignment(QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Property *valueTypeProperty = 0); + void genLiteralAssignment(QQmlScript::Property *prop, + QQmlScript::Value *value); + void genBindingAssignment(QQmlScript::Value *binding, + QQmlScript::Property *prop, + QQmlScript::Object *obj, + QQmlScript::Property *valueTypeProperty = 0); + int genContextCache(); + + QQmlPropertyData genValueTypeData(QQmlScript::Property *prop, + QQmlScript::Property *valueTypeProp); + + int componentTypeRef(); + int translationContextIndex(); + + static QQmlType *toQmlType(QQmlScript::Object *from); + bool canCoerce(int to, QQmlScript::Object *from); + + QString elementName(QQmlScript::Object *); + + QStringList deferredProperties(QQmlScript::Object *); + + QQmlPropertyData *property(QQmlScript::Object *, int); + QQmlPropertyData *property(QQmlScript::Object *, const QHashedStringRef &, + bool *notInRevision = 0); + QQmlPropertyData *signal(QQmlScript::Object *, const QHashedStringRef &, + bool *notInRevision = 0); + int indexOfProperty(QQmlScript::Object *, const QHashedStringRef &, bool *notInRevision = 0); + int indexOfProperty(QQmlScript::Object *, const QString &, bool *notInRevision = 0); + int indexOfSignal(QQmlScript::Object *, const QString &, bool *notInRevision = 0); + + void addId(const QString &, QQmlScript::Object *); + + void dumpStats(); + + void addBindingReference(QQmlCompilerTypes::JSBindingReference *); + + QQmlCompilerTypes::ComponentCompileState *compileState; + + QQmlPool *pool; + + QQmlCompilerTypes::ComponentCompileState *componentState(QQmlScript::Object *); + void saveComponentState(); + + QList<QQmlError> exceptions; + QQmlCompiledData *output; + QQmlEngine *engine; + QQmlEnginePrivate *enginePrivate; + QQmlScript::Object *unitRoot; + QQmlTypeData *unit; + int cachedComponentTypeRef; + int cachedTranslationContextIndex; + + // Compiler component statistics. Only collected if QML_COMPILER_STATS=1 + struct ComponentStat + { + ComponentStat() : ids(0), objects(0) {} + + int lineNumber; + + int ids; + QList<QQmlScript::LocationSpan> scriptBindings; + QList<QQmlScript::LocationSpan> optimizedBindings; + int objects; + }; + struct ComponentStats : public QQmlPool::Class + { + ComponentStat componentStat; + QList<ComponentStat> savedComponentStats; + }; + ComponentStats *componentStats; +}; + +QT_END_NAMESPACE + +#endif // QQMLCOMPILER_P_H diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index c168c8f4eb..e168f063c0 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,24 +39,23 @@ ** ****************************************************************************/ -#include "qdeclarativecomponent.h" -#include "qdeclarativecomponent_p.h" -#include "qdeclarativecomponentattached_p.h" - -#include "qdeclarativecompiler_p.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativevme_p.h" -#include "qdeclarative.h" -#include "qdeclarativeengine.h" -#include "qdeclarativebinding_p.h" -#include "qdeclarativebinding_p_p.h" -#include "qdeclarativeglobal_p.h" -#include "qdeclarativescript_p.h" -#include <private/qdeclarativeprofilerservice_p.h> -#include <private/qdeclarativeenginedebugservice_p.h> -#include "qdeclarativeincubator.h" -#include "qdeclarativeincubator_p.h" +#include "qqmlcomponent.h" +#include "qqmlcomponent_p.h" +#include "qqmlcomponentattached_p.h" + +#include "qqmlcompiler_p.h" +#include "qqmlcontext_p.h" +#include "qqmlengine_p.h" +#include "qqmlvme_p.h" +#include "qqml.h" +#include "qqmlengine.h" +#include "qqmlbinding_p.h" +#include "qqmlbinding_p_p.h" +#include "qqmlscript_p.h" +#include <private/qqmlprofilerservice_p.h> +#include <private/qqmlenginedebugservice_p.h> +#include "qqmlincubator.h" +#include "qqmlincubator_p.h" #include <private/qv8engine_p.h> #include <private/qv8include_p.h> @@ -64,21 +63,21 @@ #include <QStack> #include <QStringList> #include <QtCore/qdebug.h> -#include <qdeclarativeinfo.h> +#include <qqmlinfo.h> QT_BEGIN_NAMESPACE -class QDeclarativeComponentExtension : public QV8Engine::Deletable +class QQmlComponentExtension : public QV8Engine::Deletable { public: - QDeclarativeComponentExtension(QV8Engine *); - virtual ~QDeclarativeComponentExtension(); + QQmlComponentExtension(QV8Engine *); + virtual ~QQmlComponentExtension(); v8::Persistent<v8::Function> incubationConstructor; v8::Persistent<v8::Script> initialProperties; v8::Persistent<v8::Function> forceCompletion; }; -V8_DEFINE_EXTENSION(QDeclarativeComponentExtension, componentExtension); +V8_DEFINE_EXTENSION(QQmlComponentExtension, componentExtension); /* Try to do what's necessary for a reasonable display of the type @@ -91,7 +90,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) static const QString qmlMarker(QLatin1String("_QML")); static const QChar underscore(QLatin1Char('_')); static const QChar asterisk(QLatin1Char('*')); - QDeclarativeType *type = QDeclarativeMetaType::qmlType(metaObject); + QQmlType *type = QQmlMetaType::qmlType(metaObject); QString typeName = type ? type->qmlTypeName() : QString::fromUtf8(metaObject->className()); if (!type) { //### optimize further? @@ -99,7 +98,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) if (marker != -1 && marker < typeName.count() - 1) { if (typeName[marker + 1] == underscore) { const QString className = typeName.left(marker) + asterisk; - type = QDeclarativeMetaType::qmlType(QMetaType::type(className.toUtf8())); + type = QQmlMetaType::qmlType(QMetaType::type(className.toUtf8())); if (type) typeName = type->qmlTypeName(); } @@ -109,15 +108,15 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) } /*! - \class QDeclarativeComponent + \class QQmlComponent \since 4.7 - \brief The QDeclarativeComponent class encapsulates a QML component definition. + \brief The QQmlComponent class encapsulates a QML component definition. \mainclass Components are reusable, encapsulated QML elements with well-defined interfaces. They are often defined in \l {qdeclarativedocuments.html}{Component Files}. - A QDeclarativeComponent instance can be created from a QML file. + A QQmlComponent instance can be created from a QML file. For example, if there is a \c main.qml file like this: \qml @@ -134,36 +133,36 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) value: \code - QDeclarativeEngine *engine = new QDeclarativeEngine; - QDeclarativeComponent component(engine, QUrl::fromLocalFile("main.qml")); + QQmlEngine *engine = new QQmlEngine; + QQmlComponent component(engine, QUrl::fromLocalFile("main.qml")); QObject *myObject = component.create(); - QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(myObject); + QQuickItem *item = qobject_cast<QQuickItem*>(myObject); int width = item->width(); // width = 200 \endcode \section2 Network Components - If the URL passed to QDeclarativeComponent is a network resource, or if the QML document references a - network resource, the QDeclarativeComponent has to fetch the network data before it is able to create - objects. In this case, the QDeclarativeComponent will have a \l {QDeclarativeComponent::Loading}{Loading} - \l {QDeclarativeComponent::status()}{status}. An application will have to wait until the component - is \l {QDeclarativeComponent::Ready}{Ready} before calling \l {QDeclarativeComponent::create()}. + If the URL passed to QQmlComponent is a network resource, or if the QML document references a + network resource, the QQmlComponent has to fetch the network data before it is able to create + objects. In this case, the QQmlComponent will have a \l {QQmlComponent::Loading}{Loading} + \l {QQmlComponent::status()}{status}. An application will have to wait until the component + is \l {QQmlComponent::Ready}{Ready} before calling \l {QQmlComponent::create()}. The following example shows how to load a QML file from a network resource. After creating - the QDeclarativeComponent, it tests whether the component is loading. If it is, it connects to the - QDeclarativeComponent::statusChanged() signal and otherwise calls the \c {continueLoading()} method - directly. Note that QDeclarativeComponent::isLoading() may be false for a network component if the + the QQmlComponent, it tests whether the component is loading. If it is, it connects to the + QQmlComponent::statusChanged() signal and otherwise calls the \c {continueLoading()} method + directly. Note that QQmlComponent::isLoading() may be false for a network component if the component has been cached and is ready immediately. \code MyApplication::MyApplication() { // ... - component = new QDeclarativeComponent(engine, QUrl("http://www.example.com/main.qml")); + component = new QQmlComponent(engine, QUrl("http://www.example.com/main.qml")); if (component->isLoading()) - QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), + QObject::connect(component, SIGNAL(statusChanged(QQmlComponent::Status)), this, SLOT(continueLoading())); else continueLoading(); @@ -183,7 +182,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) */ /*! - \qmlclass Component QDeclarativeComponent + \qmlclass Component QQmlComponent \ingroup qml-utility-elements \since 4.7 \brief The Component element encapsulates a QML component definition. @@ -199,7 +198,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) For example, here is a component that is used by multiple \l Loader objects. It contains a single item, a \l Rectangle: - \snippet doc/src/snippets/declarative/component.qml 0 + \snippet doc/src/snippets/qml/component.qml 0 Notice that while a \l Rectangle by itself would be automatically rendered and displayed, this is not the case for the above rectangle @@ -266,23 +265,23 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) } \endqml - \sa QtDeclarative + \sa QtQml */ /*! - \enum QDeclarativeComponent::Status + \enum QQmlComponent::Status - Specifies the loading status of the QDeclarativeComponent. + Specifies the loading status of the QQmlComponent. - \value Null This QDeclarativeComponent has no data. Call loadUrl() or setData() to add QML content. - \value Ready This QDeclarativeComponent is ready and create() may be called. - \value Loading This QDeclarativeComponent is loading network data. - \value Error An error has occurred. Call errors() to retrieve a list of \{QDeclarativeError}{errors}. + \value Null This QQmlComponent has no data. Call loadUrl() or setData() to add QML content. + \value Ready This QQmlComponent is ready and create() may be called. + \value Loading This QQmlComponent is loading network data. + \value Error An error has occurred. Call errors() to retrieve a list of \{QQmlError}{errors}. */ -void QDeclarativeComponentPrivate::typeDataReady(QDeclarativeTypeData *) +void QQmlComponentPrivate::typeDataReady(QQmlTypeData *) { - Q_Q(QDeclarativeComponent); + Q_Q(QQmlComponent); Q_ASSERT(typeData); @@ -292,19 +291,19 @@ void QDeclarativeComponentPrivate::typeDataReady(QDeclarativeTypeData *) emit q->statusChanged(q->status()); } -void QDeclarativeComponentPrivate::typeDataProgress(QDeclarativeTypeData *, qreal p) +void QQmlComponentPrivate::typeDataProgress(QQmlTypeData *, qreal p) { - Q_Q(QDeclarativeComponent); + Q_Q(QQmlComponent); progress = p; emit q->progressChanged(p); } -void QDeclarativeComponentPrivate::fromTypeData(QDeclarativeTypeData *data) +void QQmlComponentPrivate::fromTypeData(QQmlTypeData *data) { url = data->finalUrl(); - QDeclarativeCompiledData *c = data->compiledData(); + QQmlCompiledData *c = data->compiledData(); if (!c) { Q_ASSERT(data->isError()); @@ -316,7 +315,7 @@ void QDeclarativeComponentPrivate::fromTypeData(QDeclarativeTypeData *data) data->release(); } -void QDeclarativeComponentPrivate::clear() +void QQmlComponentPrivate::clear() { if (typeData) { typeData->unregisterCallback(this); @@ -333,20 +332,20 @@ void QDeclarativeComponentPrivate::clear() /*! \internal */ -QDeclarativeComponent::QDeclarativeComponent(QObject *parent) - : QObject(*(new QDeclarativeComponentPrivate), parent) +QQmlComponent::QQmlComponent(QObject *parent) + : QObject(*(new QQmlComponentPrivate), parent) { } /*! - Destruct the QDeclarativeComponent. + Destruct the QQmlComponent. */ -QDeclarativeComponent::~QDeclarativeComponent() +QQmlComponent::~QQmlComponent() { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); if (d->state.completePending) { - qWarning("QDeclarativeComponent: Component destroyed while completion pending"); + qWarning("QQmlComponent: Component destroyed while completion pending"); d->completeCreate(); } @@ -371,12 +370,12 @@ QDeclarativeComponent::~QDeclarativeComponent() */ /*! - \property QDeclarativeComponent::status - The component's current \l{QDeclarativeComponent::Status} {status}. + \property QQmlComponent::status + The component's current \l{QQmlComponent::Status} {status}. */ -QDeclarativeComponent::Status QDeclarativeComponent::status() const +QQmlComponent::Status QQmlComponent::status() const { - Q_D(const QDeclarativeComponent); + Q_D(const QQmlComponent); if (d->typeData) return Loading; @@ -389,33 +388,33 @@ QDeclarativeComponent::Status QDeclarativeComponent::status() const } /*! - Returns true if status() == QDeclarativeComponent::Null. + Returns true if status() == QQmlComponent::Null. */ -bool QDeclarativeComponent::isNull() const +bool QQmlComponent::isNull() const { return status() == Null; } /*! - Returns true if status() == QDeclarativeComponent::Ready. + Returns true if status() == QQmlComponent::Ready. */ -bool QDeclarativeComponent::isReady() const +bool QQmlComponent::isReady() const { return status() == Ready; } /*! - Returns true if status() == QDeclarativeComponent::Error. + Returns true if status() == QQmlComponent::Error. */ -bool QDeclarativeComponent::isError() const +bool QQmlComponent::isError() const { return status() == Error; } /*! - Returns true if status() == QDeclarativeComponent::Loading. + Returns true if status() == QQmlComponent::Loading. */ -bool QDeclarativeComponent::isLoading() const +bool QQmlComponent::isLoading() const { return status() == Loading; } @@ -427,43 +426,43 @@ bool QDeclarativeComponent::isLoading() const */ /*! - \property QDeclarativeComponent::progress + \property QQmlComponent::progress The progress of loading the component, from 0.0 (nothing loaded) to 1.0 (finished). */ -qreal QDeclarativeComponent::progress() const +qreal QQmlComponent::progress() const { - Q_D(const QDeclarativeComponent); + Q_D(const QQmlComponent); return d->progress; } /*! - \fn void QDeclarativeComponent::progressChanged(qreal progress) + \fn void QQmlComponent::progressChanged(qreal progress) Emitted whenever the component's loading progress changes. \a progress will be the current progress between 0.0 (nothing loaded) and 1.0 (finished). */ /*! - \fn void QDeclarativeComponent::statusChanged(QDeclarativeComponent::Status status) + \fn void QQmlComponent::statusChanged(QQmlComponent::Status status) Emitted whenever the component's status changes. \a status will be the new status. */ /*! - Create a QDeclarativeComponent with no data and give it the specified + Create a QQmlComponent with no data and give it the specified \a engine and \a parent. Set the data with setData(). */ -QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QObject *parent) - : QObject(*(new QDeclarativeComponentPrivate), parent) +QQmlComponent::QQmlComponent(QQmlEngine *engine, QObject *parent) + : QObject(*(new QQmlComponentPrivate), parent) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); d->engine = engine; } /*! - Create a QDeclarativeComponent from the given \a url and give it the + Create a QQmlComponent from the given \a url and give it the specified \a parent and \a engine. Ensure that the URL provided is full and correct, in particular, use @@ -471,25 +470,25 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QObject \sa loadUrl() */ -QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const QUrl &url, QObject *parent) -: QObject(*(new QDeclarativeComponentPrivate), parent) +QQmlComponent::QQmlComponent(QQmlEngine *engine, const QUrl &url, QObject *parent) +: QObject(*(new QQmlComponentPrivate), parent) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); d->engine = engine; loadUrl(url); } /*! - Create a QDeclarativeComponent from the given \a fileName and give it the specified + Create a QQmlComponent from the given \a fileName and give it the specified \a parent and \a engine. \sa loadUrl() */ -QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const QString &fileName, +QQmlComponent::QQmlComponent(QQmlEngine *engine, const QString &fileName, QObject *parent) -: QObject(*(new QDeclarativeComponentPrivate), parent) +: QObject(*(new QQmlComponentPrivate), parent) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); d->engine = engine; loadUrl(d->engine->baseUrl().resolved(QUrl::fromLocalFile(fileName))); } @@ -497,10 +496,10 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const Q /*! \internal */ -QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QDeclarativeCompiledData *cc, int start, QObject *parent) - : QObject(*(new QDeclarativeComponentPrivate), parent) +QQmlComponent::QQmlComponent(QQmlEngine *engine, QQmlCompiledData *cc, int start, QObject *parent) + : QObject(*(new QQmlComponentPrivate), parent) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); d->engine = engine; d->cc = cc; cc->addref(); @@ -510,19 +509,19 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QDeclar } /*! - Sets the QDeclarativeComponent to use the given QML \a data. If \a url + Sets the QQmlComponent to use the given QML \a data. If \a url is provided, it is used to set the component name and to provide a base path for items resolved by this component. */ -void QDeclarativeComponent::setData(const QByteArray &data, const QUrl &url) +void QQmlComponent::setData(const QByteArray &data, const QUrl &url) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); d->clear(); d->url = url; - QDeclarativeTypeData *typeData = QDeclarativeEnginePrivate::get(d->engine)->typeLoader.get(data, url); + QQmlTypeData *typeData = QQmlEnginePrivate::get(d->engine)->typeLoader.get(data, url); if (typeData->isCompleteOrError()) { d->fromTypeData(typeData); @@ -537,27 +536,27 @@ void QDeclarativeComponent::setData(const QByteArray &data, const QUrl &url) } /*! -Returns the QDeclarativeContext the component was created in. This is only +Returns the QQmlContext the component was created in. This is only valid for components created directly from QML. */ -QDeclarativeContext *QDeclarativeComponent::creationContext() const +QQmlContext *QQmlComponent::creationContext() const { - Q_D(const QDeclarativeComponent); + Q_D(const QQmlComponent); if(d->creationContext) - return d->creationContext->asQDeclarativeContext(); + return d->creationContext->asQQmlContext(); return qmlContext(this); } /*! - Load the QDeclarativeComponent from the provided \a url. + Load the QQmlComponent from the provided \a url. Ensure that the URL provided is full and correct, in particular, use \l QUrl::fromLocalFile() when loading a file from the local filesystem. */ -void QDeclarativeComponent::loadUrl(const QUrl &url) +void QQmlComponent::loadUrl(const QUrl &url) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); d->clear(); @@ -568,13 +567,13 @@ void QDeclarativeComponent::loadUrl(const QUrl &url) d->url = url; if (url.isEmpty()) { - QDeclarativeError error; + QQmlError error; error.setDescription(tr("Invalid empty URL")); d->state.errors << error; return; } - QDeclarativeTypeData *data = QDeclarativeEnginePrivate::get(d->engine)->typeLoader.get(d->url); + QQmlTypeData *data = QQmlEnginePrivate::get(d->engine)->typeLoader.get(d->url); if (data->isCompleteOrError()) { d->fromTypeData(data); @@ -593,13 +592,13 @@ void QDeclarativeComponent::loadUrl(const QUrl &url) Return the list of errors that occurred during the last compile or create operation. An empty list is returned if isError() is not set. */ -QList<QDeclarativeError> QDeclarativeComponent::errors() const +QList<QQmlError> QQmlComponent::errors() const { - Q_D(const QDeclarativeComponent); + Q_D(const QQmlComponent); if (isError()) return d->state.errors; else - return QList<QDeclarativeError>(); + return QList<QQmlError>(); } /*! @@ -617,13 +616,13 @@ QList<QDeclarativeError> QDeclarativeComponent::errors() const \internal errorString is only meant as a way to get the errors in script */ -QString QDeclarativeComponent::errorString() const +QString QQmlComponent::errorString() const { - Q_D(const QDeclarativeComponent); + Q_D(const QQmlComponent); QString ret; if(!isError()) return ret; - foreach(const QDeclarativeError &e, d->state.errors) { + foreach(const QQmlError &e, d->state.errors) { ret += e.url().toString() + QLatin1Char(':') + QString::number(e.line()) + QLatin1Char(' ') + e.description() + QLatin1Char('\n'); @@ -637,20 +636,20 @@ QString QDeclarativeComponent::errorString() const */ /*! - \property QDeclarativeComponent::url + \property QQmlComponent::url The component URL. This is the URL passed to either the constructor, or the loadUrl() or setData() methods. */ -QUrl QDeclarativeComponent::url() const +QUrl QQmlComponent::url() const { - Q_D(const QDeclarativeComponent); + Q_D(const QQmlComponent); return d->url; } /*! \internal */ -QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject *parent) +QQmlComponent::QQmlComponent(QQmlComponentPrivate &dd, QObject *parent) : QObject(dd, parent) { } @@ -661,11 +660,11 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q instance. If \a context is 0 (the default), it will create the instance in the - engine' s \l {QDeclarativeEngine::rootContext()}{root context}. + engine' s \l {QQmlEngine::rootContext()}{root context}. */ -QObject *QDeclarativeComponent::create(QDeclarativeContext *context) +QObject *QQmlComponent::create(QQmlContext *context) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); if (!context) context = d->engine->rootContext(); @@ -677,67 +676,67 @@ QObject *QDeclarativeComponent::create(QDeclarativeContext *context) /*! This method provides more advanced control over component instance creation. - In general, programmers should use QDeclarativeComponent::create() to create a + In general, programmers should use QQmlComponent::create() to create a component. Create an object instance from this component. Returns 0 if creation failed. \a publicContext specifies the context within which to create the object instance. - When QDeclarativeComponent constructs an instance, it occurs in three steps: + When QQmlComponent constructs an instance, it occurs in three steps: \list 1 \i The object hierarchy is created, and constant values are assigned. \i Property bindings are evaluated for the the first time. - \i If applicable, QDeclarativeParserStatus::componentComplete() is called on objects. + \i If applicable, QQmlParserStatus::componentComplete() is called on objects. \endlist - QDeclarativeComponent::beginCreate() differs from QDeclarativeComponent::create() in that it - only performs step 1. QDeclarativeComponent::completeCreate() must be called to + QQmlComponent::beginCreate() differs from QQmlComponent::create() in that it + only performs step 1. QQmlComponent::completeCreate() must be called to complete steps 2 and 3. This breaking point is sometimes useful when using attached properties to communicate information to an instantiated component, as it allows their initial values to be configured before property bindings take effect. */ -QObject *QDeclarativeComponent::beginCreate(QDeclarativeContext *publicContext) +QObject *QQmlComponent::beginCreate(QQmlContext *publicContext) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); Q_ASSERT(publicContext); - QDeclarativeContextData *context = QDeclarativeContextData::get(publicContext); + QQmlContextData *context = QQmlContextData::get(publicContext); return d->beginCreate(context); } QObject * -QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context) +QQmlComponentPrivate::beginCreate(QQmlContextData *context) { - Q_Q(QDeclarativeComponent); + Q_Q(QQmlComponent); if (!context) { - qWarning("QDeclarativeComponent: Cannot create a component in a null context"); + qWarning("QQmlComponent: Cannot create a component in a null context"); return 0; } if (!context->isValid()) { - qWarning("QDeclarativeComponent: Cannot create a component in an invalid context"); + qWarning("QQmlComponent: Cannot create a component in an invalid context"); return 0; } if (context->engine != engine) { - qWarning("QDeclarativeComponent: Must create component in context from the same QDeclarativeEngine"); + qWarning("QQmlComponent: Must create component in context from the same QQmlEngine"); return 0; } if (state.completePending) { - qWarning("QDeclarativeComponent: Cannot create new component instance before completing the previous"); + qWarning("QQmlComponent: Cannot create new component instance before completing the previous"); return 0; } if (!q->isReady()) { - qWarning("QDeclarativeComponent: Component is not ready"); + qWarning("QQmlComponent: Component is not ready"); return 0; } - QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine); + QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(engine); bool isRoot = enginePriv->inProgressCreations == 0; enginePriv->inProgressCreations++; @@ -745,7 +744,7 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context) state.completePending = true; if (isRoot) - QDeclarativeProfilerService::startRange(QDeclarativeProfilerService::Creating); + QQmlProfilerService::startRange(QQmlProfilerService::Creating); enginePriv->referenceScarceResources(); state.vme.init(context, cc, start, creationContext); @@ -753,21 +752,21 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context) enginePriv->dereferenceScarceResources(); if (rv) { - QDeclarativeData *ddata = QDeclarativeData::get(rv); + QQmlData *ddata = QQmlData::get(rv); Q_ASSERT(ddata); ddata->indestructible = true; } if (enginePriv->isDebugging && rv) { if (!context->isInternal) - context->asQDeclarativeContextPrivate()->instances.append(rv); - QDeclarativeEngineDebugService::instance()->objectCreated(engine, rv); + context->asQQmlContextPrivate()->instances.append(rv); + QQmlEngineDebugService::instance()->objectCreated(engine, rv); if (isRoot) { - QDeclarativeProfilerService::rangeData(QDeclarativeProfilerService::Creating, + QQmlProfilerService::rangeData(QQmlProfilerService::Creating, buildTypeNameForDebug(rv->metaObject())); - QDeclarativeData *data = QDeclarativeData::get(rv); + QQmlData *data = QQmlData::get(rv); Q_ASSERT(data); - QDeclarativeProfilerService::rangeLocation(QDeclarativeProfilerService::Creating, + QQmlProfilerService::rangeLocation(QQmlProfilerService::Creating, cc->url, data->lineNumber, data->columnNumber); } } @@ -775,7 +774,7 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context) return rv; } -void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *enginePriv, +void QQmlComponentPrivate::beginDeferred(QQmlEnginePrivate *enginePriv, QObject *object, ConstructionState *state) { enginePriv->inProgressCreations++; @@ -786,7 +785,7 @@ void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *engi state->vme.execute(&state->errors); } -void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state) +void QQmlComponentPrivate::complete(QQmlEnginePrivate *enginePriv, ConstructionState *state) { if (state->completePending) { state->vme.complete(); @@ -806,34 +805,34 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri /*! This method provides more advanced control over component instance creation. - In general, programmers should use QDeclarativeComponent::create() to create a + In general, programmers should use QQmlComponent::create() to create a component. - Complete a component creation begin with QDeclarativeComponent::beginCreate(). + Complete a component creation begin with QQmlComponent::beginCreate(). */ -void QDeclarativeComponent::completeCreate() +void QQmlComponent::completeCreate() { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); d->completeCreate(); } -void QDeclarativeComponentPrivate::completeCreate() +void QQmlComponentPrivate::completeCreate() { if (state.completePending) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); complete(ep, &state); - QDeclarativeProfilerService::endRange(QDeclarativeProfilerService::Creating); + QQmlProfilerService::endRange(QQmlProfilerService::Creating); } } -QDeclarativeComponentAttached::QDeclarativeComponentAttached(QObject *parent) +QQmlComponentAttached::QQmlComponentAttached(QObject *parent) : QObject(parent), prev(0), next(0) { } -QDeclarativeComponentAttached::~QDeclarativeComponentAttached() +QQmlComponentAttached::~QQmlComponentAttached() { if (prev) *prev = next; if (next) next->prev = prev; @@ -844,19 +843,19 @@ QDeclarativeComponentAttached::~QDeclarativeComponentAttached() /*! \internal */ -QDeclarativeComponentAttached *QDeclarativeComponent::qmlAttachedProperties(QObject *obj) +QQmlComponentAttached *QQmlComponent::qmlAttachedProperties(QObject *obj) { - QDeclarativeComponentAttached *a = new QDeclarativeComponentAttached(obj); + QQmlComponentAttached *a = new QQmlComponentAttached(obj); - QDeclarativeEngine *engine = qmlEngine(obj); + QQmlEngine *engine = qmlEngine(obj); if (!engine) return a; - if (QDeclarativeEnginePrivate::get(engine)->activeVME) { // XXX should only be allowed during begin - QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine); + if (QQmlEnginePrivate::get(engine)->activeVME) { // XXX should only be allowed during begin + QQmlEnginePrivate *p = QQmlEnginePrivate::get(engine); a->add(&p->activeVME->componentAttached); } else { - QDeclarativeData *d = QDeclarativeData::get(obj); + QQmlData *d = QQmlData::get(obj); Q_ASSERT(d); Q_ASSERT(d->context); a->add(&d->context->componentAttached); @@ -865,37 +864,37 @@ QDeclarativeComponentAttached *QDeclarativeComponent::qmlAttachedProperties(QObj return a; } -void QDeclarativeComponent::create(QDeclarativeIncubator &i, QDeclarativeContext *context, - QDeclarativeContext *forContext) +void QQmlComponent::create(QQmlIncubator &i, QQmlContext *context, + QQmlContext *forContext) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); if (!context) context = d->engine->rootContext(); - QDeclarativeContextData *contextData = QDeclarativeContextData::get(context); - QDeclarativeContextData *forContextData = contextData; - if (forContext) forContextData = QDeclarativeContextData::get(forContext); + QQmlContextData *contextData = QQmlContextData::get(context); + QQmlContextData *forContextData = contextData; + if (forContext) forContextData = QQmlContextData::get(forContext); if (!contextData->isValid()) { - qWarning("QDeclarativeComponent: Cannot create a component in an invalid context"); + qWarning("QQmlComponent: Cannot create a component in an invalid context"); return; } if (contextData->engine != d->engine) { - qWarning("QDeclarativeComponent: Must create component in context from the same QDeclarativeEngine"); + qWarning("QQmlComponent: Must create component in context from the same QQmlEngine"); return; } if (!isReady()) { - qWarning("QDeclarativeComponent: Component is not ready"); + qWarning("QQmlComponent: Component is not ready"); return; } i.clear(); - QDeclarativeIncubatorPrivate *p = i.d; + QQmlIncubatorPrivate *p = i.d; - QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(d->engine); + QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(d->engine); p->component = d->cc; p->component->addref(); p->vme.init(contextData, d->cc, d->start, d->creationContext); @@ -904,7 +903,7 @@ void QDeclarativeComponent::create(QDeclarativeIncubator &i, QDeclarativeContext } class QV8IncubatorResource : public QV8ObjectResource, - public QDeclarativeIncubator + public QQmlIncubator { V8_RESOURCE_TYPE(IncubatorType) public: @@ -926,7 +925,7 @@ public: void dispose(); v8::Persistent<v8::Object> me; - QDeclarativeGuard<QObject> parent; + QQmlGuard<QObject> parent; v8::Persistent<v8::Value> valuemap; v8::Persistent<v8::Object> qmlGlobal; protected: @@ -934,25 +933,25 @@ protected: virtual void setInitialState(QObject *); }; -static void QDeclarativeComponent_setQmlParent(QObject *me, QObject *parent) +static void QQmlComponent_setQmlParent(QObject *me, QObject *parent) { if (parent) { me->setParent(parent); - typedef QDeclarativePrivate::AutoParentFunction APF; - QList<APF> functions = QDeclarativeMetaType::parentFunctions(); + typedef QQmlPrivate::AutoParentFunction APF; + QList<APF> functions = QQmlMetaType::parentFunctions(); bool needParent = false; for (int ii = 0; ii < functions.count(); ++ii) { - QDeclarativePrivate::AutoParentResult res = functions.at(ii)(me, parent); - if (res == QDeclarativePrivate::Parented) { + QQmlPrivate::AutoParentResult res = functions.at(ii)(me, parent); + if (res == QQmlPrivate::Parented) { needParent = false; break; - } else if (res == QDeclarativePrivate::IncompatibleParent) { + } else if (res == QQmlPrivate::IncompatibleParent) { needParent = true; } } if (needParent) - qWarning("QDeclarativeComponent: Created graphical object was not " + qWarning("QQmlComponent: Created graphical object was not " "placed in the graphics scene."); } } @@ -995,9 +994,9 @@ static void QDeclarativeComponent_setQmlParent(QObject *me, QObject *parent) Dynamically created instances can be deleted with the \c destroy() method. See \l {Dynamic Object Management in QML} for more information. */ -void QDeclarativeComponent::createObject(QDeclarativeV8Function *args) +void QQmlComponent::createObject(QQmlV8Function *args) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); Q_ASSERT(d->engine); Q_ASSERT(args); @@ -1019,7 +1018,7 @@ void QDeclarativeComponent::createObject(QDeclarativeV8Function *args) QV8Engine *v8engine = args->engine(); - QDeclarativeContext *ctxt = creationContext(); + QQmlContext *ctxt = creationContext(); if (!ctxt) ctxt = d->engine->rootContext(); QObject *rv = beginCreate(ctxt); @@ -1029,14 +1028,14 @@ void QDeclarativeComponent::createObject(QDeclarativeV8Function *args) return; } - QDeclarativeComponent_setQmlParent(rv, parent); + QQmlComponent_setQmlParent(rv, parent); v8::Handle<v8::Value> ov = v8engine->newQObject(rv); Q_ASSERT(ov->IsObject()); v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(ov); if (!valuemap.IsEmpty()) { - QDeclarativeComponentExtension *e = componentExtension(v8engine); + QQmlComponentExtension *e = componentExtension(v8engine); // Try catch isn't needed as the function itself is loaded with try/catch v8::Handle<v8::Value> function = e->initialProperties->Run(args->qmlGlobal()); v8::Handle<v8::Value> args[] = { object, valuemap }; @@ -1045,8 +1044,8 @@ void QDeclarativeComponent::createObject(QDeclarativeV8Function *args) d->completeCreate(); - Q_ASSERT(QDeclarativeData::get(rv)); - QDeclarativeData::get(rv)->setImplicitDestructible(); + Q_ASSERT(QQmlData::get(rv)); + QQmlData::get(rv)->setImplicitDestructible(); if (!rv) args->returnValue(v8::Null()); @@ -1105,16 +1104,16 @@ void QDeclarativeComponent::createObject(QDeclarativeV8Function *args) \endjs */ -void QDeclarativeComponent::incubateObject(QDeclarativeV8Function *args) +void QQmlComponent::incubateObject(QQmlV8Function *args) { - Q_D(QDeclarativeComponent); + Q_D(QQmlComponent); Q_ASSERT(d->engine); Q_UNUSED(d); Q_ASSERT(args); QObject *parent = 0; v8::Local<v8::Object> valuemap; - QDeclarativeIncubator::IncubationMode mode = QDeclarativeIncubator::Asynchronous; + QQmlIncubator::IncubationMode mode = QQmlIncubator::Asynchronous; if (args->Length() >= 1) parent = args->engine()->toQObject((*args)[0]); @@ -1134,12 +1133,12 @@ void QDeclarativeComponent::incubateObject(QDeclarativeV8Function *args) if (args->Length() >= 3) { quint32 v = (*args)[2]->Uint32Value(); if (v == 0) - mode = QDeclarativeIncubator::Asynchronous; + mode = QQmlIncubator::Asynchronous; else if (v == 1) - mode = QDeclarativeIncubator::AsynchronousIfNested; + mode = QQmlIncubator::AsynchronousIfNested; } - QDeclarativeComponentExtension *e = componentExtension(args->engine()); + QQmlComponentExtension *e = componentExtension(args->engine()); QV8IncubatorResource *r = new QV8IncubatorResource(args->engine(), mode); v8::Local<v8::Object> o = e->incubationConstructor->NewInstance(); @@ -1154,7 +1153,7 @@ void QDeclarativeComponent::incubateObject(QDeclarativeV8Function *args) create(*r, creationContext()); - if (r->status() == QDeclarativeIncubator::Null) { + if (r->status() == QQmlIncubator::Null) { r->dispose(); args->returnValue(v8::Null()); } else { @@ -1163,9 +1162,9 @@ void QDeclarativeComponent::incubateObject(QDeclarativeV8Function *args) } // XXX used by QSGLoader -void QDeclarativeComponentPrivate::initializeObjectWithInitialProperties(v8::Handle<v8::Object> qmlGlobal, v8::Handle<v8::Object> valuemap, QObject *toCreate) +void QQmlComponentPrivate::initializeObjectWithInitialProperties(v8::Handle<v8::Object> qmlGlobal, v8::Handle<v8::Object> valuemap, QObject *toCreate) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); QV8Engine *v8engine = ep->v8engine(); v8::HandleScope handle_scope; @@ -1175,20 +1174,20 @@ void QDeclarativeComponentPrivate::initializeObjectWithInitialProperties(v8::Han v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(ov); if (!valuemap.IsEmpty()) { - QDeclarativeComponentExtension *e = componentExtension(v8engine); + QQmlComponentExtension *e = componentExtension(v8engine); // Try catch isn't needed as the function itself is loaded with try/catch v8::Handle<v8::Value> function = e->initialProperties->Run(qmlGlobal); v8::Handle<v8::Value> args[] = { object, valuemap }; v8::Handle<v8::Function>::Cast(function)->Call(v8engine->global(), 2, args); } - QDeclarativeData *ddata = QDeclarativeData::get(toCreate); + QQmlData *ddata = QQmlData::get(toCreate); Q_ASSERT(ddata); ddata->setImplicitDestructible(); } -QDeclarativeComponentExtension::QDeclarativeComponentExtension(QV8Engine *engine) +QQmlComponentExtension::QQmlComponentExtension(QV8Engine *engine) { v8::HandleScope handle_scope; v8::Context::Scope scope(engine->context()); @@ -1276,7 +1275,7 @@ void QV8IncubatorResource::StatusChangedSetter(v8::Local<v8::String>, v8::Local< info.This()->SetInternalField(0, value); } -QDeclarativeComponentExtension::~QDeclarativeComponentExtension() +QQmlComponentExtension::~QQmlComponentExtension() { qPersistentDispose(incubationConstructor); qPersistentDispose(initialProperties); @@ -1284,16 +1283,16 @@ QDeclarativeComponentExtension::~QDeclarativeComponentExtension() } QV8IncubatorResource::QV8IncubatorResource(QV8Engine *engine, IncubationMode m) -: QV8ObjectResource(engine), QDeclarativeIncubator(m) +: QV8ObjectResource(engine), QQmlIncubator(m) { } void QV8IncubatorResource::setInitialState(QObject *o) { - QDeclarativeComponent_setQmlParent(o, parent); + QQmlComponent_setQmlParent(o, parent); if (!valuemap.IsEmpty()) { - QDeclarativeComponentExtension *e = componentExtension(engine); + QQmlComponentExtension *e = componentExtension(engine); v8::HandleScope handle_scope; v8::Context::Scope scope(engine->context()); @@ -1318,8 +1317,8 @@ void QV8IncubatorResource::dispose() void QV8IncubatorResource::statusChanged(Status s) { if (s == Ready) { - Q_ASSERT(QDeclarativeData::get(object())); - QDeclarativeData::get(object())->setImplicitDestructible(); + Q_ASSERT(QQmlData::get(object())); + QQmlData::get(object())->setImplicitDestructible(); } if (!me.IsEmpty()) { // Will be false in synchronous mode @@ -1335,9 +1334,9 @@ void QV8IncubatorResource::statusChanged(Status s) v8::TryCatch tc; f->Call(me, 1, args); if (tc.HasCaught()) { - QDeclarativeError error; - QDeclarativeExpressionPrivate::exceptionToError(tc.Message(), error); - QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate::get(engine->engine()), + QQmlError error; + QQmlExpressionPrivate::exceptionToError(tc.Message(), error); + QQmlEnginePrivate::warning(QQmlEnginePrivate::get(engine->engine()), error); } } diff --git a/src/declarative/qml/qdeclarativecomponent.h b/src/qml/qml/qqmlcomponent.h index 2bd292081c..1265fb1c7d 100644 --- a/src/declarative/qml/qdeclarativecomponent.h +++ b/src/qml/qml/qqmlcomponent.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECOMPONENT_H -#define QDECLARATIVECOMPONENT_H +#ifndef QQMLCOMPONENT_H +#define QQMLCOMPONENT_H -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativeerror.h> +#include <QtQml/qqml.h> +#include <QtQml/qqmlerror.h> #include <QtCore/qobject.h> #include <QtCore/qstring.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> QT_BEGIN_HEADER @@ -55,29 +55,29 @@ QT_BEGIN_NAMESPACE class QByteArray; -class QDeclarativeEngine; -class QDeclarativeComponent; -class QDeclarativeIncubator; -class QDeclarativeV8Function; -class QDeclarativeCompiledData; -class QDeclarativeComponentPrivate; -class QDeclarativeComponentAttached; - -class Q_DECLARATIVE_EXPORT QDeclarativeComponent : public QObject +class QQmlEngine; +class QQmlComponent; +class QQmlIncubator; +class QQmlV8Function; +class QQmlCompiledData; +class QQmlComponentPrivate; +class QQmlComponentAttached; + +class Q_QML_EXPORT QQmlComponent : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeComponent) + Q_DECLARE_PRIVATE(QQmlComponent) Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(QUrl url READ url CONSTANT) public: - QDeclarativeComponent(QObject *parent = 0); - QDeclarativeComponent(QDeclarativeEngine *, QObject *parent=0); - QDeclarativeComponent(QDeclarativeEngine *, const QString &fileName, QObject *parent = 0); - QDeclarativeComponent(QDeclarativeEngine *, const QUrl &url, QObject *parent = 0); - virtual ~QDeclarativeComponent(); + QQmlComponent(QObject *parent = 0); + QQmlComponent(QQmlEngine *, QObject *parent=0); + QQmlComponent(QQmlEngine *, const QString &fileName, QObject *parent = 0); + QQmlComponent(QQmlEngine *, const QUrl &url, QObject *parent = 0); + virtual ~QQmlComponent(); Q_ENUMS(Status) enum Status { Null, Ready, Loading, Error }; @@ -88,51 +88,51 @@ public: bool isError() const; bool isLoading() const; - QList<QDeclarativeError> errors() const; + QList<QQmlError> errors() const; Q_INVOKABLE QString errorString() const; qreal progress() const; QUrl url() const; - virtual QObject *create(QDeclarativeContext *context = 0); - virtual QObject *beginCreate(QDeclarativeContext *); + virtual QObject *create(QQmlContext *context = 0); + virtual QObject *beginCreate(QQmlContext *); virtual void completeCreate(); - void create(QDeclarativeIncubator &, QDeclarativeContext *context = 0, - QDeclarativeContext *forContext = 0); + void create(QQmlIncubator &, QQmlContext *context = 0, + QQmlContext *forContext = 0); - QDeclarativeContext *creationContext() const; + QQmlContext *creationContext() const; - static QDeclarativeComponentAttached *qmlAttachedProperties(QObject *); + static QQmlComponentAttached *qmlAttachedProperties(QObject *); public Q_SLOTS: void loadUrl(const QUrl &url); void setData(const QByteArray &, const QUrl &baseUrl); Q_SIGNALS: - void statusChanged(QDeclarativeComponent::Status); + void statusChanged(QQmlComponent::Status); void progressChanged(qreal); protected: - QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject* parent); - Q_INVOKABLE void createObject(QDeclarativeV8Function *); - Q_INVOKABLE void incubateObject(QDeclarativeV8Function *); + QQmlComponent(QQmlComponentPrivate &dd, QObject* parent); + Q_INVOKABLE void createObject(QQmlV8Function *); + Q_INVOKABLE void incubateObject(QQmlV8Function *); private: - QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, QObject *parent); + QQmlComponent(QQmlEngine *, QQmlCompiledData *, int, QObject *parent); - Q_DISABLE_COPY(QDeclarativeComponent) - friend class QDeclarativeVME; - friend class QDeclarativeTypeData; + Q_DISABLE_COPY(QQmlComponent) + friend class QQmlVME; + friend class QQmlTypeData; }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeComponent::Status) -QML_DECLARE_TYPE(QDeclarativeComponent) -QML_DECLARE_TYPEINFO(QDeclarativeComponent, QML_HAS_ATTACHED_PROPERTIES) +Q_DECLARE_METATYPE(QQmlComponent::Status) +QML_DECLARE_TYPE(QQmlComponent) +QML_DECLARE_TYPEINFO(QQmlComponent, QML_HAS_ATTACHED_PROPERTIES) QT_END_HEADER -#endif // QDECLARATIVECOMPONENT_H +#endif // QQMLCOMPONENT_H diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/qml/qml/qqmlcomponent_p.h index 2a237366d8..731fb6a8a7 100644 --- a/src/declarative/qml/qdeclarativecomponent_p.h +++ b/src/qml/qml/qqmlcomponent_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECOMPONENT_P_H -#define QDECLARATIVECOMPONENT_P_H +#ifndef QQMLCOMPONENT_P_H +#define QQMLCOMPONENT_P_H // // W A R N I N G @@ -53,15 +53,15 @@ // We mean it. // -#include "qdeclarativecomponent.h" +#include "qqmlcomponent.h" #include <private/qv8_p.h> -#include "qdeclarativeengine_p.h" -#include "qdeclarativetypeloader_p.h" +#include "qqmlengine_p.h" +#include "qqmltypeloader_p.h" #include <private/qbitfield_p.h> -#include "qdeclarativevme_p.h" -#include "qdeclarativeerror.h" -#include "qdeclarative.h" +#include "qqmlvme_p.h" +#include "qqmlerror.h" +#include "qqml.h" #include <QtCore/QString> #include <QtCore/QStringList> @@ -73,57 +73,57 @@ QT_BEGIN_NAMESPACE class QV8Engine; -class QDeclarativeComponent; -class QDeclarativeEngine; -class QDeclarativeCompiledData; +class QQmlComponent; +class QQmlEngine; +class QQmlCompiledData; -class QDeclarativeComponentAttached; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeComponentPrivate : public QObjectPrivate, public QDeclarativeTypeData::TypeDataCallback +class QQmlComponentAttached; +class Q_QML_PRIVATE_EXPORT QQmlComponentPrivate : public QObjectPrivate, public QQmlTypeData::TypeDataCallback { - Q_DECLARE_PUBLIC(QDeclarativeComponent) + Q_DECLARE_PUBLIC(QQmlComponent) public: - QDeclarativeComponentPrivate() : typeData(0), progress(0.), start(-1), cc(0), engine(0), creationContext(0) {} + QQmlComponentPrivate() : typeData(0), progress(0.), start(-1), cc(0), engine(0), creationContext(0) {} - QObject *beginCreate(QDeclarativeContextData *); + QObject *beginCreate(QQmlContextData *); void completeCreate(); void initializeObjectWithInitialProperties(v8::Handle<v8::Object> qmlGlobal, v8::Handle<v8::Object> valuemap, QObject *toCreate); - QDeclarativeTypeData *typeData; - virtual void typeDataReady(QDeclarativeTypeData *); - virtual void typeDataProgress(QDeclarativeTypeData *, qreal); + QQmlTypeData *typeData; + virtual void typeDataReady(QQmlTypeData *); + virtual void typeDataProgress(QQmlTypeData *, qreal); - void fromTypeData(QDeclarativeTypeData *data); + void fromTypeData(QQmlTypeData *data); QUrl url; qreal progress; int start; - QDeclarativeCompiledData *cc; + QQmlCompiledData *cc; struct ConstructionState { ConstructionState() : completePending(false) {} - QDeclarativeVME vme; - QList<QDeclarativeError> errors; + QQmlVME vme; + QList<QQmlError> errors; bool completePending; }; ConstructionState state; - static void beginDeferred(QDeclarativeEnginePrivate *enginePriv, QObject *object, + static void beginDeferred(QQmlEnginePrivate *enginePriv, QObject *object, ConstructionState *state); - static void complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state); + static void complete(QQmlEnginePrivate *enginePriv, ConstructionState *state); - QDeclarativeEngine *engine; - QDeclarativeGuardedContextData creationContext; + QQmlEngine *engine; + QQmlGuardedContextData creationContext; void clear(); - static QDeclarativeComponentPrivate *get(QDeclarativeComponent *c) { - return static_cast<QDeclarativeComponentPrivate *>(QObjectPrivate::get(c)); + static QQmlComponentPrivate *get(QQmlComponent *c) { + return static_cast<QQmlComponentPrivate *>(QObjectPrivate::get(c)); } }; QT_END_NAMESPACE -#endif // QDECLARATIVECOMPONENT_P_H +#endif // QQMLCOMPONENT_P_H diff --git a/src/declarative/qml/qdeclarativecomponentattached_p.h b/src/qml/qml/qqmlcomponentattached_p.h index cd21ea1dcb..09d111c227 100644 --- a/src/declarative/qml/qdeclarativecomponentattached_p.h +++ b/src/qml/qml/qqmlcomponentattached_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECOMPONENTATTACHED_P_H -#define QDECLARATIVECOMPONENTATTACHED_P_H +#ifndef QQMLCOMPONENTATTACHED_P_H +#define QQMLCOMPONENTATTACHED_P_H -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include <QtCore/QObject> QT_BEGIN_HEADER @@ -50,14 +50,14 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class Q_AUTOTEST_EXPORT QDeclarativeComponentAttached : public QObject +class Q_AUTOTEST_EXPORT QQmlComponentAttached : public QObject { Q_OBJECT public: - QDeclarativeComponentAttached(QObject *parent = 0); - ~QDeclarativeComponentAttached(); + QQmlComponentAttached(QObject *parent = 0); + ~QQmlComponentAttached(); - void add(QDeclarativeComponentAttached **a) { + void add(QQmlComponentAttached **a) { prev = a; next = *a; *a = this; if (next) next->prev = &next; } @@ -66,20 +66,20 @@ public: *prev = next; next = 0; prev = 0; } - QDeclarativeComponentAttached **prev; - QDeclarativeComponentAttached *next; + QQmlComponentAttached **prev; + QQmlComponentAttached *next; Q_SIGNALS: void completed(); void destruction(); private: - friend class QDeclarativeVME; - friend class QDeclarativeContextData; + friend class QQmlVME; + friend class QQmlContextData; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVECOMPONENTATTACHED_P_H +#endif // QQMLCOMPONENTATTACHED_P_H diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/qml/qml/qqmlcontext.cpp index 102992947e..38acc0b0c3 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/qml/qml/qqmlcontext.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qdeclarativecontext.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativecomponentattached_p.h" +#include "qqmlcontext.h" +#include "qqmlcontext_p.h" +#include "qqmlcomponentattached_p.h" -#include "qdeclarativecomponent_p.h" -#include "qdeclarativeexpression_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativeengine.h" -#include "qdeclarativeinfo.h" +#include "qqmlcomponent_p.h" +#include "qqmlexpression_p.h" +#include "qqmlengine_p.h" +#include "qqmlengine.h" +#include "qqmlinfo.h" #include <private/qv4bindings_p.h> #include <private/qv8bindings_p.h> @@ -57,46 +57,46 @@ QT_BEGIN_NAMESPACE -QDeclarativeContextPrivate::QDeclarativeContextPrivate() +QQmlContextPrivate::QQmlContextPrivate() : data(0), notifyIndex(-1) { } /*! - \class QDeclarativeContext + \class QQmlContext \since 4.7 - \brief The QDeclarativeContext class defines a context within a QML engine. + \brief The QQmlContext class defines a context within a QML engine. \mainclass Contexts allow data to be exposed to the QML components instantiated by the QML engine. - Each QDeclarativeContext contains a set of properties, distinct from its QObject + Each QQmlContext contains a set of properties, distinct from its QObject properties, that allow data to be explicitly bound to a context by name. The context properties are defined and updated by calling - QDeclarativeContext::setContextProperty(). The following example shows a Qt model + QQmlContext::setContextProperty(). The following example shows a Qt model being bound to a context and then accessed from a QML file. \code - QDeclarativeEngine engine; + QQmlEngine engine; QStringListModel modelData; - QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext()); + QQmlContext *context = new QQmlContext(engine.rootContext()); context->setContextProperty("myModel", &modelData); - QDeclarativeComponent component(&engine); + QQmlComponent component(&engine); component.setData("import QtQuick 2.0\nListView { model: myModel }", QUrl()); QObject *window = component.create(context); \endcode - Note it is the responsibility of the creator to delete any QDeclarativeContext it + Note it is the responsibility of the creator to delete any QQmlContext it constructs. If the \c context object in the example is no longer needed when the \c window component instance is destroyed, the \c context must be destroyed explicitly. The simplest way to ensure this is to set \c window as the parent of \c context. To simplify binding and maintaining larger data sets, a context object can be set - on a QDeclarativeContext. All the properties of the context object are available + on a QQmlContext. All the properties of the context object are available by name in the context, as though they were all individually added through calls - to QDeclarativeContext::setContextProperty(). Changes to the property's values are + to QQmlContext::setContextProperty(). Changes to the property's values are detected through the property's notify signal. Setting a context object is both faster and easier than manually adding and maintaing context property values. @@ -111,22 +111,22 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate() }; MyDataSet myDataSet; - QDeclarativeEngine engine; - QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext()); + QQmlEngine engine; + QQmlContext *context = new QQmlContext(engine.rootContext()); context->setContextObject(&myDataSet); - QDeclarativeComponent component(&engine); + QQmlComponent component(&engine); component.setData("import QtQuick 2.0\nListView { model: myModel }", QUrl()); component.create(context); \endcode - All properties added explicitly by QDeclarativeContext::setContextProperty() take + All properties added explicitly by QQmlContext::setContextProperty() take precedence over the context object's properties. \section2 The Context Hierarchy Contexts form a hierarchy. The root of this hierarchy is the QML engine's - \l {QDeclarativeEngine::rootContext()}{root context}. Child contexts inherit + \l {QQmlEngine::rootContext()}{root context}. Child contexts inherit the context properties of their parents; if a child context sets a context property that already exists in its parent, the new context property overrides that of the parent. @@ -136,9 +136,9 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate() new value. \code - QDeclarativeEngine engine; - QDeclarativeContext *context1 = new QDeclarativeContext(engine.rootContext()); - QDeclarativeContext *context2 = new QDeclarativeContext(context1); + QQmlEngine engine; + QQmlContext *context1 = new QQmlContext(engine.rootContext()); + QQmlContext *context2 = new QQmlContext(context1); context1->setContextProperty("a", 12); context1->setContextProperty("b", 12); @@ -159,61 +159,61 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate() */ /*! \internal */ -QDeclarativeContext::QDeclarativeContext(QDeclarativeEngine *e, bool) -: QObject(*(new QDeclarativeContextPrivate)) +QQmlContext::QQmlContext(QQmlEngine *e, bool) +: QObject(*(new QQmlContextPrivate)) { - Q_D(QDeclarativeContext); - d->data = new QDeclarativeContextData(this); + Q_D(QQmlContext); + d->data = new QQmlContextData(this); d->data->engine = e; } /*! - Create a new QDeclarativeContext as a child of \a engine's root context, and the + Create a new QQmlContext as a child of \a engine's root context, and the QObject \a parent. */ -QDeclarativeContext::QDeclarativeContext(QDeclarativeEngine *engine, QObject *parent) -: QObject(*(new QDeclarativeContextPrivate), parent) +QQmlContext::QQmlContext(QQmlEngine *engine, QObject *parent) +: QObject(*(new QQmlContextPrivate), parent) { - Q_D(QDeclarativeContext); - d->data = new QDeclarativeContextData(this); + Q_D(QQmlContext); + d->data = new QQmlContextData(this); - d->data->setParent(engine?QDeclarativeContextData::get(engine->rootContext()):0); + d->data->setParent(engine?QQmlContextData::get(engine->rootContext()):0); } /*! - Create a new QDeclarativeContext with the given \a parentContext, and the + Create a new QQmlContext with the given \a parentContext, and the QObject \a parent. */ -QDeclarativeContext::QDeclarativeContext(QDeclarativeContext *parentContext, QObject *parent) -: QObject(*(new QDeclarativeContextPrivate), parent) +QQmlContext::QQmlContext(QQmlContext *parentContext, QObject *parent) +: QObject(*(new QQmlContextPrivate), parent) { - Q_D(QDeclarativeContext); - d->data = new QDeclarativeContextData(this); + Q_D(QQmlContext); + d->data = new QQmlContextData(this); - d->data->setParent(parentContext?QDeclarativeContextData::get(parentContext):0); + d->data->setParent(parentContext?QQmlContextData::get(parentContext):0); } /*! \internal */ -QDeclarativeContext::QDeclarativeContext(QDeclarativeContextData *data) -: QObject(*(new QDeclarativeContextPrivate), 0) +QQmlContext::QQmlContext(QQmlContextData *data) +: QObject(*(new QQmlContextPrivate), 0) { - Q_D(QDeclarativeContext); + Q_D(QQmlContext); d->data = data; } /*! - Destroys the QDeclarativeContext. + Destroys the QQmlContext. Any expressions, or sub-contexts dependent on this context will be - invalidated, but not destroyed (unless they are parented to the QDeclarativeContext + invalidated, but not destroyed (unless they are parented to the QQmlContext object). */ -QDeclarativeContext::~QDeclarativeContext() +QQmlContext::~QQmlContext() { - Q_D(QDeclarativeContext); + Q_D(QQmlContext); if (!d->data->isInternal) d->data->destroy(); @@ -225,57 +225,57 @@ QDeclarativeContext::~QDeclarativeContext() To be valid, a context must have a engine, and it's contextObject(), if any, must not have been deleted. */ -bool QDeclarativeContext::isValid() const +bool QQmlContext::isValid() const { - Q_D(const QDeclarativeContext); + Q_D(const QQmlContext); return d->data && d->data->isValid(); } /*! - Return the context's QDeclarativeEngine, or 0 if the context has no QDeclarativeEngine or the - QDeclarativeEngine was destroyed. + Return the context's QQmlEngine, or 0 if the context has no QQmlEngine or the + QQmlEngine was destroyed. */ -QDeclarativeEngine *QDeclarativeContext::engine() const +QQmlEngine *QQmlContext::engine() const { - Q_D(const QDeclarativeContext); + Q_D(const QQmlContext); return d->data->engine; } /*! - Return the context's parent QDeclarativeContext, or 0 if this context has no + Return the context's parent QQmlContext, or 0 if this context has no parent or if the parent has been destroyed. */ -QDeclarativeContext *QDeclarativeContext::parentContext() const +QQmlContext *QQmlContext::parentContext() const { - Q_D(const QDeclarativeContext); - return d->data->parent?d->data->parent->asQDeclarativeContext():0; + Q_D(const QQmlContext); + return d->data->parent?d->data->parent->asQQmlContext():0; } /*! Return the context object, or 0 if there is no context object. */ -QObject *QDeclarativeContext::contextObject() const +QObject *QQmlContext::contextObject() const { - Q_D(const QDeclarativeContext); + Q_D(const QQmlContext); return d->data->contextObject; } /*! Set the context \a object. */ -void QDeclarativeContext::setContextObject(QObject *object) +void QQmlContext::setContextObject(QObject *object) { - Q_D(QDeclarativeContext); + Q_D(QQmlContext); - QDeclarativeContextData *data = d->data; + QQmlContextData *data = d->data; if (data->isInternal) { - qWarning("QDeclarativeContext: Cannot set context object for internal context."); + qWarning("QQmlContext: Cannot set context object for internal context."); return; } if (!isValid()) { - qWarning("QDeclarativeContext: Cannot set context object on invalid context."); + qWarning("QQmlContext: Cannot set context object on invalid context."); return; } @@ -285,34 +285,34 @@ void QDeclarativeContext::setContextObject(QObject *object) /*! Set a the \a value of the \a name property on this context. */ -void QDeclarativeContext::setContextProperty(const QString &name, const QVariant &value) +void QQmlContext::setContextProperty(const QString &name, const QVariant &value) { - Q_D(QDeclarativeContext); + Q_D(QQmlContext); if (d->notifyIndex == -1) d->notifyIndex = this->metaObject()->methodCount(); - QDeclarativeContextData *data = d->data; + QQmlContextData *data = d->data; if (data->isInternal) { - qWarning("QDeclarativeContext: Cannot set property on internal context."); + qWarning("QQmlContext: Cannot set property on internal context."); return; } if (!isValid()) { - qWarning("QDeclarativeContext: Cannot set property on invalid context."); + qWarning("QQmlContext: Cannot set property on invalid context."); return; } if (data->engine) { bool ok; - QObject *o = QDeclarativeEnginePrivate::get(data->engine)->toQObject(value, &ok); + QObject *o = QQmlEnginePrivate::get(data->engine)->toQObject(value, &ok); if (ok) { setContextProperty(name, o); return; } } - if (!data->propertyNames) data->propertyNames = new QDeclarativeIntegerCache(); + if (!data->propertyNames) data->propertyNames = new QQmlIntegerCache(); int idx = data->propertyNames->value(name); if (idx == -1) { @@ -329,27 +329,27 @@ void QDeclarativeContext::setContextProperty(const QString &name, const QVariant /*! Set the \a value of the \a name property on this context. - QDeclarativeContext does \bold not take ownership of \a value. + QQmlContext does \bold not take ownership of \a value. */ -void QDeclarativeContext::setContextProperty(const QString &name, QObject *value) +void QQmlContext::setContextProperty(const QString &name, QObject *value) { - Q_D(QDeclarativeContext); + Q_D(QQmlContext); if (d->notifyIndex == -1) d->notifyIndex = this->metaObject()->methodCount(); - QDeclarativeContextData *data = d->data; + QQmlContextData *data = d->data; if (data->isInternal) { - qWarning("QDeclarativeContext: Cannot set property on internal context."); + qWarning("QQmlContext: Cannot set property on internal context."); return; } if (!isValid()) { - qWarning("QDeclarativeContext: Cannot set property on invalid context."); + qWarning("QQmlContext: Cannot set property on invalid context."); return; } - if (!data->propertyNames) data->propertyNames = new QDeclarativeIntegerCache(); + if (!data->propertyNames) data->propertyNames = new QQmlIntegerCache(); int idx = data->propertyNames->value(name); if (idx == -1) { @@ -367,13 +367,13 @@ void QDeclarativeContext::setContextProperty(const QString &name, QObject *value Returns the value of the \a name property for this context as a QVariant. */ -QVariant QDeclarativeContext::contextProperty(const QString &name) const +QVariant QQmlContext::contextProperty(const QString &name) const { - Q_D(const QDeclarativeContext); + Q_D(const QQmlContext); QVariant value; int idx = -1; - QDeclarativeContextData *data = d->data; + QQmlContextData *data = d->data; if (data->propertyNames) idx = data->propertyNames->value(name); @@ -382,9 +382,9 @@ QVariant QDeclarativeContext::contextProperty(const QString &name) const QByteArray utf8Name = name.toUtf8(); if (data->contextObject) { QObject *obj = data->contextObject; - QDeclarativePropertyData local; - QDeclarativePropertyData *property = - QDeclarativePropertyCache::property(data->engine, obj, name, local); + QQmlPropertyData local; + QQmlPropertyData *property = + QQmlPropertyCache::property(data->engine, obj, name, local); if (property) value = obj->metaObject()->property(property->coreIndex).read(obj); } @@ -407,9 +407,9 @@ the case of QML created contexts. If the object has multiple names, the first is returned. */ -QString QDeclarativeContext::nameForObject(QObject *object) const +QString QQmlContext::nameForObject(QObject *object) const { - Q_D(const QDeclarativeContext); + Q_D(const QQmlContext); return d->data->findObjectId(object); } @@ -418,17 +418,17 @@ QString QDeclarativeContext::nameForObject(QObject *object) const Resolves the URL \a src relative to the URL of the containing component. - \sa QDeclarativeEngine::baseUrl(), setBaseUrl() + \sa QQmlEngine::baseUrl(), setBaseUrl() */ -QUrl QDeclarativeContext::resolvedUrl(const QUrl &src) +QUrl QQmlContext::resolvedUrl(const QUrl &src) { - Q_D(QDeclarativeContext); + Q_D(QQmlContext); return d->data->resolvedUrl(src); } -QUrl QDeclarativeContextData::resolvedUrl(const QUrl &src) +QUrl QQmlContextData::resolvedUrl(const QUrl &src) { - QDeclarativeContextData *ctxt = this; + QQmlContextData *ctxt = this; if (src.isRelative() && !src.isEmpty()) { if (ctxt) { @@ -459,9 +459,9 @@ QUrl QDeclarativeContextData::resolvedUrl(const QUrl &src) \sa resolvedUrl() */ -void QDeclarativeContext::setBaseUrl(const QUrl &baseUrl) +void QQmlContext::setBaseUrl(const QUrl &baseUrl) { - Q_D(QDeclarativeContext); + Q_D(QQmlContext); d->data->url = baseUrl; d->data->urlString = baseUrl.toString(); @@ -471,10 +471,10 @@ void QDeclarativeContext::setBaseUrl(const QUrl &baseUrl) Returns the base url of the component, or the containing component if none is set. */ -QUrl QDeclarativeContext::baseUrl() const +QUrl QQmlContext::baseUrl() const { - Q_D(const QDeclarativeContext); - const QDeclarativeContextData* data = d->data; + Q_D(const QQmlContext); + const QQmlContextData* data = d->data; while (data && data->url.isEmpty()) data = data->parent; @@ -484,10 +484,10 @@ QUrl QDeclarativeContext::baseUrl() const return QUrl(); } -int QDeclarativeContextPrivate::context_count(QDeclarativeListProperty<QObject> *prop) +int QQmlContextPrivate::context_count(QQmlListProperty<QObject> *prop) { - QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object); - QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context); + QQmlContext *context = static_cast<QQmlContext*>(prop->object); + QQmlContextPrivate *d = QQmlContextPrivate::get(context); int contextProperty = (int)(quintptr)prop->data; if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) { @@ -497,10 +497,10 @@ int QDeclarativeContextPrivate::context_count(QDeclarativeListProperty<QObject> } } -QObject *QDeclarativeContextPrivate::context_at(QDeclarativeListProperty<QObject> *prop, int index) +QObject *QQmlContextPrivate::context_at(QQmlListProperty<QObject> *prop, int index) { - QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object); - QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context); + QQmlContext *context = static_cast<QQmlContext*>(prop->object); + QQmlContextPrivate *d = QQmlContextPrivate::get(context); int contextProperty = (int)(quintptr)prop->data; if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) { @@ -511,7 +511,7 @@ QObject *QDeclarativeContextPrivate::context_at(QDeclarativeListProperty<QObject } -QDeclarativeContextData::QDeclarativeContextData() +QQmlContextData::QQmlContextData() : parent(0), engine(0), isInternal(false), ownedByParent(false), isJSContext(false), isPragmaLibraryContext(false), unresolvedNames(false), publicContext(0), activeVMEData(0), propertyNames(0), contextObject(0), imports(0), childContexts(0), nextChild(0), prevChild(0), @@ -520,7 +520,7 @@ QDeclarativeContextData::QDeclarativeContextData() { } -QDeclarativeContextData::QDeclarativeContextData(QDeclarativeContext *ctxt) +QQmlContextData::QQmlContextData(QQmlContext *ctxt) : parent(0), engine(0), isInternal(false), ownedByParent(false), isJSContext(false), isPragmaLibraryContext(false), unresolvedNames(false), publicContext(ctxt), activeVMEData(0), propertyNames(0), contextObject(0), imports(0), childContexts(0), nextChild(0), prevChild(0), @@ -529,10 +529,10 @@ QDeclarativeContextData::QDeclarativeContextData(QDeclarativeContext *ctxt) { } -void QDeclarativeContextData::invalidate() +void QQmlContextData::invalidate() { while (componentAttached) { - QDeclarativeComponentAttached *a = componentAttached; + QQmlComponentAttached *a = componentAttached; componentAttached = a->next; if (componentAttached) componentAttached->prev = &componentAttached; @@ -561,11 +561,11 @@ void QDeclarativeContextData::invalidate() parent = 0; } -void QDeclarativeContextData::clearContext() +void QQmlContextData::clearContext() { if (engine) { while (componentAttached) { - QDeclarativeComponentAttached *a = componentAttached; + QQmlComponentAttached *a = componentAttached; componentAttached = a->next; if (componentAttached) componentAttached->prev = &componentAttached; @@ -576,9 +576,9 @@ void QDeclarativeContextData::clearContext() } } - QDeclarativeAbstractExpression *expression = expressions; + QQmlAbstractExpression *expression = expressions; while (expression) { - QDeclarativeAbstractExpression *nextExpression = expression->m_nextExpression; + QQmlAbstractExpression *nextExpression = expression->m_nextExpression; expression->m_prevExpression = 0; expression->m_nextExpression = 0; @@ -590,7 +590,7 @@ void QDeclarativeContextData::clearContext() expressions = 0; } -void QDeclarativeContextData::destroy() +void QQmlContextData::destroy() { if (linkedContext) linkedContext->destroy(); @@ -600,7 +600,7 @@ void QDeclarativeContextData::destroy() clearContext(); while (contextObjects) { - QDeclarativeData *co = contextObjects; + QQmlData *co = contextObjects; contextObjects = contextObjects->nextContextObject; co->context = 0; @@ -609,9 +609,9 @@ void QDeclarativeContextData::destroy() co->prevContextObject = 0; } - QDeclarativeGuardedContextData *contextGuard = contextGuards; + QQmlGuardedContextData *contextGuard = contextGuards; while (contextGuard) { - QDeclarativeGuardedContextData *next = contextGuard->m_next; + QQmlGuardedContextData *next = contextGuard->m_next; contextGuard->m_next = 0; contextGuard->m_prev = 0; contextGuard->m_contextData = 0; @@ -643,7 +643,7 @@ void QDeclarativeContextData::destroy() delete this; } -void QDeclarativeContextData::setParent(QDeclarativeContextData *p, bool parentTakesOwnership) +void QQmlContextData::setParent(QQmlContextData *p, bool parentTakesOwnership) { if (p) { parent = p; @@ -656,9 +656,9 @@ void QDeclarativeContextData::setParent(QDeclarativeContextData *p, bool parentT } } -void QDeclarativeContextData::refreshExpressionsRecursive(QDeclarativeAbstractExpression *expression) +void QQmlContextData::refreshExpressionsRecursive(QQmlAbstractExpression *expression) { - QDeclarativeAbstractExpression::DeleteWatcher w(expression); + QQmlAbstractExpression::DeleteWatcher w(expression); if (expression->m_nextExpression) refreshExpressionsRecursive(expression->m_nextExpression); @@ -667,16 +667,16 @@ void QDeclarativeContextData::refreshExpressionsRecursive(QDeclarativeAbstractEx expression->refresh(); } -static inline bool expressions_to_run(QDeclarativeContextData *ctxt, bool isGlobalRefresh) +static inline bool expressions_to_run(QQmlContextData *ctxt, bool isGlobalRefresh) { return ctxt->expressions && (!isGlobalRefresh || ctxt->unresolvedNames); } -void QDeclarativeContextData::refreshExpressionsRecursive(bool isGlobal) +void QQmlContextData::refreshExpressionsRecursive(bool isGlobal) { // For efficiency, we try and minimize the number of guards we have to create if (expressions_to_run(this, isGlobal) && (nextChild || childContexts)) { - QDeclarativeGuardedContextData guard(this); + QQmlGuardedContextData guard(this); if (childContexts) childContexts->refreshExpressionsRecursive(isGlobal); @@ -697,7 +697,7 @@ void QDeclarativeContextData::refreshExpressionsRecursive(bool isGlobal) } else if (nextChild && childContexts) { - QDeclarativeGuardedContextData guard(this); + QQmlGuardedContextData guard(this); childContexts->refreshExpressionsRecursive(isGlobal); @@ -718,13 +718,13 @@ void QDeclarativeContextData::refreshExpressionsRecursive(bool isGlobal) // Refreshes all expressions that could possibly depend on this context. Refreshing flushes all // context-tree dependent caches in the expressions, and should occur every time the context tree // *structure* (not values) changes. -void QDeclarativeContextData::refreshExpressions() +void QQmlContextData::refreshExpressions() { bool isGlobal = (parent == 0); // For efficiency, we try and minimize the number of guards we have to create if (expressions_to_run(this, isGlobal) && childContexts) { - QDeclarativeGuardedContextData guard(this); + QQmlGuardedContextData guard(this); childContexts->refreshExpressionsRecursive(isGlobal); @@ -742,9 +742,9 @@ void QDeclarativeContextData::refreshExpressions() } } -void QDeclarativeContextData::addObject(QObject *o) +void QQmlContextData::addObject(QObject *o) { - QDeclarativeData *data = QDeclarativeData::get(o, true); + QQmlData *data = QQmlData::get(o, true); Q_ASSERT(data->context == 0); @@ -758,13 +758,13 @@ void QDeclarativeContextData::addObject(QObject *o) contextObjects = data; } -void QDeclarativeContextData::setIdProperty(int idx, QObject *obj) +void QQmlContextData::setIdProperty(int idx, QObject *obj) { idValues[idx] = obj; idValues[idx].context = this; } -void QDeclarativeContextData::setIdPropertyData(QDeclarativeIntegerCache *data) +void QQmlContextData::setIdPropertyData(QQmlIntegerCache *data) { Q_ASSERT(!propertyNames); propertyNames = data; @@ -774,7 +774,7 @@ void QDeclarativeContextData::setIdPropertyData(QDeclarativeIntegerCache *data) idValues = new ContextGuard[idValueCount]; } -QString QDeclarativeContextData::findObjectId(const QObject *obj) const +QString QQmlContextData::findObjectId(const QObject *obj) const { if (!propertyNames) return QString(); @@ -785,7 +785,7 @@ QString QDeclarativeContextData::findObjectId(const QObject *obj) const } if (publicContext) { - QDeclarativeContextPrivate *p = QDeclarativeContextPrivate::get(publicContext); + QQmlContextPrivate *p = QQmlContextPrivate::get(publicContext); for (int ii = 0; ii < p->propertyValues.count(); ++ii) if (p->propertyValues.at(ii) == QVariant::fromValue((QObject *)obj)) return propertyNames->findId(ii); @@ -796,16 +796,16 @@ QString QDeclarativeContextData::findObjectId(const QObject *obj) const return QString(); } -QDeclarativeContext *QDeclarativeContextData::asQDeclarativeContext() +QQmlContext *QQmlContextData::asQQmlContext() { if (!publicContext) - publicContext = new QDeclarativeContext(this); + publicContext = new QQmlContext(this); return publicContext; } -QDeclarativeContextPrivate *QDeclarativeContextData::asQDeclarativeContextPrivate() +QQmlContextPrivate *QQmlContextData::asQQmlContextPrivate() { - return QDeclarativeContextPrivate::get(asQDeclarativeContext()); + return QQmlContextPrivate::get(asQQmlContext()); } QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativecontext.h b/src/qml/qml/qqmlcontext.h index b1a8362a3b..f6d8aa1d3a 100644 --- a/src/declarative/qml/qdeclarativecontext.h +++ b/src/qml/qml/qqmlcontext.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECONTEXT_H -#define QDECLARATIVECONTEXT_H +#ifndef QQMLCONTEXT_H +#define QQMLCONTEXT_H #include <QtCore/qurl.h> #include <QtCore/qobject.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> #include <QtCore/qmetatype.h> #include <QtCore/qvariant.h> @@ -54,26 +54,26 @@ QT_BEGIN_NAMESPACE class QString; -class QDeclarativeEngine; -class QDeclarativeRefCount; -class QDeclarativeContextPrivate; -class QDeclarativeCompositeTypeData; -class QDeclarativeContextData; +class QQmlEngine; +class QQmlRefCount; +class QQmlContextPrivate; +class QQmlCompositeTypeData; +class QQmlContextData; -class Q_DECLARATIVE_EXPORT QDeclarativeContext : public QObject +class Q_QML_EXPORT QQmlContext : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeContext) + Q_DECLARE_PRIVATE(QQmlContext) public: - QDeclarativeContext(QDeclarativeEngine *parent, QObject *objParent=0); - QDeclarativeContext(QDeclarativeContext *parent, QObject *objParent=0); - virtual ~QDeclarativeContext(); + QQmlContext(QQmlEngine *parent, QObject *objParent=0); + QQmlContext(QQmlContext *parent, QObject *objParent=0); + virtual ~QQmlContext(); bool isValid() const; - QDeclarativeEngine *engine() const; - QDeclarativeContext *parentContext() const; + QQmlEngine *engine() const; + QQmlContext *parentContext() const; QObject *contextObject() const; void setContextObject(QObject *); @@ -90,19 +90,19 @@ public: QUrl baseUrl() const; private: - friend class QDeclarativeVME; - friend class QDeclarativeEngine; - friend class QDeclarativeEnginePrivate; - friend class QDeclarativeExpression; - friend class QDeclarativeExpressionPrivate; - friend class QDeclarativeComponent; - friend class QDeclarativeComponentPrivate; - friend class QDeclarativeScriptPrivate; - friend class QDeclarativeBoundSignalProxy; - friend class QDeclarativeContextData; - QDeclarativeContext(QDeclarativeContextData *); - QDeclarativeContext(QDeclarativeEngine *, bool); - Q_DISABLE_COPY(QDeclarativeContext) + friend class QQmlVME; + friend class QQmlEngine; + friend class QQmlEnginePrivate; + friend class QQmlExpression; + friend class QQmlExpressionPrivate; + friend class QQmlComponent; + friend class QQmlComponentPrivate; + friend class QQmlScriptPrivate; + friend class QQmlBoundSignalProxy; + friend class QQmlContextData; + QQmlContext(QQmlContextData *); + QQmlContext(QQmlEngine *, bool); + Q_DISABLE_COPY(QQmlContext) }; QT_END_NAMESPACE @@ -110,4 +110,4 @@ Q_DECLARE_METATYPE(QList<QObject*>) QT_END_HEADER -#endif // QDECLARATIVECONTEXT_H +#endif // QQMLCONTEXT_H diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/qml/qml/qqmlcontext_p.h index c53fc9cc21..d10543bde5 100644 --- a/src/declarative/qml/qdeclarativecontext_p.h +++ b/src/qml/qml/qqmlcontext_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECONTEXT_P_H -#define QDECLARATIVECONTEXT_P_H +#ifndef QQMLCONTEXT_P_H +#define QQMLCONTEXT_P_H // // W A R N I N G @@ -53,22 +53,22 @@ // We mean it. // -#include "qdeclarativecontext.h" +#include "qqmlcontext.h" -#include "qdeclarativedata_p.h" -#include "qdeclarativeintegercache_p.h" -#include "qdeclarativetypenamecache_p.h" -#include "qdeclarativenotifier_p.h" -#include "qdeclarativelist.h" -#include "qdeclarativescript_p.h" +#include "qqmldata_p.h" +#include "qqmlintegercache_p.h" +#include "qqmltypenamecache_p.h" +#include "qqmlnotifier_p.h" +#include "qqmllist.h" +#include "qqmlscript_p.h" #include <QtCore/qhash.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> #include <QtCore/qset.h> #include <private/qobject_p.h> #include <private/qflagpointer_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> #include <private/qv8_p.h> @@ -76,48 +76,48 @@ QT_BEGIN_NAMESPACE class QV8Bindings; -class QDeclarativeContext; -class QDeclarativeExpression; -class QDeclarativeEngine; -class QDeclarativeExpression; -class QDeclarativeExpressionPrivate; -class QDeclarativeAbstractExpression; +class QQmlContext; +class QQmlExpression; +class QQmlEngine; +class QQmlExpression; +class QQmlExpressionPrivate; +class QQmlAbstractExpression; class QV4Bindings; -class QDeclarativeContextData; +class QQmlContextData; -class QDeclarativeContextPrivate : public QObjectPrivate +class QQmlContextPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeContext) + Q_DECLARE_PUBLIC(QQmlContext) public: - QDeclarativeContextPrivate(); + QQmlContextPrivate(); - QDeclarativeContextData *data; + QQmlContextData *data; QList<QVariant> propertyValues; int notifyIndex; - static QDeclarativeContextPrivate *get(QDeclarativeContext *context) { - return static_cast<QDeclarativeContextPrivate *>(QObjectPrivate::get(context)); + static QQmlContextPrivate *get(QQmlContext *context) { + return static_cast<QQmlContextPrivate *>(QObjectPrivate::get(context)); } - static QDeclarativeContext *get(QDeclarativeContextPrivate *context) { - return static_cast<QDeclarativeContext *>(context->q_func()); + static QQmlContext *get(QQmlContextPrivate *context) { + return static_cast<QQmlContext *>(context->q_func()); } // Only used for debugging QList<QPointer<QObject> > instances; - static int context_count(QDeclarativeListProperty<QObject> *); - static QObject *context_at(QDeclarativeListProperty<QObject> *, int); + static int context_count(QQmlListProperty<QObject> *); + static QObject *context_at(QQmlListProperty<QObject> *, int); }; -class QDeclarativeVME; -class QDeclarativeComponentAttached; -class QDeclarativeGuardedContextData; -class Q_DECLARATIVE_EXPORT QDeclarativeContextData +class QQmlVME; +class QQmlComponentAttached; +class QQmlGuardedContextData; +class Q_QML_EXPORT QQmlContextData { public: - QDeclarativeContextData(); - QDeclarativeContextData(QDeclarativeContext *); + QQmlContextData(); + QQmlContextData(QQmlContext *); void clearContext(); void destroy(); void invalidate(); @@ -127,33 +127,33 @@ public: } // My parent context and engine - QDeclarativeContextData *parent; - QDeclarativeEngine *engine; + QQmlContextData *parent; + QQmlEngine *engine; - void setParent(QDeclarativeContextData *, bool parentTakesOwnership = false); + void setParent(QQmlContextData *, bool parentTakesOwnership = false); void refreshExpressions(); void addObject(QObject *); QUrl resolvedUrl(const QUrl &); - // My containing QDeclarativeContext. If isInternal is true this owns publicContext. + // My containing QQmlContext. If isInternal is true this owns publicContext. // If internal is false publicContext owns this. - QDeclarativeContext *asQDeclarativeContext(); - QDeclarativeContextPrivate *asQDeclarativeContextPrivate(); + QQmlContext *asQQmlContext(); + QQmlContextPrivate *asQQmlContextPrivate(); quint32 isInternal:1; quint32 ownedByParent:1; // unrelated to isInternal; parent context deletes children if true. quint32 isJSContext:1; quint32 isPragmaLibraryContext:1; quint32 unresolvedNames:1; // True if expressions in this context failed to resolve a toplevel name quint32 dummy:28; - QDeclarativeContext *publicContext; + QQmlContext *publicContext; // VME data that is constructing this context if any void *activeVMEData; // Property name cache - QDeclarativeIntegerCache *propertyNames; + QQmlIntegerCache *propertyNames; // Context object QObject *contextObject; @@ -166,26 +166,26 @@ public: QString urlString; // List of imports that apply to this context - QDeclarativeTypeNameCache *imports; + QQmlTypeNameCache *imports; // My children - QDeclarativeContextData *childContexts; + QQmlContextData *childContexts; // My peers in parent's childContexts list - QDeclarativeContextData *nextChild; - QDeclarativeContextData **prevChild; + QQmlContextData *nextChild; + QQmlContextData **prevChild; // Expressions that use this context - QDeclarativeAbstractExpression *expressions; + QQmlAbstractExpression *expressions; // Doubly-linked list of objects that are owned by this context - QDeclarativeData *contextObjects; + QQmlData *contextObjects; // Doubly-linked list of context guards (XXX merge with contextObjects) - QDeclarativeGuardedContextData *contextGuards; + QQmlGuardedContextData *contextGuards; // id guards - struct ContextGuard : public QDeclarativeGuard<QObject> + struct ContextGuard : public QQmlGuard<QObject> { inline ContextGuard(); inline ContextGuard &operator=(QObject *obj); @@ -193,20 +193,20 @@ public: inline bool wasSet() const; - QFlagPointer<QDeclarativeContextData> context; - QDeclarativeNotifier bindings; + QFlagPointer<QQmlContextData> context; + QQmlNotifier bindings; }; ContextGuard *idValues; int idValueCount; void setIdProperty(int, QObject *); - void setIdPropertyData(QDeclarativeIntegerCache *); + void setIdPropertyData(QQmlIntegerCache *); // Linked contexts. this owns linkedContext. - QDeclarativeContextData *linkedContext; + QQmlContextData *linkedContext; // Linked list of uses of the Component attached property in this // context - QDeclarativeComponentAttached *componentAttached; + QQmlComponentAttached *componentAttached; // Optimized binding objects. Needed for deferred properties. QV4Bindings *v4bindings; @@ -215,61 +215,61 @@ public: // Return the outermost id for obj, if any. QString findObjectId(const QObject *obj) const; - static QDeclarativeContextData *get(QDeclarativeContext *context) { - return QDeclarativeContextPrivate::get(context)->data; + static QQmlContextData *get(QQmlContext *context) { + return QQmlContextPrivate::get(context)->data; } private: void refreshExpressionsRecursive(bool isGlobal); - void refreshExpressionsRecursive(QDeclarativeAbstractExpression *); - ~QDeclarativeContextData() {} + void refreshExpressionsRecursive(QQmlAbstractExpression *); + ~QQmlContextData() {} }; -class QDeclarativeGuardedContextData +class QQmlGuardedContextData { public: - inline QDeclarativeGuardedContextData(); - inline QDeclarativeGuardedContextData(QDeclarativeContextData *); - inline ~QDeclarativeGuardedContextData(); + inline QQmlGuardedContextData(); + inline QQmlGuardedContextData(QQmlContextData *); + inline ~QQmlGuardedContextData(); - inline QDeclarativeContextData *contextData(); - inline void setContextData(QDeclarativeContextData *); + inline QQmlContextData *contextData(); + inline void setContextData(QQmlContextData *); inline bool isNull() const { return !m_contextData; } - inline operator QDeclarativeContextData*() const { return m_contextData; } - inline QDeclarativeContextData* operator->() const { return m_contextData; } - inline QDeclarativeGuardedContextData &operator=(QDeclarativeContextData *d); + inline operator QQmlContextData*() const { return m_contextData; } + inline QQmlContextData* operator->() const { return m_contextData; } + inline QQmlGuardedContextData &operator=(QQmlContextData *d); private: - QDeclarativeGuardedContextData &operator=(const QDeclarativeGuardedContextData &); - QDeclarativeGuardedContextData(const QDeclarativeGuardedContextData &); - friend class QDeclarativeContextData; + QQmlGuardedContextData &operator=(const QQmlGuardedContextData &); + QQmlGuardedContextData(const QQmlGuardedContextData &); + friend class QQmlContextData; inline void clear(); - QDeclarativeContextData *m_contextData; - QDeclarativeGuardedContextData *m_next; - QDeclarativeGuardedContextData **m_prev; + QQmlContextData *m_contextData; + QQmlGuardedContextData *m_next; + QQmlGuardedContextData **m_prev; }; -QDeclarativeGuardedContextData::QDeclarativeGuardedContextData() +QQmlGuardedContextData::QQmlGuardedContextData() : m_contextData(0), m_next(0), m_prev(0) { } -QDeclarativeGuardedContextData::QDeclarativeGuardedContextData(QDeclarativeContextData *data) +QQmlGuardedContextData::QQmlGuardedContextData(QQmlContextData *data) : m_contextData(0), m_next(0), m_prev(0) { setContextData(data); } -QDeclarativeGuardedContextData::~QDeclarativeGuardedContextData() +QQmlGuardedContextData::~QQmlGuardedContextData() { clear(); } -void QDeclarativeGuardedContextData::setContextData(QDeclarativeContextData *contextData) +void QQmlGuardedContextData::setContextData(QQmlContextData *contextData) { clear(); @@ -282,12 +282,12 @@ void QDeclarativeGuardedContextData::setContextData(QDeclarativeContextData *con } } -QDeclarativeContextData *QDeclarativeGuardedContextData::contextData() +QQmlContextData *QQmlGuardedContextData::contextData() { return m_contextData; } -void QDeclarativeGuardedContextData::clear() +void QQmlGuardedContextData::clear() { if (m_prev) { *m_prev = m_next; @@ -298,37 +298,37 @@ void QDeclarativeGuardedContextData::clear() } } -QDeclarativeGuardedContextData & -QDeclarativeGuardedContextData::operator=(QDeclarativeContextData *d) +QQmlGuardedContextData & +QQmlGuardedContextData::operator=(QQmlContextData *d) { setContextData(d); return *this; } -QDeclarativeContextData::ContextGuard::ContextGuard() +QQmlContextData::ContextGuard::ContextGuard() : context(0) { } -QDeclarativeContextData::ContextGuard &QDeclarativeContextData::ContextGuard::operator=(QObject *obj) +QQmlContextData::ContextGuard &QQmlContextData::ContextGuard::operator=(QObject *obj) { - QDeclarativeGuard<QObject>::operator=(obj); + QQmlGuard<QObject>::operator=(obj); context.setFlag(); bindings.notify(); // For alias connections return *this; } -void QDeclarativeContextData::ContextGuard::objectDestroyed(QObject *) +void QQmlContextData::ContextGuard::objectDestroyed(QObject *) { if (context->contextObject && !QObjectPrivate::get(context->contextObject)->wasDeleted) bindings.notify(); } -bool QDeclarativeContextData::ContextGuard::wasSet() const +bool QQmlContextData::ContextGuard::wasSet() const { return context.flag(); } QT_END_NAMESPACE -#endif // QDECLARATIVECONTEXT_P_H +#endif // QQMLCONTEXT_P_H diff --git a/src/declarative/qml/qdeclarativecustomparser.cpp b/src/qml/qml/qqmlcustomparser.cpp index a746700aa6..f888b61e7d 100644 --- a/src/declarative/qml/qdeclarativecustomparser.cpp +++ b/src/qml/qml/qqmlcustomparser.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,23 +39,23 @@ ** ****************************************************************************/ -#include "qdeclarativecustomparser_p.h" -#include "qdeclarativecustomparser_p_p.h" +#include "qqmlcustomparser_p.h" +#include "qqmlcustomparser_p_p.h" -#include "qdeclarativecompiler_p.h" +#include "qqmlcompiler_p.h" #include <QtCore/qdebug.h> QT_BEGIN_NAMESPACE -using namespace QDeclarativeScript; +using namespace QQmlScript; /*! - \class QDeclarativeCustomParser - \brief The QDeclarativeCustomParser class allows you to add new arbitrary types to QML. + \class QQmlCustomParser + \brief The QQmlCustomParser class allows you to add new arbitrary types to QML. \internal - By subclassing QDeclarativeCustomParser, you can add a parser for + By subclassing QQmlCustomParser, you can add a parser for building a particular type. The subclass must implement compile() and setCustomData(), and register @@ -67,7 +67,7 @@ using namespace QDeclarativeScript; */ /* - \fn QByteArray QDeclarativeCustomParser::compile(const QList<QDeclarativeCustomParserProperty> & properties) + \fn QByteArray QQmlCustomParser::compile(const QList<QQmlCustomParserProperty> & properties) The custom parser processes \a properties, and returns a QByteArray containing data meaningful only to the @@ -82,7 +82,7 @@ using namespace QDeclarativeScript; */ /* - \fn void QDeclarativeCustomParser::setCustomData(QObject *object, const QByteArray &data) + \fn void QQmlCustomParser::setCustomData(QObject *object, const QByteArray &data) This function sets \a object to have the properties defined by \a data, which is a block of data previously returned by a call @@ -93,10 +93,10 @@ using namespace QDeclarativeScript; The \a object will be an instance of the TypeClass specified by QML_REGISTER_CUSTOM_TYPE. */ -QDeclarativeCustomParserNode -QDeclarativeCustomParserNodePrivate::fromObject(QDeclarativeScript::Object *root) +QQmlCustomParserNode +QQmlCustomParserNodePrivate::fromObject(QQmlScript::Object *root) { - QDeclarativeCustomParserNode rootNode; + QQmlCustomParserNode rootNode; rootNode.d->name = root->typeName; rootNode.d->location = root->location.start; @@ -110,25 +110,25 @@ QDeclarativeCustomParserNodePrivate::fromObject(QDeclarativeScript::Object *root return rootNode; } -QDeclarativeCustomParserProperty -QDeclarativeCustomParserNodePrivate::fromProperty(QDeclarativeScript::Property *p) +QQmlCustomParserProperty +QQmlCustomParserNodePrivate::fromProperty(QQmlScript::Property *p) { - QDeclarativeCustomParserProperty prop; + QQmlCustomParserProperty prop; prop.d->name = p->name().toString(); prop.d->isList = p->values.isMany(); prop.d->location = p->location.start; if (p->value) { - QDeclarativeCustomParserNode node = fromObject(p->value); - QList<QDeclarativeCustomParserProperty> props = node.properties(); + QQmlCustomParserNode node = fromObject(p->value); + QList<QQmlCustomParserProperty> props = node.properties(); for (int ii = 0; ii < props.count(); ++ii) prop.d->values << QVariant::fromValue(props.at(ii)); } else { - for (QDeclarativeScript::Value *v = p->values.first(); v; v = p->values.next(v)) { - v->type = QDeclarativeScript::Value::Literal; + for (QQmlScript::Value *v = p->values.first(); v; v = p->values.next(v)) { + v->type = QQmlScript::Value::Literal; if(v->object) { - QDeclarativeCustomParserNode node = fromObject(v->object); + QQmlCustomParserNode node = fromObject(v->object); prop.d->values << QVariant::fromValue(node); } else { prop.d->values << QVariant::fromValue(v->value); @@ -140,18 +140,18 @@ QDeclarativeCustomParserNodePrivate::fromProperty(QDeclarativeScript::Property * return prop; } -QDeclarativeCustomParserNode::QDeclarativeCustomParserNode() -: d(new QDeclarativeCustomParserNodePrivate) +QQmlCustomParserNode::QQmlCustomParserNode() +: d(new QQmlCustomParserNodePrivate) { } -QDeclarativeCustomParserNode::QDeclarativeCustomParserNode(const QDeclarativeCustomParserNode &other) -: d(new QDeclarativeCustomParserNodePrivate) +QQmlCustomParserNode::QQmlCustomParserNode(const QQmlCustomParserNode &other) +: d(new QQmlCustomParserNodePrivate) { *this = other; } -QDeclarativeCustomParserNode &QDeclarativeCustomParserNode::operator=(const QDeclarativeCustomParserNode &other) +QQmlCustomParserNode &QQmlCustomParserNode::operator=(const QQmlCustomParserNode &other) { d->name = other.d->name; d->properties = other.d->properties; @@ -159,38 +159,38 @@ QDeclarativeCustomParserNode &QDeclarativeCustomParserNode::operator=(const QDec return *this; } -QDeclarativeCustomParserNode::~QDeclarativeCustomParserNode() +QQmlCustomParserNode::~QQmlCustomParserNode() { delete d; d = 0; } -QString QDeclarativeCustomParserNode::name() const +QString QQmlCustomParserNode::name() const { return d->name; } -QList<QDeclarativeCustomParserProperty> QDeclarativeCustomParserNode::properties() const +QList<QQmlCustomParserProperty> QQmlCustomParserNode::properties() const { return d->properties; } -QDeclarativeScript::Location QDeclarativeCustomParserNode::location() const +QQmlScript::Location QQmlCustomParserNode::location() const { return d->location; } -QDeclarativeCustomParserProperty::QDeclarativeCustomParserProperty() -: d(new QDeclarativeCustomParserPropertyPrivate) +QQmlCustomParserProperty::QQmlCustomParserProperty() +: d(new QQmlCustomParserPropertyPrivate) { } -QDeclarativeCustomParserProperty::QDeclarativeCustomParserProperty(const QDeclarativeCustomParserProperty &other) -: d(new QDeclarativeCustomParserPropertyPrivate) +QQmlCustomParserProperty::QQmlCustomParserProperty(const QQmlCustomParserProperty &other) +: d(new QQmlCustomParserPropertyPrivate) { *this = other; } -QDeclarativeCustomParserProperty &QDeclarativeCustomParserProperty::operator=(const QDeclarativeCustomParserProperty &other) +QQmlCustomParserProperty &QQmlCustomParserProperty::operator=(const QQmlCustomParserProperty &other) { d->name = other.d->name; d->isList = other.d->isList; @@ -199,32 +199,32 @@ QDeclarativeCustomParserProperty &QDeclarativeCustomParserProperty::operator=(co return *this; } -QDeclarativeCustomParserProperty::~QDeclarativeCustomParserProperty() +QQmlCustomParserProperty::~QQmlCustomParserProperty() { delete d; d = 0; } -QString QDeclarativeCustomParserProperty::name() const +QString QQmlCustomParserProperty::name() const { return d->name; } -bool QDeclarativeCustomParserProperty::isList() const +bool QQmlCustomParserProperty::isList() const { return d->isList; } -QDeclarativeScript::Location QDeclarativeCustomParserProperty::location() const +QQmlScript::Location QQmlCustomParserProperty::location() const { return d->location; } -QList<QVariant> QDeclarativeCustomParserProperty::assignedValues() const +QList<QVariant> QQmlCustomParserProperty::assignedValues() const { return d->values; } -void QDeclarativeCustomParser::clearErrors() +void QQmlCustomParser::clearErrors() { exceptions.clear(); } @@ -236,10 +236,10 @@ void QDeclarativeCustomParser::clearErrors() An error is generated referring to the position of the element in the source file. */ -void QDeclarativeCustomParser::error(const QString& description) +void QQmlCustomParser::error(const QString& description) { Q_ASSERT(object); - QDeclarativeError error; + QQmlError error; QString exceptionDescription; error.setLine(object->location.start.line); error.setColumn(object->location.start.column); @@ -252,9 +252,9 @@ void QDeclarativeCustomParser::error(const QString& description) An error is generated referring to the position of \a node in the source file. */ -void QDeclarativeCustomParser::error(const QDeclarativeCustomParserProperty& prop, const QString& description) +void QQmlCustomParser::error(const QQmlCustomParserProperty& prop, const QString& description) { - QDeclarativeError error; + QQmlError error; QString exceptionDescription; error.setLine(prop.location().line); error.setColumn(prop.location().column); @@ -267,9 +267,9 @@ void QDeclarativeCustomParser::error(const QDeclarativeCustomParserProperty& pro An error is generated referring to the position of \a node in the source file. */ -void QDeclarativeCustomParser::error(const QDeclarativeCustomParserNode& node, const QString& description) +void QQmlCustomParser::error(const QQmlCustomParserNode& node, const QString& description) { - QDeclarativeError error; + QQmlError error; QString exceptionDescription; error.setLine(node.location().line); error.setColumn(node.location().column); @@ -283,7 +283,7 @@ void QDeclarativeCustomParser::error(const QDeclarativeCustomParserNode& node, c Otherwise, returns -1. */ -int QDeclarativeCustomParser::evaluateEnum(const QByteArray& script) const +int QQmlCustomParser::evaluateEnum(const QByteArray& script) const { return compiler->evaluateEnum(script); } @@ -292,7 +292,7 @@ int QDeclarativeCustomParser::evaluateEnum(const QByteArray& script) const Resolves \a name to a type, or 0 if it is not a type. This can be used to type-check object nodes. */ -const QMetaObject *QDeclarativeCustomParser::resolveType(const QString& name) const +const QMetaObject *QQmlCustomParser::resolveType(const QString& name) const { return compiler->resolveType(name); } @@ -302,7 +302,7 @@ const QMetaObject *QDeclarativeCustomParser::resolveType(const QString& name) co used to construct the binding later. \a name is used as the name of the rewritten function. */ -QDeclarativeBinding::Identifier QDeclarativeCustomParser::rewriteBinding(const QDeclarativeScript::Variant &value, const QString& name) +QQmlBinding::Identifier QQmlCustomParser::rewriteBinding(const QQmlScript::Variant &value, const QString& name) { return compiler->rewriteBinding(value, name); } @@ -311,7 +311,7 @@ QDeclarativeBinding::Identifier QDeclarativeCustomParser::rewriteBinding(const Q Returns a rewritten \a handler. \a name is used as the name of the rewritten function. */ -QString QDeclarativeCustomParser::rewriteSignalHandler(const QDeclarativeScript::Variant &value, const QString &name) +QString QQmlCustomParser::rewriteSignalHandler(const QQmlScript::Variant &value, const QString &name) { return compiler->rewriteSignalHandler(value , name); } diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/qml/qml/qqmlcustomparser_p.h index 92d1ca7af2..ecc4bae4c3 100644 --- a/src/declarative/qml/qdeclarativecustomparser_p.h +++ b/src/qml/qml/qqmlcustomparser_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECUSTOMPARSER_H -#define QDECLARATIVECUSTOMPARSER_H +#ifndef QQMLCUSTOMPARSER_H +#define QQMLCUSTOMPARSER_H // // W A R N I N G @@ -53,10 +53,10 @@ // We mean it. // -#include "qdeclarativemetatype_p.h" -#include "qdeclarativeerror.h" -#include "qdeclarativescript_p.h" -#include "qdeclarativebinding_p.h" +#include "qqmlmetatype_p.h" +#include "qqmlerror.h" +#include "qqmlscript_p.h" +#include "qqmlbinding_p.h" #include <QtCore/qbytearray.h> #include <QtCore/qxmlstream.h> @@ -66,51 +66,51 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeCompiler; +class QQmlCompiler; -class QDeclarativeCustomParserPropertyPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserProperty +class QQmlCustomParserPropertyPrivate; +class Q_QML_EXPORT QQmlCustomParserProperty { public: - QDeclarativeCustomParserProperty(); - QDeclarativeCustomParserProperty(const QDeclarativeCustomParserProperty &); - QDeclarativeCustomParserProperty &operator=(const QDeclarativeCustomParserProperty &); - ~QDeclarativeCustomParserProperty(); + QQmlCustomParserProperty(); + QQmlCustomParserProperty(const QQmlCustomParserProperty &); + QQmlCustomParserProperty &operator=(const QQmlCustomParserProperty &); + ~QQmlCustomParserProperty(); QString name() const; - QDeclarativeScript::Location location() const; + QQmlScript::Location location() const; bool isList() const; - // Will be one of QDeclarativeScript::Variant, QDeclarativeCustomParserProperty or - // QDeclarativeCustomParserNode + // Will be one of QQmlScript::Variant, QQmlCustomParserProperty or + // QQmlCustomParserNode QList<QVariant> assignedValues() const; private: - friend class QDeclarativeCustomParserNodePrivate; - friend class QDeclarativeCustomParserPropertyPrivate; - QDeclarativeCustomParserPropertyPrivate *d; + friend class QQmlCustomParserNodePrivate; + friend class QQmlCustomParserPropertyPrivate; + QQmlCustomParserPropertyPrivate *d; }; -class QDeclarativeCustomParserNodePrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserNode +class QQmlCustomParserNodePrivate; +class Q_QML_EXPORT QQmlCustomParserNode { public: - QDeclarativeCustomParserNode(); - QDeclarativeCustomParserNode(const QDeclarativeCustomParserNode &); - QDeclarativeCustomParserNode &operator=(const QDeclarativeCustomParserNode &); - ~QDeclarativeCustomParserNode(); + QQmlCustomParserNode(); + QQmlCustomParserNode(const QQmlCustomParserNode &); + QQmlCustomParserNode &operator=(const QQmlCustomParserNode &); + ~QQmlCustomParserNode(); QString name() const; - QDeclarativeScript::Location location() const; + QQmlScript::Location location() const; - QList<QDeclarativeCustomParserProperty> properties() const; + QList<QQmlCustomParserProperty> properties() const; private: - friend class QDeclarativeCustomParserNodePrivate; - QDeclarativeCustomParserNodePrivate *d; + friend class QQmlCustomParserNodePrivate; + QQmlCustomParserNodePrivate *d; }; -class Q_DECLARATIVE_EXPORT QDeclarativeCustomParser +class Q_QML_EXPORT QQmlCustomParser { public: enum Flag { @@ -120,38 +120,38 @@ public: }; Q_DECLARE_FLAGS(Flags, Flag) - QDeclarativeCustomParser() : compiler(0), object(0), m_flags(NoFlag) {} - QDeclarativeCustomParser(Flags f) : compiler(0), object(0), m_flags(f) {} - virtual ~QDeclarativeCustomParser() {} + QQmlCustomParser() : compiler(0), object(0), m_flags(NoFlag) {} + QQmlCustomParser(Flags f) : compiler(0), object(0), m_flags(f) {} + virtual ~QQmlCustomParser() {} void clearErrors(); Flags flags() const { return m_flags; } - virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &)=0; + virtual QByteArray compile(const QList<QQmlCustomParserProperty> &)=0; virtual void setCustomData(QObject *, const QByteArray &)=0; - QList<QDeclarativeError> errors() const { return exceptions; } + QList<QQmlError> errors() const { return exceptions; } protected: void error(const QString& description); - void error(const QDeclarativeCustomParserProperty&, const QString& description); - void error(const QDeclarativeCustomParserNode&, const QString& description); + void error(const QQmlCustomParserProperty&, const QString& description); + void error(const QQmlCustomParserNode&, const QString& description); int evaluateEnum(const QByteArray&) const; const QMetaObject *resolveType(const QString&) const; - QDeclarativeBinding::Identifier rewriteBinding(const QDeclarativeScript::Variant&, const QString&); - QString rewriteSignalHandler(const QDeclarativeScript::Variant&, const QString&); + QQmlBinding::Identifier rewriteBinding(const QQmlScript::Variant&, const QString&); + QString rewriteSignalHandler(const QQmlScript::Variant&, const QString&); private: - QList<QDeclarativeError> exceptions; - QDeclarativeCompiler *compiler; - QDeclarativeScript::Object *object; + QList<QQmlError> exceptions; + QQmlCompiler *compiler; + QQmlScript::Object *object; Flags m_flags; - friend class QDeclarativeCompiler; + friend class QQmlCompiler; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeCustomParser::Flags); +Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlCustomParser::Flags); #if 0 #define QML_REGISTER_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN, NAME, TYPE, CUSTOMTYPE) \ @@ -160,8 +160,8 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeCustomParser::Flags); QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeCustomParserProperty) -Q_DECLARE_METATYPE(QDeclarativeCustomParserNode) +Q_DECLARE_METATYPE(QQmlCustomParserProperty) +Q_DECLARE_METATYPE(QQmlCustomParserNode) QT_END_HEADER diff --git a/src/declarative/qml/qdeclarativecustomparser_p_p.h b/src/qml/qml/qqmlcustomparser_p_p.h index e7228f07f0..c861f9e944 100644 --- a/src/declarative/qml/qdeclarativecustomparser_p_p.h +++ b/src/qml/qml/qqmlcustomparser_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECUSTOMPARSER_P_H -#define QDECLARATIVECUSTOMPARSER_P_H +#ifndef QQMLCUSTOMPARSER_P_H +#define QQMLCUSTOMPARSER_P_H // // W A R N I N G @@ -53,37 +53,37 @@ // We mean it. // -#include "qdeclarativecustomparser_p.h" +#include "qqmlcustomparser_p.h" -#include "qdeclarativescript_p.h" +#include "qqmlscript_p.h" #include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QDeclarativeCustomParserNodePrivate +class QQmlCustomParserNodePrivate { public: QString name; - QList<QDeclarativeCustomParserProperty> properties; - QDeclarativeScript::Location location; + QList<QQmlCustomParserProperty> properties; + QQmlScript::Location location; - static QDeclarativeCustomParserNode fromObject(QDeclarativeScript::Object *); - static QDeclarativeCustomParserProperty fromProperty(QDeclarativeScript::Property *); + static QQmlCustomParserNode fromObject(QQmlScript::Object *); + static QQmlCustomParserProperty fromProperty(QQmlScript::Property *); }; -class QDeclarativeCustomParserPropertyPrivate +class QQmlCustomParserPropertyPrivate { public: - QDeclarativeCustomParserPropertyPrivate() + QQmlCustomParserPropertyPrivate() : isList(false) {} QString name; bool isList; - QDeclarativeScript::Location location; + QQmlScript::Location location; QList<QVariant> values; }; QT_END_NAMESPACE -#endif // QDECLARATIVECUSTOMPARSER_P_H +#endif // QQMLCUSTOMPARSER_P_H diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/qml/qml/qqmldata_p.h index 0f75d620b8..e4ba44583d 100644 --- a/src/declarative/qml/qdeclarativedata_p.h +++ b/src/qml/qml/qqmldata_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDATA_P_H -#define QDECLARATIVEDATA_P_H +#ifndef QQMLDATA_P_H +#define QQMLDATA_P_H // // W A R N I N G @@ -53,30 +53,30 @@ // We mean it. // +#include <private/qtqmlglobal_p.h> #include <private/qobject_p.h> - #include <private/qv8_p.h> QT_BEGIN_NAMESPACE template <class Key, class T> class QHash; -class QDeclarativeGuardImpl; -class QDeclarativeCompiledData; -class QDeclarativeAbstractBinding; -class QDeclarativeContext; -class QDeclarativePropertyCache; -class QDeclarativeContextData; -class QDeclarativeNotifier; -class QDeclarativeDataExtended; -class QDeclarativeNotifierEndpoint; +class QQmlGuardImpl; +class QQmlCompiledData; +class QQmlAbstractBinding; +class QQmlContext; +class QQmlPropertyCache; +class QQmlContextData; +class QQmlNotifier; +class QQmlDataExtended; +class QQmlNotifierEndpoint; // This class is structured in such a way, that simply zero'ing it is the // default state for elemental object allocations. This is crucial in the -// workings of the QDeclarativeInstruction::CreateSimpleObject instruction. +// workings of the QQmlInstruction::CreateSimpleObject instruction. // Don't change anything here without first considering that case! -class Q_DECLARATIVE_EXPORT QDeclarativeData : public QAbstractDeclarativeData +class Q_QML_EXPORT QQmlData : public QAbstractDeclarativeData { public: - QDeclarativeData() + QQmlData() : ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false), hasTaintedV8Object(false), notifyList(0), context(0), outerContext(0), bindings(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0), bindingBits(0), @@ -118,27 +118,27 @@ public: quint16 maximumTodoIndex; quint16 notifiesSize; - QDeclarativeNotifierEndpoint *todo; - QDeclarativeNotifierEndpoint**notifies; + QQmlNotifierEndpoint *todo; + QQmlNotifierEndpoint**notifies; void layout(); private: - void layout(QDeclarativeNotifierEndpoint*); + void layout(QQmlNotifierEndpoint*); }; NotifyList *notifyList; - inline QDeclarativeNotifierEndpoint *notify(int index); - void addNotify(int index, QDeclarativeNotifierEndpoint *); + inline QQmlNotifierEndpoint *notify(int index); + void addNotify(int index, QQmlNotifierEndpoint *); // The context that created the C++ object - QDeclarativeContextData *context; + QQmlContextData *context; // The outermost context in which this object lives - QDeclarativeContextData *outerContext; + QQmlContextData *outerContext; - QDeclarativeAbstractBinding *bindings; + QQmlAbstractBinding *bindings; - // Linked list for QDeclarativeContext::contextObjects - QDeclarativeData *nextContextObject; - QDeclarativeData**prevContextObject; + // Linked list for QQmlContext::contextObjects + QQmlData *nextContextObject; + QQmlData**prevContextObject; int bindingBitsSize; quint32 *bindingBits; @@ -149,41 +149,41 @@ public: ushort lineNumber; ushort columnNumber; - QDeclarativeCompiledData *deferredComponent; // Can't this be found from the context? + QQmlCompiledData *deferredComponent; // Can't this be found from the context? unsigned int deferredIdx; quint32 v8objectid; v8::Persistent<v8::Object> v8object; - QDeclarativePropertyCache *propertyCache; + QQmlPropertyCache *propertyCache; - QDeclarativeGuardImpl *guards; + QQmlGuardImpl *guards; - static QDeclarativeData *get(const QObject *object, bool create = false) { + static QQmlData *get(const QObject *object, bool create = false) { QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object)); if (priv->wasDeleted) { Q_ASSERT(!create); return 0; } else if (priv->declarativeData) { - return static_cast<QDeclarativeData *>(priv->declarativeData); + return static_cast<QQmlData *>(priv->declarativeData); } else if (create) { - priv->declarativeData = new QDeclarativeData; - return static_cast<QDeclarativeData *>(priv->declarativeData); + priv->declarativeData = new QQmlData; + return static_cast<QQmlData *>(priv->declarativeData); } else { return 0; } } bool hasExtendedData() const { return extendedData != 0; } - QDeclarativeNotifier *objectNameNotifier() const; + QQmlNotifier *objectNameNotifier() const; QHash<int, QObject *> *attachedProperties() const; private: // For objectNameNotifier and attachedProperties - mutable QDeclarativeDataExtended *extendedData; + mutable QQmlDataExtended *extendedData; }; -QDeclarativeNotifierEndpoint *QDeclarativeData::notify(int index) +QQmlNotifierEndpoint *QQmlData::notify(int index) { Q_ASSERT(index <= 0xFFFF); @@ -204,4 +204,4 @@ QDeclarativeNotifierEndpoint *QDeclarativeData::notify(int index) QT_END_NAMESPACE -#endif // QDECLARATIVEDATA_P_H +#endif // QQMLDATA_P_H diff --git a/src/declarative/qml/qdeclarativedirparser.cpp b/src/qml/qml/qqmldirparser.cpp index f7d5be3601..7b99214f04 100644 --- a/src/declarative/qml/qdeclarativedirparser.cpp +++ b/src/qml/qml/qqmldirparser.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qdeclarativedirparser_p.h" -#include "qdeclarativeerror.h" -#include "qdeclarativeglobal_p.h" +#include "qqmldirparser_p.h" +#include "qqmlerror.h" +#include "qqmlglobal_p.h" #include <QtCore/QTextStream> #include <QtCore/QFile> @@ -49,52 +49,52 @@ QT_BEGIN_NAMESPACE -QDeclarativeDirParser::QDeclarativeDirParser() +QQmlDirParser::QQmlDirParser() : _isParsed(false) { } -QDeclarativeDirParser::~QDeclarativeDirParser() +QQmlDirParser::~QQmlDirParser() { } -QUrl QDeclarativeDirParser::url() const +QUrl QQmlDirParser::url() const { return _url; } -void QDeclarativeDirParser::setUrl(const QUrl &url) +void QQmlDirParser::setUrl(const QUrl &url) { _url = url; } -QString QDeclarativeDirParser::fileSource() const +QString QQmlDirParser::fileSource() const { return _filePathSouce; } -void QDeclarativeDirParser::setFileSource(const QString &filePath) +void QQmlDirParser::setFileSource(const QString &filePath) { _filePathSouce = filePath; } -QString QDeclarativeDirParser::source() const +QString QQmlDirParser::source() const { return _source; } -void QDeclarativeDirParser::setSource(const QString &source) +void QQmlDirParser::setSource(const QString &source) { _isParsed = false; _source = source; } -bool QDeclarativeDirParser::isParsed() const +bool QQmlDirParser::isParsed() const { return _isParsed; } -bool QDeclarativeDirParser::parse() +bool QQmlDirParser::parse() { if (_isParsed) return true; @@ -107,15 +107,15 @@ bool QDeclarativeDirParser::parse() if (_source.isEmpty() && !_filePathSouce.isEmpty()) { QFile file(_filePathSouce); - if (!QDeclarative_isFileCaseCorrect(_filePathSouce)) { - QDeclarativeError error; + if (!QQml_isFileCaseCorrect(_filePathSouce)) { + QQmlError error; error.setDescription(QString::fromUtf8("cannot load module \"$$URI$$\": File name case mismatch for \"%1\"").arg(_filePathSouce)); _errors.prepend(error); return false; } else if (file.open(QFile::ReadOnly)) { _source = QString::fromUtf8(file.readAll()); } else { - QDeclarativeError error; + QQmlError error; error.setDescription(QString::fromUtf8("module \"$$URI$$\" definition \"%1\" not readable").arg(_filePathSouce)); _errors.prepend(error); return false; @@ -243,9 +243,9 @@ bool QDeclarativeDirParser::parse() return hasError(); } -void QDeclarativeDirParser::reportError(int line, int column, const QString &description) +void QQmlDirParser::reportError(int line, int column, const QString &description) { - QDeclarativeError error; + QQmlError error; error.setUrl(_url); error.setLine(line); error.setColumn(column); @@ -253,7 +253,7 @@ void QDeclarativeDirParser::reportError(int line, int column, const QString &des _errors.append(error); } -bool QDeclarativeDirParser::hasError() const +bool QQmlDirParser::hasError() const { if (! _errors.isEmpty()) return true; @@ -261,11 +261,11 @@ bool QDeclarativeDirParser::hasError() const return false; } -QList<QDeclarativeError> QDeclarativeDirParser::errors(const QString &uri) const +QList<QQmlError> QQmlDirParser::errors(const QString &uri) const { - QList<QDeclarativeError> errors = _errors; + QList<QQmlError> errors = _errors; for (int i = 0; i < errors.size(); ++i) { - QDeclarativeError &e = errors[i]; + QQmlError &e = errors[i]; QString description = e.description(); description.replace(QLatin1String("$$URI$$"), uri); e.setDescription(description); @@ -273,23 +273,23 @@ QList<QDeclarativeError> QDeclarativeDirParser::errors(const QString &uri) const return errors; } -QList<QDeclarativeDirParser::Plugin> QDeclarativeDirParser::plugins() const +QList<QQmlDirParser::Plugin> QQmlDirParser::plugins() const { return _plugins; } -QList<QDeclarativeDirParser::Component> QDeclarativeDirParser::components() const +QList<QQmlDirParser::Component> QQmlDirParser::components() const { return _components; } -QList<QDeclarativeDirParser::Script> QDeclarativeDirParser::scripts() const +QList<QQmlDirParser::Script> QQmlDirParser::scripts() const { return _scripts; } #ifdef QT_CREATOR -QList<QDeclarativeDirParser::TypeInfo> QDeclarativeDirParser::typeInfos() const +QList<QQmlDirParser::TypeInfo> QQmlDirParser::typeInfos() const { return _typeInfos; } diff --git a/src/declarative/qml/qdeclarativedirparser_p.h b/src/qml/qml/qqmldirparser_p.h index 40b4b57a12..8c681309ac 100644 --- a/src/declarative/qml/qdeclarativedirparser_p.h +++ b/src/qml/qml/qqmldirparser_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDIRPARSER_P_H -#define QDECLARATIVEDIRPARSER_P_H +#ifndef QQMLDIRPARSER_P_H +#define QQMLDIRPARSER_P_H // // W A R N I N G @@ -58,14 +58,14 @@ QT_BEGIN_NAMESPACE -class QDeclarativeError; -class QDeclarativeDirParser +class QQmlError; +class QQmlDirParser { - Q_DISABLE_COPY(QDeclarativeDirParser) + Q_DISABLE_COPY(QQmlDirParser) public: - QDeclarativeDirParser(); - ~QDeclarativeDirParser(); + QQmlDirParser(); + ~QQmlDirParser(); QUrl url() const; void setUrl(const QUrl &url); @@ -80,7 +80,7 @@ public: bool parse(); bool hasError() const; - QList<QDeclarativeError> errors(const QString &uri) const; + QList<QQmlError> errors(const QString &uri) const; struct Plugin { @@ -144,7 +144,7 @@ private: void reportError(int line, int column, const QString &message); private: - QList<QDeclarativeError> _errors; + QList<QQmlError> _errors; QUrl _url; QString _source; QString _filePathSouce; @@ -157,10 +157,10 @@ private: unsigned _isParsed: 1; }; -typedef QList<QDeclarativeDirParser::Component> QDeclarativeDirComponents; -typedef QList<QDeclarativeDirParser::Script> QDeclarativeDirScripts; +typedef QList<QQmlDirParser::Component> QQmlDirComponents; +typedef QList<QQmlDirParser::Script> QQmlDirScripts; QT_END_NAMESPACE -#endif // QDECLARATIVEDIRPARSER_P_H +#endif // QQMLDIRPARSER_P_H diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/qml/qml/qqmlengine.cpp index 2031bc424a..8cfe635543 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,38 +39,38 @@ ** ****************************************************************************/ -#include "qdeclarativeengine_p.h" -#include "qdeclarativeengine.h" -#include "qdeclarativecomponentattached_p.h" - -#include "qdeclarativecontext_p.h" -#include "qdeclarativecompiler_p.h" -#include "qdeclarative.h" -#include "qdeclarativecontext.h" -#include "qdeclarativeexpression.h" -#include "qdeclarativecomponent.h" -#include "qdeclarativebinding_p_p.h" -#include "qdeclarativevme_p.h" -#include <private/qdeclarativeenginedebugservice_p.h> -#include "qdeclarativestringconverters_p.h" -#include "qdeclarativexmlhttprequest_p.h" -#include "qdeclarativescriptstring.h" -#include "qdeclarativeglobal_p.h" -#include "qdeclarativelistmodel_p.h" -#include "qdeclarativeworkerscript_p.h" -#include "qdeclarativecomponent_p.h" -#include "qdeclarativenetworkaccessmanagerfactory.h" -#include "qdeclarativeimageprovider.h" -#include "qdeclarativedirparser_p.h" -#include "qdeclarativeextensioninterface.h" -#include "qdeclarativelist_p.h" -#include "qdeclarativetypenamecache_p.h" -#include "qdeclarativenotifier_p.h" -#include <private/qdeclarativeprofilerservice_p.h> -#include <private/qdeclarativeapplication_p.h> +#include "qqmlengine_p.h" +#include "qqmlengine.h" +#include "qqmlcomponentattached_p.h" + +#include "qqmlcontext_p.h" +#include "qqmlcompiler_p.h" +#include "qqml.h" +#include "qqmlcontext.h" +#include "qqmlexpression.h" +#include "qqmlcomponent.h" +#include "qqmlbinding_p_p.h" +#include "qqmlvme_p.h" +#include <private/qqmlenginedebugservice_p.h> +#include "qqmlstringconverters_p.h" +#include "qqmlxmlhttprequest_p.h" +#include "qqmlscriptstring.h" +#include "qqmlglobal_p.h" +#include "qquicklistmodel_p.h" +#include "qquickworkerscript_p.h" +#include "qqmlcomponent_p.h" +#include "qqmlnetworkaccessmanagerfactory.h" +#include "qqmlimageprovider.h" +#include "qqmldirparser_p.h" +#include "qqmlextensioninterface.h" +#include "qqmllist_p.h" +#include "qqmltypenamecache_p.h" +#include "qqmlnotifier_p.h" +#include <private/qqmlprofilerservice_p.h> +#include <private/qquickapplication_p.h> #include <private/qv8debugservice_p.h> #include <private/qdebugmessageservice_p.h> -#include "qdeclarativeincubator.h" +#include "qqmlincubator.h" #include <private/qv8profilerservice_p.h> #include <QtCore/qstandardpaths.h> @@ -87,7 +87,7 @@ #include <private/qobject_p.h> -#include <private/qdeclarativelocale_p.h> +#include <private/qqmllocale_p.h> #ifdef Q_OS_WIN // for %APPDATA% #include <qt_windows.h> @@ -97,14 +97,14 @@ #define CSIDL_APPDATA 0x001a // <username>\Application Data #endif -Q_DECLARE_METATYPE(QDeclarativeProperty) +Q_DECLARE_METATYPE(QQmlProperty) QT_BEGIN_NAMESPACE void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor) { - QDeclarativeEnginePrivate::registerBaseTypes(uri, versionMajor, versionMinor); - QDeclarativeValueTypeFactory::registerBaseTypes(uri, versionMajor, versionMinor); + QQmlEnginePrivate::registerBaseTypes(uri, versionMajor, versionMinor); + QQmlValueTypeFactory::registerBaseTypes(uri, versionMajor, versionMinor); } /*! @@ -119,7 +119,7 @@ void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor) It can be useful to create a QtObject if you need an extremely lightweight element to enclose a set of custom properties: - \snippet doc/src/snippets/declarative/qtobject.qml 0 + \snippet doc/src/snippets/qml/qtobject.qml 0 It can also be useful for C++ integration, as it is just a plain QObject. See the QObject documentation for further details. @@ -152,37 +152,37 @@ void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor) \code // main.cpp - QDeclarativeView view; + QQuickView view; view.setSource(QUrl::fromLocalFile("MyRect.qml")); view.show(); - QDeclarativeItem *item = view.rootObject()->findChild<QDeclarativeItem*>("myRect"); + QQuickItem *item = view.rootObject()->findChild<QQuickItem*>("myRect"); if (item) item->setProperty("color", QColor(Qt::yellow)); \endcode */ -bool QDeclarativeEnginePrivate::qml_debugging_enabled = false; +bool QQmlEnginePrivate::qml_debugging_enabled = false; -void QDeclarativeEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int versionMinor) +void QQmlEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int versionMinor) { - qmlRegisterType<QDeclarativeComponent>(uri,versionMajor,versionMinor,"Component"); + qmlRegisterType<QQmlComponent>(uri,versionMajor,versionMinor,"Component"); qmlRegisterType<QObject>(uri,versionMajor,versionMinor,"QtObject"); - qmlRegisterType<QDeclarativeListElement>(uri, versionMajor, versionMinor,"ListElement"); - qmlRegisterCustomType<QDeclarativeListModel>(uri, versionMajor, versionMinor,"ListModel", new QDeclarativeListModelParser); - qmlRegisterType<QDeclarativeWorkerScript>(uri,versionMajor,versionMinor,"WorkerScript"); + qmlRegisterType<QQuickListElement>(uri, versionMajor, versionMinor,"ListElement"); + qmlRegisterCustomType<QQuickListModel>(uri, versionMajor, versionMinor,"ListModel", new QQuickListModelParser); + qmlRegisterType<QQuickWorkerScript>(uri,versionMajor,versionMinor,"WorkerScript"); } -void QDeclarativeEnginePrivate::defineModule() +void QQmlEnginePrivate::defineModule() { registerBaseTypes("QtQuick", 2, 0); - qmlRegisterType<QDeclarativeBinding>(); - qmlRegisterUncreatableType<QDeclarativeApplication>("QtQuick",2,0,"Application", QDeclarativeApplication::tr("Application is an abstract class")); - qmlRegisterUncreatableType<QDeclarativeLocale>("QtQuick",2,0,"Locale",QDeclarativeEngine::tr("Locale cannot be instantiated. Use Qt.locale()")); + qmlRegisterType<QQmlBinding>(); + qmlRegisterUncreatableType<QQuickApplication>("QtQuick",2,0,"Application", QQuickApplication::tr("Application is an abstract class")); + qmlRegisterUncreatableType<QQmlLocale>("QtQuick",2,0,"Locale",QQmlEngine::tr("Locale cannot be instantiated. Use Qt.locale()")); } /*! -\qmlclass Qt QDeclarativeEnginePrivate +\qmlclass Qt QQmlEnginePrivate \ingroup qml-utility-elements \brief The QML global Qt object provides useful enums and functions from Qt. @@ -303,7 +303,7 @@ of their use. The following example uses the \c application object to indicate whether the application is currently active: - \snippet doc/src/snippets/declarative/application.qml document + \snippet doc/src/snippets/qml/application.qml document \qmlproperty object Qt::inputMethod \since QtQuick 2.0 @@ -342,7 +342,7 @@ the same object as is returned from the Qt.include() call. // Qt.include() is implemented in qv8include.cpp -QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) +QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e) : propertyCapture(0), rootContext(0), isDebugging(false), outputWarningsToStdErr(true), sharedContext(0), sharedScope(0), cleanup(0), erroredBindings(0), inProgressCreations(0), @@ -353,12 +353,12 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) { } -QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate() +QQmlEnginePrivate::~QQmlEnginePrivate() { Q_ASSERT(inProgressCreations == 0); while (cleanup) { - QDeclarativeCleanup *c = cleanup; + QQmlCleanup *c = cleanup; cleanup = c->next; if (cleanup) cleanup->prev = &cleanup; c->next = 0; @@ -374,23 +374,23 @@ QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate() delete rootContext; rootContext = 0; - for(QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter) + for(QHash<int, QQmlCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter) (*iter)->release(); - for(QHash<const QMetaObject *, QDeclarativePropertyCache *>::Iterator iter = propertyCache.begin(); iter != propertyCache.end(); ++iter) + for(QHash<const QMetaObject *, QQmlPropertyCache *>::Iterator iter = propertyCache.begin(); iter != propertyCache.end(); ++iter) (*iter)->release(); - for(QHash<QPair<QDeclarativeType *, int>, QDeclarativePropertyCache *>::Iterator iter = typePropertyCache.begin(); iter != typePropertyCache.end(); ++iter) + for(QHash<QPair<QQmlType *, int>, QQmlPropertyCache *>::Iterator iter = typePropertyCache.begin(); iter != typePropertyCache.end(); ++iter) (*iter)->release(); - for(QHash<QDeclarativeMetaType::ModuleApi, QDeclarativeMetaType::ModuleApiInstance *>::Iterator iter = moduleApiInstances.begin(); iter != moduleApiInstances.end(); ++iter) { + for(QHash<QQmlMetaType::ModuleApi, QQmlMetaType::ModuleApiInstance *>::Iterator iter = moduleApiInstances.begin(); iter != moduleApiInstances.end(); ++iter) { delete (*iter)->qobjectApi; delete *iter; } } -void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o) +void QQmlPrivate::qdeclarativeelement_destructor(QObject *o) { QObjectPrivate *p = QObjectPrivate::get(o); if (p->declarativeData) { - QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData); + QQmlData *d = static_cast<QQmlData*>(p->declarativeData); if (d->ownContext && d->context) { d->context->destroy(); d->context = 0; @@ -398,62 +398,62 @@ void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o) } } -void QDeclarativeData::destroyed(QAbstractDeclarativeData *d, QObject *o) +void QQmlData::destroyed(QAbstractDeclarativeData *d, QObject *o) { - static_cast<QDeclarativeData *>(d)->destroyed(o); + static_cast<QQmlData *>(d)->destroyed(o); } -void QDeclarativeData::parentChanged(QAbstractDeclarativeData *d, QObject *o, QObject *p) +void QQmlData::parentChanged(QAbstractDeclarativeData *d, QObject *o, QObject *p) { - static_cast<QDeclarativeData *>(d)->parentChanged(o, p); + static_cast<QQmlData *>(d)->parentChanged(o, p); } -void QDeclarativeData::objectNameChanged(QAbstractDeclarativeData *d, QObject *o) +void QQmlData::objectNameChanged(QAbstractDeclarativeData *d, QObject *o) { - static_cast<QDeclarativeData *>(d)->objectNameChanged(o); + static_cast<QQmlData *>(d)->objectNameChanged(o); } -void QDeclarativeData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int index, void **) +void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int index, void **) { - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); if (!ddata) return; // Probably being deleted - QDeclarativeNotifierEndpoint *ep = ddata->notify(index); - if (ep) QDeclarativeNotifier::emitNotify(ep); + QQmlNotifierEndpoint *ep = ddata->notify(index); + if (ep) QQmlNotifier::emitNotify(ep); } -void QDeclarativeEnginePrivate::init() +void QQmlEnginePrivate::init() { - Q_Q(QDeclarativeEngine); + Q_Q(QQmlEngine); static bool firstTime = true; if (firstTime) { - qmlRegisterType<QDeclarativeComponent>("QML", 1, 0, "Component"); + qmlRegisterType<QQmlComponent>("QML", 1, 0, "Component"); firstTime = false; } qRegisterMetaType<QVariant>("QVariant"); - qRegisterMetaType<QDeclarativeScriptString>("QDeclarativeScriptString"); + qRegisterMetaType<QQmlScriptString>("QQmlScriptString"); qRegisterMetaType<QJSValue>("QJSValue"); - qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeComponent::Status"); + qRegisterMetaType<QQmlComponent::Status>("QQmlComponent::Status"); qRegisterMetaType<QList<QObject*> >("QList<QObject*>"); qRegisterMetaType<QList<int> >("QList<int>"); - qRegisterMetaType<QDeclarativeV8Handle>("QDeclarativeV8Handle"); + qRegisterMetaType<QQmlV8Handle>("QQmlV8Handle"); - QDeclarativeData::init(); + QQmlData::init(); v8engine()->setEngine(q); - rootContext = new QDeclarativeContext(q,true); + rootContext = new QQmlContext(q,true); if (QCoreApplication::instance()->thread() == q->thread() && - QDeclarativeEngineDebugService::isDebuggingEnabled()) { + QQmlEngineDebugService::isDebuggingEnabled()) { isDebugging = true; - QDeclarativeEngineDebugService::instance()->addEngine(q); + QQmlEngineDebugService::instance()->addEngine(q); QV8DebugService::initialize(v8engine()); QV8ProfilerService::initialize(); - QDeclarativeProfilerService::initialize(); + QQmlProfilerService::initialize(); QDebugMessageService::instance(); } @@ -463,76 +463,76 @@ void QDeclarativeEnginePrivate::init() QDir::separator() + QLatin1String("OfflineStorage"); } -QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine() +QQuickWorkerScriptEngine *QQmlEnginePrivate::getWorkerScriptEngine() { - Q_Q(QDeclarativeEngine); + Q_Q(QQmlEngine); if (!workerScriptEngine) - workerScriptEngine = new QDeclarativeWorkerScriptEngine(q); + workerScriptEngine = new QQuickWorkerScriptEngine(q); return workerScriptEngine; } /*! - \class QDeclarativeEngine + \class QQmlEngine \since 4.7 - \brief The QDeclarativeEngine class provides an environment for instantiating QML components. + \brief The QQmlEngine class provides an environment for instantiating QML components. \mainclass - Each QML component is instantiated in a QDeclarativeContext. - QDeclarativeContext's are essential for passing data to QML + Each QML component is instantiated in a QQmlContext. + QQmlContext's are essential for passing data to QML components. In QML, contexts are arranged hierarchically and this - hierarchy is managed by the QDeclarativeEngine. + hierarchy is managed by the QQmlEngine. Prior to creating any QML components, an application must have - created a QDeclarativeEngine to gain access to a QML context. The + created a QQmlEngine to gain access to a QML context. The following example shows how to create a simple Text item. \code - QDeclarativeEngine engine; - QDeclarativeComponent component(&engine); + QQmlEngine engine; + QQmlComponent component(&engine); component.setData("import QtQuick 2.0\nText { text: \"Hello world!\" }", QUrl()); - QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem *>(component.create()); //add item to view, etc ... \endcode In this case, the Text item will be created in the engine's - \l {QDeclarativeEngine::rootContext()}{root context}. + \l {QQmlEngine::rootContext()}{root context}. - \sa QDeclarativeComponent QDeclarativeContext + \sa QQmlComponent QQmlContext */ /*! - Create a new QDeclarativeEngine with the given \a parent. + Create a new QQmlEngine with the given \a parent. */ -QDeclarativeEngine::QDeclarativeEngine(QObject *parent) -: QJSEngine(*new QDeclarativeEnginePrivate(this), parent) +QQmlEngine::QQmlEngine(QObject *parent) +: QJSEngine(*new QQmlEnginePrivate(this), parent) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->init(); } /*! - Destroys the QDeclarativeEngine. + Destroys the QQmlEngine. - Any QDeclarativeContext's created on this engine will be + Any QQmlContext's created on this engine will be invalidated, but not destroyed (unless they are parented to the - QDeclarativeEngine object). + QQmlEngine object). */ -QDeclarativeEngine::~QDeclarativeEngine() +QQmlEngine::~QQmlEngine() { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); if (d->isDebugging) { - QDeclarativeEngineDebugService::instance()->remEngine(this); + QQmlEngineDebugService::instance()->remEngine(this); } // if we are the parent of any of the qobject module api instances, // we need to remove them from our internal list, in order to prevent // a segfault in engine private dtor. - QList<QDeclarativeMetaType::ModuleApi> keys = d->moduleApiInstances.keys(); + QList<QQmlMetaType::ModuleApi> keys = d->moduleApiInstances.keys(); QObject *currQObjectApi = 0; - QDeclarativeMetaType::ModuleApiInstance *currInstance = 0; - foreach (const QDeclarativeMetaType::ModuleApi &key, keys) { + QQmlMetaType::ModuleApiInstance *currInstance = 0; + foreach (const QQmlMetaType::ModuleApi &key, keys) { currInstance = d->moduleApiInstances.value(key); currQObjectApi = currInstance->qobjectApi; if (this->children().contains(currQObjectApi)) { @@ -549,31 +549,31 @@ QDeclarativeEngine::~QDeclarativeEngine() d->incubationController->d = 0; } -/*! \fn void QDeclarativeEngine::quit() +/*! \fn void QQmlEngine::quit() This signal is emitted when the QML loaded by the engine would like to quit. */ -/*! \fn void QDeclarativeEngine::warnings(const QList<QDeclarativeError> &warnings) +/*! \fn void QQmlEngine::warnings(const QList<QQmlError> &warnings) This signal is emitted when \a warnings messages are generated by QML. */ /*! Clears the engine's internal component cache. - Normally the QDeclarativeEngine caches components loaded from qml + Normally the QQmlEngine caches components loaded from qml files. This method clears this cache and forces the component to be reloaded. */ -void QDeclarativeEngine::clearComponentCache() +void QQmlEngine::clearComponentCache() { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->typeLoader.clearCache(); } /*! Returns the engine's root context. - The root context is automatically created by the QDeclarativeEngine. + The root context is automatically created by the QQmlEngine. Data that should be available to all QML component instances instantiated by the engine should be put in the root context. @@ -581,9 +581,9 @@ void QDeclarativeEngine::clearComponentCache() component instances should be added to sub-contexts parented to the root context. */ -QDeclarativeContext *QDeclarativeEngine::rootContext() const +QQmlContext *QQmlEngine::rootContext() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->rootContext; } @@ -597,35 +597,35 @@ QDeclarativeContext *QDeclarativeEngine::rootContext() const The factory must be set before executing the engine. */ -void QDeclarativeEngine::setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *factory) +void QQmlEngine::setNetworkAccessManagerFactory(QQmlNetworkAccessManagerFactory *factory) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); QMutexLocker locker(&d->mutex); d->networkAccessManagerFactory = factory; } /*! - Returns the current QDeclarativeNetworkAccessManagerFactory. + Returns the current QQmlNetworkAccessManagerFactory. \sa setNetworkAccessManagerFactory() */ -QDeclarativeNetworkAccessManagerFactory *QDeclarativeEngine::networkAccessManagerFactory() const +QQmlNetworkAccessManagerFactory *QQmlEngine::networkAccessManagerFactory() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->networkAccessManagerFactory; } -void QDeclarativeEnginePrivate::registerFinalizeCallback(QObject *obj, int index) +void QQmlEnginePrivate::registerFinalizeCallback(QObject *obj, int index) { if (activeVME) { - activeVME->finalizeCallbacks.append(qMakePair(QDeclarativeGuard<QObject>(obj), index)); + activeVME->finalizeCallbacks.append(qMakePair(QQmlGuard<QObject>(obj), index)); } else { void *args[] = { 0 }; QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, args); } } -QNetworkAccessManager *QDeclarativeEnginePrivate::createNetworkAccessManager(QObject *parent) const +QNetworkAccessManager *QQmlEnginePrivate::createNetworkAccessManager(QObject *parent) const { QMutexLocker locker(&mutex); QNetworkAccessManager *nam; @@ -638,11 +638,11 @@ QNetworkAccessManager *QDeclarativeEnginePrivate::createNetworkAccessManager(QOb return nam; } -QNetworkAccessManager *QDeclarativeEnginePrivate::getNetworkAccessManager() const +QNetworkAccessManager *QQmlEnginePrivate::getNetworkAccessManager() const { - Q_Q(const QDeclarativeEngine); + Q_Q(const QQmlEngine); if (!networkAccessManager) - networkAccessManager = createNetworkAccessManager(const_cast<QDeclarativeEngine*>(q)); + networkAccessManager = createNetworkAccessManager(const_cast<QQmlEngine*>(q)); return networkAccessManager; } @@ -650,28 +650,28 @@ QNetworkAccessManager *QDeclarativeEnginePrivate::getNetworkAccessManager() cons Returns a common QNetworkAccessManager which can be used by any QML element instantiated by this engine. - If a QDeclarativeNetworkAccessManagerFactory has been set and a + If a QQmlNetworkAccessManagerFactory has been set and a QNetworkAccessManager has not yet been created, the - QDeclarativeNetworkAccessManagerFactory will be used to create the + QQmlNetworkAccessManagerFactory will be used to create the QNetworkAccessManager; otherwise the returned QNetworkAccessManager will have no proxy or cache set. \sa setNetworkAccessManagerFactory() */ -QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const +QNetworkAccessManager *QQmlEngine::networkAccessManager() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->getNetworkAccessManager(); } /*! Sets the \a provider to use for images requested via the \e - image: url scheme, with host \a providerId. The QDeclarativeEngine + image: url scheme, with host \a providerId. The QQmlEngine takes ownership of \a provider. Image providers enable support for pixmap and threaded image - requests. See the QDeclarativeImageProvider documentation for details on + requests. See the QQmlImageProvider documentation for details on implementing and using image providers. All required image providers should be added to the engine before any @@ -679,51 +679,51 @@ QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const \sa removeImageProvider() */ -void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativeImageProvider *provider) +void QQmlEngine::addImageProvider(const QString &providerId, QQmlImageProvider *provider) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); QMutexLocker locker(&d->mutex); - d->imageProviders.insert(providerId.toLower(), QSharedPointer<QDeclarativeImageProvider>(provider)); + d->imageProviders.insert(providerId.toLower(), QSharedPointer<QQmlImageProvider>(provider)); } /*! - Returns the QDeclarativeImageProvider set for \a providerId. + Returns the QQmlImageProvider set for \a providerId. Returns the provider if it was found; otherwise returns 0. */ -QDeclarativeImageProvider *QDeclarativeEngine::imageProvider(const QString &providerId) const +QQmlImageProvider *QQmlEngine::imageProvider(const QString &providerId) const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); QMutexLocker locker(&d->mutex); return d->imageProviders.value(providerId).data(); } /*! - Removes the QDeclarativeImageProvider for \a providerId. + Removes the QQmlImageProvider for \a providerId. \sa addImageProvider() */ -void QDeclarativeEngine::removeImageProvider(const QString &providerId) +void QQmlEngine::removeImageProvider(const QString &providerId) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); QMutexLocker locker(&d->mutex); d->imageProviders.take(providerId); } -QDeclarativeImageProvider::ImageType QDeclarativeEnginePrivate::getImageProviderType(const QUrl &url) +QQmlImageProvider::ImageType QQmlEnginePrivate::getImageProviderType(const QUrl &url) { QMutexLocker locker(&mutex); - QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host()); + QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host()); locker.unlock(); if (provider) return provider->imageType(); - return QDeclarativeImageProvider::Invalid; + return QQmlImageProvider::Invalid; } -QDeclarativeTextureFactory *QDeclarativeEnginePrivate::getTextureFromProvider(const QUrl &url, QSize *size, const QSize& req_size) +QQuickTextureFactory *QQmlEnginePrivate::getTextureFromProvider(const QUrl &url, QSize *size, const QSize& req_size) { QMutexLocker locker(&mutex); - QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host()); + QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host()); locker.unlock(); if (provider) { QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); @@ -732,11 +732,11 @@ QDeclarativeTextureFactory *QDeclarativeEnginePrivate::getTextureFromProvider(co return 0; } -QImage QDeclarativeEnginePrivate::getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size) +QImage QQmlEnginePrivate::getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size) { QMutexLocker locker(&mutex); QImage image; - QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host()); + QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host()); locker.unlock(); if (provider) { QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); @@ -745,11 +745,11 @@ QImage QDeclarativeEnginePrivate::getImageFromProvider(const QUrl &url, QSize *s return image; } -QPixmap QDeclarativeEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size) +QPixmap QQmlEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size) { QMutexLocker locker(&mutex); QPixmap pixmap; - QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host()); + QSharedPointer<QQmlImageProvider> provider = imageProviders.value(url.host()); locker.unlock(); if (provider) { QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); @@ -761,16 +761,16 @@ QPixmap QDeclarativeEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize /*! Return the base URL for this engine. The base URL is only used to resolve components when a relative URL is passed to the - QDeclarativeComponent constructor. + QQmlComponent constructor. If a base URL has not been explicitly set, this method returns the application's current working directory. \sa setBaseUrl() */ -QUrl QDeclarativeEngine::baseUrl() const +QUrl QQmlEngine::baseUrl() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); if (d->baseUrl.isEmpty()) { return QUrl::fromLocalFile(QDir::currentPath() + QDir::separator()); } else { @@ -783,9 +783,9 @@ QUrl QDeclarativeEngine::baseUrl() const \sa baseUrl() */ -void QDeclarativeEngine::setBaseUrl(const QUrl &url) +void QQmlEngine::setBaseUrl(const QUrl &url) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->baseUrl = url; } @@ -795,9 +795,9 @@ void QDeclarativeEngine::setBaseUrl(const QUrl &url) The default value is true. */ -bool QDeclarativeEngine::outputWarningsToStandardError() const +bool QQmlEngine::outputWarningsToStandardError() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->outputWarningsToStdErr; } @@ -811,70 +811,70 @@ bool QDeclarativeEngine::outputWarningsToStandardError() const The default value is true. */ -void QDeclarativeEngine::setOutputWarningsToStandardError(bool enabled) +void QQmlEngine::setOutputWarningsToStandardError(bool enabled) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->outputWarningsToStdErr = enabled; } /*! Attempt to free unused memory. */ -void QDeclarativeEngine::collectGarbage() +void QQmlEngine::collectGarbage() { QV8Engine::gc(); } /*! - Returns the QDeclarativeContext for the \a object, or 0 if no + Returns the QQmlContext for the \a object, or 0 if no context has been set. - When the QDeclarativeEngine instantiates a QObject, the context is + When the QQmlEngine instantiates a QObject, the context is set automatically. */ -QDeclarativeContext *QDeclarativeEngine::contextForObject(const QObject *object) +QQmlContext *QQmlEngine::contextForObject(const QObject *object) { if(!object) return 0; QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object)); - QDeclarativeData *data = - static_cast<QDeclarativeData *>(priv->declarativeData); + QQmlData *data = + static_cast<QQmlData *>(priv->declarativeData); if (!data) return 0; else if (data->outerContext) - return data->outerContext->asQDeclarativeContext(); + return data->outerContext->asQQmlContext(); else return 0; } /*! - Sets the QDeclarativeContext for the \a object to \a context. + Sets the QQmlContext for the \a object to \a context. If the \a object already has a context, a warning is output, but the context is not changed. - When the QDeclarativeEngine instantiates a QObject, the context is + When the QQmlEngine instantiates a QObject, the context is set automatically. */ -void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContext *context) +void QQmlEngine::setContextForObject(QObject *object, QQmlContext *context) { if (!object || !context) return; - QDeclarativeData *data = QDeclarativeData::get(object, true); + QQmlData *data = QQmlData::get(object, true); if (data->context) { - qWarning("QDeclarativeEngine::setContextForObject(): Object already has a QDeclarativeContext"); + qWarning("QQmlEngine::setContextForObject(): Object already has a QQmlContext"); return; } - QDeclarativeContextData *contextData = QDeclarativeContextData::get(context); + QQmlContextData *contextData = QQmlContextData::get(context); contextData->addObject(object); } /*! - \enum QDeclarativeEngine::ObjectOwnership + \enum QQmlEngine::ObjectOwnership Ownership controls whether or not QML automatically destroys the QObject when the object is garbage collected by the JavaScript @@ -896,8 +896,8 @@ void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContex explicitly. QML uses a heuristic to set the default object ownership. By default, an object that is created by QML has JavaScriptOwnership. The exception to this are the root objects - created by calling QDeclarativeComponent::create() or - QDeclarativeComponent::beginCreate() which have CppOwnership by + created by calling QQmlComponent::create() or + QQmlComponent::beginCreate() which have CppOwnership by default. The ownership of these root-level objects is considered to have been transferred to the C++ caller. @@ -912,12 +912,12 @@ void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContex /*! Sets the \a ownership of \a object. */ -void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership ownership) +void QQmlEngine::setObjectOwnership(QObject *object, ObjectOwnership ownership) { if (!object) return; - QDeclarativeData *ddata = QDeclarativeData::get(object, true); + QQmlData *ddata = QQmlData::get(object, true); if (!ddata) return; @@ -928,28 +928,28 @@ void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership own /*! Returns the ownership of \a object. */ -QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(QObject *object) +QQmlEngine::ObjectOwnership QQmlEngine::objectOwnership(QObject *object) { if (!object) return CppOwnership; - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); if (!ddata) return CppOwnership; else return ddata->indestructible?CppOwnership:JavaScriptOwnership; } -bool QDeclarativeEngine::event(QEvent *e) +bool QQmlEngine::event(QEvent *e) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); if (e->type() == QEvent::User) d->doDeleteInEngineThread(); return QJSEngine::event(e); } -void QDeclarativeEnginePrivate::doDeleteInEngineThread() +void QQmlEnginePrivate::doDeleteInEngineThread() { QFieldList<Deletable, &Deletable::next> list; mutex.lock(); @@ -962,38 +962,38 @@ void QDeclarativeEnginePrivate::doDeleteInEngineThread() Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object) { - QDeclarativeData *data = QDeclarativeData::get(object); + QQmlData *data = QQmlData::get(object); if (data && data->deferredComponent) { - if (QDeclarativeDebugService::isDebuggingEnabled()) { - QDeclarativeProfilerService::startRange(QDeclarativeProfilerService::Creating); - QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject()); + if (QQmlDebugService::isDebuggingEnabled()) { + QQmlProfilerService::startRange(QQmlProfilerService::Creating); + QQmlType *type = QQmlMetaType::qmlType(object->metaObject()); QString typeName = type ? type->qmlTypeName() : QString::fromUtf8(object->metaObject()->className()); - QDeclarativeProfilerService::rangeData(QDeclarativeProfilerService::Creating, typeName); + QQmlProfilerService::rangeData(QQmlProfilerService::Creating, typeName); if (data->outerContext) - QDeclarativeProfilerService::rangeLocation(QDeclarativeProfilerService::Creating, data->outerContext->url, data->lineNumber, data->columnNumber); + QQmlProfilerService::rangeLocation(QQmlProfilerService::Creating, data->outerContext->url, data->lineNumber, data->columnNumber); } - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(data->context->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(data->context->engine); - QDeclarativeComponentPrivate::ConstructionState state; - QDeclarativeComponentPrivate::beginDeferred(ep, object, &state); + QQmlComponentPrivate::ConstructionState state; + QQmlComponentPrivate::beginDeferred(ep, object, &state); data->deferredComponent->release(); data->deferredComponent = 0; - QDeclarativeComponentPrivate::complete(ep, &state); - QDeclarativeProfilerService::endRange(QDeclarativeProfilerService::Creating); + QQmlComponentPrivate::complete(ep, &state); + QQmlProfilerService::endRange(QQmlProfilerService::Creating); } } -QDeclarativeContext *qmlContext(const QObject *obj) +QQmlContext *qmlContext(const QObject *obj) { - return QDeclarativeEngine::contextForObject(obj); + return QQmlEngine::contextForObject(obj); } -QDeclarativeEngine *qmlEngine(const QObject *obj) +QQmlEngine *qmlEngine(const QObject *obj) { - QDeclarativeData *data = QDeclarativeData::get(obj, false); + QQmlData *data = QQmlData::get(obj, false); if (!data || !data->context) return 0; return data->context->engine; @@ -1001,7 +1001,7 @@ QDeclarativeEngine *qmlEngine(const QObject *obj) QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create) { - QDeclarativeData *data = QDeclarativeData::get(object); + QQmlData *data = QQmlData::get(object); if (!data) return 0; // Attached properties are only on objects created by QML @@ -1009,7 +1009,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre if (rv || !create) return rv; - QDeclarativeAttachedPropertiesFunc pf = QDeclarativeMetaType::attachedPropertiesFuncById(id); + QQmlAttachedPropertiesFunc pf = QQmlMetaType::attachedPropertiesFuncById(id); if (!pf) return 0; @@ -1025,7 +1025,7 @@ QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, const QMetaObject *attachedMetaObject, bool create) { if (*idCache == -1) - *idCache = QDeclarativeMetaType::attachedPropertiesFuncId(attachedMetaObject); + *idCache = QQmlMetaType::attachedPropertiesFuncId(attachedMetaObject); if (*idCache == -1 || !object) return 0; @@ -1033,35 +1033,35 @@ QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, return qmlAttachedPropertiesObjectById(*idCache, object, create); } -QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler() +QQmlDebuggingEnabler::QQmlDebuggingEnabler() { -#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL - if (!QDeclarativeEnginePrivate::qml_debugging_enabled) { +#ifndef QQML_NO_DEBUG_PROTOCOL + if (!QQmlEnginePrivate::qml_debugging_enabled) { qWarning("Qml debugging is enabled. Only use this in a safe environment!"); } - QDeclarativeEnginePrivate::qml_debugging_enabled = true; + QQmlEnginePrivate::qml_debugging_enabled = true; #endif } -class QDeclarativeDataExtended { +class QQmlDataExtended { public: - QDeclarativeDataExtended(); - ~QDeclarativeDataExtended(); + QQmlDataExtended(); + ~QQmlDataExtended(); QHash<int, QObject *> attachedProperties; - QDeclarativeNotifier objectNameNotifier; + QQmlNotifier objectNameNotifier; }; -QDeclarativeDataExtended::QDeclarativeDataExtended() +QQmlDataExtended::QQmlDataExtended() { } -QDeclarativeDataExtended::~QDeclarativeDataExtended() +QQmlDataExtended::~QQmlDataExtended() { } -void QDeclarativeData::NotifyList::layout(QDeclarativeNotifierEndpoint *endpoint) +void QQmlData::NotifyList::layout(QQmlNotifierEndpoint *endpoint) { if (endpoint->next) layout(endpoint->next); @@ -1075,16 +1075,16 @@ void QDeclarativeData::NotifyList::layout(QDeclarativeNotifierEndpoint *endpoint notifies[index] = endpoint; } -void QDeclarativeData::NotifyList::layout() +void QQmlData::NotifyList::layout() { Q_ASSERT(maximumTodoIndex >= notifiesSize); if (todo) { - QDeclarativeNotifierEndpoint **old = notifies; - const int reallocSize = (maximumTodoIndex + 1) * sizeof(QDeclarativeNotifierEndpoint*); - notifies = (QDeclarativeNotifierEndpoint**)realloc(notifies, reallocSize); + QQmlNotifierEndpoint **old = notifies; + const int reallocSize = (maximumTodoIndex + 1) * sizeof(QQmlNotifierEndpoint*); + notifies = (QQmlNotifierEndpoint**)realloc(notifies, reallocSize); const int memsetSize = (maximumTodoIndex - notifiesSize + 1) * - sizeof(QDeclarativeNotifierEndpoint*); + sizeof(QQmlNotifierEndpoint*); memset(notifies + notifiesSize, 0, memsetSize); if (notifies != old) { @@ -1102,7 +1102,7 @@ void QDeclarativeData::NotifyList::layout() todo = 0; } -void QDeclarativeData::addNotify(int index, QDeclarativeNotifierEndpoint *endpoint) +void QQmlData::addNotify(int index, QQmlNotifierEndpoint *endpoint) { if (!notifyList) { notifyList = (NotifyList *)malloc(sizeof(NotifyList)); @@ -1135,19 +1135,19 @@ void QDeclarativeData::addNotify(int index, QDeclarativeNotifierEndpoint *endpoi } } -QDeclarativeNotifier *QDeclarativeData::objectNameNotifier() const +QQmlNotifier *QQmlData::objectNameNotifier() const { - if (!extendedData) extendedData = new QDeclarativeDataExtended; + if (!extendedData) extendedData = new QQmlDataExtended; return &extendedData->objectNameNotifier; } -QHash<int, QObject *> *QDeclarativeData::attachedProperties() const +QHash<int, QObject *> *QQmlData::attachedProperties() const { - if (!extendedData) extendedData = new QDeclarativeDataExtended; + if (!extendedData) extendedData = new QQmlDataExtended; return &extendedData->attachedProperties; } -void QDeclarativeData::destroyed(QObject *object) +void QQmlData::destroyed(QObject *object) { if (deferredComponent) deferredComponent->release(); @@ -1157,9 +1157,9 @@ void QDeclarativeData::destroyed(QObject *object) if (prevContextObject) *prevContextObject = nextContextObject; - QDeclarativeAbstractBinding *binding = bindings; + QQmlAbstractBinding *binding = bindings; while (binding) { - QDeclarativeAbstractBinding *next = binding->m_nextBinding; + QQmlAbstractBinding *next = binding->m_nextBinding; binding->m_prevBinding = 0; binding->m_nextBinding = 0; binding->destroy(); @@ -1176,7 +1176,7 @@ void QDeclarativeData::destroyed(QObject *object) context->destroy(); while (guards) { - QDeclarativeGuard<QObject> *guard = static_cast<QDeclarativeGuard<QObject> *>(guards); + QQmlGuard<QObject> *guard = static_cast<QQmlGuard<QObject> *>(guards); *guard = (QObject *)0; guard->objectDestroyed(object); } @@ -1185,7 +1185,7 @@ void QDeclarativeData::destroyed(QObject *object) while (notifyList->todo) notifyList->todo->disconnect(); for (int ii = 0; ii < notifyList->notifiesSize; ++ii) { - while (QDeclarativeNotifierEndpoint *ep = notifyList->notifies[ii]) + while (QQmlNotifierEndpoint *ep = notifyList->notifies[ii]) ep->disconnect(); } free(notifyList->notifies); @@ -1201,18 +1201,18 @@ void QDeclarativeData::destroyed(QObject *object) delete this; } -void QDeclarativeData::parentChanged(QObject *object, QObject *parent) +void QQmlData::parentChanged(QObject *object, QObject *parent) { Q_UNUSED(object); Q_UNUSED(parent); } -void QDeclarativeData::objectNameChanged(QObject *) +void QQmlData::objectNameChanged(QObject *) { if (extendedData) objectNameNotifier()->notify(); } -bool QDeclarativeData::hasBindingBit(int bit) const +bool QQmlData::hasBindingBit(int bit) const { if (bindingBitsSize > bit) return bindingBits[bit / 32] & (1 << (bit % 32)); @@ -1220,13 +1220,13 @@ bool QDeclarativeData::hasBindingBit(int bit) const return false; } -void QDeclarativeData::clearBindingBit(int bit) +void QQmlData::clearBindingBit(int bit) { if (bindingBitsSize > bit) bindingBits[bit / 32] &= ~(1 << (bit % 32)); } -void QDeclarativeData::setBindingBit(QObject *obj, int bit) +void QQmlData::setBindingBit(QObject *obj, int bit) { if (bindingBitsSize <= bit) { int props = obj->metaObject()->propertyCount(); @@ -1248,7 +1248,7 @@ void QDeclarativeData::setBindingBit(QObject *obj, int bit) bindingBits[bit / 32] |= (1 << (bit % 32)); } -QString QDeclarativeEnginePrivate::urlToLocalFileOrQrc(const QUrl& url) +QString QQmlEnginePrivate::urlToLocalFileOrQrc(const QUrl& url) { if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) { if (url.authority().isEmpty()) @@ -1275,7 +1275,7 @@ static QString toLocalFile(const QString &url) return file; } -QString QDeclarativeEnginePrivate::urlToLocalFileOrQrc(const QString& url) +QString QQmlEnginePrivate::urlToLocalFileOrQrc(const QString& url) { if (url.startsWith(QLatin1String("qrc:"), Qt::CaseInsensitive)) { if (url.length() > 4) @@ -1286,59 +1286,59 @@ QString QDeclarativeEnginePrivate::urlToLocalFileOrQrc(const QString& url) return toLocalFile(url); } -void QDeclarativeEnginePrivate::sendQuit() +void QQmlEnginePrivate::sendQuit() { - Q_Q(QDeclarativeEngine); + Q_Q(QQmlEngine); emit q->quit(); if (q->receivers(SIGNAL(quit())) == 0) { - qWarning("Signal QDeclarativeEngine::quit() emitted, but no receivers connected to handle it."); + qWarning("Signal QQmlEngine::quit() emitted, but no receivers connected to handle it."); } } -static void dumpwarning(const QDeclarativeError &error) +static void dumpwarning(const QQmlError &error) { qWarning().nospace() << qPrintable(error.toString()); } -static void dumpwarning(const QList<QDeclarativeError> &errors) +static void dumpwarning(const QList<QQmlError> &errors) { for (int ii = 0; ii < errors.count(); ++ii) dumpwarning(errors.at(ii)); } -void QDeclarativeEnginePrivate::warning(const QDeclarativeError &error) +void QQmlEnginePrivate::warning(const QQmlError &error) { - Q_Q(QDeclarativeEngine); - q->warnings(QList<QDeclarativeError>() << error); + Q_Q(QQmlEngine); + q->warnings(QList<QQmlError>() << error); if (outputWarningsToStdErr) dumpwarning(error); } -void QDeclarativeEnginePrivate::warning(const QList<QDeclarativeError> &errors) +void QQmlEnginePrivate::warning(const QList<QQmlError> &errors) { - Q_Q(QDeclarativeEngine); + Q_Q(QQmlEngine); q->warnings(errors); if (outputWarningsToStdErr) dumpwarning(errors); } -void QDeclarativeEnginePrivate::warning(QDeclarativeEngine *engine, const QDeclarativeError &error) +void QQmlEnginePrivate::warning(QQmlEngine *engine, const QQmlError &error) { if (engine) - QDeclarativeEnginePrivate::get(engine)->warning(error); + QQmlEnginePrivate::get(engine)->warning(error); else dumpwarning(error); } -void QDeclarativeEnginePrivate::warning(QDeclarativeEngine *engine, const QList<QDeclarativeError> &error) +void QQmlEnginePrivate::warning(QQmlEngine *engine, const QList<QQmlError> &error) { if (engine) - QDeclarativeEnginePrivate::get(engine)->warning(error); + QQmlEnginePrivate::get(engine)->warning(error); else dumpwarning(error); } -void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const QDeclarativeError &error) +void QQmlEnginePrivate::warning(QQmlEnginePrivate *engine, const QQmlError &error) { if (engine) engine->warning(error); @@ -1346,7 +1346,7 @@ void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const dumpwarning(error); } -void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const QList<QDeclarativeError> &error) +void QQmlEnginePrivate::warning(QQmlEnginePrivate *engine, const QList<QQmlError> &error) { if (engine) engine->warning(error); @@ -1359,7 +1359,7 @@ void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const so that scarce resources are not freed prematurely (eg, if there is a nested javascript expression). */ -void QDeclarativeEnginePrivate::referenceScarceResources() +void QQmlEnginePrivate::referenceScarceResources() { scarceResourcesRefCount += 1; } @@ -1368,7 +1368,7 @@ void QDeclarativeEnginePrivate::referenceScarceResources() This function should be called after evaluation of the js expression is complete, and so the scarce resources may be freed safely. */ -void QDeclarativeEnginePrivate::dereferenceScarceResources() +void QQmlEnginePrivate::dereferenceScarceResources() { Q_ASSERT(scarceResourcesRefCount > 0); scarceResourcesRefCount -= 1; @@ -1397,9 +1397,9 @@ void QDeclarativeEnginePrivate::dereferenceScarceResources() \sa setImportPathList(), {QML Modules} */ -void QDeclarativeEngine::addImportPath(const QString& path) +void QQmlEngine::addImportPath(const QString& path) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->importDatabase.addImportPath(path); } @@ -1408,7 +1408,7 @@ void QDeclarativeEngine::addImportPath(const QString& path) installed modules in a URL-based directory structure. For example, if \c /opt/MyApp/lib/imports is in the path, then QML that - imports \c com.mycompany.Feature will cause the QDeclarativeEngine to look + imports \c com.mycompany.Feature will cause the QQmlEngine to look in \c /opt/MyApp/lib/imports/com/mycompany/Feature/ for the components provided by that module. A \c qmldir file is required for defining the type version mapping and possibly declarative extensions plugins. @@ -1419,9 +1419,9 @@ void QDeclarativeEngine::addImportPath(const QString& path) \sa addImportPath() setImportPathList() */ -QStringList QDeclarativeEngine::importPathList() const +QStringList QQmlEngine::importPathList() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->importDatabase.importPathList(); } @@ -1435,9 +1435,9 @@ QStringList QDeclarativeEngine::importPathList() const \sa importPathList() addImportPath() */ -void QDeclarativeEngine::setImportPathList(const QStringList &paths) +void QQmlEngine::setImportPathList(const QStringList &paths) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->importDatabase.setImportPathList(paths); } @@ -1453,9 +1453,9 @@ void QDeclarativeEngine::setImportPathList(const QStringList &paths) \sa setPluginPathList() */ -void QDeclarativeEngine::addPluginPath(const QString& path) +void QQmlEngine::addPluginPath(const QString& path) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->importDatabase.addPluginPath(path); } @@ -1469,9 +1469,9 @@ void QDeclarativeEngine::addPluginPath(const QString& path) \sa addPluginPath() setPluginPathList() */ -QStringList QDeclarativeEngine::pluginPathList() const +QStringList QQmlEngine::pluginPathList() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->importDatabase.pluginPathList(); } @@ -1485,9 +1485,9 @@ QStringList QDeclarativeEngine::pluginPathList() const \sa pluginPathList() addPluginPath() */ -void QDeclarativeEngine::setPluginPathList(const QStringList &paths) +void QQmlEngine::setPluginPathList(const QStringList &paths) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->importDatabase.setPluginPathList(paths); } @@ -1497,11 +1497,11 @@ void QDeclarativeEngine::setPluginPathList(const QStringList &paths) On failure and if non-null, the \a errors list will have any errors which occurred prepended to it. - The plugin has to be a Qt plugin which implements the QDeclarativeExtensionPlugin interface. + The plugin has to be a Qt plugin which implements the QQmlExtensionPlugin interface. */ -bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &uri, QList<QDeclarativeError> *errors) +bool QQmlEngine::importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); return d->importDatabase.importPlugin(filePath, uri, errors); } @@ -1511,12 +1511,12 @@ bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &ur On failure and if non-null, *\a errorString will be set to a message describing the failure. - The plugin has to be a Qt plugin which implements the QDeclarativeExtensionPlugin interface. + The plugin has to be a Qt plugin which implements the QQmlExtensionPlugin interface. */ -bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &uri, QString *errorString) +bool QQmlEngine::importPlugin(const QString &filePath, const QString &uri, QString *errorString) { - Q_D(QDeclarativeEngine); - QList<QDeclarativeError> errors; + Q_D(QQmlEngine); + QList<QQmlError> errors; bool retn = d->importDatabase.importPlugin(filePath, uri, &errors); if (!errors.isEmpty()) { QString builtError; @@ -1531,13 +1531,13 @@ bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &ur } /*! - \property QDeclarativeEngine::offlineStoragePath + \property QQmlEngine::offlineStoragePath \brief the directory for storing offline user data Returns the directory where SQL and other offline storage is placed. - QDeclarativeWebView and the SQL databases created with openDatabase() + QQuickWebView and the SQL databases created with openDatabase() are stored here. The default is QML/OfflineStorage in the platform-standard @@ -1547,15 +1547,15 @@ bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &ur callers wanting to \e create new files at this location should create it first - see QDir::mkpath(). */ -void QDeclarativeEngine::setOfflineStoragePath(const QString& dir) +void QQmlEngine::setOfflineStoragePath(const QString& dir) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); d->offlineStoragePath = dir; } -QString QDeclarativeEngine::offlineStoragePath() const +QString QQmlEngine::offlineStoragePath() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->offlineStoragePath; } @@ -1574,33 +1574,33 @@ static void *voidptr_constructor(const void *v) } } -QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(const QMetaObject *mo) +QQmlPropertyCache *QQmlEnginePrivate::createCache(const QMetaObject *mo) { - Q_Q(QDeclarativeEngine); + Q_Q(QQmlEngine); if (!mo->superClass()) { - QDeclarativePropertyCache *rv = new QDeclarativePropertyCache(q, mo); + QQmlPropertyCache *rv = new QQmlPropertyCache(q, mo); propertyCache.insert(mo, rv); return rv; } else { - QDeclarativePropertyCache *super = cache(mo->superClass()); - QDeclarativePropertyCache *rv = super->copyAndAppend(q, mo); + QQmlPropertyCache *super = cache(mo->superClass()); + QQmlPropertyCache *rv = super->copyAndAppend(q, mo); propertyCache.insert(mo, rv); return rv; } } -QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(QDeclarativeType *type, int minorVersion, - QDeclarativeError &error) +QQmlPropertyCache *QQmlEnginePrivate::createCache(QQmlType *type, int minorVersion, + QQmlError &error) { - QList<QDeclarativeType *> types; + QList<QQmlType *> types; int maxMinorVersion = 0; const QMetaObject *metaObject = type->metaObject(); while (metaObject) { - QDeclarativeType *t = QDeclarativeMetaType::qmlType(metaObject, type->module(), + QQmlType *t = QQmlMetaType::qmlType(metaObject, type->module(), type->majorVersion(), minorVersion); if (t) { maxMinorVersion = qMax(maxMinorVersion, t->minorVersion()); @@ -1612,18 +1612,18 @@ QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(QDeclarativeTy metaObject = metaObject->superClass(); } - if (QDeclarativePropertyCache *c = typePropertyCache.value(qMakePair(type, maxMinorVersion))) { + if (QQmlPropertyCache *c = typePropertyCache.value(qMakePair(type, maxMinorVersion))) { c->addref(); typePropertyCache.insert(qMakePair(type, minorVersion), c); return c; } - QDeclarativePropertyCache *raw = cache(type->metaObject()); + QQmlPropertyCache *raw = cache(type->metaObject()); bool hasCopied = false; for (int ii = 0; ii < types.count(); ++ii) { - QDeclarativeType *currentType = types.at(ii); + QQmlType *currentType = types.at(ii); if (!currentType) continue; @@ -1657,16 +1657,16 @@ QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(QDeclarativeTy QString overloadName; #if 0 - for (QDeclarativePropertyCache::StringCache::ConstIterator iter = raw->stringCache.begin(); + for (QQmlPropertyCache::StringCache::ConstIterator iter = raw->stringCache.begin(); !overloadError && iter != raw->stringCache.end(); ++iter) { - QDeclarativePropertyData *d = *iter; + QQmlPropertyData *d = *iter; if (raw->isAllowedInRevision(d)) continue; // Not excluded - no problems // check that a regular "name" overload isn't happening - QDeclarativePropertyData *current = d; + QQmlPropertyData *current = d; while (!overloadError && current) { current = d->overrideData(current); if (current && raw->isAllowedInRevision(current)) @@ -1693,14 +1693,14 @@ QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(QDeclarativeTy return raw; } -QDeclarativeMetaType::ModuleApiInstance * -QDeclarativeEnginePrivate::moduleApiInstance(const QDeclarativeMetaType::ModuleApi &module) +QQmlMetaType::ModuleApiInstance * +QQmlEnginePrivate::moduleApiInstance(const QQmlMetaType::ModuleApi &module) { Locker locker(this); - QDeclarativeMetaType::ModuleApiInstance *a = moduleApiInstances.value(module); + QQmlMetaType::ModuleApiInstance *a = moduleApiInstances.value(module); if (!a) { - a = new QDeclarativeMetaType::ModuleApiInstance; + a = new QQmlMetaType::ModuleApiInstance; a->scriptCallback = module.script; a->qobjectCallback = module.qobject; moduleApiInstances.insert(module, a); @@ -1709,13 +1709,13 @@ QDeclarativeEnginePrivate::moduleApiInstance(const QDeclarativeMetaType::ModuleA return a; } -bool QDeclarativeEnginePrivate::isQObject(int t) +bool QQmlEnginePrivate::isQObject(int t) { Locker locker(this); - return m_compositeTypes.contains(t) || QDeclarativeMetaType::isQObject(t); + return m_compositeTypes.contains(t) || QQmlMetaType::isQObject(t); } -QObject *QDeclarativeEnginePrivate::toQObject(const QVariant &v, bool *ok) const +QObject *QQmlEnginePrivate::toQObject(const QVariant &v, bool *ok) const { Locker locker(this); int t = v.userType(); @@ -1723,67 +1723,67 @@ QObject *QDeclarativeEnginePrivate::toQObject(const QVariant &v, bool *ok) const if (ok) *ok = true; return *(QObject **)(v.constData()); } else { - return QDeclarativeMetaType::toQObject(v, ok); + return QQmlMetaType::toQObject(v, ok); } } -QDeclarativeMetaType::TypeCategory QDeclarativeEnginePrivate::typeCategory(int t) const +QQmlMetaType::TypeCategory QQmlEnginePrivate::typeCategory(int t) const { Locker locker(this); if (m_compositeTypes.contains(t)) - return QDeclarativeMetaType::Object; + return QQmlMetaType::Object; else if (m_qmlLists.contains(t)) - return QDeclarativeMetaType::List; + return QQmlMetaType::List; else - return QDeclarativeMetaType::typeCategory(t); + return QQmlMetaType::typeCategory(t); } -bool QDeclarativeEnginePrivate::isList(int t) const +bool QQmlEnginePrivate::isList(int t) const { Locker locker(this); - return m_qmlLists.contains(t) || QDeclarativeMetaType::isList(t); + return m_qmlLists.contains(t) || QQmlMetaType::isList(t); } -int QDeclarativeEnginePrivate::listType(int t) const +int QQmlEnginePrivate::listType(int t) const { Locker locker(this); QHash<int, int>::ConstIterator iter = m_qmlLists.find(t); if (iter != m_qmlLists.end()) return *iter; else - return QDeclarativeMetaType::listType(t); + return QQmlMetaType::listType(t); } -const QMetaObject *QDeclarativeEnginePrivate::rawMetaObjectForType(int t) const +const QMetaObject *QQmlEnginePrivate::rawMetaObjectForType(int t) const { Locker locker(this); - QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.find(t); + QHash<int, QQmlCompiledData*>::ConstIterator iter = m_compositeTypes.find(t); if (iter != m_compositeTypes.end()) { return (*iter)->root; } else { - QDeclarativeType *type = QDeclarativeMetaType::qmlType(t); + QQmlType *type = QQmlMetaType::qmlType(t); return type?type->baseMetaObject():0; } } -const QMetaObject *QDeclarativeEnginePrivate::metaObjectForType(int t) const +const QMetaObject *QQmlEnginePrivate::metaObjectForType(int t) const { Locker locker(this); - QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.find(t); + QHash<int, QQmlCompiledData*>::ConstIterator iter = m_compositeTypes.find(t); if (iter != m_compositeTypes.end()) { return (*iter)->root; } else { - QDeclarativeType *type = QDeclarativeMetaType::qmlType(t); + QQmlType *type = QQmlMetaType::qmlType(t); return type?type->metaObject():0; } } -void QDeclarativeEnginePrivate::registerCompositeType(QDeclarativeCompiledData *data) +void QQmlEnginePrivate::registerCompositeType(QQmlCompiledData *data) { QByteArray name = data->root->className(); QByteArray ptr = name + '*'; - QByteArray lst = "QDeclarativeListProperty<" + name + '>'; + QByteArray lst = "QQmlListProperty<" + name + '>'; int ptr_type = QMetaType::registerType(ptr.constData(), voidptr_destructor, voidptr_constructor); @@ -1797,7 +1797,7 @@ void QDeclarativeEnginePrivate::registerCompositeType(QDeclarativeCompiledData * m_compositeTypes.insert(ptr_type, data); } -bool QDeclarative_isFileCaseCorrect(const QString &fileName) +bool QQml_isFileCaseCorrect(const QString &fileName) { #if defined(Q_OS_MAC) || defined(Q_OS_WIN) QFileInfo info(fileName); @@ -1836,19 +1836,19 @@ bool QDeclarative_isFileCaseCorrect(const QString &fileName) } /*! - \fn QDeclarativeEngine *qmlEngine(const QObject *object) - \relates QDeclarativeEngine + \fn QQmlEngine *qmlEngine(const QObject *object) + \relates QQmlEngine - Returns the QDeclarativeEngine associated with \a object, if any. This is equivalent to - QDeclarativeEngine::contextForObject(object)->engine(), but more efficient. + Returns the QQmlEngine associated with \a object, if any. This is equivalent to + QQmlEngine::contextForObject(object)->engine(), but more efficient. */ /*! - \fn QDeclarativeContext *qmlContext(const QObject *object) - \relates QDeclarativeEngine + \fn QQmlContext *qmlContext(const QObject *object) + \relates QQmlEngine - Returns the QDeclarativeContext associated with \a object, if any. This is equivalent to - QDeclarativeEngine::contextForObject(object). + Returns the QQmlContext associated with \a object, if any. This is equivalent to + QQmlEngine::contextForObject(object). */ QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/qml/qml/qqmlengine.h index eb310d4b9a..04ac61c05b 100644 --- a/src/declarative/qml/qdeclarativeengine.h +++ b/src/qml/qml/qqmlengine.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,42 +39,42 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEENGINE_H -#define QDECLARATIVEENGINE_H +#ifndef QQMLENGINE_H +#define QQMLENGINE_H #include <QtCore/qurl.h> #include <QtCore/qobject.h> #include <QtCore/qmap.h> -#include <QtDeclarative/qjsengine.h> -#include <QtDeclarative/qdeclarativeerror.h> -#include <QtDeclarative/qdeclarativedebug.h> +#include <QtQml/qjsengine.h> +#include <QtQml/qqmlerror.h> +#include <QtQml/qqmldebug.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeComponent; -class QDeclarativeEnginePrivate; -class QDeclarativeImportsPrivate; -class QDeclarativeExpression; -class QDeclarativeContext; -class QDeclarativeType; +class QQmlComponent; +class QQmlEnginePrivate; +class QQmlImportsPrivate; +class QQmlExpression; +class QQmlContext; +class QQmlType; class QUrl; class QScriptContext; -class QDeclarativeImageProvider; +class QQmlImageProvider; class QNetworkAccessManager; -class QDeclarativeNetworkAccessManagerFactory; -class QDeclarativeIncubationController; -class Q_DECLARATIVE_EXPORT QDeclarativeEngine : public QJSEngine +class QQmlNetworkAccessManagerFactory; +class QQmlIncubationController; +class Q_QML_EXPORT QQmlEngine : public QJSEngine { Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath) Q_OBJECT public: - QDeclarativeEngine(QObject *p = 0); - virtual ~QDeclarativeEngine(); + QQmlEngine(QObject *p = 0); + virtual ~QQmlEngine(); - QDeclarativeContext *rootContext() const; + QQmlContext *rootContext() const; void clearComponentCache(); @@ -87,19 +87,19 @@ public: void addPluginPath(const QString& dir); bool importPlugin(const QString &filePath, const QString &uri, QString *errorString); // XXX: Qt 5: Remove this function - bool importPlugin(const QString &filePath, const QString &uri, QList<QDeclarativeError> *errors); + bool importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors); - void setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *); - QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory() const; + void setNetworkAccessManagerFactory(QQmlNetworkAccessManagerFactory *); + QQmlNetworkAccessManagerFactory *networkAccessManagerFactory() const; QNetworkAccessManager *networkAccessManager() const; - void addImageProvider(const QString &id, QDeclarativeImageProvider *); - QDeclarativeImageProvider *imageProvider(const QString &id) const; + void addImageProvider(const QString &id, QQmlImageProvider *); + QQmlImageProvider *imageProvider(const QString &id) const; void removeImageProvider(const QString &id); - void setIncubationController(QDeclarativeIncubationController *); - QDeclarativeIncubationController *incubationController() const; + void setIncubationController(QQmlIncubationController *); + QQmlIncubationController *incubationController() const; void setOfflineStoragePath(const QString& dir); QString offlineStoragePath() const; @@ -112,8 +112,8 @@ public: void collectGarbage(); - static QDeclarativeContext *contextForObject(const QObject *); - static void setContextForObject(QObject *, QDeclarativeContext *); + static QQmlContext *contextForObject(const QObject *); + static void setContextForObject(QObject *, QQmlContext *); enum ObjectOwnership { CppOwnership, JavaScriptOwnership }; static void setObjectOwnership(QObject *, ObjectOwnership); @@ -124,15 +124,15 @@ protected: Q_SIGNALS: void quit(); - void warnings(const QList<QDeclarativeError> &warnings); + void warnings(const QList<QQmlError> &warnings); private: - Q_DISABLE_COPY(QDeclarativeEngine) - Q_DECLARE_PRIVATE(QDeclarativeEngine) + Q_DISABLE_COPY(QQmlEngine) + Q_DECLARE_PRIVATE(QQmlEngine) }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEENGINE_H +#endif // QQMLENGINE_H diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/qml/qml/qqmlengine_p.h index afc7a18161..db834489ba 100644 --- a/src/declarative/qml/qdeclarativeengine_p.h +++ b/src/qml/qml/qqmlengine_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEENGINE_P_H -#define QDECLARATIVEENGINE_P_H +#ifndef QQMLENGINE_P_H +#define QQMLENGINE_P_H // // W A R N I N G @@ -53,21 +53,21 @@ // We mean it. // -#include "qdeclarativeengine.h" +#include "qqmlengine.h" -#include "qdeclarativetypeloader_p.h" -#include "qdeclarativeimport_p.h" +#include "qqmltypeloader_p.h" +#include "qqmlimport_p.h" #include <private/qpodvector_p.h> -#include "qdeclarative.h" -#include "qdeclarativevaluetype_p.h" -#include "qdeclarativecontext.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativeexpression.h" -#include "qdeclarativeimageprovider.h" -#include "qdeclarativeproperty_p.h" -#include "qdeclarativepropertycache_p.h" -#include "qdeclarativemetatype_p.h" -#include "qdeclarativedirparser_p.h" +#include "qqml.h" +#include "qqmlvaluetype_p.h" +#include "qqmlcontext.h" +#include "qqmlcontext_p.h" +#include "qqmlexpression.h" +#include "qqmlimageprovider.h" +#include "qqmlproperty_p.h" +#include "qqmlpropertycache_p.h" +#include "qqmlmetatype_p.h" +#include "qqmldirparser_p.h" #include <private/qintrusivelist_p.h> #include <private/qrecyclepool_p.h> @@ -85,97 +85,97 @@ QT_BEGIN_NAMESPACE -class QDeclarativeContext; -class QDeclarativeEngine; -class QDeclarativeContextPrivate; -class QDeclarativeExpression; -class QDeclarativeImportDatabase; +class QQmlContext; +class QQmlEngine; +class QQmlContextPrivate; +class QQmlExpression; +class QQmlImportDatabase; class QNetworkReply; class QNetworkAccessManager; -class QDeclarativeNetworkAccessManagerFactory; -class QDeclarativeAbstractBinding; -class QDeclarativeTypeNameCache; -class QDeclarativeComponentAttached; -class QDeclarativeCleanup; -class QDeclarativeDelayedError; -class QDeclarativeWorkerScriptEngine; -class QDeclarativeVME; +class QQmlNetworkAccessManagerFactory; +class QQmlAbstractBinding; +class QQmlTypeNameCache; +class QQmlComponentAttached; +class QQmlCleanup; +class QQmlDelayedError; +class QQuickWorkerScriptEngine; +class QQmlVME; class QDir; -class QDeclarativeIncubator; +class QQmlIncubator; -// This needs to be declared here so that the pool for it can live in QDeclarativeEnginePrivate. -// The inline method definitions are in qdeclarativeexpression_p.h -class QDeclarativeJavaScriptExpressionGuard : public QDeclarativeNotifierEndpoint +// This needs to be declared here so that the pool for it can live in QQmlEnginePrivate. +// The inline method definitions are in qqmlexpression_p.h +class QQmlJavaScriptExpressionGuard : public QQmlNotifierEndpoint { public: - inline QDeclarativeJavaScriptExpressionGuard(QDeclarativeJavaScriptExpression *); + inline QQmlJavaScriptExpressionGuard(QQmlJavaScriptExpression *); - static inline void endpointCallback(QDeclarativeNotifierEndpoint *); - static inline QDeclarativeJavaScriptExpressionGuard *New(QDeclarativeJavaScriptExpression *e, - QDeclarativeEngine *engine); + static inline void endpointCallback(QQmlNotifierEndpoint *); + static inline QQmlJavaScriptExpressionGuard *New(QQmlJavaScriptExpression *e, + QQmlEngine *engine); inline void Delete(); - QDeclarativeJavaScriptExpression *expression; - QDeclarativeJavaScriptExpressionGuard *next; + QQmlJavaScriptExpression *expression; + QQmlJavaScriptExpressionGuard *next; }; -class Q_DECLARATIVE_EXPORT QDeclarativeEnginePrivate : public QJSEnginePrivate +class Q_QML_EXPORT QQmlEnginePrivate : public QJSEnginePrivate { - Q_DECLARE_PUBLIC(QDeclarativeEngine) + Q_DECLARE_PUBLIC(QQmlEngine) public: - QDeclarativeEnginePrivate(QDeclarativeEngine *); - ~QDeclarativeEnginePrivate(); + QQmlEnginePrivate(QQmlEngine *); + ~QQmlEnginePrivate(); void init(); class PropertyCapture { public: inline virtual ~PropertyCapture() {} - virtual void captureProperty(QDeclarativeNotifier *) = 0; + virtual void captureProperty(QQmlNotifier *) = 0; virtual void captureProperty(QObject *, int, int) = 0; }; PropertyCapture *propertyCapture; - inline void captureProperty(QDeclarativeNotifier *); + inline void captureProperty(QQmlNotifier *); inline void captureProperty(QObject *, int, int); - QRecyclePool<QDeclarativeJavaScriptExpressionGuard> jsExpressionGuardPool; + QRecyclePool<QQmlJavaScriptExpressionGuard> jsExpressionGuardPool; - QDeclarativeContext *rootContext; + QQmlContext *rootContext; bool isDebugging; bool outputWarningsToStdErr; - QDeclarativeContextData *sharedContext; + QQmlContextData *sharedContext; QObject *sharedScope; // Registered cleanup handlers - QDeclarativeCleanup *cleanup; + QQmlCleanup *cleanup; // Bindings that have had errors during startup - QDeclarativeDelayedError *erroredBindings; + QQmlDelayedError *erroredBindings; int inProgressCreations; QV8Engine *v8engine() const { return q_func()->handle(); } - QDeclarativeWorkerScriptEngine *getWorkerScriptEngine(); - QDeclarativeWorkerScriptEngine *workerScriptEngine; + QQuickWorkerScriptEngine *getWorkerScriptEngine(); + QQuickWorkerScriptEngine *workerScriptEngine; QUrl baseUrl; - typedef QPair<QDeclarativeGuard<QObject>,int> FinalizeCallback; + typedef QPair<QQmlGuard<QObject>,int> FinalizeCallback; void registerFinalizeCallback(QObject *obj, int index); - QDeclarativeVME *activeVME; + QQmlVME *activeVME; QNetworkAccessManager *createNetworkAccessManager(QObject *parent) const; QNetworkAccessManager *getNetworkAccessManager() const; mutable QNetworkAccessManager *networkAccessManager; - mutable QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory; + mutable QQmlNetworkAccessManagerFactory *networkAccessManagerFactory; - QHash<QString,QSharedPointer<QDeclarativeImageProvider> > imageProviders; - QDeclarativeImageProvider::ImageType getImageProviderType(const QUrl &url); - QDeclarativeTextureFactory *getTextureFromProvider(const QUrl &url, QSize *size, const QSize& req_size); + QHash<QString,QSharedPointer<QQmlImageProvider> > imageProviders; + QQmlImageProvider::ImageType getImageProviderType(const QUrl &url); + QQuickTextureFactory *getTextureFromProvider(const QUrl &url, QSize *size, const QSize& req_size); QImage getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size); QPixmap getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size); @@ -196,8 +196,8 @@ public: void referenceScarceResources(); void dereferenceScarceResources(); - QDeclarativeTypeLoader typeLoader; - QDeclarativeImportDatabase importDatabase; + QQmlTypeLoader typeLoader; + QQmlImportDatabase importDatabase; QString offlineStoragePath; @@ -206,10 +206,10 @@ public: return uniqueId++; } - QDeclarativeValueTypeFactory valueTypes; + QQmlValueTypeFactory valueTypes; // Unfortunate workaround to avoid a circular dependency between - // qdeclarativeengine_p.h and qdeclarativeincubator_p.h + // qqmlengine_p.h and qqmlincubator_p.h struct Incubator { QIntrusiveListNode next; // Unfortunate workaround for MSVC @@ -217,49 +217,49 @@ public: }; QIntrusiveList<Incubator, &Incubator::next> incubatorList; unsigned int incubatorCount; - QDeclarativeIncubationController *incubationController; - void incubate(QDeclarativeIncubator &, QDeclarativeContextData *); + QQmlIncubationController *incubationController; + void incubate(QQmlIncubator &, QQmlContextData *); // These methods may be called from any thread inline bool isEngineThread() const; - inline static bool isEngineThread(const QDeclarativeEngine *); + inline static bool isEngineThread(const QQmlEngine *); template<typename T> inline void deleteInEngineThread(T *); template<typename T> - inline static void deleteInEngineThread(QDeclarativeEngine *, T *); + inline static void deleteInEngineThread(QQmlEngine *, T *); // These methods may be called from the loader thread - QDeclarativeMetaType::ModuleApiInstance *moduleApiInstance(const QDeclarativeMetaType::ModuleApi &module); + QQmlMetaType::ModuleApiInstance *moduleApiInstance(const QQmlMetaType::ModuleApi &module); // These methods may be called from the loader thread - inline QDeclarativePropertyCache *cache(QObject *obj); - inline QDeclarativePropertyCache *cache(const QMetaObject *); - inline QDeclarativePropertyCache *cache(QDeclarativeType *, int, QDeclarativeError &error); + inline QQmlPropertyCache *cache(QObject *obj); + inline QQmlPropertyCache *cache(const QMetaObject *); + inline QQmlPropertyCache *cache(QQmlType *, int, QQmlError &error); // These methods may be called from the loader thread bool isQObject(int); QObject *toQObject(const QVariant &, bool *ok = 0) const; - QDeclarativeMetaType::TypeCategory typeCategory(int) const; + QQmlMetaType::TypeCategory typeCategory(int) const; bool isList(int) const; int listType(int) const; const QMetaObject *rawMetaObjectForType(int) const; const QMetaObject *metaObjectForType(int) const; - void registerCompositeType(QDeclarativeCompiledData *); + void registerCompositeType(QQmlCompiledData *); void sendQuit(); - void warning(const QDeclarativeError &); - void warning(const QList<QDeclarativeError> &); - static void warning(QDeclarativeEngine *, const QDeclarativeError &); - static void warning(QDeclarativeEngine *, const QList<QDeclarativeError> &); - static void warning(QDeclarativeEnginePrivate *, const QDeclarativeError &); - static void warning(QDeclarativeEnginePrivate *, const QList<QDeclarativeError> &); - - inline static QV8Engine *getV8Engine(QDeclarativeEngine *e); - inline static QDeclarativeEnginePrivate *get(QDeclarativeEngine *e); - inline static const QDeclarativeEnginePrivate *get(const QDeclarativeEngine *e); - inline static QDeclarativeEnginePrivate *get(QDeclarativeContext *c); - inline static QDeclarativeEnginePrivate *get(QDeclarativeContextData *c); - inline static QDeclarativeEngine *get(QDeclarativeEnginePrivate *p); + void warning(const QQmlError &); + void warning(const QList<QQmlError> &); + static void warning(QQmlEngine *, const QQmlError &); + static void warning(QQmlEngine *, const QList<QQmlError> &); + static void warning(QQmlEnginePrivate *, const QQmlError &); + static void warning(QQmlEnginePrivate *, const QList<QQmlError> &); + + inline static QV8Engine *getV8Engine(QQmlEngine *e); + inline static QQmlEnginePrivate *get(QQmlEngine *e); + inline static const QQmlEnginePrivate *get(const QQmlEngine *e); + inline static QQmlEnginePrivate *get(QQmlContext *c); + inline static QQmlEnginePrivate *get(QQmlContextData *c); + inline static QQmlEngine *get(QQmlEnginePrivate *p); static QString urlToLocalFileOrQrc(const QUrl& url); static QString urlToLocalFileOrQrc(const QString& url); @@ -272,66 +272,66 @@ public: mutable QMutex mutex; private: - // Locker locks the QDeclarativeEnginePrivate data structures for read and write, if necessary. + // Locker locks the QQmlEnginePrivate data structures for read and write, if necessary. // Currently, locking is only necessary if the threaded loader is running concurrently. If it is // either idle, or is running with the main thread blocked, no locking is necessary. This way // we only pay for locking when we have to. // Consequently, this class should only be used to protect simple accesses or modifications of the - // QDeclarativeEnginePrivate structures or operations that can be guarenteed not to start activity + // QQmlEnginePrivate structures or operations that can be guarenteed not to start activity // on the loader thread. - // The Locker API is identical to QMutexLocker. Locker reuses the QDeclarativeEnginePrivate::mutex + // The Locker API is identical to QMutexLocker. Locker reuses the QQmlEnginePrivate::mutex // QMutex instance and multiple Lockers are recursive in the same thread. class Locker { public: - inline Locker(const QDeclarativeEngine *); - inline Locker(const QDeclarativeEnginePrivate *); + inline Locker(const QQmlEngine *); + inline Locker(const QQmlEnginePrivate *); inline ~Locker(); inline void unlock(); inline void relock(); private: - const QDeclarativeEnginePrivate *m_ep; + const QQmlEnginePrivate *m_ep; quint32 m_locked:1; }; // Must be called locked - QDeclarativePropertyCache *createCache(const QMetaObject *); - QDeclarativePropertyCache *createCache(QDeclarativeType *, int, QDeclarativeError &error); + QQmlPropertyCache *createCache(const QMetaObject *); + QQmlPropertyCache *createCache(QQmlType *, int, QQmlError &error); - // These members must be protected by a QDeclarativeEnginePrivate::Locker as they are required by + // These members must be protected by a QQmlEnginePrivate::Locker as they are required by // the threaded loader. Only access them through their respective accessor methods. - QHash<QDeclarativeMetaType::ModuleApi, QDeclarativeMetaType::ModuleApiInstance *> moduleApiInstances; - QHash<const QMetaObject *, QDeclarativePropertyCache *> propertyCache; - QHash<QPair<QDeclarativeType *, int>, QDeclarativePropertyCache *> typePropertyCache; + QHash<QQmlMetaType::ModuleApi, QQmlMetaType::ModuleApiInstance *> moduleApiInstances; + QHash<const QMetaObject *, QQmlPropertyCache *> propertyCache; + QHash<QPair<QQmlType *, int>, QQmlPropertyCache *> typePropertyCache; QHash<int, int> m_qmlLists; - QHash<int, QDeclarativeCompiledData *> m_compositeTypes; + QHash<int, QQmlCompiledData *> m_compositeTypes; - // These members is protected by the full QDeclarativeEnginePrivate::mutex mutex + // These members is protected by the full QQmlEnginePrivate::mutex mutex struct Deletable { Deletable():next(0) {} virtual ~Deletable() {} Deletable *next; }; QFieldList<Deletable, &Deletable::next> toDeleteInEngineThread; void doDeleteInEngineThread(); }; -QDeclarativeEnginePrivate::Locker::Locker(const QDeclarativeEngine *e) -: m_ep(QDeclarativeEnginePrivate::get(e)) +QQmlEnginePrivate::Locker::Locker(const QQmlEngine *e) +: m_ep(QQmlEnginePrivate::get(e)) { relock(); } -QDeclarativeEnginePrivate::Locker::Locker(const QDeclarativeEnginePrivate *e) +QQmlEnginePrivate::Locker::Locker(const QQmlEnginePrivate *e) : m_ep(e), m_locked(false) { relock(); } -QDeclarativeEnginePrivate::Locker::~Locker() +QQmlEnginePrivate::Locker::~Locker() { unlock(); } -void QDeclarativeEnginePrivate::Locker::unlock() +void QQmlEnginePrivate::Locker::unlock() { if (m_locked) { m_ep->mutex.unlock(); @@ -339,7 +339,7 @@ void QDeclarativeEnginePrivate::Locker::unlock() } } -void QDeclarativeEnginePrivate::Locker::relock() +void QQmlEnginePrivate::Locker::relock() { Q_ASSERT(!m_locked); if (m_ep->typeLoader.isConcurrent()) { @@ -349,21 +349,21 @@ void QDeclarativeEnginePrivate::Locker::relock() } /*! -Returns true if the calling thread is the QDeclarativeEngine thread. +Returns true if the calling thread is the QQmlEngine thread. */ -bool QDeclarativeEnginePrivate::isEngineThread() const +bool QQmlEnginePrivate::isEngineThread() const { - Q_Q(const QDeclarativeEngine); + Q_Q(const QQmlEngine); return QThread::currentThread() == q->thread(); } /*! -Returns true if the calling thread is the QDeclarativeEngine \a engine thread. +Returns true if the calling thread is the QQmlEngine \a engine thread. */ -bool QDeclarativeEnginePrivate::isEngineThread(const QDeclarativeEngine *engine) +bool QQmlEnginePrivate::isEngineThread(const QQmlEngine *engine) { Q_ASSERT(engine); - return QDeclarativeEnginePrivate::get(engine)->isEngineThread(); + return QQmlEnginePrivate::get(engine)->isEngineThread(); } /*! @@ -377,9 +377,9 @@ practice to check if any V8 handles actually need to be freed and delete the instance directly if not. */ template<typename T> -void QDeclarativeEnginePrivate::deleteInEngineThread(T *value) +void QQmlEnginePrivate::deleteInEngineThread(T *value) { - Q_Q(QDeclarativeEngine); + Q_Q(QQmlEngine); Q_ASSERT(value); if (isEngineThread()) { @@ -405,14 +405,14 @@ Delete \a value in the \a engine thread. If the calling thread is the engine thread, \a value will be deleted immediately. */ template<typename T> -void QDeclarativeEnginePrivate::deleteInEngineThread(QDeclarativeEngine *engine, T *value) +void QQmlEnginePrivate::deleteInEngineThread(QQmlEngine *engine, T *value) { Q_ASSERT(engine); - QDeclarativeEnginePrivate::get(engine)->deleteInEngineThread<T>(value); + QQmlEnginePrivate::get(engine)->deleteInEngineThread<T>(value); } /*! -Returns a QDeclarativePropertyCache for \a obj if one is available. +Returns a QQmlPropertyCache for \a obj if one is available. If \a obj is null, being deleted or contains a dynamic meta object 0 is returned. @@ -420,49 +420,49 @@ is returned. The returned cache is not referenced, so if it is to be stored, call addref(). XXX thread There is a potential future race condition in this and all the cache() -functions. As the QDeclarativePropertyCache is returned unreferenced, when called +functions. As the QQmlPropertyCache is returned unreferenced, when called from the loader thread, it is possible that the cache will have been dereferenced and deleted before the loader thread has a chance to use or reference it. This can't currently happen as the cache holds a reference to the -QDeclarativePropertyCache until the QDeclarativeEngine is destroyed. +QQmlPropertyCache until the QQmlEngine is destroyed. */ -QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(QObject *obj) +QQmlPropertyCache *QQmlEnginePrivate::cache(QObject *obj) { if (!obj || QObjectPrivate::get(obj)->metaObject || QObjectPrivate::get(obj)->wasDeleted) return 0; Locker locker(this); const QMetaObject *mo = obj->metaObject(); - QDeclarativePropertyCache *rv = propertyCache.value(mo); + QQmlPropertyCache *rv = propertyCache.value(mo); if (!rv) rv = createCache(mo); return rv; } /*! -Returns a QDeclarativePropertyCache for \a metaObject. +Returns a QQmlPropertyCache for \a metaObject. As the cache is persisted for the life of the engine, \a metaObject must be a static "compile time" meta-object, or a meta-object that is otherwise known to -exist for the lifetime of the QDeclarativeEngine. +exist for the lifetime of the QQmlEngine. The returned cache is not referenced, so if it is to be stored, call addref(). */ -QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(const QMetaObject *metaObject) +QQmlPropertyCache *QQmlEnginePrivate::cache(const QMetaObject *metaObject) { Q_ASSERT(metaObject); Locker locker(this); - QDeclarativePropertyCache *rv = propertyCache.value(metaObject); + QQmlPropertyCache *rv = propertyCache.value(metaObject); if (!rv) rv = createCache(metaObject); return rv; } /*! -Returns a QDeclarativePropertyCache for \a type with \a minorVersion. +Returns a QQmlPropertyCache for \a type with \a minorVersion. The returned cache is not referenced, so if it is to be stored, call addref(). */ -QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(QDeclarativeType *type, int minorVersion, QDeclarativeError &error) +QQmlPropertyCache *QQmlEnginePrivate::cache(QQmlType *type, int minorVersion, QQmlError &error) { Q_ASSERT(type); @@ -470,48 +470,48 @@ QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(QDeclarativeType *ty return cache(type->metaObject()); Locker locker(this); - QDeclarativePropertyCache *rv = typePropertyCache.value(qMakePair(type, minorVersion)); + QQmlPropertyCache *rv = typePropertyCache.value(qMakePair(type, minorVersion)); if (!rv) rv = createCache(type, minorVersion, error); return rv; } -QV8Engine *QDeclarativeEnginePrivate::getV8Engine(QDeclarativeEngine *e) +QV8Engine *QQmlEnginePrivate::getV8Engine(QQmlEngine *e) { return e->d_func()->v8engine(); } -QDeclarativeEnginePrivate *QDeclarativeEnginePrivate::get(QDeclarativeEngine *e) +QQmlEnginePrivate *QQmlEnginePrivate::get(QQmlEngine *e) { return e->d_func(); } -const QDeclarativeEnginePrivate *QDeclarativeEnginePrivate::get(const QDeclarativeEngine *e) +const QQmlEnginePrivate *QQmlEnginePrivate::get(const QQmlEngine *e) { return e->d_func(); } -QDeclarativeEnginePrivate *QDeclarativeEnginePrivate::get(QDeclarativeContext *c) +QQmlEnginePrivate *QQmlEnginePrivate::get(QQmlContext *c) { - return (c && c->engine()) ? QDeclarativeEnginePrivate::get(c->engine()) : 0; + return (c && c->engine()) ? QQmlEnginePrivate::get(c->engine()) : 0; } -QDeclarativeEnginePrivate *QDeclarativeEnginePrivate::get(QDeclarativeContextData *c) +QQmlEnginePrivate *QQmlEnginePrivate::get(QQmlContextData *c) { - return (c && c->engine) ? QDeclarativeEnginePrivate::get(c->engine) : 0; + return (c && c->engine) ? QQmlEnginePrivate::get(c->engine) : 0; } -QDeclarativeEngine *QDeclarativeEnginePrivate::get(QDeclarativeEnginePrivate *p) +QQmlEngine *QQmlEnginePrivate::get(QQmlEnginePrivate *p) { return p->q_func(); } -void QDeclarativeEnginePrivate::captureProperty(QDeclarativeNotifier *n) +void QQmlEnginePrivate::captureProperty(QQmlNotifier *n) { if (propertyCapture) propertyCapture->captureProperty(n); } -void QDeclarativeEnginePrivate::captureProperty(QObject *o, int c, int n) +void QQmlEnginePrivate::captureProperty(QObject *o, int c, int n) { if (propertyCapture) propertyCapture->captureProperty(o, c, n); @@ -519,4 +519,4 @@ void QDeclarativeEnginePrivate::captureProperty(QObject *o, int c, int n) QT_END_NAMESPACE -#endif // QDECLARATIVEENGINE_P_H +#endif // QQMLENGINE_P_H diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/qml/qml/qqmlerror.cpp index 4f4d3cf7aa..79424913f8 100644 --- a/src/declarative/qml/qdeclarativeerror.cpp +++ b/src/qml/qml/qqmlerror.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativeerror.h" +#include "qqmlerror.h" #include <QtCore/qdebug.h> #include <QtCore/qfile.h> @@ -48,11 +48,11 @@ QT_BEGIN_NAMESPACE /*! - \class QDeclarativeError + \class QQmlError \since 4.7 - \brief The QDeclarativeError class encapsulates a QML error. + \brief The QQmlError class encapsulates a QML error. - QDeclarativeError includes a textual description of the error, as well + QQmlError includes a textual description of the error, as well as location information (the file, line, and column). The toString() method creates a single-line, human-readable string containing all of this information, for example: @@ -69,12 +69,12 @@ QT_BEGIN_NAMESPACE ^ \endcode - \sa QDeclarativeView::errors(), QDeclarativeComponent::errors() + \sa QQuickView::errors(), QQmlComponent::errors() */ -class QDeclarativeErrorPrivate +class QQmlErrorPrivate { public: - QDeclarativeErrorPrivate(); + QQmlErrorPrivate(); QUrl url; QString description; @@ -82,7 +82,7 @@ public: int column; }; -QDeclarativeErrorPrivate::QDeclarativeErrorPrivate() +QQmlErrorPrivate::QQmlErrorPrivate() : line(-1), column(-1) { } @@ -90,7 +90,7 @@ QDeclarativeErrorPrivate::QDeclarativeErrorPrivate() /*! Creates an empty error object. */ -QDeclarativeError::QDeclarativeError() +QQmlError::QQmlError() : d(0) { } @@ -98,7 +98,7 @@ QDeclarativeError::QDeclarativeError() /*! Creates a copy of \a other. */ -QDeclarativeError::QDeclarativeError(const QDeclarativeError &other) +QQmlError::QQmlError(const QQmlError &other) : d(0) { *this = other; @@ -107,13 +107,13 @@ QDeclarativeError::QDeclarativeError(const QDeclarativeError &other) /*! Assigns \a other to this error object. */ -QDeclarativeError &QDeclarativeError::operator=(const QDeclarativeError &other) +QQmlError &QQmlError::operator=(const QQmlError &other) { if (!other.d) { delete d; d = 0; } else { - if (!d) d = new QDeclarativeErrorPrivate; + if (!d) d = new QQmlErrorPrivate; d->url = other.d->url; d->description = other.d->description; d->line = other.d->line; @@ -125,7 +125,7 @@ QDeclarativeError &QDeclarativeError::operator=(const QDeclarativeError &other) /*! \internal */ -QDeclarativeError::~QDeclarativeError() +QQmlError::~QQmlError() { delete d; d = 0; } @@ -133,7 +133,7 @@ QDeclarativeError::~QDeclarativeError() /*! Returns true if this error is valid, otherwise false. */ -bool QDeclarativeError::isValid() const +bool QQmlError::isValid() const { return d != 0; } @@ -141,7 +141,7 @@ bool QDeclarativeError::isValid() const /*! Returns the url for the file that caused this error. */ -QUrl QDeclarativeError::url() const +QUrl QQmlError::url() const { if (d) return d->url; else return QUrl(); @@ -150,16 +150,16 @@ QUrl QDeclarativeError::url() const /*! Sets the \a url for the file that caused this error. */ -void QDeclarativeError::setUrl(const QUrl &url) +void QQmlError::setUrl(const QUrl &url) { - if (!d) d = new QDeclarativeErrorPrivate; + if (!d) d = new QQmlErrorPrivate; d->url = url; } /*! Returns the error description. */ -QString QDeclarativeError::description() const +QString QQmlError::description() const { if (d) return d->description; else return QString(); @@ -168,16 +168,16 @@ QString QDeclarativeError::description() const /*! Sets the error \a description. */ -void QDeclarativeError::setDescription(const QString &description) +void QQmlError::setDescription(const QString &description) { - if (!d) d = new QDeclarativeErrorPrivate; + if (!d) d = new QQmlErrorPrivate; d->description = description; } /*! Returns the error line number. */ -int QDeclarativeError::line() const +int QQmlError::line() const { if (d) return d->line; else return -1; @@ -186,16 +186,16 @@ int QDeclarativeError::line() const /*! Sets the error \a line number. */ -void QDeclarativeError::setLine(int line) +void QQmlError::setLine(int line) { - if (!d) d = new QDeclarativeErrorPrivate; + if (!d) d = new QQmlErrorPrivate; d->line = line; } /*! Returns the error column number. */ -int QDeclarativeError::column() const +int QQmlError::column() const { if (d) return d->column; else return -1; @@ -204,16 +204,16 @@ int QDeclarativeError::column() const /*! Sets the error \a column number. */ -void QDeclarativeError::setColumn(int column) +void QQmlError::setColumn(int column) { - if (!d) d = new QDeclarativeErrorPrivate; + if (!d) d = new QQmlErrorPrivate; d->column = column; } /*! Returns the error as a human readable string. */ -QString QDeclarativeError::toString() const +QString QQmlError::toString() const { QString rv; if (url().isEmpty()) { @@ -232,13 +232,13 @@ QString QDeclarativeError::toString() const } /*! - \relates QDeclarativeError - \fn QDebug operator<<(QDebug debug, const QDeclarativeError &error) + \relates QQmlError + \fn QDebug operator<<(QDebug debug, const QQmlError &error) Outputs a human readable version of \a error to \a debug. */ -QDebug operator<<(QDebug debug, const QDeclarativeError &error) +QDebug operator<<(QDebug debug, const QQmlError &error) { debug << qPrintable(error.toString()); diff --git a/src/declarative/qml/qdeclarativeerror.h b/src/qml/qml/qqmlerror.h index be22768a32..3c148549d0 100644 --- a/src/declarative/qml/qdeclarativeerror.h +++ b/src/qml/qml/qqmlerror.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEERROR_H -#define QDECLARATIVEERROR_H +#ifndef QQMLERROR_H +#define QQMLERROR_H + +#include <QtQml/qtqmlglobal.h> #include <QtCore/qurl.h> #include <QtCore/qstring.h> @@ -51,14 +53,14 @@ QT_BEGIN_NAMESPACE class QDebug; -class QDeclarativeErrorPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeError +class QQmlErrorPrivate; +class Q_QML_EXPORT QQmlError { public: - QDeclarativeError(); - QDeclarativeError(const QDeclarativeError &); - QDeclarativeError &operator=(const QDeclarativeError &); - ~QDeclarativeError(); + QQmlError(); + QQmlError(const QQmlError &); + QQmlError &operator=(const QQmlError &); + ~QQmlError(); bool isValid() const; @@ -73,13 +75,13 @@ public: QString toString() const; private: - QDeclarativeErrorPrivate *d; + QQmlErrorPrivate *d; }; -QDebug Q_DECLARATIVE_EXPORT operator<<(QDebug debug, const QDeclarativeError &error); +QDebug Q_QML_EXPORT operator<<(QDebug debug, const QQmlError &error); QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEERROR_H +#endif // QQMLERROR_H diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 1a4c486931..3fbb80c280 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,20 +39,20 @@ ** ****************************************************************************/ -#include "qdeclarativeexpression.h" -#include "qdeclarativeexpression_p.h" +#include "qqmlexpression.h" +#include "qqmlexpression_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativerewrite_p.h" -#include "qdeclarativescriptstring_p.h" -#include "qdeclarativecompiler_p.h" +#include "qqmlengine_p.h" +#include "qqmlcontext_p.h" +#include "qqmlrewrite_p.h" +#include "qqmlscriptstring_p.h" +#include "qqmlcompiler_p.h" #include <QtCore/qdebug.h> QT_BEGIN_NAMESPACE -bool QDeclarativeDelayedError::addError(QDeclarativeEnginePrivate *e) +bool QQmlDelayedError::addError(QQmlEnginePrivate *e) { if (!e) return false; @@ -68,29 +68,29 @@ bool QDeclarativeDelayedError::addError(QDeclarativeEnginePrivate *e) return true; } -QDeclarativeJavaScriptExpression::QDeclarativeJavaScriptExpression(VTable *v) +QQmlJavaScriptExpression::QQmlJavaScriptExpression(VTable *v) : m_vtable(v) { } -QDeclarativeJavaScriptExpression::~QDeclarativeJavaScriptExpression() +QQmlJavaScriptExpression::~QQmlJavaScriptExpression() { clearGuards(); } -static QDeclarativeJavaScriptExpression::VTable QDeclarativeExpressionPrivate_jsvtable = { - QDeclarativeExpressionPrivate::expressionIdentifier, - QDeclarativeExpressionPrivate::expressionChanged +static QQmlJavaScriptExpression::VTable QDeclarativeExpressionPrivate_jsvtable = { + QQmlExpressionPrivate::expressionIdentifier, + QQmlExpressionPrivate::expressionChanged }; -QDeclarativeExpressionPrivate::QDeclarativeExpressionPrivate() -: QDeclarativeJavaScriptExpression(&QDeclarativeExpressionPrivate_jsvtable), +QQmlExpressionPrivate::QQmlExpressionPrivate() +: QQmlJavaScriptExpression(&QDeclarativeExpressionPrivate_jsvtable), expressionFunctionValid(true), expressionFunctionRewritten(false), extractExpressionFromFunction(false), line(-1), dataRef(0) { } -QDeclarativeExpressionPrivate::~QDeclarativeExpressionPrivate() +QQmlExpressionPrivate::~QQmlExpressionPrivate() { qPersistentDispose(v8qmlscope); qPersistentDispose(v8function); @@ -98,21 +98,21 @@ QDeclarativeExpressionPrivate::~QDeclarativeExpressionPrivate() dataRef = 0; } -void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QString &expr, +void QQmlExpressionPrivate::init(QQmlContextData *ctxt, const QString &expr, QObject *me) { expression = expr; - QDeclarativeAbstractExpression::setContext(ctxt); + QQmlAbstractExpression::setContext(ctxt); setScopeObject(me); expressionFunctionValid = false; expressionFunctionRewritten = false; } -void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, v8::Handle<v8::Function> func, +void QQmlExpressionPrivate::init(QQmlContextData *ctxt, v8::Handle<v8::Function> func, QObject *me) { - QDeclarativeAbstractExpression::setContext(ctxt); + QQmlAbstractExpression::setContext(ctxt); setScopeObject(me); v8function = qPersistentNew<v8::Function>(func); @@ -122,7 +122,7 @@ void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, v8::Hand extractExpressionFromFunction = true; } -void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QString &expr, +void QQmlExpressionPrivate::init(QQmlContextData *ctxt, const QString &expr, bool isRewritten, QObject *me, const QString &srcUrl, int lineNumber, int columnNumber) { @@ -135,11 +135,11 @@ void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QS expressionFunctionValid = false; expressionFunctionRewritten = isRewritten; - QDeclarativeAbstractExpression::setContext(ctxt); + QQmlAbstractExpression::setContext(ctxt); setScopeObject(me); } -void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QByteArray &expr, +void QQmlExpressionPrivate::init(QQmlContextData *ctxt, const QByteArray &expr, bool isRewritten, QObject *me, const QString &srcUrl, int lineNumber, int columnNumber) { @@ -162,19 +162,19 @@ void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QB expressionFunctionRewritten = isRewritten; } - QDeclarativeAbstractExpression::setContext(ctxt); + QQmlAbstractExpression::setContext(ctxt); setScopeObject(me); } // Callee owns the persistent handle v8::Persistent<v8::Function> -QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObject *scope, +QQmlExpressionPrivate::evalFunction(QQmlContextData *ctxt, QObject *scope, const char *code, int codeLength, const QString &filename, int line, v8::Persistent<v8::Object> *qmlscope) { - QDeclarativeEngine *engine = ctxt->engine; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEngine *engine = ctxt->engine; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); v8::HandleScope handle_scope; v8::Context::Scope ctxtscope(ep->v8engine()->context()); @@ -183,25 +183,25 @@ QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObje v8::Local<v8::Object> scopeobject = ep->v8engine()->qmlScope(ctxt, scope); v8::Local<v8::Script> script = ep->v8engine()->qmlModeCompile(code, codeLength, filename, line); if (tc.HasCaught()) { - QDeclarativeError error; + QQmlError error; error.setDescription(QLatin1String("Exception occurred during function compilation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); v8::Local<v8::Message> message = tc.Message(); if (!message.IsEmpty()) - QDeclarativeExpressionPrivate::exceptionToError(message, error); + QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent<v8::Function>(); } v8::Local<v8::Value> result = script->Run(scopeobject); if (tc.HasCaught()) { - QDeclarativeError error; + QQmlError error; error.setDescription(QLatin1String("Exception occurred during function evaluation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); v8::Local<v8::Message> message = tc.Message(); if (!message.IsEmpty()) - QDeclarativeExpressionPrivate::exceptionToError(message, error); + QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent<v8::Function>(); } @@ -211,12 +211,12 @@ QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObje // Callee owns the persistent handle v8::Persistent<v8::Function> -QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObject *scope, +QQmlExpressionPrivate::evalFunction(QQmlContextData *ctxt, QObject *scope, const QString &code, const QString &filename, int line, v8::Persistent<v8::Object> *qmlscope) { - QDeclarativeEngine *engine = ctxt->engine; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEngine *engine = ctxt->engine; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); v8::HandleScope handle_scope; v8::Context::Scope ctxtscope(ep->v8engine()->context()); @@ -225,25 +225,25 @@ QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObje v8::Local<v8::Object> scopeobject = ep->v8engine()->qmlScope(ctxt, scope); v8::Local<v8::Script> script = ep->v8engine()->qmlModeCompile(code, filename, line); if (tc.HasCaught()) { - QDeclarativeError error; + QQmlError error; error.setDescription(QLatin1String("Exception occurred during function compilation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); v8::Local<v8::Message> message = tc.Message(); if (!message.IsEmpty()) - QDeclarativeExpressionPrivate::exceptionToError(message, error); + QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent<v8::Function>(); } v8::Local<v8::Value> result = script->Run(scopeobject); if (tc.HasCaught()) { - QDeclarativeError error; + QQmlError error; error.setDescription(QLatin1String("Exception occurred during function evaluation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); v8::Local<v8::Message> message = tc.Message(); if (!message.IsEmpty()) - QDeclarativeExpressionPrivate::exceptionToError(message, error); + QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent<v8::Function>(); } @@ -251,18 +251,18 @@ QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObje return qPersistentNew<v8::Function>(v8::Local<v8::Function>::Cast(result)); } -QDeclarativeExpression * -QDeclarativeExpressionPrivate::create(QDeclarativeContextData *ctxt, QObject *object, +QQmlExpression * +QQmlExpressionPrivate::create(QQmlContextData *ctxt, QObject *object, const QString &expr, bool isRewritten, const QString &url, int lineNumber, int columnNumber) { - return new QDeclarativeExpression(ctxt, object, expr, isRewritten, url, lineNumber, columnNumber, *new QDeclarativeExpressionPrivate); + return new QQmlExpression(ctxt, object, expr, isRewritten, url, lineNumber, columnNumber, *new QQmlExpressionPrivate); } /*! - \class QDeclarativeExpression + \class QQmlExpression \since 4.7 - \brief The QDeclarativeExpression class evaluates JavaScript in a QML context. + \brief The QQmlExpression class evaluates JavaScript in a QML context. For example, given a file \c main.qml like this: @@ -278,51 +278,51 @@ QDeclarativeExpressionPrivate::create(QDeclarativeContextData *ctxt, QObject *ob above QML: \code - QDeclarativeEngine *engine = new QDeclarativeEngine; - QDeclarativeComponent component(engine, QUrl::fromLocalFile("main.qml")); + QQmlEngine *engine = new QQmlEngine; + QQmlComponent component(engine, QUrl::fromLocalFile("main.qml")); QObject *myObject = component.create(); - QDeclarativeExpression *expr = new QDeclarativeExpression(engine->rootContext(), myObject, "width * 2"); + QQmlExpression *expr = new QQmlExpression(engine->rootContext(), myObject, "width * 2"); int result = expr->evaluate().toInt(); // result = 400 \endcode */ /*! - Create an invalid QDeclarativeExpression. + Create an invalid QQmlExpression. - As the expression will not have an associated QDeclarativeContext, this will be a + As the expression will not have an associated QQmlContext, this will be a null expression object and its value will always be an invalid QVariant. */ -QDeclarativeExpression::QDeclarativeExpression() -: QObject(*new QDeclarativeExpressionPrivate, 0) +QQmlExpression::QQmlExpression() +: QObject(*new QQmlExpressionPrivate, 0) { } /*! \internal */ -QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, +QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *object, const QString &expr, bool isRewritten, const QString &url, int lineNumber, int columnNumber, - QDeclarativeExpressionPrivate &dd) + QQmlExpressionPrivate &dd) : QObject(dd, 0) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->init(ctxt, expr, isRewritten, object, url, lineNumber, columnNumber); } /*! \internal */ -QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, +QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *object, const QByteArray &expr, bool isRewritten, const QString &url, int lineNumber, int columnNumber, - QDeclarativeExpressionPrivate &dd) + QQmlExpressionPrivate &dd) : QObject(dd, 0) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->init(ctxt, expr, isRewritten, object, url, lineNumber, columnNumber); } /*! - Create a QDeclarativeExpression object that is a child of \a parent. + Create a QQmlExpression object that is a child of \a parent. The \script provides the expression to be evaluated, the context to evaluate it in, and the scope object to evaluate it with. @@ -330,26 +330,26 @@ QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, This constructor is functionally equivalent to the following, but in most cases is more efficient. \code - QDeclarativeExpression expression(script.context(), script.scopeObject(), script.script(), parent); + QQmlExpression expression(script.context(), script.scopeObject(), script.script(), parent); \endcode - \sa QDeclarativeScriptString + \sa QQmlScriptString */ -QDeclarativeExpression::QDeclarativeExpression(const QDeclarativeScriptString &script, QObject *parent) -: QObject(*new QDeclarativeExpressionPrivate, parent) +QQmlExpression::QQmlExpression(const QQmlScriptString &script, QObject *parent) +: QObject(*new QQmlExpressionPrivate, parent) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); bool defaultConstruction = false; int id = script.d.data()->bindingId; if (id < 0) { defaultConstruction = true; } else { - QDeclarativeContextData *ctxtdata = QDeclarativeContextData::get(script.context()); + QQmlContextData *ctxtdata = QQmlContextData::get(script.context()); - QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(script.context()->engine()); - QDeclarativeCompiledData *cdata = 0; - QDeclarativeTypeData *typeData = 0; + QQmlEnginePrivate *engine = QQmlEnginePrivate::get(script.context()->engine()); + QQmlCompiledData *cdata = 0; + QQmlTypeData *typeData = 0; if (engine && ctxtdata && !ctxtdata->url.isEmpty()) { typeData = engine->typeLoader.get(ctxtdata->url); cdata = typeData->compiledData(); @@ -368,43 +368,43 @@ QDeclarativeExpression::QDeclarativeExpression(const QDeclarativeScriptString &s } if (defaultConstruction) - d->init(QDeclarativeContextData::get(script.context()), script.script(), script.scopeObject()); + d->init(QQmlContextData::get(script.context()), script.script(), script.scopeObject()); } /*! - Create a QDeclarativeExpression object that is a child of \a parent. + Create a QQmlExpression object that is a child of \a parent. - The \a expression JavaScript will be executed in the \a ctxt QDeclarativeContext. + The \a expression JavaScript will be executed in the \a ctxt QQmlContext. If specified, the \a scope object's properties will also be in scope during the expression's execution. */ -QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContext *ctxt, +QQmlExpression::QQmlExpression(QQmlContext *ctxt, QObject *scope, const QString &expression, QObject *parent) -: QObject(*new QDeclarativeExpressionPrivate, parent) +: QObject(*new QQmlExpressionPrivate, parent) { - Q_D(QDeclarativeExpression); - d->init(QDeclarativeContextData::get(ctxt), expression, scope); + Q_D(QQmlExpression); + d->init(QQmlContextData::get(ctxt), expression, scope); } /*! \internal */ -QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QObject *scope, +QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *scope, const QString &expression) -: QObject(*new QDeclarativeExpressionPrivate, 0) +: QObject(*new QQmlExpressionPrivate, 0) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->init(ctxt, expression, scope); } /*! \internal */ -QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QObject *scope, - const QString &expression, QDeclarativeExpressionPrivate &dd) +QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *scope, + const QString &expression, QQmlExpressionPrivate &dd) : QObject(dd, 0) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->init(ctxt, expression, scope); } @@ -414,54 +414,54 @@ QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QO To avoid exposing v8 in the public API, functionPtr must be a pointer to a v8::Handle<v8::Function>. For example: v8::Handle<v8::Function> function; - new QDeclarativeExpression(ctxt, scope, &function, ...); + new QQmlExpression(ctxt, scope, &function, ...); */ -QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QObject *scope, void *functionPtr, - QDeclarativeExpressionPrivate &dd) +QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *scope, void *functionPtr, + QQmlExpressionPrivate &dd) : QObject(dd, 0) { v8::Handle<v8::Function> function = *(v8::Handle<v8::Function> *)functionPtr; - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->init(ctxt, function, scope); } /*! - Destroy the QDeclarativeExpression instance. + Destroy the QQmlExpression instance. */ -QDeclarativeExpression::~QDeclarativeExpression() +QQmlExpression::~QQmlExpression() { } /*! - Returns the QDeclarativeEngine this expression is associated with, or 0 if there - is no association or the QDeclarativeEngine has been destroyed. + Returns the QQmlEngine this expression is associated with, or 0 if there + is no association or the QQmlEngine has been destroyed. */ -QDeclarativeEngine *QDeclarativeExpression::engine() const +QQmlEngine *QQmlExpression::engine() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->context()?d->context()->engine:0; } /*! - Returns the QDeclarativeContext this expression is associated with, or 0 if there - is no association or the QDeclarativeContext has been destroyed. + Returns the QQmlContext this expression is associated with, or 0 if there + is no association or the QQmlContext has been destroyed. */ -QDeclarativeContext *QDeclarativeExpression::context() const +QQmlContext *QQmlExpression::context() const { - Q_D(const QDeclarativeExpression); - QDeclarativeContextData *data = d->context(); - return data?data->asQDeclarativeContext():0; + Q_D(const QQmlExpression); + QQmlContextData *data = d->context(); + return data?data->asQQmlContext():0; } /*! Returns the expression string. */ -QString QDeclarativeExpression::expression() const +QString QQmlExpression::expression() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); if (d->extractExpressionFromFunction && context()->engine()) { - QV8Engine *v8engine = QDeclarativeEnginePrivate::getV8Engine(context()->engine()); + QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(context()->engine()); v8::HandleScope handle_scope; v8::Context::Scope scope(v8engine->context()); @@ -476,9 +476,9 @@ QString QDeclarativeExpression::expression() const /*! Set the expression to \a expression. */ -void QDeclarativeExpression::setExpression(const QString &expression) +void QQmlExpression::setExpression(const QString &expression) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->resetNotifyOnValueChanged(); d->expression = expression; @@ -489,8 +489,8 @@ void QDeclarativeExpression::setExpression(const QString &expression) qPersistentDispose(d->v8qmlscope); } -void QDeclarativeExpressionPrivate::exceptionToError(v8::Handle<v8::Message> message, - QDeclarativeError &error) +void QQmlExpressionPrivate::exceptionToError(v8::Handle<v8::Message> message, + QQmlError &error) { Q_ASSERT(!message.IsEmpty()); @@ -514,19 +514,19 @@ void QDeclarativeExpressionPrivate::exceptionToError(v8::Handle<v8::Message> mes error.setDescription(qDescription); } -void QDeclarativeJavaScriptExpression::setNotifyOnValueChanged(bool v) +void QQmlJavaScriptExpression::setNotifyOnValueChanged(bool v) { activeGuards.setFlagValue(v); if (!v) clearGuards(); } -void QDeclarativeJavaScriptExpression::resetNotifyOnValueChanged() +void QQmlJavaScriptExpression::resetNotifyOnValueChanged() { clearGuards(); } v8::Local<v8::Value> -QDeclarativeJavaScriptExpression::evaluate(QDeclarativeContextData *context, +QQmlJavaScriptExpression::evaluate(QQmlContextData *context, v8::Handle<v8::Function> function, bool *isUndefined) { Q_ASSERT(context && context->engine); @@ -536,19 +536,19 @@ QDeclarativeJavaScriptExpression::evaluate(QDeclarativeContextData *context, return v8::Local<v8::Value>(); } - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context->engine); Q_ASSERT(notifyOnValueChanged() || activeGuards.isEmpty()); GuardCapture capture(context->engine, this); - QDeclarativeEnginePrivate::PropertyCapture *lastPropertyCapture = ep->propertyCapture; + QQmlEnginePrivate::PropertyCapture *lastPropertyCapture = ep->propertyCapture; ep->propertyCapture = notifyOnValueChanged()?&capture:0; if (notifyOnValueChanged()) capture.guards.copyAndClearPrepend(activeGuards); - QDeclarativeContextData *lastSharedContext = 0; + QQmlContextData *lastSharedContext = 0; QObject *lastSharedScope = 0; bool sharedContext = useSharedContext(); @@ -583,12 +583,12 @@ QDeclarativeJavaScriptExpression::evaluate(QDeclarativeContextData *context, v8::Context::Scope scope(ep->v8engine()->context()); v8::Local<v8::Message> message = try_catch.Message(); if (!message.IsEmpty()) { - QDeclarativeExpressionPrivate::exceptionToError(message, delayedError()->error); + QQmlExpressionPrivate::exceptionToError(message, delayedError()->error); } else { - if (hasDelayedError()) delayedError()->error = QDeclarativeError(); + if (hasDelayedError()) delayedError()->error = QQmlError(); } } else { - if (hasDelayedError()) delayedError()->error = QDeclarativeError(); + if (hasDelayedError()) delayedError()->error = QQmlError(); } } @@ -612,7 +612,7 @@ QDeclarativeJavaScriptExpression::evaluate(QDeclarativeContextData *context, return result; } -void QDeclarativeJavaScriptExpression::GuardCapture::captureProperty(QDeclarativeNotifier *n) +void QQmlJavaScriptExpression::GuardCapture::captureProperty(QQmlNotifier *n) { if (expression) { @@ -634,13 +634,13 @@ void QDeclarativeJavaScriptExpression::GuardCapture::captureProperty(QDeclarativ } } -void QDeclarativeJavaScriptExpression::GuardCapture::captureProperty(QObject *o, int c, int n) +void QQmlJavaScriptExpression::GuardCapture::captureProperty(QObject *o, int c, int n) { if (expression) { if (n == -1) { if (!errorString) { errorString = new QStringList; - QString preamble = QLatin1String("QDeclarativeExpression: Expression ") + + QString preamble = QLatin1String("QQmlExpression: Expression ") + expression->m_vtable->expressionIdentifier(expression) + QLatin1String(" depends on non-NOTIFYable properties:"); errorString->append(preamble); @@ -675,38 +675,38 @@ void QDeclarativeJavaScriptExpression::GuardCapture::captureProperty(QObject *o, } } -void QDeclarativeJavaScriptExpression::clearError() +void QQmlJavaScriptExpression::clearError() { if (m_vtable.hasValue()) { - m_vtable.value().error = QDeclarativeError(); + m_vtable.value().error = QQmlError(); m_vtable.value().removeError(); } } -QDeclarativeError QDeclarativeJavaScriptExpression::error() const +QQmlError QQmlJavaScriptExpression::error() const { if (m_vtable.hasValue()) return m_vtable.constValue()->error; - else return QDeclarativeError(); + else return QQmlError(); } -QDeclarativeDelayedError *QDeclarativeJavaScriptExpression::delayedError() +QQmlDelayedError *QQmlJavaScriptExpression::delayedError() { return &m_vtable.value(); } -void QDeclarativeJavaScriptExpression::clearGuards() +void QQmlJavaScriptExpression::clearGuards() { while (Guard *g = activeGuards.takeFirst()) g->Delete(); } // Must be called with a valid handle scope -v8::Local<v8::Value> QDeclarativeExpressionPrivate::v8value(QObject *secondaryScope, bool *isUndefined) +v8::Local<v8::Value> QQmlExpressionPrivate::v8value(QObject *secondaryScope, bool *isUndefined) { if (!expressionFunctionValid) { bool ok = true; - QDeclarativeRewrite::RewriteBinding rewriteBinding; + QQmlRewrite::RewriteBinding rewriteBinding; rewriteBinding.setName(name); QString code; if (expressionFunctionRewritten) @@ -722,7 +722,7 @@ v8::Local<v8::Value> QDeclarativeExpressionPrivate::v8value(QObject *secondarySc if (secondaryScope) { v8::Local<v8::Value> result; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context()->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context()->engine); QObject *restoreSecondaryScope = 0; restoreSecondaryScope = ep->v8engine()->contextWrapper()->setSecondaryScope(v8qmlscope, secondaryScope); result = evaluate(context(), v8function, isUndefined); @@ -733,16 +733,16 @@ v8::Local<v8::Value> QDeclarativeExpressionPrivate::v8value(QObject *secondarySc } } -QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined) +QVariant QQmlExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined) { - Q_Q(QDeclarativeExpression); + Q_Q(QQmlExpression); if (!context() || !context()->isValid()) { - qWarning("QDeclarativeExpression: Attempted to evaluate an expression in an invalid context"); + qWarning("QQmlExpression: Attempted to evaluate an expression in an invalid context"); return QVariant(); } - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(q->engine()); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(q->engine()); QVariant rv; ep->referenceScarceResources(); // "hold" scarce resources in memory during evaluation. @@ -768,9 +768,9 @@ QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isU \sa hasError(), error() */ -QVariant QDeclarativeExpression::evaluate(bool *valueIsUndefined) +QVariant QQmlExpression::evaluate(bool *valueIsUndefined) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); return d->value(0, valueIsUndefined); } @@ -778,9 +778,9 @@ QVariant QDeclarativeExpression::evaluate(bool *valueIsUndefined) Returns true if the valueChanged() signal is emitted when the expression's evaluated value changes. */ -bool QDeclarativeExpression::notifyOnValueChanged() const +bool QQmlExpression::notifyOnValueChanged() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->notifyOnValueChanged(); } @@ -788,21 +788,21 @@ bool QDeclarativeExpression::notifyOnValueChanged() const Sets whether the valueChanged() signal is emitted when the expression's evaluated value changes. - If \a notifyOnChange is true, the QDeclarativeExpression will + If \a notifyOnChange is true, the QQmlExpression will monitor properties involved in the expression's evaluation, and emit - QDeclarativeExpression::valueChanged() if they have changed. This + QQmlExpression::valueChanged() if they have changed. This allows an application to ensure that any value associated with the result of the expression remains up to date. - If \a notifyOnChange is false (default), the QDeclarativeExpression + If \a notifyOnChange is false (default), the QQmlExpression will not montitor properties involved in the expression's - evaluation, and QDeclarativeExpression::valueChanged() will never be + evaluation, and QQmlExpression::valueChanged() will never be emitted. This is more efficient if an application wants a "one off" evaluation of the expression. */ -void QDeclarativeExpression::setNotifyOnValueChanged(bool notifyOnChange) +void QQmlExpression::setNotifyOnValueChanged(bool notifyOnChange) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->setNotifyOnValueChanged(notifyOnChange); } @@ -810,9 +810,9 @@ void QDeclarativeExpression::setNotifyOnValueChanged(bool notifyOnChange) Returns the source file URL for this expression. The source location must have been previously set by calling setSourceLocation(). */ -QString QDeclarativeExpression::sourceFile() const +QString QQmlExpression::sourceFile() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->url; } @@ -820,9 +820,9 @@ QString QDeclarativeExpression::sourceFile() const Returns the source file line number for this expression. The source location must have been previously set by calling setSourceLocation(). */ -int QDeclarativeExpression::lineNumber() const +int QQmlExpression::lineNumber() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->line; } @@ -830,9 +830,9 @@ int QDeclarativeExpression::lineNumber() const Returns the source file column number for this expression. The source location must have been previously set by calling setSourceLocation(). */ -int QDeclarativeExpression::columnNumber() const +int QQmlExpression::columnNumber() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->column; } @@ -840,9 +840,9 @@ int QDeclarativeExpression::columnNumber() const Set the location of this expression to \a line of \a url. This information is used by the script engine. */ -void QDeclarativeExpression::setSourceLocation(const QString &url, int line, int column) +void QQmlExpression::setSourceLocation(const QString &url, int line, int column) { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->url = url; d->line = line; d->column = column; @@ -851,12 +851,12 @@ void QDeclarativeExpression::setSourceLocation(const QString &url, int line, int /*! Returns the expression's scope object, if provided, otherwise 0. - In addition to data provided by the expression's QDeclarativeContext, the scope + In addition to data provided by the expression's QQmlContext, the scope object's properties are also in scope during the expression's evaluation. */ -QObject *QDeclarativeExpression::scopeObject() const +QObject *QQmlExpression::scopeObject() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->scopeObject(); } @@ -866,9 +866,9 @@ QObject *QDeclarativeExpression::scopeObject() const \sa error(), clearError() */ -bool QDeclarativeExpression::hasError() const +bool QQmlExpression::hasError() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->hasError(); } @@ -878,57 +878,57 @@ bool QDeclarativeExpression::hasError() const \sa hasError(), error() */ -void QDeclarativeExpression::clearError() +void QQmlExpression::clearError() { - Q_D(QDeclarativeExpression); + Q_D(QQmlExpression); d->clearError(); } /*! Return any error from the last call to evaluate(). If there was no error, - this returns an invalid QDeclarativeError instance. + this returns an invalid QQmlError instance. \sa hasError(), clearError() */ -QDeclarativeError QDeclarativeExpression::error() const +QQmlError QQmlExpression::error() const { - Q_D(const QDeclarativeExpression); + Q_D(const QQmlExpression); return d->error(); } /*! - \fn void QDeclarativeExpression::valueChanged() + \fn void QQmlExpression::valueChanged() Emitted each time the expression value changes from the last time it was evaluated. The expression must have been evaluated at least once (by - calling QDeclarativeExpression::evaluate()) before this signal will be emitted. + calling QQmlExpression::evaluate()) before this signal will be emitted. */ -void QDeclarativeExpressionPrivate::expressionChanged(QDeclarativeJavaScriptExpression *e) +void QQmlExpressionPrivate::expressionChanged(QQmlJavaScriptExpression *e) { - QDeclarativeExpressionPrivate *This = static_cast<QDeclarativeExpressionPrivate *>(e); + QQmlExpressionPrivate *This = static_cast<QQmlExpressionPrivate *>(e); This->expressionChanged(); } -void QDeclarativeExpressionPrivate::expressionChanged() +void QQmlExpressionPrivate::expressionChanged() { - Q_Q(QDeclarativeExpression); + Q_Q(QQmlExpression); emit q->valueChanged(); } -QString QDeclarativeExpressionPrivate::expressionIdentifier(QDeclarativeJavaScriptExpression *e) +QString QQmlExpressionPrivate::expressionIdentifier(QQmlJavaScriptExpression *e) { - QDeclarativeExpressionPrivate *This = static_cast<QDeclarativeExpressionPrivate *>(e); + QQmlExpressionPrivate *This = static_cast<QQmlExpressionPrivate *>(e); return QLatin1String("\"") + This->expression + QLatin1String("\""); } -QDeclarativeAbstractExpression::QDeclarativeAbstractExpression() +QQmlAbstractExpression::QQmlAbstractExpression() : m_prevExpression(0), m_nextExpression(0) { } -QDeclarativeAbstractExpression::~QDeclarativeAbstractExpression() +QQmlAbstractExpression::~QQmlAbstractExpression() { if (m_prevExpression) { *m_prevExpression = m_nextExpression; @@ -940,13 +940,13 @@ QDeclarativeAbstractExpression::~QDeclarativeAbstractExpression() m_context.asT2()->_s = 0; } -QDeclarativeContextData *QDeclarativeAbstractExpression::context() const +QQmlContextData *QQmlAbstractExpression::context() const { if (m_context.isT1()) return m_context.asT1(); else return m_context.asT2()->_c; } -void QDeclarativeAbstractExpression::setContext(QDeclarativeContextData *context) +void QQmlAbstractExpression::setContext(QQmlContextData *context) { if (m_prevExpression) { *m_prevExpression = m_nextExpression; @@ -968,15 +968,15 @@ void QDeclarativeAbstractExpression::setContext(QDeclarativeContextData *context } } -void QDeclarativeAbstractExpression::refresh() +void QQmlAbstractExpression::refresh() { } -bool QDeclarativeAbstractExpression::isValid() const +bool QQmlAbstractExpression::isValid() const { return context() != 0; } QT_END_NAMESPACE -#include <moc_qdeclarativeexpression.cpp> +#include <moc_qqmlexpression.cpp> diff --git a/src/declarative/qml/qdeclarativeexpression.h b/src/qml/qml/qqmlexpression.h index c9ab40854d..4044546fbf 100644 --- a/src/declarative/qml/qdeclarativeexpression.h +++ b/src/qml/qml/qqmlexpression.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEEXPRESSION_H -#define QDECLARATIVEEXPRESSION_H +#ifndef QQMLEXPRESSION_H +#define QQMLEXPRESSION_H -#include <QtDeclarative/qdeclarativeerror.h> -#include <QtDeclarative/qdeclarativescriptstring.h> +#include <QtQml/qqmlerror.h> +#include <QtQml/qqmlscriptstring.h> #include <QtCore/qobject.h> #include <QtCore/qvariant.h> @@ -54,22 +54,22 @@ QT_BEGIN_NAMESPACE class QString; -class QDeclarativeRefCount; -class QDeclarativeEngine; -class QDeclarativeContext; -class QDeclarativeExpressionPrivate; -class QDeclarativeContextData; -class Q_DECLARATIVE_EXPORT QDeclarativeExpression : public QObject +class QQmlRefCount; +class QQmlEngine; +class QQmlContext; +class QQmlExpressionPrivate; +class QQmlContextData; +class Q_QML_EXPORT QQmlExpression : public QObject { Q_OBJECT public: - QDeclarativeExpression(); - QDeclarativeExpression(QDeclarativeContext *, QObject *, const QString &, QObject * = 0); - explicit QDeclarativeExpression(const QDeclarativeScriptString &, QObject * = 0); - virtual ~QDeclarativeExpression(); + QQmlExpression(); + QQmlExpression(QQmlContext *, QObject *, const QString &, QObject * = 0); + explicit QQmlExpression(const QQmlScriptString &, QObject * = 0); + virtual ~QQmlExpression(); - QDeclarativeEngine *engine() const; - QDeclarativeContext *context() const; + QQmlEngine *engine() const; + QQmlContext *context() const; QString expression() const; void setExpression(const QString &); @@ -86,7 +86,7 @@ public: bool hasError() const; void clearError(); - QDeclarativeError error() const; + QQmlError error() const; QVariant evaluate(bool *valueIsUndefined = 0); @@ -94,28 +94,28 @@ Q_SIGNALS: void valueChanged(); protected: - QDeclarativeExpression(QDeclarativeContextData *, QObject *, const QString &, - QDeclarativeExpressionPrivate &dd); - QDeclarativeExpression(QDeclarativeContextData *, QObject *, void *, - QDeclarativeExpressionPrivate &dd); - QDeclarativeExpression(QDeclarativeContextData *, QObject *, const QString &, bool, - const QString &, int, int, QDeclarativeExpressionPrivate &dd); - QDeclarativeExpression(QDeclarativeContextData *, QObject *, const QByteArray &, bool, - const QString &, int, int, QDeclarativeExpressionPrivate &dd); + QQmlExpression(QQmlContextData *, QObject *, const QString &, + QQmlExpressionPrivate &dd); + QQmlExpression(QQmlContextData *, QObject *, void *, + QQmlExpressionPrivate &dd); + QQmlExpression(QQmlContextData *, QObject *, const QString &, bool, + const QString &, int, int, QQmlExpressionPrivate &dd); + QQmlExpression(QQmlContextData *, QObject *, const QByteArray &, bool, + const QString &, int, int, QQmlExpressionPrivate &dd); private: - QDeclarativeExpression(QDeclarativeContextData *, QObject *, const QString &); + QQmlExpression(QQmlContextData *, QObject *, const QString &); - Q_DISABLE_COPY(QDeclarativeExpression) - Q_DECLARE_PRIVATE(QDeclarativeExpression) - friend class QDeclarativeDebugger; - friend class QDeclarativeContext; - friend class QDeclarativeVME; + Q_DISABLE_COPY(QQmlExpression) + Q_DECLARE_PRIVATE(QQmlExpression) + friend class QQmlDebugger; + friend class QQmlContext; + friend class QQmlVME; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEEXPRESSION_H +#endif // QQMLEXPRESSION_H diff --git a/src/declarative/qml/qdeclarativeexpression_p.h b/src/qml/qml/qqmlexpression_p.h index 541a06dba5..deca29ab60 100644 --- a/src/declarative/qml/qdeclarativeexpression_p.h +++ b/src/qml/qml/qqmlexpression_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEEXPRESSION_P_H -#define QDECLARATIVEEXPRESSION_P_H +#ifndef QQMLEXPRESSION_P_H +#define QQMLEXPRESSION_P_H // // W A R N I N G @@ -53,62 +53,62 @@ // We mean it. // -#include "qdeclarativeexpression.h" +#include "qqmlexpression.h" #include <private/qv8engine_p.h> #include <private/qfieldlist_p.h> #include <private/qflagpointer_p.h> #include <private/qdeletewatcher_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> #include <private/qpointervaluepair_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeAbstractExpression +class QQmlAbstractExpression { public: - QDeclarativeAbstractExpression(); - virtual ~QDeclarativeAbstractExpression(); + QQmlAbstractExpression(); + virtual ~QQmlAbstractExpression(); bool isValid() const; - QDeclarativeContextData *context() const; - void setContext(QDeclarativeContextData *); + QQmlContextData *context() const; + void setContext(QQmlContextData *); virtual void refresh(); class DeleteWatcher { public: - inline DeleteWatcher(QDeclarativeAbstractExpression *); + inline DeleteWatcher(QQmlAbstractExpression *); inline ~DeleteWatcher(); inline bool wasDeleted() const; private: - friend class QDeclarativeAbstractExpression; - QDeclarativeContextData *_c; - QDeclarativeAbstractExpression **_w; - QDeclarativeAbstractExpression *_s; + friend class QQmlAbstractExpression; + QQmlContextData *_c; + QQmlAbstractExpression **_w; + QQmlAbstractExpression *_s; }; private: - friend class QDeclarativeContext; - friend class QDeclarativeContextData; - friend class QDeclarativeContextPrivate; + friend class QQmlContext; + friend class QQmlContextData; + friend class QQmlContextPrivate; - QBiPointer<QDeclarativeContextData, DeleteWatcher> m_context; - QDeclarativeAbstractExpression **m_prevExpression; - QDeclarativeAbstractExpression *m_nextExpression; + QBiPointer<QQmlContextData, DeleteWatcher> m_context; + QQmlAbstractExpression **m_prevExpression; + QQmlAbstractExpression *m_nextExpression; }; -class QDeclarativeDelayedError +class QQmlDelayedError { public: - inline QDeclarativeDelayedError() : nextError(0), prevError(0) {} - inline ~QDeclarativeDelayedError() { removeError(); } + inline QQmlDelayedError() : nextError(0), prevError(0) {} + inline ~QQmlDelayedError() { removeError(); } - QDeclarativeError error; + QQmlError error; - bool addError(QDeclarativeEnginePrivate *); + bool addError(QQmlEnginePrivate *); inline void removeError() { if (!prevError) return; @@ -119,11 +119,11 @@ public: } private: - QDeclarativeDelayedError *nextError; - QDeclarativeDelayedError **prevError; + QQmlDelayedError *nextError; + QQmlDelayedError **prevError; }; -class QDeclarativeJavaScriptExpression +class QQmlJavaScriptExpression { public: // Although this looks crazy, we implement our own "vtable" here, rather than relying on @@ -132,13 +132,13 @@ public: // If we use C++ virtuals, we can't do this and it consts us an extra sizeof(void *) in // memory for every expression. struct VTable { - QString (*expressionIdentifier)(QDeclarativeJavaScriptExpression *); - void (*expressionChanged)(QDeclarativeJavaScriptExpression *); + QString (*expressionIdentifier)(QQmlJavaScriptExpression *); + void (*expressionChanged)(QQmlJavaScriptExpression *); }; - QDeclarativeJavaScriptExpression(VTable *vtable); + QQmlJavaScriptExpression(VTable *vtable); - v8::Local<v8::Value> evaluate(QDeclarativeContextData *, v8::Handle<v8::Function>, + v8::Local<v8::Value> evaluate(QQmlContextData *, v8::Handle<v8::Function>, bool *isUndefined); inline bool requiresThisObject() const; @@ -155,31 +155,31 @@ public: class DeleteWatcher { public: - inline DeleteWatcher(QDeclarativeJavaScriptExpression *); + inline DeleteWatcher(QQmlJavaScriptExpression *); inline ~DeleteWatcher(); inline bool wasDeleted() const; private: - friend class QDeclarativeJavaScriptExpression; + friend class QQmlJavaScriptExpression; QObject *_c; - QDeclarativeJavaScriptExpression **_w; - QDeclarativeJavaScriptExpression *_s; + QQmlJavaScriptExpression **_w; + QQmlJavaScriptExpression *_s; }; inline bool hasError() const; inline bool hasDelayedError() const; - QDeclarativeError error() const; + QQmlError error() const; void clearError(); - QDeclarativeDelayedError *delayedError(); + QQmlDelayedError *delayedError(); protected: - ~QDeclarativeJavaScriptExpression(); + ~QQmlJavaScriptExpression(); private: - typedef QDeclarativeJavaScriptExpressionGuard Guard; - friend class QDeclarativeJavaScriptExpressionGuard; + typedef QQmlJavaScriptExpressionGuard Guard; + friend class QQmlJavaScriptExpressionGuard; - struct GuardCapture : public QDeclarativeEnginePrivate::PropertyCapture { - GuardCapture(QDeclarativeEngine *engine, QDeclarativeJavaScriptExpression *e) + struct GuardCapture : public QQmlEnginePrivate::PropertyCapture { + GuardCapture(QQmlEngine *engine, QQmlJavaScriptExpression *e) : engine(engine), expression(e), errorString(0) { } ~GuardCapture() { @@ -187,16 +187,16 @@ private: Q_ASSERT(errorString == 0); } - virtual void captureProperty(QDeclarativeNotifier *); + virtual void captureProperty(QQmlNotifier *); virtual void captureProperty(QObject *, int, int); - QDeclarativeEngine *engine; - QDeclarativeJavaScriptExpression *expression; + QQmlEngine *engine; + QQmlJavaScriptExpression *expression; QFieldList<Guard, &Guard::next> guards; QStringList *errorString; }; - QPointerValuePair<VTable, QDeclarativeDelayedError> m_vtable; + QPointerValuePair<VTable, QQmlDelayedError> m_vtable; // We store some flag bits in the following flag pointers. // m_scopeObject:flag1 - requiresThisObject @@ -208,49 +208,49 @@ private: void clearGuards(); }; -class QDeclarativeExpression; +class QQmlExpression; class QString; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeExpressionPrivate : public QObjectPrivate, public QDeclarativeJavaScriptExpression, public QDeclarativeAbstractExpression +class Q_QML_PRIVATE_EXPORT QQmlExpressionPrivate : public QObjectPrivate, public QQmlJavaScriptExpression, public QQmlAbstractExpression { - Q_DECLARE_PUBLIC(QDeclarativeExpression) + Q_DECLARE_PUBLIC(QQmlExpression) public: - QDeclarativeExpressionPrivate(); - ~QDeclarativeExpressionPrivate(); + QQmlExpressionPrivate(); + ~QQmlExpressionPrivate(); - void init(QDeclarativeContextData *, const QString &, QObject *); - void init(QDeclarativeContextData *, v8::Handle<v8::Function>, QObject *); - void init(QDeclarativeContextData *, const QString &, bool, QObject *, const QString &, int, int); - void init(QDeclarativeContextData *, const QByteArray &, bool, QObject *, const QString &, int, int); + void init(QQmlContextData *, const QString &, QObject *); + void init(QQmlContextData *, v8::Handle<v8::Function>, QObject *); + void init(QQmlContextData *, const QString &, bool, QObject *, const QString &, int, int); + void init(QQmlContextData *, const QByteArray &, bool, QObject *, const QString &, int, int); QVariant value(QObject *secondaryScope = 0, bool *isUndefined = 0); v8::Local<v8::Value> v8value(QObject *secondaryScope = 0, bool *isUndefined = 0); - static inline QDeclarativeExpressionPrivate *get(QDeclarativeExpression *expr); - static inline QDeclarativeExpression *get(QDeclarativeExpressionPrivate *expr); + static inline QQmlExpressionPrivate *get(QQmlExpression *expr); + static inline QQmlExpression *get(QQmlExpressionPrivate *expr); void _q_notify(); - static void exceptionToError(v8::Handle<v8::Message>, QDeclarativeError &); - static v8::Persistent<v8::Function> evalFunction(QDeclarativeContextData *ctxt, QObject *scope, + static void exceptionToError(v8::Handle<v8::Message>, QQmlError &); + static v8::Persistent<v8::Function> evalFunction(QQmlContextData *ctxt, QObject *scope, const QString &code, const QString &filename, int line, v8::Persistent<v8::Object> *qmlscope = 0); - static v8::Persistent<v8::Function> evalFunction(QDeclarativeContextData *ctxt, QObject *scope, + static v8::Persistent<v8::Function> evalFunction(QQmlContextData *ctxt, QObject *scope, const char *code, int codeLength, const QString &filename, int line, v8::Persistent<v8::Object> *qmlscope = 0); - static QDeclarativeExpression *create(QDeclarativeContextData *, QObject *, const QString &, bool, + static QQmlExpression *create(QQmlContextData *, QObject *, const QString &, bool, const QString &, int, int); bool expressionFunctionValid:1; bool expressionFunctionRewritten:1; bool extractExpressionFromFunction:1; - // "Inherited" from QDeclarativeJavaScriptExpression - static QString expressionIdentifier(QDeclarativeJavaScriptExpression *); - static void expressionChanged(QDeclarativeJavaScriptExpression *); + // "Inherited" from QQmlJavaScriptExpression + static QString expressionIdentifier(QQmlJavaScriptExpression *); + static void expressionChanged(QQmlJavaScriptExpression *); virtual void expressionChanged(); QString expression; @@ -264,10 +264,10 @@ public: int column; QString name; //function name, hint for the debugger - QDeclarativeRefCount *dataRef; + QQmlRefCount *dataRef; }; -QDeclarativeAbstractExpression::DeleteWatcher::DeleteWatcher(QDeclarativeAbstractExpression *e) +QQmlAbstractExpression::DeleteWatcher::DeleteWatcher(QQmlAbstractExpression *e) : _c(0), _w(0), _s(e) { if (e->m_context.isT1()) { @@ -280,19 +280,19 @@ QDeclarativeAbstractExpression::DeleteWatcher::DeleteWatcher(QDeclarativeAbstrac } } -QDeclarativeAbstractExpression::DeleteWatcher::~DeleteWatcher() +QQmlAbstractExpression::DeleteWatcher::~DeleteWatcher() { Q_ASSERT(*_w == 0 || (*_w == _s && _s->m_context.isT2())); if (*_w && _s->m_context.asT2() == this) _s->m_context = _c; } -bool QDeclarativeAbstractExpression::DeleteWatcher::wasDeleted() const +bool QQmlAbstractExpression::DeleteWatcher::wasDeleted() const { return *_w == 0; } -QDeclarativeJavaScriptExpression::DeleteWatcher::DeleteWatcher(QDeclarativeJavaScriptExpression *e) +QQmlJavaScriptExpression::DeleteWatcher::DeleteWatcher(QQmlJavaScriptExpression *e) : _c(0), _w(0), _s(e) { if (e->m_scopeObject.isT1()) { @@ -305,102 +305,102 @@ QDeclarativeJavaScriptExpression::DeleteWatcher::DeleteWatcher(QDeclarativeJavaS } } -QDeclarativeJavaScriptExpression::DeleteWatcher::~DeleteWatcher() +QQmlJavaScriptExpression::DeleteWatcher::~DeleteWatcher() { Q_ASSERT(*_w == 0 || (*_w == _s && _s->m_scopeObject.isT2())); if (*_w && _s->m_scopeObject.asT2() == this) _s->m_scopeObject = _c; } -bool QDeclarativeJavaScriptExpression::DeleteWatcher::wasDeleted() const +bool QQmlJavaScriptExpression::DeleteWatcher::wasDeleted() const { return *_w == 0; } -bool QDeclarativeJavaScriptExpression::requiresThisObject() const +bool QQmlJavaScriptExpression::requiresThisObject() const { return m_scopeObject.flag(); } -void QDeclarativeJavaScriptExpression::setRequiresThisObject(bool v) +void QQmlJavaScriptExpression::setRequiresThisObject(bool v) { m_scopeObject.setFlagValue(v); } -bool QDeclarativeJavaScriptExpression::useSharedContext() const +bool QQmlJavaScriptExpression::useSharedContext() const { return activeGuards.flag2(); } -void QDeclarativeJavaScriptExpression::setUseSharedContext(bool v) +void QQmlJavaScriptExpression::setUseSharedContext(bool v) { activeGuards.setFlag2Value(v); } -bool QDeclarativeJavaScriptExpression::notifyOnValueChanged() const +bool QQmlJavaScriptExpression::notifyOnValueChanged() const { return activeGuards.flag(); } -QObject *QDeclarativeJavaScriptExpression::scopeObject() const +QObject *QQmlJavaScriptExpression::scopeObject() const { if (m_scopeObject.isT1()) return m_scopeObject.asT1(); else return m_scopeObject.asT2()->_c; } -void QDeclarativeJavaScriptExpression::setScopeObject(QObject *v) +void QQmlJavaScriptExpression::setScopeObject(QObject *v) { if (m_scopeObject.isT1()) m_scopeObject = v; else m_scopeObject.asT2()->_c = v; } -bool QDeclarativeJavaScriptExpression::hasError() const +bool QQmlJavaScriptExpression::hasError() const { return m_vtable.hasValue() && m_vtable.constValue()->error.isValid(); } -bool QDeclarativeJavaScriptExpression::hasDelayedError() const +bool QQmlJavaScriptExpression::hasDelayedError() const { return m_vtable.hasValue(); } -QDeclarativeExpressionPrivate *QDeclarativeExpressionPrivate::get(QDeclarativeExpression *expr) +QQmlExpressionPrivate *QQmlExpressionPrivate::get(QQmlExpression *expr) { - return static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr)); + return static_cast<QQmlExpressionPrivate *>(QObjectPrivate::get(expr)); } -QDeclarativeExpression *QDeclarativeExpressionPrivate::get(QDeclarativeExpressionPrivate *expr) +QQmlExpression *QQmlExpressionPrivate::get(QQmlExpressionPrivate *expr) { return expr->q_func(); } -QDeclarativeJavaScriptExpressionGuard::QDeclarativeJavaScriptExpressionGuard(QDeclarativeJavaScriptExpression *e) +QQmlJavaScriptExpressionGuard::QQmlJavaScriptExpressionGuard(QQmlJavaScriptExpression *e) : expression(e), next(0) { callback = &endpointCallback; } -void QDeclarativeJavaScriptExpressionGuard::endpointCallback(QDeclarativeNotifierEndpoint *e) +void QQmlJavaScriptExpressionGuard::endpointCallback(QQmlNotifierEndpoint *e) { - QDeclarativeJavaScriptExpression *expression = - static_cast<QDeclarativeJavaScriptExpressionGuard *>(e)->expression; + QQmlJavaScriptExpression *expression = + static_cast<QQmlJavaScriptExpressionGuard *>(e)->expression; expression->m_vtable->expressionChanged(expression); } -QDeclarativeJavaScriptExpressionGuard * -QDeclarativeJavaScriptExpressionGuard::New(QDeclarativeJavaScriptExpression *e, - QDeclarativeEngine *engine) +QQmlJavaScriptExpressionGuard * +QQmlJavaScriptExpressionGuard::New(QQmlJavaScriptExpression *e, + QQmlEngine *engine) { Q_ASSERT(e); - return QDeclarativeEnginePrivate::get(engine)->jsExpressionGuardPool.New(e); + return QQmlEnginePrivate::get(engine)->jsExpressionGuardPool.New(e); } -void QDeclarativeJavaScriptExpressionGuard::Delete() +void QQmlJavaScriptExpressionGuard::Delete() { - QRecyclePool<QDeclarativeJavaScriptExpressionGuard>::Delete(this); + QRecyclePool<QQmlJavaScriptExpressionGuard>::Delete(this); } QT_END_NAMESPACE -#endif // QDECLARATIVEEXPRESSION_P_H +#endif // QQMLEXPRESSION_P_H diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.h b/src/qml/qml/qqmlextensioninterface.h index 4189cae345..63ef1adc08 100644 --- a/src/declarative/qml/qdeclarativepropertyvaluesource.h +++ b/src/qml/qml/qqmlextensioninterface.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROPERTYVALUESOURCE_H -#define QDECLARATIVEPROPERTYVALUESOURCE_H +#ifndef QQMLEXTENSIONINTERFACE_H +#define QQMLEXTENSIONINTERFACE_H +#include <QtQml/qtqmlglobal.h> #include <QtCore/qobject.h> QT_BEGIN_HEADER @@ -49,18 +50,27 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeProperty; -class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueSource +class QQmlEngine; + +class Q_QML_EXPORT QQmlTypesExtensionInterface +{ +public: + virtual ~QQmlTypesExtensionInterface() {} + virtual void registerTypes(const char *uri) = 0; +}; + +class Q_QML_EXPORT QQmlExtensionInterface : public QQmlTypesExtensionInterface { public: - QDeclarativePropertyValueSource(); - virtual ~QDeclarativePropertyValueSource(); - virtual void setTarget(const QDeclarativeProperty &) = 0; + virtual ~QQmlExtensionInterface() {} + virtual void initializeEngine(QQmlEngine *engine, const char *uri) = 0; }; -Q_DECLARE_INTERFACE(QDeclarativePropertyValueSource, "com.trolltech.qml.QDeclarativePropertyValueSource") + +Q_DECLARE_INTERFACE(QQmlTypesExtensionInterface, "org.qt-project.Qt.QQmlTypesExtensionInterface/1.0") +Q_DECLARE_INTERFACE(QQmlExtensionInterface, "org.qt-project.Qt.QQmlExtensionInterface/1.0") QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEPROPERTYVALUESOURCE_H +#endif // QQMLEXTENSIONINTERFACE_H diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp index f69fa30e0d..c3d8f0b34f 100644 --- a/src/declarative/qml/qdeclarativeextensionplugin.cpp +++ b/src/qml/qml/qqmlextensionplugin.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,25 +39,25 @@ ** ****************************************************************************/ -#include "qdeclarativeextensionplugin.h" +#include "qqmlextensionplugin.h" QT_BEGIN_NAMESPACE /*! \since 4.7 - \class QDeclarativeExtensionPlugin - \brief The QDeclarativeExtensionPlugin class provides an abstract base for custom QML extension plugins. + \class QQmlExtensionPlugin + \brief The QQmlExtensionPlugin class provides an abstract base for custom QML extension plugins. \ingroup plugins - QDeclarativeExtensionPlugin is a plugin interface that makes it possible to + QQmlExtensionPlugin is a plugin interface that makes it possible to create QML extensions that can be loaded dynamically into QML applications. These extensions allow custom QML types to be made available to the QML engine. To write a QML extension plugin: \list - \o Subclass QDeclarativeExtensionPlugin, implement registerTypes() method + \o Subclass QQmlExtensionPlugin, implement registerTypes() method to register types using qmlRegisterType(), and export the class using the Q_EXPORT_PLUGIN2() macro \o Write an appropriate project file for the plugin \o Create a \l{Writing a qmldir file}{qmldir file} to describe the plugin @@ -121,11 +121,11 @@ QT_BEGIN_NAMESPACE The \l {Tutorial: Writing QML extensions with C++} also contains a chapter on creating QML plugins. - \sa QDeclarativeEngine::importPlugin(), {How to Create Qt Plugins} + \sa QQmlEngine::importPlugin(), {How to Create Qt Plugins} */ /*! - \fn void QDeclarativeExtensionPlugin::registerTypes(const char *uri) + \fn void QQmlExtensionPlugin::registerTypes(const char *uri) Registers the QML types in the given \a uri. Subclasses should implement this to call qmlRegisterType() for all types which are provided by the extension @@ -142,7 +142,7 @@ QT_BEGIN_NAMESPACE Q_EXPORT_PLUGIN2() macro, so there is no need for calling it explicitly. */ -QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(QObject *parent) +QQmlExtensionPlugin::QQmlExtensionPlugin(QObject *parent) : QObject(parent) { } @@ -150,19 +150,19 @@ QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(QObject *parent) /*! \internal */ -QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin() +QQmlExtensionPlugin::~QQmlExtensionPlugin() { } /*! - \fn void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) + \fn void QQmlExtensionPlugin::initializeEngine(QQmlEngine *engine, const char *uri) Initializes the extension from the \a uri using the \a engine. Here an application plugin might, for example, expose some data or objects to QML, as context properties on the engine's root context. */ -void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) +void QQmlExtensionPlugin::initializeEngine(QQmlEngine *engine, const char *uri) { Q_UNUSED(engine); Q_UNUSED(uri); diff --git a/src/declarative/qml/qdeclarativeextensionplugin.h b/src/qml/qml/qqmlextensionplugin.h index 477e58d83c..91a9e95869 100644 --- a/src/declarative/qml/qdeclarativeextensionplugin.h +++ b/src/qml/qml/qqmlextensionplugin.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,39 +39,39 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEEXTENSIONPLUGIN_H -#define QDECLARATIVEEXTENSIONPLUGIN_H +#ifndef QQMLEXTENSIONPLUGIN_H +#define QQMLEXTENSIONPLUGIN_H #include <QtCore/qplugin.h> -#include <QtDeclarative/qdeclarativeextensioninterface.h> +#include <QtQml/qqmlextensioninterface.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; -class Q_DECLARATIVE_EXPORT QDeclarativeExtensionPlugin : public QObject, - public QDeclarativeExtensionInterface +class Q_QML_EXPORT QQmlExtensionPlugin : public QObject, + public QQmlExtensionInterface { Q_OBJECT - Q_INTERFACES(QDeclarativeExtensionInterface) - Q_INTERFACES(QDeclarativeTypesExtensionInterface) + Q_INTERFACES(QQmlExtensionInterface) + Q_INTERFACES(QQmlTypesExtensionInterface) public: - explicit QDeclarativeExtensionPlugin(QObject *parent = 0); - ~QDeclarativeExtensionPlugin(); + explicit QQmlExtensionPlugin(QObject *parent = 0); + ~QQmlExtensionPlugin(); virtual void registerTypes(const char *uri) = 0; - virtual void initializeEngine(QDeclarativeEngine *engine, const char *uri); + virtual void initializeEngine(QQmlEngine *engine, const char *uri); private: - Q_DISABLE_COPY(QDeclarativeExtensionPlugin) + Q_DISABLE_COPY(QQmlExtensionPlugin) }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEEXTENSIONPLUGIN_H +#endif // QQMLEXTENSIONPLUGIN_H diff --git a/src/declarative/qml/qdeclarativeglobal_p.h b/src/qml/qml/qqmlglobal_p.h index 3534a75bc9..c41b823e60 100644 --- a/src/declarative/qml/qdeclarativeglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEGLOBAL_H -#define QDECLARATIVEGLOBAL_H +#ifndef QQMLGLOBAL_H +#define QQMLGLOBAL_H #include <QtCore/qglobal.h> #include <QtCore/QObject> @@ -89,9 +89,7 @@ QT_BEGIN_NAMESPACE QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); \ } -#define Q_DECLARATIVE_PRIVATE_EXPORT Q_DECLARATIVE_EXPORT - -struct QDeclarativeGraphics_DerivedObject : public QObject +struct QQmlGraphics_DerivedObject : public QObject { void setParent_noEvent(QObject *parent) { bool sce = d_ptr->sendChildEvents; @@ -112,20 +110,20 @@ struct QDeclarativeGraphics_DerivedObject : public QObject should never have a false negative (say the case is incorrect when it is correct). */ -bool QDeclarative_isFileCaseCorrect(const QString &fileName); +bool QQml_isFileCaseCorrect(const QString &fileName); /*! Makes the \a object a child of \a parent. Note that when using this method, neither \a parent nor the object's previous parent (if it had one) will receive ChildRemoved or ChildAdded events. */ -inline void QDeclarative_setParent_noEvent(QObject *object, QObject *parent) +inline void QQml_setParent_noEvent(QObject *object, QObject *parent) { - static_cast<QDeclarativeGraphics_DerivedObject *>(object)->setParent_noEvent(parent); + static_cast<QQmlGraphics_DerivedObject *>(object)->setParent_noEvent(parent); } QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEGLOBAL_H +#endif // QQMLGLOBAL_H diff --git a/src/declarative/qml/qdeclarativeguard_p.h b/src/qml/qml/qqmlguard_p.h index fdd5c016a5..b4e7408fae 100644 --- a/src/declarative/qml/qdeclarativeguard_p.h +++ b/src/qml/qml/qqmlguard_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEGUARD_P_H -#define QDECLARATIVEGUARD_P_H +#ifndef QQMLGUARD_P_H +#define QQMLGUARD_P_H // // W A R N I N G @@ -55,21 +55,21 @@ #include <QtCore/qglobal.h> #include <QtCore/qvariant.h> -#include <private/qdeclarativedata_p.h> +#include <private/qqmldata_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeGuardImpl +class QQmlGuardImpl { public: - inline QDeclarativeGuardImpl(); - inline QDeclarativeGuardImpl(QObject *); - inline QDeclarativeGuardImpl(const QDeclarativeGuardImpl &); - inline ~QDeclarativeGuardImpl(); + inline QQmlGuardImpl(); + inline QQmlGuardImpl(QObject *); + inline QQmlGuardImpl(const QQmlGuardImpl &); + inline ~QQmlGuardImpl(); QObject *o; - QDeclarativeGuardImpl *next; - QDeclarativeGuardImpl **prev; + QQmlGuardImpl *next; + QQmlGuardImpl **prev; inline void addGuard(); inline void remGuard(); @@ -77,17 +77,17 @@ public: class QObject; template<class T> -class QDeclarativeGuard : private QDeclarativeGuardImpl +class QQmlGuard : private QQmlGuardImpl { - friend class QDeclarativeData; + friend class QQmlData; public: - inline QDeclarativeGuard(); - inline QDeclarativeGuard(T *); - inline QDeclarativeGuard(const QDeclarativeGuard<T> &); - inline virtual ~QDeclarativeGuard(); + inline QQmlGuard(); + inline QQmlGuard(T *); + inline QQmlGuard(const QQmlGuard<T> &); + inline virtual ~QQmlGuard(); - inline QDeclarativeGuard<T> &operator=(const QDeclarativeGuard<T> &o); - inline QDeclarativeGuard<T> &operator=(T *); + inline QQmlGuard<T> &operator=(const QQmlGuard<T> &o); + inline QQmlGuard<T> &operator=(T *); inline T *object() const; inline void setObject(T *g); @@ -110,48 +110,48 @@ protected: QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeGuard<QObject>) +Q_DECLARE_METATYPE(QQmlGuard<QObject>) QT_BEGIN_NAMESPACE -QDeclarativeGuardImpl::QDeclarativeGuardImpl() +QQmlGuardImpl::QQmlGuardImpl() : o(0), next(0), prev(0) { } -QDeclarativeGuardImpl::QDeclarativeGuardImpl(QObject *g) +QQmlGuardImpl::QQmlGuardImpl(QObject *g) : o(g), next(0), prev(0) { if (o) addGuard(); } -QDeclarativeGuardImpl::QDeclarativeGuardImpl(const QDeclarativeGuardImpl &g) +QQmlGuardImpl::QQmlGuardImpl(const QQmlGuardImpl &g) : o(g.o), next(0), prev(0) { if (o) addGuard(); } -QDeclarativeGuardImpl::~QDeclarativeGuardImpl() +QQmlGuardImpl::~QQmlGuardImpl() { if (prev) remGuard(); o = 0; } -void QDeclarativeGuardImpl::addGuard() +void QQmlGuardImpl::addGuard() { Q_ASSERT(!prev); if (QObjectPrivate::get(o)->wasDeleted) return; - QDeclarativeData *data = QDeclarativeData::get(o, true); + QQmlData *data = QQmlData::get(o, true); next = data->guards; if (next) next->prev = &next; data->guards = this; prev = &data->guards; } -void QDeclarativeGuardImpl::remGuard() +void QQmlGuardImpl::remGuard() { Q_ASSERT(prev); @@ -162,49 +162,49 @@ void QDeclarativeGuardImpl::remGuard() } template<class T> -QDeclarativeGuard<T>::QDeclarativeGuard() +QQmlGuard<T>::QQmlGuard() { } template<class T> -QDeclarativeGuard<T>::QDeclarativeGuard(T *g) -: QDeclarativeGuardImpl(g) +QQmlGuard<T>::QQmlGuard(T *g) +: QQmlGuardImpl(g) { } template<class T> -QDeclarativeGuard<T>::QDeclarativeGuard(const QDeclarativeGuard<T> &g) -: QDeclarativeGuardImpl(g) +QQmlGuard<T>::QQmlGuard(const QQmlGuard<T> &g) +: QQmlGuardImpl(g) { } template<class T> -QDeclarativeGuard<T>::~QDeclarativeGuard() +QQmlGuard<T>::~QQmlGuard() { } template<class T> -QDeclarativeGuard<T> &QDeclarativeGuard<T>::operator=(const QDeclarativeGuard<T> &g) +QQmlGuard<T> &QQmlGuard<T>::operator=(const QQmlGuard<T> &g) { setObject(g.object()); return *this; } template<class T> -QDeclarativeGuard<T> &QDeclarativeGuard<T>::operator=(T *g) +QQmlGuard<T> &QQmlGuard<T>::operator=(T *g) { setObject(g); return *this; } template<class T> -T *QDeclarativeGuard<T>::object() const +T *QQmlGuard<T>::object() const { return static_cast<T *>(o); }; template<class T> -void QDeclarativeGuard<T>::setObject(T *g) +void QQmlGuard<T>::setObject(T *g) { if (g != o) { if (prev) remGuard(); @@ -215,4 +215,4 @@ void QDeclarativeGuard<T>::setObject(T *g) QT_END_NAMESPACE -#endif // QDECLARATIVEGUARD_P_H +#endif // QQMLGUARD_P_H diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/qml/qml/qqmlimageprovider.cpp index f2749fff30..863093033a 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/qml/qml/qqmlimageprovider.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,20 +39,20 @@ ** ****************************************************************************/ -#include "qdeclarativeimageprovider.h" +#include "qqmlimageprovider.h" QT_BEGIN_NAMESPACE -class QDeclarativeImageProviderPrivate +class QQmlImageProviderPrivate { public: - QDeclarativeImageProvider::ImageType type; + QQmlImageProvider::ImageType type; }; /*! - \class QDeclarativeTextureFactory + \class QQuickTextureFactory \since 5.0 - \brief The QDeclarativeTextureFactory class provides an interface for loading custom textures from QML. + \brief The QQuickTextureFactory class provides an interface for loading custom textures from QML. The purpose of the texture factory is to provide a placeholder for a image data that can be converted into an OpenGL texture. @@ -61,18 +61,18 @@ public: available in the thread that is responsible for loading the image data. */ -QDeclarativeTextureFactory::QDeclarativeTextureFactory() +QQuickTextureFactory::QQuickTextureFactory() { } -QDeclarativeTextureFactory::~QDeclarativeTextureFactory() +QQuickTextureFactory::~QQuickTextureFactory() { } /*! - \fn QSGTexture *QDeclarativeTextureFactory::createTexture() const + \fn QSGTexture *QQuickTextureFactory::createTexture() const This function is called on the scene graph rendering thread to create a QSGTexture instance from the factory. @@ -84,7 +84,7 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() */ /*! - \fn QSize QDeclarativeTextureFactory::textureSize() const + \fn QSize QQuickTextureFactory::textureSize() const Returns the size of the texture. This function will be called from arbitrary threads and should not rely on an OpenGL context bound. @@ -92,16 +92,16 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() /*! - \class QDeclarativeImageProvider + \class QQmlImageProvider \since 4.7 - \brief The QDeclarativeImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML. + \brief The QQmlImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML. - QDeclarativeImageProvider is used to provide advanced image loading features + QQmlImageProvider is used to provide advanced image loading features in QML applications. It allows images in QML to be: \list \o Loaded using QPixmaps rather than actual image files - \o Loaded asynchronously in a separate thread, if imageType() is \l{QDeclarativeImageProvider::ImageType}{ImageType::Image} + \o Loaded asynchronously in a separate thread, if imageType() is \l{QQmlImageProvider::ImageType}{ImageType::Image} \endlist To specify that an image should be loaded by an image provider, use the @@ -115,7 +115,7 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() This specifies that the image should be loaded by the image provider named "myimageprovider", and the image to be loaded is named "image.png". The QML engine invokes the appropriate image provider according to the providers that have - been registered through QDeclarativeEngine::addImageProvider(). + been registered through QQmlEngine::addImageProvider(). Note that the identifiers are case-insensitive, but the rest of the URL will be passed on with preserved case. For example, the below snippet would still specify that the image is loaded by the @@ -157,7 +157,7 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() { ... - QDeclarativeEngine engine; + QQmlEngine engine; engine->addImageProvider(QLatin1String("colors"), new ColorPixmapProvider); ... @@ -170,7 +170,7 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() A complete example is available in Qt's \l {declarative/cppextensions/imageprovider}{examples/declarative/cppextensions/imageprovider} - directory. Note the example registers the provider via a \l{QDeclarativeExtensionPlugin}{plugin} + directory. Note the example registers the provider via a \l{QQmlExtensionPlugin}{plugin} instead of registering it in the application \c main() function as shown above. @@ -193,7 +193,7 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() \section2 Image caching - Images returned by a QDeclarativeImageProvider are automatically cached, + Images returned by a QQmlImageProvider are automatically cached, similar to any image loaded by the QML engine. When an image with a "image://" prefix is loaded from cache, requestImage() and requestPixmap() will not be called for the relevant image provider. If an image should always @@ -201,11 +201,11 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() \c cache property to \c false for the relevant \l Image, \l BorderImage or \l AnimatedImage object. - \sa QDeclarativeEngine::addImageProvider() + \sa QQmlEngine::addImageProvider() */ /*! - \enum QDeclarativeImageProvider::ImageType + \enum QQmlImageProvider::ImageType Defines the type of image supported by this image provider. @@ -220,18 +220,18 @@ QDeclarativeTextureFactory::~QDeclarativeTextureFactory() /*! Creates an image provider that will provide images of the given \a type. */ -QDeclarativeImageProvider::QDeclarativeImageProvider(ImageType type) - : d(new QDeclarativeImageProviderPrivate) +QQmlImageProvider::QQmlImageProvider(ImageType type) + : d(new QQmlImageProviderPrivate) { d->type = type; } /*! - Destroys the QDeclarativeImageProvider + Destroys the QQmlImageProvider \note The destructor of your derived class need to be thread safe. */ -QDeclarativeImageProvider::~QDeclarativeImageProvider() +QQmlImageProvider::~QQmlImageProvider() { delete d; } @@ -239,7 +239,7 @@ QDeclarativeImageProvider::~QDeclarativeImageProvider() /*! Returns the image type supported by this provider. */ -QDeclarativeImageProvider::ImageType QDeclarativeImageProvider::imageType() const +QQmlImageProvider::ImageType QQmlImageProvider::imageType() const { return d->type; } @@ -263,7 +263,7 @@ QDeclarativeImageProvider::ImageType QDeclarativeImageProvider::imageType() cons \note this method may be called by multiple threads, so ensure the implementation of this method is reentrant. */ -QImage QDeclarativeImageProvider::requestImage(const QString &id, QSize *size, const QSize& requestedSize) +QImage QQmlImageProvider::requestImage(const QString &id, QSize *size, const QSize& requestedSize) { Q_UNUSED(id); Q_UNUSED(size); @@ -289,7 +289,7 @@ QImage QDeclarativeImageProvider::requestImage(const QString &id, QSize *size, c is used to set the \l {Item::}{width} and \l {Item::}{height} of the relevant \l Image if these values have not been set explicitly. */ -QPixmap QDeclarativeImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize) +QPixmap QQmlImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize) { Q_UNUSED(id); Q_UNUSED(size); @@ -320,7 +320,7 @@ QPixmap QDeclarativeImageProvider::requestPixmap(const QString &id, QSize *size, implementation of this method is reentrant. */ -QDeclarativeTextureFactory *QDeclarativeImageProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize) +QQuickTextureFactory *QQmlImageProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize) { Q_UNUSED(id); Q_UNUSED(size); diff --git a/src/declarative/qml/qdeclarativeimageprovider.h b/src/qml/qml/qqmlimageprovider.h index 55a5ca2d23..d59cfc42ca 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.h +++ b/src/qml/qml/qqmlimageprovider.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEIMAGEPROVIDER_H -#define QDECLARATIVEIMAGEPROVIDER_H +#ifndef QQMLIMAGEPROVIDER_H +#define QQMLIMAGEPROVIDER_H +#include <QtQml/qtqmlglobal.h> #include <QtGui/qimage.h> #include <QtGui/qpixmap.h> @@ -50,22 +51,22 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeImageProviderPrivate; +class QQmlImageProviderPrivate; class QSGTexture; class QQuickCanvas; -class Q_DECLARATIVE_EXPORT QDeclarativeTextureFactory : public QObject +class Q_QML_EXPORT QQuickTextureFactory : public QObject { public: - QDeclarativeTextureFactory(); - ~QDeclarativeTextureFactory(); + QQuickTextureFactory(); + ~QQuickTextureFactory(); virtual QSGTexture *createTexture(QQuickCanvas *canvas) const = 0; virtual QSize textureSize() const = 0; virtual int textureByteCount() const = 0; }; -class Q_DECLARATIVE_EXPORT QDeclarativeImageProvider +class Q_QML_EXPORT QQmlImageProvider { public: enum ImageType { @@ -75,21 +76,21 @@ public: Invalid }; - QDeclarativeImageProvider(ImageType type); - virtual ~QDeclarativeImageProvider(); + QQmlImageProvider(ImageType type); + virtual ~QQmlImageProvider(); ImageType imageType() const; virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize); virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize); - virtual QDeclarativeTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize); + virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize); private: - QDeclarativeImageProviderPrivate *d; + QQmlImageProviderPrivate *d; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEIMAGEPROVIDER +#endif // QQMLIMAGEPROVIDER diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/qml/qml/qqmlimport.cpp index a8d9035079..6e74536fa3 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativeimport_p.h" +#include "qqmlimport_p.h" #include <QtCore/qdebug.h> #include <QtCore/qdir.h> #include <QtCore/qfileinfo.h> #include <QtCore/qpluginloader.h> #include <QtCore/qlibraryinfo.h> -#include <QtDeclarative/qdeclarativeextensioninterface.h> -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativetypenamecache_p.h> -#include <private/qdeclarativeengine_p.h> +#include <QtQml/qqmlextensioninterface.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmltypenamecache_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE @@ -84,7 +84,7 @@ QString resolveLocalUrl(const QString &url, const QString &relative) typedef QMap<QString, QString> StringStringMap; Q_GLOBAL_STATIC(StringStringMap, qmlEnginePluginsWithRegisteredTypes); // stores the uri -class QDeclarativeImportedNamespace +class QQmlImportedNamespace { public: struct Data { @@ -93,62 +93,62 @@ public: int majversion; int minversion; bool isLibrary; - QDeclarativeDirComponents qmlDirComponents; - QDeclarativeDirScripts qmlDirScripts; + QQmlDirComponents qmlDirComponents; + QQmlDirScripts qmlDirScripts; }; QList<Data> imports; - bool find_helper(QDeclarativeTypeLoader *typeLoader, const Data &data, const QString& type, int *vmajor, int *vminor, - QDeclarativeType** type_return, QString* url_return, + bool find_helper(QQmlTypeLoader *typeLoader, const Data &data, const QString& type, int *vmajor, int *vminor, + QQmlType** type_return, QString* url_return, QString *base = 0, bool *typeRecursionDetected = 0); - bool find(QDeclarativeTypeLoader *typeLoader, const QString& type, int *vmajor, int *vminor, QDeclarativeType** type_return, - QString* url_return, QString *base = 0, QList<QDeclarativeError> *errors = 0); + bool find(QQmlTypeLoader *typeLoader, const QString& type, int *vmajor, int *vminor, QQmlType** type_return, + QString* url_return, QString *base = 0, QList<QQmlError> *errors = 0); }; -class QDeclarativeImportsPrivate { +class QQmlImportsPrivate { public: - QDeclarativeImportsPrivate(QDeclarativeTypeLoader *loader); - ~QDeclarativeImportsPrivate(); + QQmlImportsPrivate(QQmlTypeLoader *loader); + ~QQmlImportsPrivate(); bool importExtension(const QString &absoluteFilePath, const QString &uri, - QDeclarativeImportDatabase *database, QDeclarativeDirComponents* components, - QDeclarativeDirScripts *scripts, - QList<QDeclarativeError> *errors); + QQmlImportDatabase *database, QQmlDirComponents* components, + QQmlDirScripts *scripts, + QList<QQmlError> *errors); - QString resolvedUri(const QString &dir_arg, QDeclarativeImportDatabase *database); - bool add(const QDeclarativeDirComponents &qmldircomponentsnetwork, + QString resolvedUri(const QString &dir_arg, QQmlImportDatabase *database); + bool add(const QQmlDirComponents &qmldircomponentsnetwork, const QString& uri_arg, const QString& prefix, - int vmaj, int vmin, QDeclarativeScript::Import::Type importType, - QDeclarativeImportDatabase *database, QList<QDeclarativeError> *errors); + int vmaj, int vmin, QQmlScript::Import::Type importType, + QQmlImportDatabase *database, QList<QQmlError> *errors); bool find(const QString& type, int *vmajor, int *vminor, - QDeclarativeType** type_return, QString* url_return, QList<QDeclarativeError> *errors); + QQmlType** type_return, QString* url_return, QList<QQmlError> *errors); - QDeclarativeImportedNamespace *findNamespace(const QString& type); + QQmlImportedNamespace *findNamespace(const QString& type); QUrl baseUrl; QString base; int ref; QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded; - QDeclarativeImportedNamespace unqualifiedset; - QHash<QString,QDeclarativeImportedNamespace* > set; - QDeclarativeTypeLoader *typeLoader; + QQmlImportedNamespace unqualifiedset; + QHash<QString,QQmlImportedNamespace* > set; + QQmlTypeLoader *typeLoader; }; /*! -\class QDeclarativeImports -\brief The QDeclarativeImports class encapsulates one QML document's import statements. +\class QQmlImports +\brief The QQmlImports class encapsulates one QML document's import statements. \internal */ -QDeclarativeImports::QDeclarativeImports(const QDeclarativeImports ©) +QQmlImports::QQmlImports(const QQmlImports ©) : d(copy.d) { ++d->ref; } -QDeclarativeImports & -QDeclarativeImports::operator =(const QDeclarativeImports ©) +QQmlImports & +QQmlImports::operator =(const QQmlImports ©) { ++copy.d->ref; if (--d->ref == 0) @@ -157,12 +157,12 @@ QDeclarativeImports::operator =(const QDeclarativeImports ©) return *this; } -QDeclarativeImports::QDeclarativeImports(QDeclarativeTypeLoader *typeLoader) - : d(new QDeclarativeImportsPrivate(typeLoader)) +QQmlImports::QQmlImports(QQmlTypeLoader *typeLoader) + : d(new QQmlImportsPrivate(typeLoader)) { } -QDeclarativeImports::~QDeclarativeImports() +QQmlImports::~QQmlImports() { if (--d->ref == 0) delete d; @@ -171,7 +171,7 @@ QDeclarativeImports::~QDeclarativeImports() /*! Sets the base URL to be used for all relative file imports added. */ -void QDeclarativeImports::setBaseUrl(const QUrl& url, const QString &urlString) +void QQmlImports::setBaseUrl(const QUrl& url, const QString &urlString) { d->baseUrl = url; @@ -186,55 +186,55 @@ void QDeclarativeImports::setBaseUrl(const QUrl& url, const QString &urlString) /*! Returns the base URL to be used for all relative file imports added. */ -QUrl QDeclarativeImports::baseUrl() const +QUrl QQmlImports::baseUrl() const { return d->baseUrl; } -void QDeclarativeImports::populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const +void QQmlImports::populateCache(QQmlTypeNameCache *cache, QQmlEngine *engine) const { - const QDeclarativeImportedNamespace &set = d->unqualifiedset; + const QQmlImportedNamespace &set = d->unqualifiedset; for (int ii = set.imports.count() - 1; ii >= 0; --ii) { - const QDeclarativeImportedNamespace::Data &data = set.imports.at(ii); - QDeclarativeTypeModule *module = QDeclarativeMetaType::typeModule(data.uri, data.majversion); + const QQmlImportedNamespace::Data &data = set.imports.at(ii); + QQmlTypeModule *module = QQmlMetaType::typeModule(data.uri, data.majversion); if (module) - cache->m_anonymousImports.append(QDeclarativeTypeModuleVersion(module, data.minversion)); + cache->m_anonymousImports.append(QQmlTypeModuleVersion(module, data.minversion)); } - for (QHash<QString,QDeclarativeImportedNamespace* >::ConstIterator iter = d->set.begin(); + for (QHash<QString,QQmlImportedNamespace* >::ConstIterator iter = d->set.begin(); iter != d->set.end(); ++iter) { - const QDeclarativeImportedNamespace &set = *iter.value(); + const QQmlImportedNamespace &set = *iter.value(); for (int ii = set.imports.count() - 1; ii >= 0; --ii) { - const QDeclarativeImportedNamespace::Data &data = set.imports.at(ii); - QDeclarativeTypeModule *module = QDeclarativeMetaType::typeModule(data.uri, data.majversion); + const QQmlImportedNamespace::Data &data = set.imports.at(ii); + QQmlTypeModule *module = QQmlMetaType::typeModule(data.uri, data.majversion); if (module) { - QDeclarativeTypeNameCache::Import &import = cache->m_namedImports[iter.key()]; - import.modules.append(QDeclarativeTypeModuleVersion(module, data.minversion)); + QQmlTypeNameCache::Import &import = cache->m_namedImports[iter.key()]; + import.modules.append(QQmlTypeModuleVersion(module, data.minversion)); } - QDeclarativeMetaType::ModuleApi moduleApi = QDeclarativeMetaType::moduleApi(data.uri, data.majversion, data.minversion); + QQmlMetaType::ModuleApi moduleApi = QQmlMetaType::moduleApi(data.uri, data.majversion, data.minversion); if (moduleApi.script || moduleApi.qobject) { - QDeclarativeTypeNameCache::Import &import = cache->m_namedImports[iter.key()]; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlTypeNameCache::Import &import = cache->m_namedImports[iter.key()]; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); import.moduleApi = ep->moduleApiInstance(moduleApi); } } } } -QList<QDeclarativeImports::ScriptReference> QDeclarativeImports::resolvedScripts() const +QList<QQmlImports::ScriptReference> QQmlImports::resolvedScripts() const { - QList<QDeclarativeImports::ScriptReference> scripts; + QList<QQmlImports::ScriptReference> scripts; - const QDeclarativeImportedNamespace &set = d->unqualifiedset; + const QQmlImportedNamespace &set = d->unqualifiedset; for (int ii = set.imports.count() - 1; ii >= 0; --ii) { - const QDeclarativeImportedNamespace::Data &data = set.imports.at(ii); + const QQmlImportedNamespace::Data &data = set.imports.at(ii); - foreach (const QDeclarativeDirParser::Script &script, data.qmlDirScripts) { + foreach (const QQmlDirParser::Script &script, data.qmlDirScripts) { ScriptReference ref; ref.nameSpace = script.nameSpace; ref.location = QUrl(data.url).resolved(QUrl(script.fileName)); @@ -242,15 +242,15 @@ QList<QDeclarativeImports::ScriptReference> QDeclarativeImports::resolvedScripts } } - for (QHash<QString,QDeclarativeImportedNamespace* >::ConstIterator iter = d->set.constBegin(); + for (QHash<QString,QQmlImportedNamespace* >::ConstIterator iter = d->set.constBegin(); iter != d->set.constEnd(); ++iter) { - const QDeclarativeImportedNamespace &set = *iter.value(); + const QQmlImportedNamespace &set = *iter.value(); for (int ii = set.imports.count() - 1; ii >= 0; --ii) { - const QDeclarativeImportedNamespace::Data &data = set.imports.at(ii); + const QQmlImportedNamespace::Data &data = set.imports.at(ii); - foreach (const QDeclarativeDirParser::Script &script, data.qmlDirScripts) { + foreach (const QQmlDirParser::Script &script, data.qmlDirScripts) { ScriptReference ref; ref.nameSpace = script.nameSpace; ref.qualifier = iter.key(); @@ -268,8 +268,8 @@ QList<QDeclarativeImports::ScriptReference> QDeclarativeImports::resolvedScripts The given (namespace qualified) \a type is resolved to either \list - \o a QDeclarativeImportedNamespace stored at \a ns_return, - \o a QDeclarativeType stored at \a type_return, or + \o a QQmlImportedNamespace stored at \a ns_return, + \o a QQmlType stored at \a type_return, or \o a component located at \a url_return. \endlist @@ -277,11 +277,11 @@ QList<QDeclarativeImports::ScriptReference> QDeclarativeImports::resolvedScripts \sa addImport() */ -bool QDeclarativeImports::resolveType(const QString& type, - QDeclarativeType** type_return, QString* url_return, int *vmaj, int *vmin, - QDeclarativeImportedNamespace** ns_return, QList<QDeclarativeError> *errors) const +bool QQmlImports::resolveType(const QString& type, + QQmlType** type_return, QString* url_return, int *vmaj, int *vmin, + QQmlImportedNamespace** ns_return, QList<QQmlError> *errors) const { - QDeclarativeImportedNamespace* ns = d->findNamespace(type); + QQmlImportedNamespace* ns = d->findNamespace(type); if (ns) { if (ns_return) *ns_return = ns; @@ -291,13 +291,13 @@ bool QDeclarativeImports::resolveType(const QString& type, if (d->find(type,vmaj,vmin,type_return,url_return, errors)) { if (qmlImportTrace()) { if (type_return && *type_return && url_return && !url_return->isEmpty()) - qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " + qDebug().nospace() << "QQmlImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " << type << " => " << (*type_return)->typeName() << " " << *url_return; if (type_return && *type_return) - qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " + qDebug().nospace() << "QQmlImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " << type << " => " << (*type_return)->typeName(); if (url_return && !url_return->isEmpty()) - qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " + qDebug().nospace() << "QQmlImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " << type << " => " << *url_return; } return true; @@ -311,20 +311,20 @@ bool QDeclarativeImports::resolveType(const QString& type, Searching \e only in the namespace \a ns (previously returned in a call to resolveType(), \a type is found and returned to either - a QDeclarativeType stored at \a type_return, or + a QQmlType stored at \a type_return, or a component located at \a url_return. If either return pointer is 0, the corresponding search is not done. */ -bool QDeclarativeImports::resolveType(QDeclarativeImportedNamespace* ns, const QString& type, - QDeclarativeType** type_return, QString* url_return, +bool QQmlImports::resolveType(QQmlImportedNamespace* ns, const QString& type, + QQmlType** type_return, QString* url_return, int *vmaj, int *vmin) const { return ns->find(d->typeLoader,type,vmaj,vmin,type_return,url_return); } -bool QDeclarativeImportedNamespace::find_helper(QDeclarativeTypeLoader *typeLoader, const Data &data, const QString& type, int *vmajor, int *vminor, - QDeclarativeType** type_return, QString* url_return, +bool QQmlImportedNamespace::find_helper(QQmlTypeLoader *typeLoader, const Data &data, const QString& type, int *vmajor, int *vminor, + QQmlType** type_return, QString* url_return, QString *base, bool *typeRecursionDetected) { int vmaj = data.majversion; @@ -332,7 +332,7 @@ bool QDeclarativeImportedNamespace::find_helper(QDeclarativeTypeLoader *typeLoad if (vmaj >= 0 && vmin >= 0) { QString qt = data.uri + QLatin1Char('/') + type; - QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin); + QQmlType *t = QQmlMetaType::qmlType(qt,vmaj,vmin); if (t) { if (vmajor) *vmajor = vmaj; if (vminor) *vminor = vmin; @@ -342,10 +342,10 @@ bool QDeclarativeImportedNamespace::find_helper(QDeclarativeTypeLoader *typeLoad } } - const QDeclarativeDirComponents &qmldircomponents = data.qmlDirComponents; + const QQmlDirComponents &qmldircomponents = data.qmlDirComponents; bool typeWasDeclaredInQmldir = false; if (!qmldircomponents.isEmpty()) { - foreach (const QDeclarativeDirParser::Component &c, qmldircomponents) { + foreach (const QQmlDirParser::Component &c, qmldircomponents) { if (c.typeName == type) { typeWasDeclaredInQmldir = true; // importing version -1 means import ALL versions @@ -372,7 +372,7 @@ bool QDeclarativeImportedNamespace::find_helper(QDeclarativeTypeLoader *typeLoad if (!typeWasDeclaredInQmldir && !data.isLibrary) { // XXX search non-files too! (eg. zip files, see QT-524) QString url(data.url + type + QLatin1String(".qml")); - QString file = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); + QString file = QQmlEnginePrivate::urlToLocalFileOrQrc(url); if (!typeLoader->absoluteFilePath(file).isEmpty()) { if (base && *base == url) { // no recursion if (typeRecursionDetected) @@ -387,27 +387,27 @@ bool QDeclarativeImportedNamespace::find_helper(QDeclarativeTypeLoader *typeLoad return false; } -QDeclarativeImportsPrivate::QDeclarativeImportsPrivate(QDeclarativeTypeLoader *loader) +QQmlImportsPrivate::QQmlImportsPrivate(QQmlTypeLoader *loader) : ref(1), typeLoader(loader) { } -QDeclarativeImportsPrivate::~QDeclarativeImportsPrivate() +QQmlImportsPrivate::~QQmlImportsPrivate() { - foreach (QDeclarativeImportedNamespace* s, set.values()) + foreach (QQmlImportedNamespace* s, set.values()) delete s; } -bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath, const QString &uri, - QDeclarativeImportDatabase *database, - QDeclarativeDirComponents* components, - QDeclarativeDirScripts* scripts, - QList<QDeclarativeError> *errors) +bool QQmlImportsPrivate::importExtension(const QString &absoluteFilePath, const QString &uri, + QQmlImportDatabase *database, + QQmlDirComponents* components, + QQmlDirScripts* scripts, + QList<QQmlError> *errors) { - const QDeclarativeDirParser *qmldirParser = typeLoader->qmlDirParser(absoluteFilePath); + const QQmlDirParser *qmldirParser = typeLoader->qmlDirParser(absoluteFilePath); if (qmldirParser->hasError()) { if (errors) { - const QList<QDeclarativeError> qmldirErrors = qmldirParser->errors(uri); + const QList<QQmlError> qmldirErrors = qmldirParser->errors(uri); for (int i = 0; i < qmldirErrors.size(); ++i) errors->prepend(qmldirErrors.at(i)); } @@ -415,7 +415,7 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath } if (qmlImportTrace()) - qDebug().nospace() << "QDeclarativeImports(" << qPrintable(base) << "::importExtension: " + qDebug().nospace() << "QQmlImports(" << qPrintable(base) << "::importExtension: " << "loaded " << absoluteFilePath; if (! qmlDirFilesForWhichPluginsHaveBeenLoaded.contains(absoluteFilePath)) { @@ -425,7 +425,7 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath int slash = absoluteFilePath.lastIndexOf(QLatin1Char('/')); if (slash > 0) qmldirPath.truncate(slash); - foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser->plugins()) { + foreach (const QQmlDirParser::Plugin &plugin, qmldirParser->plugins()) { QString resolvedFilePath = database->resolvePlugin(typeLoader, qmldirPath, plugin.path, plugin.name); if (!resolvedFilePath.isEmpty()) { @@ -434,9 +434,9 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath // XXX TODO: should we leave the import plugin error alone? // Here, we pop it off the top and coalesce it into this error's message. // The reason is that the lower level may add url and line/column numbering information. - QDeclarativeError poppedError = errors->takeFirst(); - QDeclarativeError error; - error.setDescription(QDeclarativeImportDatabase::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(poppedError.description())); + QQmlError poppedError = errors->takeFirst(); + QQmlError error; + error.setDescription(QQmlImportDatabase::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(poppedError.description())); error.setUrl(QUrl::fromLocalFile(absoluteFilePath)); errors->prepend(error); } @@ -444,8 +444,8 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath } } else { if (errors) { - QDeclarativeError error; - error.setDescription(QDeclarativeImportDatabase::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name)); + QQmlError error; + error.setDescription(QQmlImportDatabase::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name)); error.setUrl(QUrl::fromLocalFile(absoluteFilePath)); errors->prepend(error); } @@ -462,7 +462,7 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath return true; } -QString QDeclarativeImportsPrivate::resolvedUri(const QString &dir_arg, QDeclarativeImportDatabase *database) +QString QQmlImportsPrivate::resolvedUri(const QString &dir_arg, QQmlImportDatabase *database) { QString dir = dir_arg; if (dir.endsWith(QLatin1Char('/')) || dir.endsWith(QLatin1Char('\\'))) @@ -493,28 +493,28 @@ QString QDeclarativeImportsPrivate::resolvedUri(const QString &dir_arg, QDeclara return stableRelativePath; } -bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomponentsnetwork, +bool QQmlImportsPrivate::add(const QQmlDirComponents &qmldircomponentsnetwork, const QString& uri_arg, const QString& prefix, int vmaj, int vmin, - QDeclarativeScript::Import::Type importType, - QDeclarativeImportDatabase *database, QList<QDeclarativeError> *errors) + QQmlScript::Import::Type importType, + QQmlImportDatabase *database, QList<QQmlError> *errors) { static QLatin1String Slash_qmldir("/qmldir"); static QLatin1Char Slash('/'); - QDeclarativeDirComponents qmldircomponents = qmldircomponentsnetwork; - QDeclarativeDirScripts qmldirscripts; + QQmlDirComponents qmldircomponents = qmldircomponentsnetwork; + QQmlDirScripts qmldirscripts; QString uri = uri_arg; - QDeclarativeImportedNamespace *s; + QQmlImportedNamespace *s; if (prefix.isEmpty()) { s = &unqualifiedset; } else { s = set.value(prefix); if (!s) - set.insert(prefix,(s=new QDeclarativeImportedNamespace)); + set.insert(prefix,(s=new QQmlImportedNamespace)); } QString url = uri; bool versionFound = false; - if (importType == QDeclarativeScript::Import::Library) { + if (importType == QQmlScript::Import::Library) { Q_ASSERT(vmaj >= 0 && vmin >= 0); // Versions are always specified for libraries @@ -592,30 +592,30 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp } } - if (QDeclarativeMetaType::isModule(uri, vmaj, vmin)) + if (QQmlMetaType::isModule(uri, vmaj, vmin)) versionFound = true; if (!versionFound && qmldircomponents.isEmpty() && qmldirscripts.isEmpty()) { if (errors) { - QDeclarativeError error; // we don't set the url or line or column as these will be set by the loader. - if (QDeclarativeMetaType::isAnyModule(uri)) - error.setDescription(QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin)); + QQmlError error; // we don't set the url or line or column as these will be set by the loader. + if (QQmlMetaType::isAnyModule(uri)) + error.setDescription(QQmlImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin)); else - error.setDescription(QDeclarativeImportDatabase::tr("module \"%1\" is not installed").arg(uri_arg)); + error.setDescription(QQmlImportDatabase::tr("module \"%1\" is not installed").arg(uri_arg)); errors->prepend(error); } return false; } } else { - if (importType == QDeclarativeScript::Import::File && qmldircomponents.isEmpty()) { + if (importType == QQmlScript::Import::File && qmldircomponents.isEmpty()) { QString importUrl = resolveLocalUrl(base, uri + Slash_qmldir); - QString localFileOrQrc = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(importUrl); + QString localFileOrQrc = QQmlEnginePrivate::urlToLocalFileOrQrc(importUrl); if (!localFileOrQrc.isEmpty()) { - QString dir = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(resolveLocalUrl(base, uri)); + QString dir = QQmlEnginePrivate::urlToLocalFileOrQrc(resolveLocalUrl(base, uri)); if (!typeLoader->directoryExists(dir)) { if (errors) { - QDeclarativeError error; // we don't set the line or column as these will be set by the loader. - error.setDescription(QDeclarativeImportDatabase::tr("\"%1\": no such directory").arg(uri_arg)); + QQmlError error; // we don't set the line or column as these will be set by the loader. + error.setDescription(QQmlImportDatabase::tr("\"%1\": no such directory").arg(uri_arg)); error.setUrl(QUrl(importUrl)); errors->prepend(error); } @@ -631,14 +631,14 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp } else { if (prefix.isEmpty()) { // directory must at least exist for valid import - QString localFileOrQrc = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(resolveLocalUrl(base, uri)); + QString localFileOrQrc = QQmlEnginePrivate::urlToLocalFileOrQrc(resolveLocalUrl(base, uri)); if (!typeLoader->directoryExists(localFileOrQrc)) { if (errors) { - QDeclarativeError error; // we don't set the line or column as these will be set by the loader. + QQmlError error; // we don't set the line or column as these will be set by the loader. if (localFileOrQrc.isEmpty()) - error.setDescription(QDeclarativeImportDatabase::tr("import \"%1\" has no qmldir and no namespace").arg(uri)); + error.setDescription(QQmlImportDatabase::tr("import \"%1\" has no qmldir and no namespace").arg(uri)); else - error.setDescription(QDeclarativeImportDatabase::tr("\"%1\": no such directory").arg(uri)); + error.setDescription(QQmlImportDatabase::tr("\"%1\": no such directory").arg(uri)); error.setUrl(QUrl(importUrl)); errors->prepend(error); } @@ -655,8 +655,8 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp int lowest_min = INT_MAX; int highest_min = INT_MIN; - QList<QDeclarativeDirParser::Component>::const_iterator cend = qmldircomponents.constEnd(); - for (QList<QDeclarativeDirParser::Component>::const_iterator cit = qmldircomponents.constBegin(); cit != cend; ++cit) { + QList<QQmlDirParser::Component>::const_iterator cend = qmldircomponents.constEnd(); + for (QList<QQmlDirParser::Component>::const_iterator cit = qmldircomponents.constBegin(); cit != cend; ++cit) { if (cit->majorVersion == vmaj) { lowest_min = qMin(lowest_min, cit->minorVersion); highest_min = qMax(highest_min, cit->minorVersion); @@ -665,8 +665,8 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp if (lowest_min > vmin || highest_min < vmin) { if (errors) { - QDeclarativeError error; // we don't set the url or line or column information, as these will be set by the loader. - error.setDescription(QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin)); + QQmlError error; // we don't set the url or line or column information, as these will be set by the loader. + error.setDescription(QQmlImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin)); errors->prepend(error); } return false; @@ -676,28 +676,28 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp if (!url.endsWith(Slash)) url += Slash; - QMap<QString, QDeclarativeDirParser::Script> scripts; + QMap<QString, QQmlDirParser::Script> scripts; if (!qmldirscripts.isEmpty()) { // Verify that we haven't imported these scripts already - QList<QDeclarativeImportedNamespace::Data>::const_iterator end = s->imports.constEnd(); - for (QList<QDeclarativeImportedNamespace::Data>::const_iterator it = s->imports.constBegin(); it != end; ++it) { + QList<QQmlImportedNamespace::Data>::const_iterator end = s->imports.constEnd(); + for (QList<QQmlImportedNamespace::Data>::const_iterator it = s->imports.constBegin(); it != end; ++it) { if (it->uri == uri) { - QDeclarativeError error; - error.setDescription(QDeclarativeImportDatabase::tr("\"%1\" is ambiguous. Found in %2 and in %3").arg(uri).arg(url).arg(it->url)); + QQmlError error; + error.setDescription(QQmlImportDatabase::tr("\"%1\" is ambiguous. Found in %2 and in %3").arg(uri).arg(url).arg(it->url)); errors->prepend(error); return false; } } - QList<QDeclarativeDirParser::Script>::const_iterator send = qmldirscripts.constEnd(); - for (QList<QDeclarativeDirParser::Script>::const_iterator sit = qmldirscripts.constBegin(); sit != send; ++sit) { + QList<QQmlDirParser::Script>::const_iterator send = qmldirscripts.constEnd(); + for (QList<QQmlDirParser::Script>::const_iterator sit = qmldirscripts.constBegin(); sit != send; ++sit) { // Only include scripts that match our requested version if (((vmaj == -1) || (sit->majorVersion == vmaj)) && ((vmin == -1) || (sit->minorVersion <= vmin))) { // Load the highest version that matches - QMap<QString, QDeclarativeDirParser::Script>::iterator it = scripts.find(sit->nameSpace); + QMap<QString, QQmlDirParser::Script>::iterator it = scripts.find(sit->nameSpace); if (it == scripts.end() || (it->minorVersion < sit->minorVersion)) { scripts.insert(sit->nameSpace, *sit); } @@ -705,12 +705,12 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp } } - QDeclarativeImportedNamespace::Data data; + QQmlImportedNamespace::Data data; data.uri = uri; data.url = url; data.majversion = vmaj; data.minversion = vmin; - data.isLibrary = importType == QDeclarativeScript::Import::Library; + data.isLibrary = importType == QQmlScript::Import::Library; data.qmlDirComponents = qmldircomponents; data.qmlDirScripts = scripts.values(); @@ -719,18 +719,18 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp return true; } -bool QDeclarativeImportsPrivate::find(const QString& type, int *vmajor, int *vminor, QDeclarativeType** type_return, - QString* url_return, QList<QDeclarativeError> *errors) +bool QQmlImportsPrivate::find(const QString& type, int *vmajor, int *vminor, QQmlType** type_return, + QString* url_return, QList<QQmlError> *errors) { - QDeclarativeImportedNamespace *s = 0; + QQmlImportedNamespace *s = 0; int slash = type.indexOf(QLatin1Char('/')); if (slash >= 0) { QString namespaceName = type.left(slash); s = set.value(namespaceName); if (!s) { if (errors) { - QDeclarativeError error; - error.setDescription(QDeclarativeImportDatabase::tr("- %1 is not a namespace").arg(namespaceName)); + QQmlError error; + error.setDescription(QQmlImportDatabase::tr("- %1 is not a namespace").arg(namespaceName)); errors->prepend(error); } return false; @@ -738,8 +738,8 @@ bool QDeclarativeImportsPrivate::find(const QString& type, int *vmajor, int *vmi int nslash = type.indexOf(QLatin1Char('/'),slash+1); if (nslash > 0) { if (errors) { - QDeclarativeError error; - error.setDescription(QDeclarativeImportDatabase::tr("- nested namespaces not allowed")); + QQmlError error; + error.setDescription(QQmlImportDatabase::tr("- nested namespaces not allowed")); errors->prepend(error); } return false; @@ -761,13 +761,13 @@ bool QDeclarativeImportsPrivate::find(const QString& type, int *vmajor, int *vmi return false; } -QDeclarativeImportedNamespace *QDeclarativeImportsPrivate::findNamespace(const QString& type) +QQmlImportedNamespace *QQmlImportsPrivate::findNamespace(const QString& type) { return set.value(type); } -bool QDeclarativeImportedNamespace::find(QDeclarativeTypeLoader *typeLoader, const QString& type, int *vmajor, int *vminor, QDeclarativeType** type_return, - QString* url_return, QString *base, QList<QDeclarativeError> *errors) +bool QQmlImportedNamespace::find(QQmlTypeLoader *typeLoader, const QString& type, int *vmajor, int *vminor, QQmlType** type_return, + QString* url_return, QString *base, QList<QQmlError> *errors) { bool typeRecursionDetected = false; for (int i=0; i<imports.count(); ++i) { @@ -788,19 +788,19 @@ bool QDeclarativeImportedNamespace::find(QDeclarativeTypeLoader *typeLoader, con if (u1.startsWith(b)) u1 = u1.mid(b.count()); else if (u1 == l) - u1 = QDeclarativeImportDatabase::tr("local directory"); + u1 = QQmlImportDatabase::tr("local directory"); if (u2.startsWith(b)) u2 = u2.mid(b.count()); else if (u2 == l) - u2 = QDeclarativeImportDatabase::tr("local directory"); + u2 = QQmlImportDatabase::tr("local directory"); } } - QDeclarativeError error; + QQmlError error; if (u1 != u2) { - error.setDescription(QDeclarativeImportDatabase::tr("is ambiguous. Found in %1 and in %2").arg(u1).arg(u2)); + error.setDescription(QQmlImportDatabase::tr("is ambiguous. Found in %1 and in %2").arg(u1).arg(u2)); } else { - error.setDescription(QDeclarativeImportDatabase::tr("is ambiguous. Found in %1 in version %2.%3 and %4.%5") + error.setDescription(QQmlImportDatabase::tr("is ambiguous. Found in %1 in version %2.%3 and %4.%5") .arg(u1) .arg(imports.at(i).majversion).arg(imports.at(i).minversion) .arg(imports.at(j).majversion).arg(imports.at(j).minversion)); @@ -815,22 +815,22 @@ bool QDeclarativeImportedNamespace::find(QDeclarativeTypeLoader *typeLoader, con } } if (errors) { - QDeclarativeError error; + QQmlError error; if (typeRecursionDetected) - error.setDescription(QDeclarativeImportDatabase::tr("is instantiated recursively")); + error.setDescription(QQmlImportDatabase::tr("is instantiated recursively")); else - error.setDescription(QDeclarativeImportDatabase::tr("is not a type")); + error.setDescription(QQmlImportDatabase::tr("is not a type")); errors->prepend(error); } return false; } /*! -\class QDeclarativeImportDatabase -\brief The QDeclarativeImportDatabase class manages the QML imports for a QDeclarativeEngine. +\class QQmlImportDatabase +\brief The QQmlImportDatabase class manages the QML imports for a QQmlEngine. \internal */ -QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) +QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) : engine(e) { filePluginPath << QLatin1String("."); @@ -858,7 +858,7 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) addImportPath(QCoreApplication::applicationDirPath()); } -QDeclarativeImportDatabase::~QDeclarativeImportDatabase() +QQmlImportDatabase::~QQmlImportDatabase() { } @@ -876,16 +876,16 @@ QDeclarativeImportDatabase::~QDeclarativeImportDatabase() The base URL must already have been set with Import::setBaseUrl(). */ -bool QDeclarativeImports::addImport(QDeclarativeImportDatabase *importDb, +bool QQmlImports::addImport(QQmlImportDatabase *importDb, const QString& uri, const QString& prefix, int vmaj, int vmin, - QDeclarativeScript::Import::Type importType, - const QDeclarativeDirComponents &qmldircomponentsnetwork, - QList<QDeclarativeError> *errors) + QQmlScript::Import::Type importType, + const QQmlDirComponents &qmldircomponentsnetwork, + QList<QQmlError> *errors) { if (qmlImportTrace()) - qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::addImport: " + qDebug().nospace() << "QQmlImports(" << qPrintable(baseUrl().toString()) << ")" << "::addImport: " << uri << " " << vmaj << '.' << vmin << " " - << (importType==QDeclarativeScript::Import::Library? "Library" : "File") + << (importType==QQmlScript::Import::Library? "Library" : "File") << " as " << prefix; return d->add(qmldircomponentsnetwork, uri, prefix, vmaj, vmin, importType, importDb, errors); @@ -899,7 +899,7 @@ bool QDeclarativeImports::addImport(QDeclarativeImportDatabase *importDb, \a qmldirPath is the location of the qmldir file. */ -QString QDeclarativeImportDatabase::resolvePlugin(QDeclarativeTypeLoader *typeLoader, +QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, const QString &qmldirPath, const QString &qmldirPluginPath, const QString &baseName, const QStringList &suffixes, const QString &prefix) @@ -944,7 +944,7 @@ QString QDeclarativeImportDatabase::resolvePlugin(QDeclarativeTypeLoader *typeLo } if (qmlImportTrace()) - qDebug() << "QDeclarativeImportDatabase::resolvePlugin: Could not resolve plugin" << baseName + qDebug() << "QQmlImportDatabase::resolvePlugin: Could not resolve plugin" << baseName << "in" << qmldirPath; return QString(); @@ -966,7 +966,7 @@ QString QDeclarativeImportDatabase::resolvePlugin(QDeclarativeTypeLoader *typeLo Version number on unix are ignored. */ -QString QDeclarativeImportDatabase::resolvePlugin(QDeclarativeTypeLoader *typeLoader, +QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, const QString &qmldirPath, const QString &qmldirPluginPath, const QString &baseName) { @@ -1024,7 +1024,7 @@ QString QDeclarativeImportDatabase::resolvePlugin(QDeclarativeTypeLoader *typeLo /*! \internal */ -QStringList QDeclarativeImportDatabase::pluginPathList() const +QStringList QQmlImportDatabase::pluginPathList() const { return filePluginPath; } @@ -1032,7 +1032,7 @@ QStringList QDeclarativeImportDatabase::pluginPathList() const /*! \internal */ -void QDeclarativeImportDatabase::setPluginPathList(const QStringList &paths) +void QQmlImportDatabase::setPluginPathList(const QStringList &paths) { filePluginPath = paths; } @@ -1040,10 +1040,10 @@ void QDeclarativeImportDatabase::setPluginPathList(const QStringList &paths) /*! \internal */ -void QDeclarativeImportDatabase::addPluginPath(const QString& path) +void QQmlImportDatabase::addPluginPath(const QString& path) { if (qmlImportTrace()) - qDebug().nospace() << "QDeclarativeImportDatabase::addPluginPath: " << path; + qDebug().nospace() << "QQmlImportDatabase::addPluginPath: " << path; QUrl url = QUrl(path); if (url.isRelative() || url.scheme() == QLatin1String("file") @@ -1058,10 +1058,10 @@ void QDeclarativeImportDatabase::addPluginPath(const QString& path) /*! \internal */ -void QDeclarativeImportDatabase::addImportPath(const QString& path) +void QQmlImportDatabase::addImportPath(const QString& path) { if (qmlImportTrace()) - qDebug().nospace() << "QDeclarativeImportDatabase::addImportPath: " << path; + qDebug().nospace() << "QQmlImportDatabase::addImportPath: " << path; if (path.isEmpty()) return; @@ -1086,7 +1086,7 @@ void QDeclarativeImportDatabase::addImportPath(const QString& path) /*! \internal */ -QStringList QDeclarativeImportDatabase::importPathList() const +QStringList QQmlImportDatabase::importPathList() const { return fileImportPath; } @@ -1094,7 +1094,7 @@ QStringList QDeclarativeImportDatabase::importPathList() const /*! \internal */ -void QDeclarativeImportDatabase::setImportPathList(const QStringList &paths) +void QQmlImportDatabase::setImportPathList(const QStringList &paths) { fileImportPath = paths; } @@ -1102,10 +1102,10 @@ void QDeclarativeImportDatabase::setImportPathList(const QStringList &paths) /*! \internal */ -bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QString &uri, QList<QDeclarativeError> *errors) +bool QQmlImportDatabase::importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors) { if (qmlImportTrace()) - qDebug().nospace() << "QDeclarativeImportDatabase::importPlugin: " << uri << " from " << filePath; + qDebug().nospace() << "QQmlImportDatabase::importPlugin: " << uri << " from " << filePath; #ifndef QT_NO_LIBRARY QFileInfo fileInfo(filePath); @@ -1116,14 +1116,14 @@ bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QSt if (typesRegistered) { Q_ASSERT_X(qmlEnginePluginsWithRegisteredTypes()->value(absoluteFilePath) == uri, - "QDeclarativeImportDatabase::importExtension", + "QQmlImportDatabase::importExtension", "Internal error: Plugin imported previously with different uri"); } if (!engineInitialized || !typesRegistered) { - if (!QDeclarative_isFileCaseCorrect(absoluteFilePath)) { + if (!QQml_isFileCaseCorrect(absoluteFilePath)) { if (errors) { - QDeclarativeError error; + QQmlError error; error.setDescription(tr("File name case mismatch for \"%1\"").arg(absoluteFilePath)); errors->prepend(error); } @@ -1133,7 +1133,7 @@ bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QSt if (!loader.load()) { if (errors) { - QDeclarativeError error; + QQmlError error; error.setDescription(loader.errorString()); errors->prepend(error); } @@ -1141,7 +1141,7 @@ bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QSt } QObject *instance = loader.instance(); - if (QDeclarativeTypesExtensionInterface *iface = qobject_cast<QDeclarativeExtensionInterface *>(instance)) { + if (QQmlTypesExtensionInterface *iface = qobject_cast<QQmlExtensionInterface *>(instance)) { const QByteArray bytes = uri.toUtf8(); const char *moduleId = bytes.constData(); @@ -1157,16 +1157,16 @@ bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QSt // XXX protect against double initialization initializedPlugins.insert(absoluteFilePath); - QDeclarativeExtensionInterface *eiface = - qobject_cast<QDeclarativeExtensionInterface *>(instance); + QQmlExtensionInterface *eiface = + qobject_cast<QQmlExtensionInterface *>(instance); if (eiface) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); ep->typeLoader.initializeEngine(eiface, moduleId); } } } else { if (errors) { - QDeclarativeError error; + QQmlError error; error.setDescription(loader.errorString()); errors->prepend(error); } diff --git a/src/declarative/qml/qdeclarativeimport_p.h b/src/qml/qml/qqmlimport_p.h index 6dae0f38b9..ff19510525 100644 --- a/src/declarative/qml/qdeclarativeimport_p.h +++ b/src/qml/qml/qqmlimport_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEIMPORT_P_H -#define QDECLARATIVEIMPORT_P_H +#ifndef QQMLIMPORT_P_H +#define QQMLIMPORT_P_H #include <QtCore/qurl.h> #include <QtCore/qcoreapplication.h> #include <QtCore/qset.h> #include <QtCore/qstringlist.h> -#include <private/qdeclarativedirparser_p.h> -#include <private/qdeclarativescript_p.h> -#include <private/qdeclarativemetatype_p.h> +#include <private/qqmldirparser_p.h> +#include <private/qqmlscript_p.h> +#include <private/qqmlmetatype_p.h> // // W A R N I N G @@ -63,43 +63,43 @@ QT_BEGIN_NAMESPACE -class QDeclarativeTypeNameCache; -class QDeclarativeEngine; +class QQmlTypeNameCache; +class QQmlEngine; class QDir; -class QDeclarativeImportedNamespace; -class QDeclarativeImportsPrivate; -class QDeclarativeImportDatabase; -class QDeclarativeTypeLoader; +class QQmlImportedNamespace; +class QQmlImportsPrivate; +class QQmlImportDatabase; +class QQmlTypeLoader; // Exported for QtQuick1 -class Q_DECLARATIVE_EXPORT QDeclarativeImports +class Q_QML_EXPORT QQmlImports { public: - QDeclarativeImports(QDeclarativeTypeLoader *); - QDeclarativeImports(const QDeclarativeImports &); - ~QDeclarativeImports(); - QDeclarativeImports &operator=(const QDeclarativeImports &); + QQmlImports(QQmlTypeLoader *); + QQmlImports(const QQmlImports &); + ~QQmlImports(); + QQmlImports &operator=(const QQmlImports &); void setBaseUrl(const QUrl &url, const QString &urlString = QString()); QUrl baseUrl() const; bool resolveType(const QString& type, - QDeclarativeType** type_return, QString* url_return, + QQmlType** type_return, QString* url_return, int *version_major, int *version_minor, - QDeclarativeImportedNamespace** ns_return, - QList<QDeclarativeError> *errors = 0) const; - bool resolveType(QDeclarativeImportedNamespace*, + QQmlImportedNamespace** ns_return, + QList<QQmlError> *errors = 0) const; + bool resolveType(QQmlImportedNamespace*, const QString& type, - QDeclarativeType** type_return, QString* url_return, + QQmlType** type_return, QString* url_return, int *version_major, int *version_minor) const; - bool addImport(QDeclarativeImportDatabase *, + bool addImport(QQmlImportDatabase *, const QString& uri, const QString& prefix, int vmaj, int vmin, - QDeclarativeScript::Import::Type importType, - const QDeclarativeDirComponents &qmldircomponentsnetwork, - QList<QDeclarativeError> *errors); + QQmlScript::Import::Type importType, + const QQmlDirComponents &qmldircomponentsnetwork, + QList<QQmlError> *errors); - void populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const; + void populateCache(QQmlTypeNameCache *cache, QQmlEngine *) const; struct ScriptReference { @@ -111,18 +111,18 @@ public: QList<ScriptReference> resolvedScripts() const; private: - friend class QDeclarativeImportDatabase; - QDeclarativeImportsPrivate *d; + friend class QQmlImportDatabase; + QQmlImportsPrivate *d; }; -class QDeclarativeImportDatabase +class QQmlImportDatabase { - Q_DECLARE_TR_FUNCTIONS(QDeclarativeImportDatabase) + Q_DECLARE_TR_FUNCTIONS(QQmlImportDatabase) public: - QDeclarativeImportDatabase(QDeclarativeEngine *); - ~QDeclarativeImportDatabase(); + QQmlImportDatabase(QQmlEngine *); + ~QQmlImportDatabase(); - bool importPlugin(const QString &filePath, const QString &uri, QList<QDeclarativeError> *errors); + bool importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors); QStringList importPathList() const; void setImportPathList(const QStringList &paths); @@ -133,12 +133,12 @@ public: void addPluginPath(const QString& path); private: - friend class QDeclarativeImportsPrivate; - QString resolvePlugin(QDeclarativeTypeLoader *typeLoader, + friend class QQmlImportsPrivate; + QString resolvePlugin(QQmlTypeLoader *typeLoader, const QString &qmldirPath, const QString &qmldirPluginPath, const QString &baseName, const QStringList &suffixes, const QString &prefix = QString()); - QString resolvePlugin(QDeclarativeTypeLoader *typeLoader, + QString resolvePlugin(QQmlTypeLoader *typeLoader, const QString &qmldirPath, const QString &qmldirPluginPath, const QString &baseName); @@ -148,10 +148,10 @@ private: QStringList fileImportPath; QSet<QString> initializedPlugins; - QDeclarativeEngine *engine; + QQmlEngine *engine; }; QT_END_NAMESPACE -#endif // QDECLARATIVEIMPORT_P_H +#endif // QQMLIMPORT_P_H diff --git a/src/declarative/qml/qdeclarativeincubator.cpp b/src/qml/qml/qqmlincubator.cpp index 38f172f795..ee622ba048 100644 --- a/src/declarative/qml/qdeclarativeincubator.cpp +++ b/src/qml/qml/qqmlincubator.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,58 +39,58 @@ ** ****************************************************************************/ -#include "qdeclarativeincubator.h" -#include "qdeclarativecomponent.h" -#include "qdeclarativeincubator_p.h" +#include "qqmlincubator.h" +#include "qqmlcomponent.h" +#include "qqmlincubator_p.h" -#include "qdeclarativecompiler_p.h" -#include "qdeclarativeexpression_p.h" +#include "qqmlcompiler_p.h" +#include "qqmlexpression_p.h" // XXX TODO // - check that the Component.onCompleted behavior is the same as 4.8 in the synchronous and // async if nested cases -void QDeclarativeEnginePrivate::incubate(QDeclarativeIncubator &i, QDeclarativeContextData *forContext) +void QQmlEnginePrivate::incubate(QQmlIncubator &i, QQmlContextData *forContext) { - QDeclarativeIncubatorPrivate *p = i.d; + QQmlIncubatorPrivate *p = i.d; - QDeclarativeIncubator::IncubationMode mode = i.incubationMode(); + QQmlIncubator::IncubationMode mode = i.incubationMode(); if (!incubationController) - mode = QDeclarativeIncubator::Synchronous; + mode = QQmlIncubator::Synchronous; - if (mode == QDeclarativeIncubator::AsynchronousIfNested) { - mode = QDeclarativeIncubator::Synchronous; + if (mode == QQmlIncubator::AsynchronousIfNested) { + mode = QQmlIncubator::Synchronous; // Need to find the first constructing context and see if it is asynchronous - QDeclarativeIncubatorPrivate *parentIncubator = 0; - QDeclarativeContextData *cctxt = forContext; + QQmlIncubatorPrivate *parentIncubator = 0; + QQmlContextData *cctxt = forContext; while (cctxt) { if (cctxt->activeVMEData) { - parentIncubator = (QDeclarativeIncubatorPrivate *)cctxt->activeVMEData; + parentIncubator = (QQmlIncubatorPrivate *)cctxt->activeVMEData; break; } cctxt = cctxt->parent; } if (parentIncubator && parentIncubator->isAsynchronous) { - mode = QDeclarativeIncubator::Asynchronous; + mode = QQmlIncubator::Asynchronous; p->waitingOnMe = parentIncubator; parentIncubator->waitingFor.insert(p); } } - p->isAsynchronous = (mode != QDeclarativeIncubator::Synchronous); + p->isAsynchronous = (mode != QQmlIncubator::Synchronous); inProgressCreations++; - if (mode == QDeclarativeIncubator::Synchronous) { - typedef QDeclarativeIncubatorPrivate IP; + if (mode == QQmlIncubator::Synchronous) { + typedef QQmlIncubatorPrivate IP; QRecursionWatcher<IP, &IP::recursion> watcher(p); - p->changeStatus(QDeclarativeIncubator::Loading); + p->changeStatus(QQmlIncubator::Loading); if (!watcher.hasRecursed()) { - QDeclarativeVME::Interrupt i; + QQmlVME::Interrupt i; p->incubate(i); } } else { @@ -98,7 +98,7 @@ void QDeclarativeEnginePrivate::incubate(QDeclarativeIncubator &i, QDeclarativeC incubatorCount++; p->vmeGuard.guard(&p->vme); - p->changeStatus(QDeclarativeIncubator::Loading); + p->changeStatus(QQmlIncubator::Loading); if (incubationController) incubationController->incubatingObjectCountChanged(incubatorCount); @@ -111,9 +111,9 @@ and it does not take ownership of it. \sa incubationController() */ -void QDeclarativeEngine::setIncubationController(QDeclarativeIncubationController *controller) +void QQmlEngine::setIncubationController(QQmlIncubationController *controller) { - Q_D(QDeclarativeEngine); + Q_D(QQmlEngine); if (d->incubationController) d->incubationController->d = 0; d->incubationController = controller; @@ -125,33 +125,33 @@ Returns the currently set incubation controller, or 0 if no controller has been \sa setIncubationController() */ -QDeclarativeIncubationController *QDeclarativeEngine::incubationController() const +QQmlIncubationController *QQmlEngine::incubationController() const { - Q_D(const QDeclarativeEngine); + Q_D(const QQmlEngine); return d->incubationController; } -QDeclarativeIncubatorPrivate::QDeclarativeIncubatorPrivate(QDeclarativeIncubator *q, - QDeclarativeIncubator::IncubationMode m) -: q(q), status(QDeclarativeIncubator::Null), mode(m), isAsynchronous(false), progress(Execute), +QQmlIncubatorPrivate::QQmlIncubatorPrivate(QQmlIncubator *q, + QQmlIncubator::IncubationMode m) +: q(q), status(QQmlIncubator::Null), mode(m), isAsynchronous(false), progress(Execute), result(0), component(0), vme(this), waitingOnMe(0) { } -QDeclarativeIncubatorPrivate::~QDeclarativeIncubatorPrivate() +QQmlIncubatorPrivate::~QQmlIncubatorPrivate() { } -void QDeclarativeIncubatorPrivate::clear() +void QQmlIncubatorPrivate::clear() { if (next.isInList()) { next.remove(); Q_ASSERT(component); - QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(component->engine); + QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(component->engine); component->release(); component = 0; enginePriv->incubatorCount--; - QDeclarativeIncubationController *controller = enginePriv->incubationController; + QQmlIncubationController *controller = enginePriv->incubationController; if (controller) controller->incubatingObjectCountChanged(enginePriv->incubatorCount); } else if (component) { @@ -171,18 +171,18 @@ void QDeclarativeIncubatorPrivate::clear() } /*! -\class QDeclarativeIncubationController -\brief QDeclarativeIncubationController instances drive the progress of QDeclarativeIncubators +\class QQmlIncubationController +\brief QQmlIncubationController instances drive the progress of QQmlIncubators In order to behave asynchronously and not introduce stutters or freezes in an application, -the process of creating objects a QDeclarativeIncubators must be driven only during the -application's idle time. QDeclarativeIncubationController allows the application to control +the process of creating objects a QQmlIncubators must be driven only during the +application's idle time. QQmlIncubationController allows the application to control exactly when, how often and for how long this processing occurs. -A QDeclarativeIncubationController derived instance should be created and set on a -QDeclarativeEngine by calling the QDeclarativeEngine::setIncubationController() method. -Processing is then controlled by calling the QDeclarativeIncubationController::incubateFor() -or QDeclarativeIncubationController::incubateWhile() methods as dictated by the application's +A QQmlIncubationController derived instance should be created and set on a +QQmlEngine by calling the QQmlEngine::setIncubationController() method. +Processing is then controlled by calling the QQmlIncubationController::incubateFor() +or QQmlIncubationController::incubateWhile() methods as dictated by the application's requirements. For example, this is an example of a incubation controller that will incubate for a maximum @@ -190,7 +190,7 @@ of 5 milliseconds out of every 16 milliseconds. \code class PeriodicIncubationController : public QObject, - public QDeclarativeIncubationController + public QQmlIncubationController { public: PeriodicIncubationController() { @@ -212,31 +212,31 @@ than a static amount like 5 milliseconds - while not disturbing the application. /*! Create a new incubation controller. */ -QDeclarativeIncubationController::QDeclarativeIncubationController() +QQmlIncubationController::QQmlIncubationController() : d(0) { } /*! \internal */ -QDeclarativeIncubationController::~QDeclarativeIncubationController() +QQmlIncubationController::~QQmlIncubationController() { - if (d) QDeclarativeEnginePrivate::get(d)->setIncubationController(0); + if (d) QQmlEnginePrivate::get(d)->setIncubationController(0); d = 0; } /*! -Return the QDeclarativeEngine this incubation controller is set on, or 0 if it +Return the QQmlEngine this incubation controller is set on, or 0 if it has not been set on any engine. */ -QDeclarativeEngine *QDeclarativeIncubationController::engine() const +QQmlEngine *QQmlIncubationController::engine() const { - return QDeclarativeEnginePrivate::get(d); + return QQmlEnginePrivate::get(d); } /*! Return the number of objects currently incubating. */ -int QDeclarativeIncubationController::incubatingObjectCount() const +int QQmlIncubationController::incubatingObjectCount() const { if (d) return d->incubatorCount; @@ -250,35 +250,35 @@ new number of incubating objects. The default implementation does nothing. */ -void QDeclarativeIncubationController::incubatingObjectCountChanged(int incubatingObjectCount) +void QQmlIncubationController::incubatingObjectCountChanged(int incubatingObjectCount) { Q_UNUSED(incubatingObjectCount); } -void QDeclarativeIncubatorPrivate::incubate(QDeclarativeVME::Interrupt &i) +void QQmlIncubatorPrivate::incubate(QQmlVME::Interrupt &i) { if (!component) return; - typedef QDeclarativeIncubatorPrivate IP; + typedef QQmlIncubatorPrivate IP; QRecursionWatcher<IP, &IP::recursion> watcher(this); - QDeclarativeEngine *engine = component->engine; - QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine); + QQmlEngine *engine = component->engine; + QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(engine); bool guardOk = vmeGuard.isOK(); vmeGuard.clear(); if (!guardOk) { - QDeclarativeError error; + QQmlError error; error.setUrl(component->url); - error.setDescription(QDeclarativeComponent::tr("Object destroyed during incubation")); + error.setDescription(QQmlComponent::tr("Object destroyed during incubation")); errors << error; - progress = QDeclarativeIncubatorPrivate::Completed; + progress = QQmlIncubatorPrivate::Completed; goto finishIncubate; } - if (progress == QDeclarativeIncubatorPrivate::Execute) { + if (progress == QQmlIncubatorPrivate::Execute) { enginePriv->referenceScarceResources(); QObject *tresult = vme.execute(&errors, i); enginePriv->dereferenceScarceResources(); @@ -291,7 +291,7 @@ void QDeclarativeIncubatorPrivate::incubate(QDeclarativeVME::Interrupt &i) goto finishIncubate; if (result) { - QDeclarativeData *ddata = QDeclarativeData::get(result); + QQmlData *ddata = QQmlData::get(result); Q_ASSERT(ddata); ddata->indestructible = true; @@ -302,9 +302,9 @@ void QDeclarativeIncubatorPrivate::incubate(QDeclarativeVME::Interrupt &i) return; if (errors.isEmpty()) - progress = QDeclarativeIncubatorPrivate::Completing; + progress = QQmlIncubatorPrivate::Completing; else - progress = QDeclarativeIncubatorPrivate::Completed; + progress = QQmlIncubatorPrivate::Completed; changeStatus(calculateStatus()); @@ -315,25 +315,25 @@ void QDeclarativeIncubatorPrivate::incubate(QDeclarativeVME::Interrupt &i) goto finishIncubate; } - if (progress == QDeclarativeIncubatorPrivate::Completing) { + if (progress == QQmlIncubatorPrivate::Completing) { do { if (watcher.hasRecursed()) return; - QDeclarativeContextData *ctxt = vme.complete(i); + QQmlContextData *ctxt = vme.complete(i); if (ctxt) { rootContext = ctxt; - progress = QDeclarativeIncubatorPrivate::Completed; + progress = QQmlIncubatorPrivate::Completed; goto finishIncubate; } } while (!i.shouldInterrupt()); } finishIncubate: - if (progress == QDeclarativeIncubatorPrivate::Completed && waitingFor.isEmpty()) { - typedef QDeclarativeIncubatorPrivate IP; + if (progress == QQmlIncubatorPrivate::Completed && waitingFor.isEmpty()) { + typedef QQmlIncubatorPrivate IP; - QDeclarativeIncubatorPrivate *isWaiting = waitingOnMe; + QQmlIncubatorPrivate *isWaiting = waitingOnMe; clear(); if (isWaiting) { @@ -361,15 +361,15 @@ finishIncubate: /*! Incubate objects for \a msecs, or until there are no more objects to incubate. */ -void QDeclarativeIncubationController::incubateFor(int msecs) +void QQmlIncubationController::incubateFor(int msecs) { if (!d || d->incubatorCount == 0) return; - QDeclarativeVME::Interrupt i(msecs * 1000000); + QQmlVME::Interrupt i(msecs * 1000000); i.reset(); do { - QDeclarativeIncubatorPrivate *p = (QDeclarativeIncubatorPrivate*)d->incubatorList.first(); + QQmlIncubatorPrivate *p = (QQmlIncubatorPrivate*)d->incubatorList.first(); p->incubate(i); } while (d && d->incubatorCount != 0 && !i.shouldInterrupt()); } @@ -381,34 +381,34 @@ more objects to incubate. Generally this method is used in conjunction with a thread or a UNIX signal that sets the bool pointed to by \a flag to false when it wants incubation to be interrupted. */ -void QDeclarativeIncubationController::incubateWhile(bool *flag) +void QQmlIncubationController::incubateWhile(bool *flag) { if (!d || d->incubatorCount == 0) return; - QDeclarativeVME::Interrupt i(flag); + QQmlVME::Interrupt i(flag); do { - QDeclarativeIncubatorPrivate *p = (QDeclarativeIncubatorPrivate*)d->incubatorList.first(); + QQmlIncubatorPrivate *p = (QQmlIncubatorPrivate*)d->incubatorList.first(); p->incubate(i); } while (d && d->incubatorCount != 0 && !i.shouldInterrupt()); } /*! -\class QDeclarativeIncubator -\brief The QDeclarativeIncubator class allows QML objects to be created asynchronously. +\class QQmlIncubator +\brief The QQmlIncubator class allows QML objects to be created asynchronously. Creating QML objects - like delegates in a view, or a new page in an application - can take a noticable amount of time, especially on resource constrained mobile devices. When an -application uses QDeclarativeComponent::create() directly, the QML object instance is created +application uses QQmlComponent::create() directly, the QML object instance is created synchronously which, depending on the complexity of the object, can cause noticable pauses or stutters in the application. -The use of QDeclarativeIncubator gives more control over the creation of a QML object, +The use of QQmlIncubator gives more control over the creation of a QML object, including allowing it to be created asynchronously using application idle time. The following -example shows a simple use of QDeclarativeIncubator. +example shows a simple use of QQmlIncubator. \code -QDeclarativeIncubator incubator; +QQmlIncubator incubator; component->create(incubator); while (incubator.isReady()) { @@ -418,23 +418,23 @@ while (incubator.isReady()) { QObject *object = incubator.object(); \endcode -Asynchronous incubators are controlled by a QDeclarativeIncubationController that is -set on the QDeclarativeEngine, which lets the engine know when the application is idle and +Asynchronous incubators are controlled by a QQmlIncubationController that is +set on the QQmlEngine, which lets the engine know when the application is idle and incubating objects should be processed. If an incubation controller is not set on the -QDeclarativeEngine, QDeclarativeIncubator creates objects synchronously regardless of the +QQmlEngine, QQmlIncubator creates objects synchronously regardless of the specified IncubationMode. -QDeclarativeIncubator supports three incubation modes: +QQmlIncubator supports three incubation modes: \list \i Synchronous The creation occurs synchronously. That is, once the -QDeclarativeComponent::create() call returns, the incubator will already be in either the +QQmlComponent::create() call returns, the incubator will already be in either the Error or Ready state. A synchronous incubator has no real advantage compared to using -the synchronous creation methods on QDeclarativeComponent directly, but it may simplify an +the synchronous creation methods on QQmlComponent directly, but it may simplify an application's implementation to use the same API for both synchronous and asynchronous creations. \i Asynchronous (default) The creation occurs asynchronously, assuming a -QDeclarativeIncubatorController is set on the QDeclarativeEngine. +QQmlIncubatorController is set on the QQmlEngine. The incubator will remain in the Loading state until either the creation is complete or an error occurs. The statusChanged() callback can be used to be notified of status changes. @@ -442,7 +442,7 @@ occurs. The statusChanged() callback can be used to be notified of status chang Applications should use the Asynchronous incubation mode to create objects that are not needed immediately. For example, the ListView element uses Asynchronous incubation to create objects that are slightly off screen while the list is being scrolled. If, during asynchronous creation, -the object is needed immediately the QDeclarativeIncubator::forceCompletion() method can be called +the object is needed immediately the QQmlIncubator::forceCompletion() method can be called to complete the creation process synchronously. \i AsynchronousIfNested The creation will occur asynchronously if part of a nested asynchronous @@ -478,13 +478,13 @@ or stutters into the application, should use the AsynchronousIfNested incubation /*! Create a new incubator with the specified \a mode */ -QDeclarativeIncubator::QDeclarativeIncubator(IncubationMode mode) -: d(new QDeclarativeIncubatorPrivate(this, mode)) +QQmlIncubator::QQmlIncubator(IncubationMode mode) +: d(new QQmlIncubatorPrivate(this, mode)) { } /*! \internal */ -QDeclarativeIncubator::~QDeclarativeIncubator() +QQmlIncubator::~QQmlIncubator() { clear(); @@ -492,11 +492,11 @@ QDeclarativeIncubator::~QDeclarativeIncubator() } /*! -\enum QDeclarativeIncubator::IncubationMode +\enum QQmlIncubator::IncubationMode Specifies the mode the incubator operates in. Regardless of the incubation mode, a -QDeclarativeIncubator will behave synchronously if the QDeclarativeEngine does not have -a QDeclarativeIncubationController set. +QQmlIncubator will behave synchronously if the QQmlEngine does not have +a QQmlIncubationController set. \value Asynchronous The object will be created asynchronously. \value AsynchronousIfNested If the object is being created in a context that is already part @@ -507,11 +507,11 @@ incubation have completed. Otherwise, the incubation will execute synchronously */ /*! -\enum QDeclarativeIncubator::Status +\enum QQmlIncubator::Status -Specifies the status of the QDeclarativeIncubator. +Specifies the status of the QQmlIncubator. -\value Null Incubation is not in progress. Call QDeclarativeComponent::create() to begin incubating. +\value Null Incubation is not in progress. Call QQmlComponent::create() to begin incubating. \value Ready The object is fully created and can be accessed by calling object(). \value Loading The object is in the process of being created. \value Error An error occurred. The errors can be access by calling errors(). @@ -521,9 +521,9 @@ Specifies the status of the QDeclarativeIncubator. Clears the incubator. Any in-progress incubation is aborted. If the incubator is in the Ready state, the created object is \b not deleted. */ -void QDeclarativeIncubator::clear() +void QQmlIncubator::clear() { - typedef QDeclarativeIncubatorPrivate IP; + typedef QQmlIncubatorPrivate IP; QRecursionWatcher<IP, &IP::recursion> watcher(d); Status s = status(); @@ -531,10 +531,10 @@ void QDeclarativeIncubator::clear() if (s == Null) return; - QDeclarativeEnginePrivate *enginePriv = 0; + QQmlEnginePrivate *enginePriv = 0; if (s == Loading) { Q_ASSERT(d->component); - enginePriv = QDeclarativeEnginePrivate::get(d->component->engine); + enginePriv = QQmlEnginePrivate::get(d->component->engine); if (d->result) d->result->deleteLater(); d->result = 0; } @@ -550,7 +550,7 @@ void QDeclarativeIncubator::clear() Q_ASSERT(!d->nextWaitingFor.isInList()); d->errors.clear(); - d->progress = QDeclarativeIncubatorPrivate::Execute; + d->progress = QQmlIncubatorPrivate::Execute; d->result = 0; if (s == Loading) { @@ -572,12 +572,12 @@ void QDeclarativeIncubator::clear() Force any in-progress incubation to finish synchronously. Once this call returns, the incubator will not be in the Loading state. */ -void QDeclarativeIncubator::forceCompletion() +void QQmlIncubator::forceCompletion() { - QDeclarativeVME::Interrupt i; + QQmlVME::Interrupt i; while (Loading == status()) { while (Loading == status() && !d->waitingFor.isEmpty()) - static_cast<QDeclarativeIncubatorPrivate *>(d->waitingFor.first())->incubate(i); + static_cast<QQmlIncubatorPrivate *>(d->waitingFor.first())->incubate(i); if (Loading == status()) d->incubate(i); } @@ -586,7 +586,7 @@ void QDeclarativeIncubator::forceCompletion() /*! Returns true if the incubator's status() is Null. */ -bool QDeclarativeIncubator::isNull() const +bool QQmlIncubator::isNull() const { return status() == Null; } @@ -594,7 +594,7 @@ bool QDeclarativeIncubator::isNull() const /*! Returns true if the incubator's status() is Ready. */ -bool QDeclarativeIncubator::isReady() const +bool QQmlIncubator::isReady() const { return status() == Ready; } @@ -602,7 +602,7 @@ bool QDeclarativeIncubator::isReady() const /*! Returns true if the incubator's status() is Error. */ -bool QDeclarativeIncubator::isError() const +bool QQmlIncubator::isError() const { return status() == Error; } @@ -610,7 +610,7 @@ bool QDeclarativeIncubator::isError() const /*! Returns true if the incubator's status() is Loading. */ -bool QDeclarativeIncubator::isLoading() const +bool QQmlIncubator::isLoading() const { return status() == Loading; } @@ -618,15 +618,15 @@ bool QDeclarativeIncubator::isLoading() const /*! Return the list of errors encountered while incubating the object. */ -QList<QDeclarativeError> QDeclarativeIncubator::errors() const +QList<QQmlError> QQmlIncubator::errors() const { return d->errors; } /*! -Return the incubation mode passed to the QDeclarativeIncubator constructor. +Return the incubation mode passed to the QQmlIncubator constructor. */ -QDeclarativeIncubator::IncubationMode QDeclarativeIncubator::incubationMode() const +QQmlIncubator::IncubationMode QQmlIncubator::incubationMode() const { return d->mode; } @@ -634,7 +634,7 @@ QDeclarativeIncubator::IncubationMode QDeclarativeIncubator::incubationMode() co /*! Return the current status of the incubator. */ -QDeclarativeIncubator::Status QDeclarativeIncubator::status() const +QQmlIncubator::Status QQmlIncubator::status() const { return d->status; } @@ -642,7 +642,7 @@ QDeclarativeIncubator::Status QDeclarativeIncubator::status() const /*! Return the incubated object if the status is Ready, otherwise 0. */ -QObject *QDeclarativeIncubator::object() const +QObject *QQmlIncubator::object() const { if (status() != Ready) return 0; else return d->result; @@ -653,26 +653,26 @@ Called when the status of the incubator changes. \a status is the new status. The default implementation does nothing. */ -void QDeclarativeIncubator::statusChanged(Status status) +void QQmlIncubator::statusChanged(Status status) { Q_UNUSED(status); } /*! Called after the object is first created, but before property bindings are -evaluated and, if applicable, QDeclarativeParserStatus::componentComplete() is -called. This is equivalent to the point between QDeclarativeComponent::beginCreate() -and QDeclarativeComponent::endCreate(), and can be used to assign initial values +evaluated and, if applicable, QQmlParserStatus::componentComplete() is +called. This is equivalent to the point between QQmlComponent::beginCreate() +and QQmlComponent::endCreate(), and can be used to assign initial values to the object's properties. The default implementation does nothing. */ -void QDeclarativeIncubator::setInitialState(QObject *object) +void QQmlIncubator::setInitialState(QObject *object) { Q_UNUSED(object); } -void QDeclarativeIncubatorPrivate::changeStatus(QDeclarativeIncubator::Status s) +void QQmlIncubatorPrivate::changeStatus(QQmlIncubator::Status s) { if (s == status) return; @@ -681,16 +681,16 @@ void QDeclarativeIncubatorPrivate::changeStatus(QDeclarativeIncubator::Status s) q->statusChanged(status); } -QDeclarativeIncubator::Status QDeclarativeIncubatorPrivate::calculateStatus() const +QQmlIncubator::Status QQmlIncubatorPrivate::calculateStatus() const { if (!errors.isEmpty()) - return QDeclarativeIncubator::Error; - else if (result && progress == QDeclarativeIncubatorPrivate::Completed && + return QQmlIncubator::Error; + else if (result && progress == QQmlIncubatorPrivate::Completed && waitingFor.isEmpty()) - return QDeclarativeIncubator::Ready; + return QQmlIncubator::Ready; else if (component) - return QDeclarativeIncubator::Loading; + return QQmlIncubator::Loading; else - return QDeclarativeIncubator::Null; + return QQmlIncubator::Null; } diff --git a/src/declarative/qml/qdeclarativeincubator.h b/src/qml/qml/qqmlincubator.h index cabd7e2b28..5d8ae7d6c3 100644 --- a/src/declarative/qml/qdeclarativeincubator.h +++ b/src/qml/qml/qqmlincubator.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,22 +39,22 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINCUBATOR_H -#define QDECLARATIVEINCUBATOR_H +#ifndef QQMLINCUBATOR_H +#define QQMLINCUBATOR_H -#include <QtDeclarative/qdeclarativeerror.h> +#include <QtQml/qqmlerror.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; -class QDeclarativeIncubatorPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeIncubator +class QQmlIncubatorPrivate; +class Q_QML_EXPORT QQmlIncubator { - Q_DISABLE_COPY(QDeclarativeIncubator) + Q_DISABLE_COPY(QQmlIncubator) public: enum IncubationMode { Asynchronous, @@ -68,8 +68,8 @@ public: Error }; - QDeclarativeIncubator(IncubationMode = Asynchronous); - virtual ~QDeclarativeIncubator(); + QQmlIncubator(IncubationMode = Asynchronous); + virtual ~QQmlIncubator(); void clear(); void forceCompletion(); @@ -79,7 +79,7 @@ public: bool isError() const; bool isLoading() const; - QList<QDeclarativeError> errors() const; + QList<QQmlError> errors() const; IncubationMode incubationMode() const; @@ -92,21 +92,21 @@ protected: virtual void setInitialState(QObject *); private: - friend class QDeclarativeComponent; - friend class QDeclarativeEnginePrivate; - friend class QDeclarativeIncubatorPrivate; - QDeclarativeIncubatorPrivate *d; + friend class QQmlComponent; + friend class QQmlEnginePrivate; + friend class QQmlIncubatorPrivate; + QQmlIncubatorPrivate *d; }; -class QDeclarativeEnginePrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeIncubationController +class QQmlEnginePrivate; +class Q_QML_EXPORT QQmlIncubationController { - Q_DISABLE_COPY(QDeclarativeIncubationController) + Q_DISABLE_COPY(QQmlIncubationController) public: - QDeclarativeIncubationController(); - virtual ~QDeclarativeIncubationController(); + QQmlIncubationController(); + virtual ~QQmlIncubationController(); - QDeclarativeEngine *engine() const; + QQmlEngine *engine() const; int incubatingObjectCount() const; void incubateFor(int msecs); @@ -116,14 +116,14 @@ protected: virtual void incubatingObjectCountChanged(int); private: - friend class QDeclarativeEngine; - friend class QDeclarativeEnginePrivate; - friend class QDeclarativeIncubatorPrivate; - QDeclarativeEnginePrivate *d; + friend class QQmlEngine; + friend class QQmlEnginePrivate; + friend class QQmlIncubatorPrivate; + QQmlEnginePrivate *d; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEINCUBATOR_H +#endif // QQMLINCUBATOR_H diff --git a/src/declarative/qml/qdeclarativeincubator_p.h b/src/qml/qml/qqmlincubator_p.h index 39ef710a41..0dec34a8d5 100644 --- a/src/declarative/qml/qdeclarativeincubator_p.h +++ b/src/qml/qml/qqmlincubator_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINCUBATOR_P_H -#define QDECLARATIVEINCUBATOR_P_H +#ifndef QQMLINCUBATOR_P_H +#define QQMLINCUBATOR_P_H #include <private/qintrusivelist_p.h> -#include <private/qdeclarativevme_p.h> +#include <private/qqmlvme_p.h> #include <private/qrecursionwatcher_p.h> -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativecontext_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlcontext_p.h> // // W A R N I N G @@ -61,46 +61,46 @@ QT_BEGIN_NAMESPACE -class QDeclarativeCompiledData; -class QDeclarativeIncubator; -class QDeclarativeIncubatorPrivate : public QDeclarativeEnginePrivate::Incubator +class QQmlCompiledData; +class QQmlIncubator; +class QQmlIncubatorPrivate : public QQmlEnginePrivate::Incubator { public: - QDeclarativeIncubatorPrivate(QDeclarativeIncubator *q, QDeclarativeIncubator::IncubationMode m); - ~QDeclarativeIncubatorPrivate(); + QQmlIncubatorPrivate(QQmlIncubator *q, QQmlIncubator::IncubationMode m); + ~QQmlIncubatorPrivate(); - QDeclarativeIncubator *q; + QQmlIncubator *q; - QDeclarativeIncubator::Status calculateStatus() const; - void changeStatus(QDeclarativeIncubator::Status); - QDeclarativeIncubator::Status status; + QQmlIncubator::Status calculateStatus() const; + void changeStatus(QQmlIncubator::Status); + QQmlIncubator::Status status; - QDeclarativeIncubator::IncubationMode mode; + QQmlIncubator::IncubationMode mode; bool isAsynchronous; - QList<QDeclarativeError> errors; + QList<QQmlError> errors; enum Progress { Execute, Completing, Completed }; Progress progress; - QDeclarativeGuard<QObject> result; - QDeclarativeGuardedContextData rootContext; - QDeclarativeCompiledData *component; - QDeclarativeVME vme; - QDeclarativeVMEGuard vmeGuard; + QQmlGuard<QObject> result; + QQmlGuardedContextData rootContext; + QQmlCompiledData *component; + QQmlVME vme; + QQmlVMEGuard vmeGuard; - QDeclarativeIncubatorPrivate *waitingOnMe; - typedef QDeclarativeEnginePrivate::Incubator QIPBase; + QQmlIncubatorPrivate *waitingOnMe; + typedef QQmlEnginePrivate::Incubator QIPBase; QIntrusiveList<QIPBase, &QIPBase::nextWaitingFor> waitingFor; QRecursionNode recursion; void clear(); - void incubate(QDeclarativeVME::Interrupt &i); + void incubate(QQmlVME::Interrupt &i); }; QT_END_NAMESPACE -#endif // QDECLARATIVEINCUBATOR_P_H +#endif // QQMLINCUBATOR_P_H diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/qml/qml/qqmlinfo.cpp index 42afbb26f7..53145737d8 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/qml/qml/qqmlinfo.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,21 +39,21 @@ ** ****************************************************************************/ -#include "qdeclarativeinfo.h" +#include "qqmlinfo.h" -#include "qdeclarativedata_p.h" -#include "qdeclarativecontext.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativemetatype_p.h" -#include "qdeclarativeengine_p.h" +#include "qqmldata_p.h" +#include "qqmlcontext.h" +#include "qqmlcontext_p.h" +#include "qqmlmetatype_p.h" +#include "qqmlengine_p.h" #include <QCoreApplication> QT_BEGIN_NAMESPACE /*! - \fn QDeclarativeInfo qmlInfo(const QObject *object) - \relates QDeclarativeEngine + \fn QQmlInfo qmlInfo(const QObject *object) + \relates QQmlEngine Prints warning messages that include the file and line number for the specified QML \a object. @@ -80,45 +80,45 @@ QT_BEGIN_NAMESPACE \endcode */ -class QDeclarativeInfoPrivate +class QQmlInfoPrivate { public: - QDeclarativeInfoPrivate() : ref (1), object(0) {} + QQmlInfoPrivate() : ref (1), object(0) {} int ref; const QObject *object; QString buffer; - QList<QDeclarativeError> errors; + QList<QQmlError> errors; }; -QDeclarativeInfo::QDeclarativeInfo(QDeclarativeInfoPrivate *p) +QQmlInfo::QQmlInfo(QQmlInfoPrivate *p) : QDebug(&p->buffer), d(p) { nospace(); } -QDeclarativeInfo::QDeclarativeInfo(const QDeclarativeInfo &other) +QQmlInfo::QQmlInfo(const QQmlInfo &other) : QDebug(other), d(other.d) { d->ref++; } -QDeclarativeInfo::~QDeclarativeInfo() +QQmlInfo::~QQmlInfo() { if (0 == --d->ref) { - QList<QDeclarativeError> errors = d->errors; + QList<QQmlError> errors = d->errors; - QDeclarativeEngine *engine = 0; + QQmlEngine *engine = 0; if (!d->buffer.isEmpty()) { - QDeclarativeError error; + QQmlError error; QObject *object = const_cast<QObject *>(d->object); if (object) { engine = qmlEngine(d->object); QString typeName; - QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject()); + QQmlType *type = QQmlMetaType::qmlType(object->metaObject()); if (type) { typeName = type->qmlTypeName(); int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); @@ -134,7 +134,7 @@ QDeclarativeInfo::~QDeclarativeInfo() if (marker != -1) { typeName = typeName.left(marker); typeName += QLatin1Char('*'); - type = QDeclarativeMetaType::qmlType(QMetaType::type(typeName.toLatin1())); + type = QQmlMetaType::qmlType(QMetaType::type(typeName.toLatin1())); if (type) { typeName = type->qmlTypeName(); int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); @@ -146,7 +146,7 @@ QDeclarativeInfo::~QDeclarativeInfo() d->buffer.prepend(QLatin1String("QML ") + typeName + QLatin1String(": ")); - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) { error.setUrl(ddata->outerContext->url); error.setLine(ddata->lineNumber); @@ -159,33 +159,33 @@ QDeclarativeInfo::~QDeclarativeInfo() errors.prepend(error); } - QDeclarativeEnginePrivate::warning(engine, errors); + QQmlEnginePrivate::warning(engine, errors); delete d; } } -QDeclarativeInfo qmlInfo(const QObject *me) +QQmlInfo qmlInfo(const QObject *me) { - QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate; + QQmlInfoPrivate *d = new QQmlInfoPrivate; d->object = me; - return QDeclarativeInfo(d); + return QQmlInfo(d); } -QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error) +QQmlInfo qmlInfo(const QObject *me, const QQmlError &error) { - QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate; + QQmlInfoPrivate *d = new QQmlInfoPrivate; d->object = me; d->errors << error; - return QDeclarativeInfo(d); + return QQmlInfo(d); } -QDeclarativeInfo qmlInfo(const QObject *me, const QList<QDeclarativeError> &errors) +QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors) { - QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate; + QQmlInfoPrivate *d = new QQmlInfoPrivate; d->object = me; d->errors = errors; - return QDeclarativeInfo(d); + return QQmlInfo(d); } diff --git a/src/qml/qml/qqmlinfo.h b/src/qml/qml/qqmlinfo.h new file mode 100644 index 0000000000..92d6d72e8b --- /dev/null +++ b/src/qml/qml/qqmlinfo.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QQMLINFO_H +#define QQMLINFO_H + +#include <QtCore/qdebug.h> +#include <QtCore/qurl.h> +#include <QtQml/qqmlerror.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QQmlInfoPrivate; +class Q_QML_EXPORT QQmlInfo : public QDebug +{ +public: + QQmlInfo(const QQmlInfo &); + ~QQmlInfo(); + + inline QQmlInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(bool t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(char t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(signed short t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(unsigned short t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(signed int t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(unsigned int t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(signed long t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(unsigned long t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(qint64 t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(quint64 t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(float t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(double t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(const char* t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(const QString & t) { QDebug::operator<<(t.toLocal8Bit().constData()); return *this; } + inline QQmlInfo &operator<<(const QStringRef & t) { return operator<<(t.toString()); } + inline QQmlInfo &operator<<(const QLatin1String &t) { QDebug::operator<<(t.latin1()); return *this; } + inline QQmlInfo &operator<<(const QByteArray & t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; } + inline QQmlInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; } + inline QQmlInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; } +#ifndef QT_NO_DEBUG_STREAM + inline QQmlInfo &operator<<(const QUrl &t) { static_cast<QDebug &>(*this) << t; return *this; } +#endif + +private: + friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me); + friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error); + friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors); + + QQmlInfo(QQmlInfoPrivate *); + QQmlInfoPrivate *d; +}; + +Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me); +Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error); +Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors); + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QQMLINFO_H diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/qml/qml/qqmlinstruction.cpp index 799357cf04..72f04c9d61 100644 --- a/src/declarative/qml/qdeclarativeinstruction.cpp +++ b/src/qml/qml/qqmlinstruction.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,223 +39,223 @@ ** ****************************************************************************/ -#include "qdeclarativeinstruction_p.h" +#include "qqmlinstruction_p.h" -#include "qdeclarativecompiler_p.h" +#include "qqmlcompiler_p.h" #include <QtCore/qdebug.h> QT_BEGIN_NAMESPACE -void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx) +void QQmlCompiledData::dump(QQmlInstruction *instr, int idx) { #ifdef QT_NO_DEBUG_STREAM Q_UNUSED(instr) Q_UNUSED(idx) #else switch (instructionType(instr)) { - case QDeclarativeInstruction::Init: + case QQmlInstruction::Init: qWarning().nospace() << idx << "\t\t" << "INIT\t\t\t" << instr->init.bindingsSize << "\t" << instr->init.parserStatusSize << "\t" << instr->init.contextCache << "\t" << instr->init.compiledBinding; break; - case QDeclarativeInstruction::DeferInit: + case QQmlInstruction::DeferInit: qWarning().nospace() << idx << "\t\t" << "DEFER_INIT\t\t" << instr->deferInit.bindingsSize << "\t" << instr->deferInit.parserStatusSize; break; - case QDeclarativeInstruction::Done: + case QQmlInstruction::Done: qWarning().nospace() << idx << "\t\t" << "DONE"; break; - case QDeclarativeInstruction::CreateCppObject: + case QQmlInstruction::CreateCppObject: qWarning().nospace() << idx << "\t\t" << "CREATECPP\t\t\t" << instr->create.type << "\t\t\t" << types.at(instr->create.type).className; break; - case QDeclarativeInstruction::CreateQMLObject: + case QQmlInstruction::CreateQMLObject: qWarning().nospace() << idx << "\t\t" << "CREATEQML\t\t\t" << instr->createQml.type << "\t" << instr->createQml.bindingBits << "\t\t" << types.at(instr->createQml.type).className; break; - case QDeclarativeInstruction::CompleteQMLObject: + case QQmlInstruction::CompleteQMLObject: qWarning().nospace() << idx << "\t\t" << "COMPLETEQML"; break; - case QDeclarativeInstruction::CreateSimpleObject: + case QQmlInstruction::CreateSimpleObject: qWarning().nospace() << idx << "\t\t" << "CREATE_SIMPLE\t\t" << instr->createSimple.typeSize; break; - case QDeclarativeInstruction::SetId: + case QQmlInstruction::SetId: qWarning().nospace() << idx << "\t\t" << "SETID\t\t\t" << instr->setId.value << "\t\t\t" << primitives.at(instr->setId.value); break; - case QDeclarativeInstruction::SetDefault: + case QQmlInstruction::SetDefault: qWarning().nospace() << idx << "\t\t" << "SET_DEFAULT"; break; - case QDeclarativeInstruction::CreateComponent: + case QQmlInstruction::CreateComponent: qWarning().nospace() << idx << "\t\t" << "CREATE_COMPONENT\t" << instr->createComponent.count; break; - case QDeclarativeInstruction::StoreMetaObject: + case QQmlInstruction::StoreMetaObject: qWarning().nospace() << idx << "\t\t" << "STORE_META\t\t" << instr->storeMeta.data; break; - case QDeclarativeInstruction::StoreFloat: + case QQmlInstruction::StoreFloat: qWarning().nospace() << idx << "\t\t" << "STORE_FLOAT\t\t" << instr->storeFloat.propertyIndex << "\t" << instr->storeFloat.value; break; - case QDeclarativeInstruction::StoreDouble: + case QQmlInstruction::StoreDouble: qWarning().nospace() << idx << "\t\t" << "STORE_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value; break; - case QDeclarativeInstruction::StoreDoubleQList: + case QQmlInstruction::StoreDoubleQList: qWarning().nospace() << idx << "\t\t" << "STORE_DOUBLE_QLIST\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value; break; - case QDeclarativeInstruction::StoreInteger: + case QQmlInstruction::StoreInteger: qWarning().nospace() << idx << "\t\t" << "STORE_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value; break; - case QDeclarativeInstruction::StoreIntegerQList: + case QQmlInstruction::StoreIntegerQList: qWarning().nospace() << idx << "\t\t" << "STORE_INTEGER_QLIST\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value; break; - case QDeclarativeInstruction::StoreBool: + case QQmlInstruction::StoreBool: qWarning().nospace() << idx << "\t\t" << "STORE_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value; break; - case QDeclarativeInstruction::StoreBoolQList: + case QQmlInstruction::StoreBoolQList: qWarning().nospace() << idx << "\t\t" << "STORE_BOOL_QLIST\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value; break; - case QDeclarativeInstruction::StoreString: + case QQmlInstruction::StoreString: qWarning().nospace() << idx << "\t\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value); break; - case QDeclarativeInstruction::StoreStringList: + case QQmlInstruction::StoreStringList: qWarning().nospace() << idx << "\t\t" << "STORE_STRINGLIST\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value); break; - case QDeclarativeInstruction::StoreStringQList: + case QQmlInstruction::StoreStringQList: qWarning().nospace() << idx << "\t\t" << "STORE_STRING_QLIST\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value); break; - case QDeclarativeInstruction::StoreTrString: + case QQmlInstruction::StoreTrString: qWarning().nospace() << idx << "\t\t" << "STORE_TR_STRING\t" << instr->storeTrString.propertyIndex << "\t" << instr->storeTrString.context << "\t" << instr->storeTrString.text << "\t" << instr->storeTrString.comment << "\t" << instr->storeTrString.n; break; - case QDeclarativeInstruction::StoreTrIdString: + case QQmlInstruction::StoreTrIdString: qWarning().nospace() << idx << "\t\t" << "STORE_TRID_STRING\t" << instr->storeTrIdString.propertyIndex << "\t" << instr->storeTrIdString.text << "\t" << instr->storeTrIdString.n; break; - case QDeclarativeInstruction::StoreByteArray: + case QQmlInstruction::StoreByteArray: qWarning().nospace() << idx << "\t\t" << "STORE_BYTEARRAY" << instr->storeByteArray.propertyIndex << "\t" << instr->storeByteArray.value << "\t\t" << datas.at(instr->storeByteArray.value); break; - case QDeclarativeInstruction::StoreUrl: + case QQmlInstruction::StoreUrl: qWarning().nospace() << idx << "\t\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value); break; - case QDeclarativeInstruction::StoreUrlQList: + case QQmlInstruction::StoreUrlQList: qWarning().nospace() << idx << "\t\t" << "STORE_URL_QLIST\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value); break; - case QDeclarativeInstruction::StoreColor: + case QQmlInstruction::StoreColor: qWarning().nospace() << idx << "\t\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16); break; - case QDeclarativeInstruction::StoreDate: + case QQmlInstruction::StoreDate: qWarning().nospace() << idx << "\t\t" << "STORE_DATE\t\t" << instr->storeDate.propertyIndex << "\t" << instr->storeDate.value; break; - case QDeclarativeInstruction::StoreTime: + case QQmlInstruction::StoreTime: qWarning().nospace() << idx << "\t\t" << "STORE_TIME\t\t" << instr->storeTime.propertyIndex; break; - case QDeclarativeInstruction::StoreDateTime: + case QQmlInstruction::StoreDateTime: qWarning().nospace() << idx << "\t\t" << "STORE_DATETIME\t\t" << instr->storeDateTime.propertyIndex; break; - case QDeclarativeInstruction::StorePoint: + case QQmlInstruction::StorePoint: qWarning().nospace() << idx << "\t\t" << "STORE_POINT\t\t" << instr->storePoint.propertyIndex << "\t" << instr->storePoint.point.xp << "\t" << instr->storePoint.point.yp; break; - case QDeclarativeInstruction::StorePointF: + case QQmlInstruction::StorePointF: qWarning().nospace() << idx << "\t\t" << "STORE_POINTF\t\t" << instr->storePointF.propertyIndex << "\t" << instr->storePointF.point.xp << "\t" << instr->storePointF.point.yp; break; - case QDeclarativeInstruction::StoreSize: + case QQmlInstruction::StoreSize: qWarning().nospace() << idx << "\t\t" << "STORE_SIZE\t\t" << instr->storeSize.propertyIndex << "\t" << instr->storeSize.size.wd << "\t" << instr->storeSize.size.ht; break; - case QDeclarativeInstruction::StoreSizeF: + case QQmlInstruction::StoreSizeF: qWarning().nospace() << idx << "\t\t" << "STORE_SIZEF\t\t" << instr->storeSizeF.propertyIndex << "\t" << instr->storeSizeF.size.wd << "\t" << instr->storeSizeF.size.ht; break; - case QDeclarativeInstruction::StoreRect: + case QQmlInstruction::StoreRect: qWarning().nospace() << idx << "\t\t" << "STORE_RECT\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.rect.x1 << "\t" << instr->storeRect.rect.y1 << "\t" << instr->storeRect.rect.x2 << "\t" << instr->storeRect.rect.y2; break; - case QDeclarativeInstruction::StoreRectF: + case QQmlInstruction::StoreRectF: qWarning().nospace() << idx << "\t\t" << "STORE_RECTF\t\t" << instr->storeRectF.propertyIndex << "\t" << instr->storeRectF.rect.xp << "\t" << instr->storeRectF.rect.yp << "\t" << instr->storeRectF.rect.w << "\t" << instr->storeRectF.rect.h; break; - case QDeclarativeInstruction::StoreVector3D: + case QQmlInstruction::StoreVector3D: qWarning().nospace() << idx << "\t\t" << "STORE_VECTOR3D\t\t" << instr->storeVector3D.propertyIndex << "\t" << instr->storeVector3D.vector.xp << "\t" << instr->storeVector3D.vector.yp << "\t" << instr->storeVector3D.vector.zp; break; - case QDeclarativeInstruction::StoreVector4D: + case QQmlInstruction::StoreVector4D: qWarning().nospace() << idx << "\t\t" << "STORE_VECTOR4D\t\t" << instr->storeVector4D.propertyIndex << "\t" << instr->storeVector4D.vector.xp << "\t" << instr->storeVector4D.vector.yp << "\t" << instr->storeVector4D.vector.zp << "\t" << instr->storeVector4D.vector.wp; break; - case QDeclarativeInstruction::StoreVariant: + case QQmlInstruction::StoreVariant: qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value); break; - case QDeclarativeInstruction::StoreVariantInteger: + case QQmlInstruction::StoreVariantInteger: qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value; break; - case QDeclarativeInstruction::StoreVariantDouble: + case QQmlInstruction::StoreVariantDouble: qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value; break; - case QDeclarativeInstruction::StoreVariantBool: + case QQmlInstruction::StoreVariantBool: qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value; break; - case QDeclarativeInstruction::StoreObject: + case QQmlInstruction::StoreObject: qWarning().nospace() << idx << "\t\t" << "STORE_OBJECT\t\t" << instr->storeObject.propertyIndex; break; - case QDeclarativeInstruction::StoreVariantObject: + case QQmlInstruction::StoreVariantObject: qWarning().nospace() << idx << "\t\t" << "STORE_VARIANT_OBJECT\t" << instr->storeObject.propertyIndex; break; - case QDeclarativeInstruction::StoreInterface: + case QQmlInstruction::StoreInterface: qWarning().nospace() << idx << "\t\t" << "STORE_INTERFACE\t\t" << instr->storeObject.propertyIndex; break; - case QDeclarativeInstruction::StoreSignal: + case QQmlInstruction::StoreSignal: qWarning().nospace() << idx << "\t\t" << "STORE_SIGNAL\t\t" << instr->storeSignal.signalIndex << "\t" << instr->storeSignal.value << "\t\t" << primitives.at(instr->storeSignal.value); break; - case QDeclarativeInstruction::StoreImportedScript: + case QQmlInstruction::StoreImportedScript: qWarning().nospace() << idx << "\t\t" << "STORE_IMPORTED_SCRIPT\t" << instr->storeScript.value; break; - case QDeclarativeInstruction::StoreScriptString: + case QQmlInstruction::StoreScriptString: qWarning().nospace() << idx << "\t\t" << "STORE_SCRIPT_STRING\t" << instr->storeScriptString.propertyIndex << "\t" << instr->storeScriptString.value << "\t" << instr->storeScriptString.scope << "\t" << instr->storeScriptString.bindingId; break; - case QDeclarativeInstruction::AssignSignalObject: + case QQmlInstruction::AssignSignalObject: qWarning().nospace() << idx << "\t\t" << "ASSIGN_SIGNAL_OBJECT\t" << instr->assignSignalObject.signal << "\t\t\t" << primitives.at(instr->assignSignalObject.signal); break; - case QDeclarativeInstruction::AssignCustomType: + case QQmlInstruction::AssignCustomType: qWarning().nospace() << idx << "\t\t" << "ASSIGN_CUSTOMTYPE\t" << instr->assignCustomType.propertyIndex << "\t" << instr->assignCustomType.primitive << "\t" << instr->assignCustomType.type; break; - case QDeclarativeInstruction::InitV8Bindings: + case QQmlInstruction::InitV8Bindings: qWarning().nospace() << idx << "\t\t" << "INIT_V8_BINDING\t" << instr->initV8Bindings.programIndex << "\t" << instr->initV8Bindings.line; break; - case QDeclarativeInstruction::StoreBinding: + case QQmlInstruction::StoreBinding: qWarning().nospace() << idx << "\t\t" << "STORE_BINDING\t" << instr->assignBinding.property.coreIndex << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context; break; - case QDeclarativeInstruction::StoreBindingOnAlias: + case QQmlInstruction::StoreBindingOnAlias: qWarning().nospace() << idx << "\t\t" << "STORE_BINDING_ALIAS\t" << instr->assignBinding.property.coreIndex << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context; break; - case QDeclarativeInstruction::StoreV4Binding: + case QQmlInstruction::StoreV4Binding: qWarning().nospace() << idx << "\t\t" << "STORE_COMPILED_BINDING\t" << instr->assignV4Binding.property << "\t" << instr->assignV4Binding.value << "\t" << instr->assignV4Binding.context; break; - case QDeclarativeInstruction::StoreV8Binding: + case QQmlInstruction::StoreV8Binding: qWarning().nospace() << idx << "\t\t" << "STORE_V8_BINDING\t" << instr->assignBinding.property.coreIndex << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context; break; - case QDeclarativeInstruction::StoreValueSource: + case QQmlInstruction::StoreValueSource: qWarning().nospace() << idx << "\t\t" << "STORE_VALUE_SOURCE\t" << instr->assignValueSource.property.coreIndex << "\t" << instr->assignValueSource.castValue; break; - case QDeclarativeInstruction::StoreValueInterceptor: + case QQmlInstruction::StoreValueInterceptor: qWarning().nospace() << idx << "\t\t" << "STORE_VALUE_INTERCEPTOR\t" << instr->assignValueInterceptor.property.coreIndex << "\t" << instr->assignValueInterceptor.castValue; break; - case QDeclarativeInstruction::BeginObject: + case QQmlInstruction::BeginObject: qWarning().nospace() << idx << "\t\t" << "BEGIN\t\t\t" << instr->begin.castValue; break; - case QDeclarativeInstruction::StoreObjectQList: + case QQmlInstruction::StoreObjectQList: qWarning().nospace() << idx << "\t\t" << "STORE_OBJECT_QLIST"; break; - case QDeclarativeInstruction::AssignObjectList: + case QQmlInstruction::AssignObjectList: qWarning().nospace() << idx << "\t\t" << "ASSIGN_OBJECT_LIST"; break; - case QDeclarativeInstruction::FetchAttached: + case QQmlInstruction::FetchAttached: qWarning().nospace() << idx << "\t\t" << "FETCH_ATTACHED\t\t" << instr->fetchAttached.id; break; - case QDeclarativeInstruction::FetchQList: + case QQmlInstruction::FetchQList: qWarning().nospace() << idx << "\t\t" << "FETCH_QLIST\t\t" << instr->fetch.property; break; - case QDeclarativeInstruction::FetchObject: + case QQmlInstruction::FetchObject: qWarning().nospace() << idx << "\t\t" << "FETCH\t\t\t" << instr->fetch.property; break; - case QDeclarativeInstruction::FetchValueType: + case QQmlInstruction::FetchValueType: qWarning().nospace() << idx << "\t\t" << "FETCH_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type << "\t" << instr->fetchValue.bindingSkipList; break; - case QDeclarativeInstruction::PopFetchedObject: + case QQmlInstruction::PopFetchedObject: qWarning().nospace() << idx << "\t\t" << "POP"; break; - case QDeclarativeInstruction::PopQList: + case QQmlInstruction::PopQList: qWarning().nospace() << idx << "\t\t" << "POP_QLIST"; break; - case QDeclarativeInstruction::PopValueType: + case QQmlInstruction::PopValueType: qWarning().nospace() << idx << "\t\t" << "POP_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type; break; - case QDeclarativeInstruction::Defer: + case QQmlInstruction::Defer: qWarning().nospace() << idx << "\t\t" << "DEFER" << "\t\t\t" << instr->defer.deferCount; break; default: @@ -265,9 +265,9 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx) #endif // QT_NO_DEBUG_STREAM } -int QDeclarativeInstruction::size(Type type) +int QQmlInstruction::size(Type type) { -#define QML_RETURN_INSTR_SIZE(I, FMT) case I: return QDeclarativeInstructionMeta<(int)I>::Size; +#define QML_RETURN_INSTR_SIZE(I, FMT) case I: return QQmlInstructionMeta<(int)I>::Size; switch (type) { FOR_EACH_QML_INSTR(QML_RETURN_INSTR_SIZE) default: return 0; diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/qml/qml/qqmlinstruction_p.h index dee712d0dc..b7533aca68 100644 --- a/src/declarative/qml/qdeclarativeinstruction_p.h +++ b/src/qml/qml/qqmlinstruction_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINSTRUCTION_P_H -#define QDECLARATIVEINSTRUCTION_P_H +#ifndef QQMLINSTRUCTION_P_H +#define QQMLINSTRUCTION_P_H // // W A R N I N G @@ -54,7 +54,7 @@ // #include <QtCore/qglobal.h> -#include <private/qdeclarativepropertycache_p.h> +#include <private/qqmlpropertycache_p.h> QT_BEGIN_NAMESPACE @@ -138,7 +138,7 @@ QT_BEGIN_NAMESPACE #endif #ifdef Q_ALIGNOF -# define QML_INSTR_ALIGN_MASK (Q_ALIGNOF(QDeclarativeInstruction) - 1) +# define QML_INSTR_ALIGN_MASK (Q_ALIGNOF(QQmlInstruction) - 1) #else # define QML_INSTR_ALIGN_MASK (sizeof(void *) - 1) #endif @@ -150,10 +150,10 @@ QT_BEGIN_NAMESPACE #endif #define QML_INSTR_ENUM(I, FMT) I, -#define QML_INSTR_SIZE(I, FMT) ((sizeof(QDeclarativeInstruction::instr_##FMT) + QML_INSTR_ALIGN_MASK) & ~QML_INSTR_ALIGN_MASK) +#define QML_INSTR_SIZE(I, FMT) ((sizeof(QQmlInstruction::instr_##FMT) + QML_INSTR_ALIGN_MASK) & ~QML_INSTR_ALIGN_MASK) -class QDeclarativeCompiledData; -union QDeclarativeInstruction +class QQmlCompiledData; +union QQmlInstruction { enum Type { FOR_EACH_QML_INSTR(QML_INSTR_ENUM) @@ -219,13 +219,13 @@ union QDeclarativeInstruction }; struct instr_assignValueSource { QML_INSTR_HEADER - QDeclarativePropertyRawData property; + QQmlPropertyRawData property; int owner; int castValue; }; struct instr_assignValueInterceptor { QML_INSTR_HEADER - QDeclarativePropertyRawData property; + QQmlPropertyRawData property; int owner; int castValue; }; @@ -246,7 +246,7 @@ union QDeclarativeInstruction }; struct instr_assignBinding { QML_INSTR_HEADER - QDeclarativePropertyRawData property; + QQmlPropertyRawData property; int value; short context; short owner; @@ -535,24 +535,24 @@ union QDeclarativeInstruction }; template<int N> -struct QDeclarativeInstructionMeta { +struct QQmlInstructionMeta { }; #define QML_INSTR_META_TEMPLATE(I, FMT) \ - template<> struct QDeclarativeInstructionMeta<(int)QDeclarativeInstruction::I> { \ + template<> struct QQmlInstructionMeta<(int)QQmlInstruction::I> { \ enum { Size = QML_INSTR_SIZE(I, FMT) }; \ - typedef QDeclarativeInstruction::instr_##FMT DataType; \ - static const DataType &data(const QDeclarativeInstruction &instr) { return instr.FMT; } \ - static void setData(QDeclarativeInstruction &instr, const DataType &v) { instr.FMT = v; } \ + typedef QQmlInstruction::instr_##FMT DataType; \ + static const DataType &data(const QQmlInstruction &instr) { return instr.FMT; } \ + static void setData(QQmlInstruction &instr, const DataType &v) { instr.FMT = v; } \ }; FOR_EACH_QML_INSTR(QML_INSTR_META_TEMPLATE); #undef QML_INSTR_META_TEMPLATE template<int Instr> -class QDeclarativeInstructionData : public QDeclarativeInstructionMeta<Instr>::DataType +class QQmlInstructionData : public QQmlInstructionMeta<Instr>::DataType { }; QT_END_NAMESPACE -#endif // QDECLARATIVEINSTRUCTION_P_H +#endif // QQMLINSTRUCTION_P_H diff --git a/src/declarative/qml/qdeclarativeintegercache.cpp b/src/qml/qml/qqmlintegercache.cpp index 61f6f3c8e1..88ea3af2de 100644 --- a/src/declarative/qml/qdeclarativeintegercache.cpp +++ b/src/qml/qml/qqmlintegercache.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,19 +39,19 @@ ** ****************************************************************************/ -#include "qdeclarativeintegercache_p.h" +#include "qqmlintegercache_p.h" QT_BEGIN_NAMESPACE -QDeclarativeIntegerCache::QDeclarativeIntegerCache() +QQmlIntegerCache::QQmlIntegerCache() { } -QDeclarativeIntegerCache::~QDeclarativeIntegerCache() +QQmlIntegerCache::~QQmlIntegerCache() { } -QString QDeclarativeIntegerCache::findId(int value) const +QString QQmlIntegerCache::findId(int value) const { for (StringCache::ConstIterator iter = stringCache.begin(); iter != stringCache.end(); ++iter) { @@ -61,19 +61,19 @@ QString QDeclarativeIntegerCache::findId(int value) const return QString(); } -void QDeclarativeIntegerCache::reserve(int size) +void QQmlIntegerCache::reserve(int size) { stringCache.reserve(size); } -void QDeclarativeIntegerCache::add(const QString &id, int value) +void QQmlIntegerCache::add(const QString &id, int value) { Q_ASSERT(!stringCache.contains(id)); stringCache.insert(id, value); } -int QDeclarativeIntegerCache::value(const QString &id) +int QQmlIntegerCache::value(const QString &id) { int *rv = stringCache.value(id); return rv?*rv:-1; diff --git a/src/declarative/qml/qdeclarativeintegercache_p.h b/src/qml/qml/qqmlintegercache_p.h index a40100722e..317a86b45a 100644 --- a/src/declarative/qml/qdeclarativeintegercache_p.h +++ b/src/qml/qml/qqmlintegercache_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEINTEGERCACHE_P_H -#define QDECLARATIVEINTEGERCACHE_P_H +#ifndef QQMLINTEGERCACHE_P_H +#define QQMLINTEGERCACHE_P_H // // W A R N I N G @@ -53,18 +53,18 @@ // We mean it. // -#include <private/qdeclarativerefcount_p.h> +#include <private/qqmlrefcount_p.h> #include <private/qhashedstring_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeType; -class QDeclarativeEngine; -class QDeclarativeIntegerCache : public QDeclarativeRefCount +class QQmlType; +class QQmlEngine; +class QQmlIntegerCache : public QQmlRefCount { public: - QDeclarativeIntegerCache(); - virtual ~QDeclarativeIntegerCache(); + QQmlIntegerCache(); + virtual ~QQmlIntegerCache(); inline int count() const; void add(const QString &, int); @@ -80,18 +80,18 @@ private: StringCache stringCache; }; -int QDeclarativeIntegerCache::value(const QHashedV8String &name) +int QQmlIntegerCache::value(const QHashedV8String &name) { int *result = stringCache.value(name); return result?*result:-1; } -int QDeclarativeIntegerCache::count() const +int QQmlIntegerCache::count() const { return stringCache.count(); } QT_END_NAMESPACE -#endif // QDECLARATIVEINTEGERCACHE_P_H +#endif // QQMLINTEGERCACHE_P_H diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/qml/qml/qqmllist.cpp index 128bd0b86f..00fd805ee0 100644 --- a/src/declarative/qml/qdeclarativelist.cpp +++ b/src/qml/qml/qqmllist.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,45 +39,45 @@ ** ****************************************************************************/ -#include "qdeclarativelist.h" -#include "qdeclarativelist_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativeproperty_p.h" +#include "qqmllist.h" +#include "qqmllist_p.h" +#include "qqmlengine_p.h" +#include "qqmlproperty_p.h" QT_BEGIN_NAMESPACE -QDeclarativeListReferencePrivate::QDeclarativeListReferencePrivate() +QQmlListReferencePrivate::QQmlListReferencePrivate() : propertyType(-1), refCount(1) { } -QDeclarativeListReference QDeclarativeListReferencePrivate::init(const QDeclarativeListProperty<QObject> &prop, int propType, QDeclarativeEngine *engine) +QQmlListReference QQmlListReferencePrivate::init(const QQmlListProperty<QObject> &prop, int propType, QQmlEngine *engine) { - QDeclarativeListReference rv; + QQmlListReference rv; if (!prop.object) return rv; - QDeclarativeEnginePrivate *p = engine?QDeclarativeEnginePrivate::get(engine):0; + QQmlEnginePrivate *p = engine?QQmlEnginePrivate::get(engine):0; - int listType = p?p->listType(propType):QDeclarativeMetaType::listType(propType); + int listType = p?p->listType(propType):QQmlMetaType::listType(propType); if (listType == -1) return rv; - rv.d = new QDeclarativeListReferencePrivate; + rv.d = new QQmlListReferencePrivate; rv.d->object = prop.object; - rv.d->elementType = p?p->rawMetaObjectForType(listType):QDeclarativeMetaType::qmlType(listType)->baseMetaObject(); + rv.d->elementType = p?p->rawMetaObjectForType(listType):QQmlMetaType::qmlType(listType)->baseMetaObject(); rv.d->property = prop; rv.d->propertyType = propType; return rv; } -void QDeclarativeListReferencePrivate::addref() +void QQmlListReferencePrivate::addref() { Q_ASSERT(refCount > 0); ++refCount; } -void QDeclarativeListReferencePrivate::release() +void QQmlListReferencePrivate::release() { Q_ASSERT(refCount > 0); --refCount; @@ -86,20 +86,20 @@ void QDeclarativeListReferencePrivate::release() } /*! -\class QDeclarativeListReference +\class QQmlListReference \since 4.7 -\module QtDeclarative -\brief The QDeclarativeListReference class allows the manipulation of QDeclarativeListProperty properties. +\module QtQml +\brief The QQmlListReference class allows the manipulation of QQmlListProperty properties. -QDeclarativeListReference allows C++ programs to read from, and assign values to a QML list property in a -simple and type safe way. A QDeclarativeListReference can be created by passing an object and property -name or through a QDeclarativeProperty instance. These two are equivalant: +QQmlListReference allows C++ programs to read from, and assign values to a QML list property in a +simple and type safe way. A QQmlListReference can be created by passing an object and property +name or through a QQmlProperty instance. These two are equivalant: \code -QDeclarativeListReference ref1(object, "children"); +QQmlListReference ref1(object, "children"); -QDeclarativeProperty ref2(object, "children"); -QDeclarativeListReference ref2 = qvariant_cast<QDeclarativeListReference>(ref2.read()); +QQmlProperty ref2(object, "children"); +QQmlListReference ref2 = qvariant_cast<QQmlListReference>(ref2.read()); \endcode Not all QML list properties support all operations. A set of methods, canAppend(), canAt(), canClear() and @@ -116,39 +116,39 @@ that it does not request an out of range element using the count() method before /*! Constructs an invalid instance. */ -QDeclarativeListReference::QDeclarativeListReference() +QQmlListReference::QQmlListReference() : d(0) { } /*! -Constructs a QDeclarativeListReference for \a object's \a property. If \a property is not a list -property, an invalid QDeclarativeListReference is created. If \a object is destroyed after +Constructs a QQmlListReference for \a object's \a property. If \a property is not a list +property, an invalid QQmlListReference is created. If \a object is destroyed after the reference is constructed, it will automatically become invalid. That is, it is safe to hold -QDeclarativeListReference instances even after \a object is deleted. +QQmlListReference instances even after \a object is deleted. Passing \a engine is required to access some QML created list properties. If in doubt, and an engine is available, pass it. */ -QDeclarativeListReference::QDeclarativeListReference(QObject *object, const char *property, QDeclarativeEngine *engine) +QQmlListReference::QQmlListReference(QObject *object, const char *property, QQmlEngine *engine) : d(0) { if (!object || !property) return; - QDeclarativePropertyData local; - QDeclarativePropertyData *data = - QDeclarativePropertyCache::property(engine, object, QLatin1String(property), local); + QQmlPropertyData local; + QQmlPropertyData *data = + QQmlPropertyCache::property(engine, object, QLatin1String(property), local); if (!data || !data->isQList()) return; - QDeclarativeEnginePrivate *p = engine?QDeclarativeEnginePrivate::get(engine):0; + QQmlEnginePrivate *p = engine?QQmlEnginePrivate::get(engine):0; - int listType = p?p->listType(data->propType):QDeclarativeMetaType::listType(data->propType); + int listType = p?p->listType(data->propType):QQmlMetaType::listType(data->propType); if (listType == -1) return; - d = new QDeclarativeListReferencePrivate; + d = new QQmlListReferencePrivate; d->object = object; - d->elementType = p?p->rawMetaObjectForType(listType):QDeclarativeMetaType::qmlType(listType)->baseMetaObject(); + d->elementType = p?p->rawMetaObjectForType(listType):QQmlMetaType::qmlType(listType)->baseMetaObject(); d->propertyType = data->propType; void *args[] = { &d->property, 0 }; @@ -156,14 +156,14 @@ QDeclarativeListReference::QDeclarativeListReference(QObject *object, const char } /*! \internal */ -QDeclarativeListReference::QDeclarativeListReference(const QDeclarativeListReference &o) +QQmlListReference::QQmlListReference(const QQmlListReference &o) : d(o.d) { if (d) d->addref(); } /*! \internal */ -QDeclarativeListReference &QDeclarativeListReference::operator=(const QDeclarativeListReference &o) +QQmlListReference &QQmlListReference::operator=(const QQmlListReference &o) { if (o.d) o.d->addref(); if (d) d->release(); @@ -172,7 +172,7 @@ QDeclarativeListReference &QDeclarativeListReference::operator=(const QDeclarati } /*! \internal */ -QDeclarativeListReference::~QDeclarativeListReference() +QQmlListReference::~QQmlListReference() { if (d) d->release(); } @@ -180,7 +180,7 @@ QDeclarativeListReference::~QDeclarativeListReference() /*! Returns true if the instance refers to a valid list property, otherwise false. */ -bool QDeclarativeListReference::isValid() const +bool QQmlListReference::isValid() const { return d && d->object; } @@ -188,7 +188,7 @@ bool QDeclarativeListReference::isValid() const /*! Returns the list property's object. Returns 0 if the reference is invalid. */ -QObject *QDeclarativeListReference::object() const +QObject *QQmlListReference::object() const { if (isValid()) return d->object; else return 0; @@ -201,7 +201,7 @@ is invalid. The QMetaObject can be used ahead of time to determine whether a given instance can be added to a list. */ -const QMetaObject *QDeclarativeListReference::listElementType() const +const QMetaObject *QQmlListReference::listElementType() const { if (isValid()) return d->elementType; else return 0; @@ -213,7 +213,7 @@ reference is invalid. \sa append() */ -bool QDeclarativeListReference::canAppend() const +bool QQmlListReference::canAppend() const { return (isValid() && d->property.append); } @@ -224,7 +224,7 @@ reference is invalid. \sa at() */ -bool QDeclarativeListReference::canAt() const +bool QQmlListReference::canAt() const { return (isValid() && d->property.at); } @@ -235,7 +235,7 @@ reference is invalid. \sa clear() */ -bool QDeclarativeListReference::canClear() const +bool QQmlListReference::canClear() const { return (isValid() && d->property.clear); } @@ -246,7 +246,7 @@ Returns false if the reference is invalid. \sa count() */ -bool QDeclarativeListReference::canCount() const +bool QQmlListReference::canCount() const { return (isValid() && d->property.count); } @@ -256,11 +256,11 @@ Appends \a object to the list. Returns true if the operation succeeded, otherwi \sa canAppend() */ -bool QDeclarativeListReference::append(QObject *object) const +bool QQmlListReference::append(QObject *object) const { if (!canAppend()) return false; - if (object && !QDeclarativePropertyPrivate::canConvert(object->metaObject(), d->elementType)) + if (object && !QQmlPropertyPrivate::canConvert(object->metaObject(), d->elementType)) return false; d->property.append(&d->property, object); @@ -273,7 +273,7 @@ Returns the list element at \a index, or 0 if the operation failed. \sa canAt() */ -QObject *QDeclarativeListReference::at(int index) const +QObject *QQmlListReference::at(int index) const { if (!canAt()) return 0; @@ -285,7 +285,7 @@ Clears the list. Returns true if the operation succeeded, otherwise false. \sa canClear() */ -bool QDeclarativeListReference::clear() const +bool QQmlListReference::clear() const { if (!canClear()) return false; @@ -297,7 +297,7 @@ bool QDeclarativeListReference::clear() const /*! Returns the number of objects in the list, or 0 if the operation failed. */ -int QDeclarativeListReference::count() const +int QQmlListReference::count() const { if (!canCount()) return 0; @@ -305,9 +305,9 @@ int QDeclarativeListReference::count() const } /*! -\class QDeclarativeListProperty +\class QQmlListProperty \since 4.7 -\brief The QDeclarativeListProperty class allows applications to expose list-like +\brief The QQmlListProperty class allows applications to expose list-like properties to QML. QML has many list properties, where more than one object value can be assigned. @@ -323,38 +323,38 @@ FruitBasket { } \endcode -The QDeclarativeListProperty encapsulates a group of function pointers that represet the +The QQmlListProperty encapsulates a group of function pointers that represet the set of actions QML can perform on the list - adding items, retrieving items and clearing the list. In the future, additional operations may be supported. All list properties must implement the append operation, but the rest are optional. To provide a list property, a C++ class must implement the operation callbacks, -and then return an appropriate QDeclarativeListProperty value from the property getter. +and then return an appropriate QQmlListProperty value from the property getter. List properties should have no setter. In the example above, the Q_PROPERTY() declarative will look like this: \code -Q_PROPERTY(QDeclarativeListProperty<Fruit> fruit READ fruit); +Q_PROPERTY(QQmlListProperty<Fruit> fruit READ fruit); \endcode QML list properties are typesafe - in this case \c {Fruit} is a QObject type that \c {Apple}, \c {Orange} and \c {Banana} all derive from. -\note QDeclarativeListProperty can only be used for lists of QObject-derived object pointers. +\note QQmlListProperty can only be used for lists of QObject-derived object pointers. \sa {Object and List Property Types} */ /*! -\fn QDeclarativeListProperty::QDeclarativeListProperty() +\fn QQmlListProperty::QQmlListProperty() \internal */ /*! -\fn QDeclarativeListProperty::QDeclarativeListProperty(QObject *object, QList<T *> &list) +\fn QQmlListProperty::QQmlListProperty(QObject *object, QList<T *> &list) -Convenience constructor for making a QDeclarativeListProperty value from an existing +Convenience constructor for making a QQmlListProperty value from an existing QList \a list. The \a list reference must remain valid for as long as \a object exists. \a object must be provided. @@ -364,11 +364,11 @@ can very useful while prototyping. */ /*! -\fn QDeclarativeListProperty::QDeclarativeListProperty(QObject *object, void *data, AppendFunction append, +\fn QQmlListProperty::QQmlListProperty(QObject *object, void *data, AppendFunction append, CountFunction count = 0, AtFunction at = 0, ClearFunction clear = 0) -Construct a QDeclarativeListProperty from a set of operation functions. An opaque \a data handle +Construct a QQmlListProperty from a set of operation functions. An opaque \a data handle may be passed which can be accessed from within the operation functions. The list property remains valid while \a object exists. @@ -377,39 +377,39 @@ The \a append operation is compulsory and must be provided, while the \a count, */ /*! -\typedef QDeclarativeListProperty::AppendFunction +\typedef QQmlListProperty::AppendFunction -Synonym for \c {void (*)(QDeclarativeListProperty<T> *property, T *value)}. +Synonym for \c {void (*)(QQmlListProperty<T> *property, T *value)}. Append the \a value to the list \a property. */ /*! -\typedef QDeclarativeListProperty::CountFunction +\typedef QQmlListProperty::CountFunction -Synonym for \c {int (*)(QDeclarativeListProperty<T> *property)}. +Synonym for \c {int (*)(QQmlListProperty<T> *property)}. Return the number of elements in the list \a property. */ /*! -\fn bool QDeclarativeListProperty::operator==(const QDeclarativeListProperty &other) const +\fn bool QQmlListProperty::operator==(const QQmlListProperty &other) const -Returns true if this QDeclarativeListProperty is equal to \a other, otherwise false. +Returns true if this QQmlListProperty is equal to \a other, otherwise false. */ /*! -\typedef QDeclarativeListProperty::AtFunction +\typedef QQmlListProperty::AtFunction -Synonym for \c {T *(*)(QDeclarativeListProperty<T> *property, int index)}. +Synonym for \c {T *(*)(QQmlListProperty<T> *property, int index)}. Return the element at position \a index in the list \a property. */ /*! -\typedef QDeclarativeListProperty::ClearFunction +\typedef QQmlListProperty::ClearFunction -Synonym for \c {void (*)(QDeclarativeListProperty<T> *property)}. +Synonym for \c {void (*)(QQmlListProperty<T> *property)}. Clear the list \a property. */ diff --git a/src/declarative/qml/qdeclarativelist.h b/src/qml/qml/qqmllist.h index d1cebd240a..3f23cedbc2 100644 --- a/src/declarative/qml/qdeclarativelist.h +++ b/src/qml/qml/qqmllist.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELIST_H -#define QDECLARATIVELIST_H +#ifndef QQMLLIST_H +#define QQMLLIST_H -#include <QtCore/qglobal.h> +#include <QtQml/qtqmlglobal.h> #include <QtCore/qlist.h> #include <QtCore/qvariant.h> @@ -54,26 +54,26 @@ QT_BEGIN_NAMESPACE class QObject; struct QMetaObject; -#ifndef QDECLARATIVELISTPROPERTY -#define QDECLARATIVELISTPROPERTY +#ifndef QQMLLISTPROPERTY +#define QQMLLISTPROPERTY template<typename T> -class QDeclarativeListProperty { +class QQmlListProperty { public: - typedef void (*AppendFunction)(QDeclarativeListProperty<T> *, T*); - typedef int (*CountFunction)(QDeclarativeListProperty<T> *); - typedef T *(*AtFunction)(QDeclarativeListProperty<T> *, int); - typedef void (*ClearFunction)(QDeclarativeListProperty<T> *); + typedef void (*AppendFunction)(QQmlListProperty<T> *, T*); + typedef int (*CountFunction)(QQmlListProperty<T> *); + typedef T *(*AtFunction)(QQmlListProperty<T> *, int); + typedef void (*ClearFunction)(QQmlListProperty<T> *); - QDeclarativeListProperty() + QQmlListProperty() : object(0), data(0), append(0), count(0), at(0), clear(0), dummy1(0), dummy2(0) {} - QDeclarativeListProperty(QObject *o, QList<T *> &list) + QQmlListProperty(QObject *o, QList<T *> &list) : object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at), clear(qlist_clear), dummy1(0), dummy2(0) {} - QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0, + QQmlListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0, ClearFunction r = 0) : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {} - bool operator==(const QDeclarativeListProperty &o) const { + bool operator==(const QQmlListProperty &o) const { return object == o.object && data == o.data && append == o.append && @@ -96,31 +96,31 @@ public: void *dummy2; private: - static void qlist_append(QDeclarativeListProperty *p, T *v) { + static void qlist_append(QQmlListProperty *p, T *v) { reinterpret_cast<QList<T *> *>(p->data)->append(v); } - static int qlist_count(QDeclarativeListProperty *p) { + static int qlist_count(QQmlListProperty *p) { return reinterpret_cast<QList<T *> *>(p->data)->count(); } - static T *qlist_at(QDeclarativeListProperty *p, int idx) { + static T *qlist_at(QQmlListProperty *p, int idx) { return reinterpret_cast<QList<T *> *>(p->data)->at(idx); } - static void qlist_clear(QDeclarativeListProperty *p) { + static void qlist_clear(QQmlListProperty *p) { return reinterpret_cast<QList<T *> *>(p->data)->clear(); } }; #endif -class QDeclarativeEngine; -class QDeclarativeListReferencePrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeListReference +class QQmlEngine; +class QQmlListReferencePrivate; +class Q_QML_EXPORT QQmlListReference { public: - QDeclarativeListReference(); - QDeclarativeListReference(QObject *, const char *property, QDeclarativeEngine * = 0); - QDeclarativeListReference(const QDeclarativeListReference &); - QDeclarativeListReference &operator=(const QDeclarativeListReference &); - ~QDeclarativeListReference(); + QQmlListReference(); + QQmlListReference(QObject *, const char *property, QQmlEngine * = 0); + QQmlListReference(const QQmlListReference &); + QQmlListReference &operator=(const QQmlListReference &); + ~QQmlListReference(); bool isValid() const; @@ -138,14 +138,14 @@ public: int count() const; private: - friend class QDeclarativeListReferencePrivate; - QDeclarativeListReferencePrivate* d; + friend class QQmlListReferencePrivate; + QQmlListReferencePrivate* d; }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeListReference) +Q_DECLARE_METATYPE(QQmlListReference) QT_END_HEADER -#endif // QDECLARATIVELIST_H +#endif // QQMLLIST_H diff --git a/src/declarative/qml/qdeclarativelist_p.h b/src/qml/qml/qqmllist_p.h index 60d4d28558..0fe0ed3d44 100644 --- a/src/declarative/qml/qdeclarativelist_p.h +++ b/src/qml/qml/qqmllist_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELIST_P_H -#define QDECLARATIVELIST_P_H +#ifndef QQMLLIST_P_H +#define QQMLLIST_P_H // // W A R N I N G @@ -53,28 +53,28 @@ // We mean it. // -#include "qdeclarativelist.h" -#include "qdeclarativeguard_p.h" +#include "qqmllist.h" +#include "qqmlguard_p.h" QT_BEGIN_NAMESPACE -class QDeclarativeListReferencePrivate +class QQmlListReferencePrivate { public: - QDeclarativeListReferencePrivate(); + QQmlListReferencePrivate(); - static QDeclarativeListReference init(const QDeclarativeListProperty<QObject> &, int, QDeclarativeEngine *); + static QQmlListReference init(const QQmlListProperty<QObject> &, int, QQmlEngine *); - QDeclarativeGuard<QObject> object; + QQmlGuard<QObject> object; const QMetaObject *elementType; - QDeclarativeListProperty<QObject> property; + QQmlListProperty<QObject> property; int propertyType; void addref(); void release(); int refCount; - static inline QDeclarativeListReferencePrivate *get(QDeclarativeListReference *ref) { + static inline QQmlListReferencePrivate *get(QQmlListReference *ref) { return ref->d; } }; @@ -82,4 +82,4 @@ public: QT_END_NAMESPACE -#endif // QDECLARATIVELIST_P_H +#endif // QQMLLIST_P_H diff --git a/src/declarative/qml/qdeclarativelocale.cpp b/src/qml/qml/qqmllocale.cpp index 39d0f6c378..4dc30f27ea 100644 --- a/src/declarative/qml/qdeclarativelocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qdeclarativelocale_p.h" -#include "qdeclarativeengine_p.h" -#include <private/qdeclarativecontext_p.h> +#include "qqmllocale_p.h" +#include "qqmlengine_p.h" +#include <private/qqmlcontext_p.h> #include <private/qjsconverter_impl_p.h> #include <QtCore/qnumeric.h> #include <QtCore/qdatetime.h> @@ -142,7 +142,7 @@ static void registerFunction(QV8Engine *engine, const char *script, v8::Invocati registerFunc->Call(v8::Local<v8::Object>::Cast(registerFunc), 1, &args); } -void QDeclarativeDateExtension::registerExtension(QV8Engine *engine) +void QQmlDateExtension::registerExtension(QV8Engine *engine) { registerFunction(engine, dateToLocaleStringFunction, toLocaleString); registerFunction(engine, dateToLocaleTimeStringFunction, toLocaleTimeString); @@ -152,7 +152,7 @@ void QDeclarativeDateExtension::registerExtension(QV8Engine *engine) registerFunction(engine, dateFromLocaleDateStringFunction, fromLocaleDateString); } -v8::Handle<v8::Value> QDeclarativeDateExtension::toLocaleString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlDateExtension::toLocaleString(const v8::Arguments& args) { if (args.Length() > 2) return v8::Undefined(); @@ -193,7 +193,7 @@ v8::Handle<v8::Value> QDeclarativeDateExtension::toLocaleString(const v8::Argume return r->engine->toString(formattedDt); } -v8::Handle<v8::Value> QDeclarativeDateExtension::toLocaleTimeString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlDateExtension::toLocaleTimeString(const v8::Arguments& args) { if (args.Length() > 2) return v8::Undefined(); @@ -235,7 +235,7 @@ v8::Handle<v8::Value> QDeclarativeDateExtension::toLocaleTimeString(const v8::Ar return r->engine->toString(formattedTime); } -v8::Handle<v8::Value> QDeclarativeDateExtension::toLocaleDateString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlDateExtension::toLocaleDateString(const v8::Arguments& args) { if (args.Length() > 2) return v8::Undefined(); @@ -277,7 +277,7 @@ v8::Handle<v8::Value> QDeclarativeDateExtension::toLocaleDateString(const v8::Ar return r->engine->toString(formattedDate); } -v8::Handle<v8::Value> QDeclarativeDateExtension::fromLocaleString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlDateExtension::fromLocaleString(const v8::Arguments& args) { if (args.Length() == 1 && args[0]->IsString()) { QLocale locale; @@ -312,7 +312,7 @@ v8::Handle<v8::Value> QDeclarativeDateExtension::fromLocaleString(const v8::Argu return QJSConverter::toDateTime(dt); } -v8::Handle<v8::Value> QDeclarativeDateExtension::fromLocaleTimeString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlDateExtension::fromLocaleTimeString(const v8::Arguments& args) { if (args.Length() == 1 && args[0]->IsString()) { QLocale locale; @@ -352,7 +352,7 @@ v8::Handle<v8::Value> QDeclarativeDateExtension::fromLocaleTimeString(const v8:: return QJSConverter::toDateTime(dt); } -v8::Handle<v8::Value> QDeclarativeDateExtension::fromLocaleDateString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlDateExtension::fromLocaleDateString(const v8::Arguments& args) { if (args.Length() == 1 && args[0]->IsString()) { QLocale locale; @@ -416,14 +416,14 @@ static const char *numberFromLocaleStringFunction = "})"; -void QDeclarativeNumberExtension::registerExtension(QV8Engine *engine) +void QQmlNumberExtension::registerExtension(QV8Engine *engine) { registerFunction(engine, numberToLocaleStringFunction, toLocaleString); registerFunction(engine, numberToLocaleCurrencyStringFunction, toLocaleCurrencyString); registerFunction(engine, numberFromLocaleStringFunction, fromLocaleString); } -v8::Handle<v8::Value> QDeclarativeNumberExtension::toLocaleString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlNumberExtension::toLocaleString(const v8::Arguments& args) { if (args.Length() > 3) V8THROW_ERROR("Locale: Number.toLocaleString(): Invalid arguments"); @@ -459,7 +459,7 @@ v8::Handle<v8::Value> QDeclarativeNumberExtension::toLocaleString(const v8::Argu return r->engine->toString(r->locale.toString(number, (char)format, prec)); } -v8::Handle<v8::Value> QDeclarativeNumberExtension::toLocaleCurrencyString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlNumberExtension::toLocaleCurrencyString(const v8::Arguments& args) { if (args.Length() > 2) V8THROW_ERROR("Locale: Number.toLocaleCurrencyString(): Invalid arguments"); @@ -487,7 +487,7 @@ v8::Handle<v8::Value> QDeclarativeNumberExtension::toLocaleCurrencyString(const return r->engine->toString(r->locale.toCurrencyString(number, symbol)); } -v8::Handle<v8::Value> QDeclarativeNumberExtension::fromLocaleString(const v8::Arguments& args) +v8::Handle<v8::Value> QQmlNumberExtension::fromLocaleString(const v8::Arguments& args) { if (args.Length() < 1 || args.Length() > 2) V8THROW_ERROR("Locale: Number.fromLocaleString(): Invalid arguments"); @@ -743,7 +743,7 @@ QV8LocaleDataDeletable::~QV8LocaleDataDeletable() V8_DEFINE_EXTENSION(QV8LocaleDataDeletable, localeV8Data); /*! - \qmlclass Locale QDeclarativeLocale + \qmlclass Locale QQmlLocale \inqmlmodule QtQuick 2 \brief The Locale object provides locale specific properties and formatted data. @@ -812,15 +812,15 @@ V8_DEFINE_EXTENSION(QV8LocaleDataDeletable, localeV8Data); \sa {QtQuick2::Date}{Date} {QtQuick2::Number}{Number} */ -QDeclarativeLocale::QDeclarativeLocale() +QQmlLocale::QQmlLocale() { } -QDeclarativeLocale::~QDeclarativeLocale() +QQmlLocale::~QQmlLocale() { } -v8::Handle<v8::Value> QDeclarativeLocale::locale(QV8Engine *v8engine, const QString &locale) +v8::Handle<v8::Value> QQmlLocale::locale(QV8Engine *v8engine, const QString &locale) { QV8LocaleDataDeletable *d = localeV8Data(v8engine); v8::Local<v8::Object> v8Value = d->constructor->NewInstance(); @@ -845,12 +845,12 @@ static const char *localeCompareFunction = " })" "})"; -void QDeclarativeLocale::registerStringLocaleCompare(QV8Engine *engine) +void QQmlLocale::registerStringLocaleCompare(QV8Engine *engine) { registerFunction(engine, localeCompareFunction, localeCompare); } -v8::Handle<v8::Value> QDeclarativeLocale::localeCompare(const v8::Arguments &args) +v8::Handle<v8::Value> QQmlLocale::localeCompare(const v8::Arguments &args) { if (args.Length() != 1 || (!args[0]->IsString() && !args[0]->IsStringObject())) return v8::Undefined(); diff --git a/src/declarative/qml/qdeclarativelocale_p.h b/src/qml/qml/qqmllocale_p.h index 98370fbf8a..2763ce4fc3 100644 --- a/src/declarative/qml/qdeclarativelocale_p.h +++ b/src/qml/qml/qqmllocale_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELOCALE_H -#define QDECLARATIVELOCALE_H +#ifndef QQMLLOCALE_H +#define QQMLLOCALE_H -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/qlocale.h> #include <QtCore/qobject.h> @@ -54,7 +54,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDateExtension +class QQmlDateExtension { public: static void registerExtension(QV8Engine *engine); @@ -69,7 +69,7 @@ private: }; -class QDeclarativeNumberExtension +class QQmlNumberExtension { public: static void registerExtension(QV8Engine *engine); @@ -81,7 +81,7 @@ private: }; -class Q_AUTOTEST_EXPORT QDeclarativeLocale +class Q_AUTOTEST_EXPORT QQmlLocale { Q_GADGET Q_ENUMS(MeasurementSystem) @@ -90,7 +90,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeLocale Q_ENUMS(DayOfWeek) public: - ~QDeclarativeLocale(); + ~QQmlLocale(); enum MeasurementSystem { MetricSystem = QLocale::MetricSystem, @@ -122,7 +122,7 @@ public: static void registerStringLocaleCompare(QV8Engine *engine); private: - QDeclarativeLocale(); + QQmlLocale(); static v8::Handle<v8::Value> localeCompare(const v8::Arguments &args); }; diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index ac9d23184f..2061530dc5 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include <QtDeclarative/qdeclarativeprivate.h> -#include "qdeclarativemetatype_p.h" +#include <QtQml/qqmlprivate.h> +#include "qqmlmetatype_p.h" -#include <private/qdeclarativeproxymetaobject_p.h> -#include <private/qdeclarativecustomparser_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlproxymetaobject_p.h> +#include <private/qqmlcustomparser_p.h> +#include <private/qqmlguard_p.h> #include <private/qhashedstring_p.h> #include <QtCore/qdebug.h> @@ -66,18 +66,18 @@ QT_BEGIN_NAMESPACE -struct QDeclarativeMetaTypeData +struct QQmlMetaTypeData { - QDeclarativeMetaTypeData(); - ~QDeclarativeMetaTypeData(); - QList<QDeclarativeType *> types; - typedef QHash<int, QDeclarativeType *> Ids; + QQmlMetaTypeData(); + ~QQmlMetaTypeData(); + QList<QQmlType *> types; + typedef QHash<int, QQmlType *> Ids; Ids idToType; - typedef QHash<QString, QDeclarativeType *> Names; + typedef QHash<QString, QQmlType *> Names; Names nameToType; - typedef QHash<const QMetaObject *, QDeclarativeType *> MetaObjects; + typedef QHash<const QMetaObject *, QQmlType *> MetaObjects; MetaObjects metaObjectToType; - typedef QHash<int, QDeclarativeMetaType::StringConverter> StringConverters; + typedef QHash<int, QQmlMetaType::StringConverter> StringConverters; StringConverters stringConverters; struct VersionedUri { @@ -91,12 +91,12 @@ struct QDeclarativeMetaTypeData QString uri; int majorVersion; }; - typedef QHash<VersionedUri, QDeclarativeTypeModule *> TypeModules; + typedef QHash<VersionedUri, QQmlTypeModule *> TypeModules; TypeModules uriToModule; struct ModuleApiList { ModuleApiList() : sorted(true) {} - QList<QDeclarativeMetaType::ModuleApi> moduleApis; + QList<QQmlMetaType::ModuleApi> moduleApis; bool sorted; }; typedef QHash<QString, ModuleApiList> ModuleApis; @@ -107,49 +107,49 @@ struct QDeclarativeMetaTypeData QBitArray interfaces; QBitArray lists; - QList<QDeclarativePrivate::AutoParentFunction> parentFunctions; + QList<QQmlPrivate::AutoParentFunction> parentFunctions; }; -class QDeclarativeTypeModulePrivate +class QQmlTypeModulePrivate { public: - QDeclarativeTypeModulePrivate() + QQmlTypeModulePrivate() : minMinorVersion(INT_MAX), maxMinorVersion(0) {} - QDeclarativeMetaTypeData::VersionedUri uri; + QQmlMetaTypeData::VersionedUri uri; int minMinorVersion; int maxMinorVersion; - void add(QDeclarativeType *); + void add(QQmlType *); - QStringHash<QList<QDeclarativeType *> > typeHash; - QList<QDeclarativeType *> types; + QStringHash<QList<QQmlType *> > typeHash; + QList<QQmlType *> types; }; -Q_GLOBAL_STATIC(QDeclarativeMetaTypeData, metaTypeData) +Q_GLOBAL_STATIC(QQmlMetaTypeData, metaTypeData) Q_GLOBAL_STATIC(QReadWriteLock, metaTypeDataLock) -static uint qHash(const QDeclarativeMetaTypeData::VersionedUri &v) +static uint qHash(const QQmlMetaTypeData::VersionedUri &v) { return qHash(v.uri) ^ qHash(v.majorVersion); } -QDeclarativeMetaTypeData::QDeclarativeMetaTypeData() +QQmlMetaTypeData::QQmlMetaTypeData() : moduleApiCount(0) { } -QDeclarativeMetaTypeData::~QDeclarativeMetaTypeData() +QQmlMetaTypeData::~QQmlMetaTypeData() { for (int i = 0; i < types.count(); ++i) delete types.at(i); } -class QDeclarativeTypePrivate +class QQmlTypePrivate { public: - QDeclarativeTypePrivate(); + QQmlTypePrivate(); void init() const; void initEnums() const; @@ -164,14 +164,14 @@ public: int m_typeId; int m_listId; int m_revision; mutable bool m_containsRevisionedAttributes; - mutable QDeclarativeType *m_superType; + mutable QQmlType *m_superType; int m_allocationSize; void (*m_newFunc)(void *); QString m_noCreationReason; const QMetaObject *m_baseMetaObject; - QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc; + QQmlAttachedPropertiesFunc m_attachedPropertiesFunc; const QMetaObject *m_attachedPropertiesType; int m_attachedPropertiesId; int m_parserStatusCast; @@ -180,19 +180,19 @@ public: QObject *(*m_extFunc)(QObject *); const QMetaObject *m_extMetaObject; int m_index; - QDeclarativeCustomParser *m_customParser; + QQmlCustomParser *m_customParser; mutable volatile bool m_isSetup:1; mutable volatile bool m_isEnumSetup:1; mutable bool m_haveSuperType:1; - mutable QList<QDeclarativeProxyMetaObject::ProxyData> m_metaObjects; + mutable QList<QQmlProxyMetaObject::ProxyData> m_metaObjects; mutable QStringHash<int> m_enums; static QHash<const QMetaObject *, int> m_attachedPropertyIds; }; -QHash<const QMetaObject *, int> QDeclarativeTypePrivate::m_attachedPropertyIds; +QHash<const QMetaObject *, int> QQmlTypePrivate::m_attachedPropertyIds; -QDeclarativeTypePrivate::QDeclarativeTypePrivate() +QQmlTypePrivate::QQmlTypePrivate() : m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0), m_revision(0), m_containsRevisionedAttributes(false), m_superType(0), m_allocationSize(0), m_newFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), m_attachedPropertiesType(0), m_parserStatusCast(-1), m_propertyValueSourceCast(-1), @@ -202,8 +202,8 @@ QDeclarativeTypePrivate::QDeclarativeTypePrivate() } -QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::RegisterInterface &interface) -: d(new QDeclarativeTypePrivate) +QQmlType::QQmlType(int index, const QQmlPrivate::RegisterInterface &interface) +: d(new QQmlTypePrivate) { d->m_isInterface = true; d->m_iid = interface.iid; @@ -216,8 +216,8 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe d->m_version_min = 0; } -QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::RegisterType &type) -: d(new QDeclarativeTypePrivate) +QQmlType::QQmlType(int index, const QQmlPrivate::RegisterType &type) +: d(new QQmlTypePrivate) { QString name = QString::fromUtf8(type.uri); if (type.uri) name += QLatin1Char('/'); @@ -256,46 +256,46 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe d->m_extMetaObject = type.extensionMetaObject; } -QDeclarativeType::~QDeclarativeType() +QQmlType::~QQmlType() { delete d->m_customParser; delete d; } -QString QDeclarativeType::module() const +QString QQmlType::module() const { return d->m_module; } -int QDeclarativeType::majorVersion() const +int QQmlType::majorVersion() const { return d->m_version_maj; } -int QDeclarativeType::minorVersion() const +int QQmlType::minorVersion() const { return d->m_version_min; } -bool QDeclarativeType::availableInVersion(int vmajor, int vminor) const +bool QQmlType::availableInVersion(int vmajor, int vminor) const { Q_ASSERT(vmajor >= 0 && vminor >= 0); return vmajor == d->m_version_maj && vminor >= d->m_version_min; } -bool QDeclarativeType::availableInVersion(const QString &module, int vmajor, int vminor) const +bool QQmlType::availableInVersion(const QString &module, int vmajor, int vminor) const { Q_ASSERT(vmajor >= 0 && vminor >= 0); return module == d->m_module && vmajor == d->m_version_maj && vminor >= d->m_version_min; } // returns the nearest _registered_ super class -QDeclarativeType *QDeclarativeType::superType() const +QQmlType *QQmlType::superType() const { if (!d->m_haveSuperType) { const QMetaObject *mo = d->m_baseMetaObject->superClass(); while (mo && !d->m_superType) { - d->m_superType = QDeclarativeMetaType::qmlType(mo, d->m_module, d->m_version_maj, d->m_version_min); + d->m_superType = QQmlMetaType::qmlType(mo, d->m_module, d->m_version_maj, d->m_version_min); mo = mo->superClass(); } d->m_haveSuperType = true; @@ -395,7 +395,7 @@ static bool isPropertyRevisioned(const QMetaObject *mo, int index) return false; } -void QDeclarativeTypePrivate::init() const +void QQmlTypePrivate::init() const { if (m_isSetup) return; @@ -412,13 +412,13 @@ void QDeclarativeTypePrivate::init() const builder.setFlags(QMetaObjectBuilder::DynamicMetaObject); QMetaObject *mmo = builder.toMetaObject(); mmo->d.superdata = mo; - QDeclarativeProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0, 0 }; + QQmlProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0, 0 }; m_metaObjects << data; } mo = mo->d.superdata; while(mo) { - QDeclarativeType *t = metaTypeData()->metaObjectToType.value(mo); + QQmlType *t = metaTypeData()->metaObjectToType.value(mo); if (t) { if (t->d->m_extFunc) { QMetaObjectBuilder builder; @@ -428,7 +428,7 @@ void QDeclarativeTypePrivate::init() const mmo->d.superdata = m_baseMetaObject; if (!m_metaObjects.isEmpty()) m_metaObjects.last().metaObject->d.superdata = mmo; - QDeclarativeProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0, 0 }; + QQmlProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0, 0 }; m_metaObjects << data; } } @@ -465,7 +465,7 @@ void QDeclarativeTypePrivate::init() const lock.unlock(); } -void QDeclarativeTypePrivate::initEnums() const +void QQmlTypePrivate::initEnums() const { if (m_isEnumSetup) return; @@ -486,7 +486,7 @@ void QDeclarativeTypePrivate::initEnums() const m_isEnumSetup = true; } -QByteArray QDeclarativeType::typeName() const +QByteArray QQmlType::typeName() const { if (d->m_baseMetaObject) return d->m_baseMetaObject->className(); @@ -494,7 +494,7 @@ QByteArray QDeclarativeType::typeName() const return QByteArray(); } -const QString &QDeclarativeType::elementName() const +const QString &QQmlType::elementName() const { if (d->m_elementName.isEmpty()) { QString n = qmlTypeName(); @@ -504,12 +504,12 @@ const QString &QDeclarativeType::elementName() const return d->m_elementName; } -const QString &QDeclarativeType::qmlTypeName() const +const QString &QQmlType::qmlTypeName() const { return d->m_name; } -QObject *QDeclarativeType::create() const +QObject *QQmlType::create() const { d->init(); @@ -517,12 +517,12 @@ QObject *QDeclarativeType::create() const d->m_newFunc(rv); if (rv && !d->m_metaObjects.isEmpty()) - (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); + (void *)new QQmlProxyMetaObject(rv, &d->m_metaObjects); return rv; } -void QDeclarativeType::create(QObject **out, void **memory, size_t additionalMemory) const +void QQmlType::create(QObject **out, void **memory, size_t additionalMemory) const { d->init(); @@ -530,60 +530,60 @@ void QDeclarativeType::create(QObject **out, void **memory, size_t additionalMem d->m_newFunc(rv); if (rv && !d->m_metaObjects.isEmpty()) - (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); + (void *)new QQmlProxyMetaObject(rv, &d->m_metaObjects); *out = rv; *memory = ((char *)rv) + d->m_allocationSize; } -QDeclarativeCustomParser *QDeclarativeType::customParser() const +QQmlCustomParser *QQmlType::customParser() const { return d->m_customParser; } -QDeclarativeType::CreateFunc QDeclarativeType::createFunction() const +QQmlType::CreateFunc QQmlType::createFunction() const { return d->m_newFunc; } -QString QDeclarativeType::noCreationReason() const +QString QQmlType::noCreationReason() const { return d->m_noCreationReason; } -int QDeclarativeType::createSize() const +int QQmlType::createSize() const { return d->m_allocationSize; } -bool QDeclarativeType::isCreatable() const +bool QQmlType::isCreatable() const { return d->m_newFunc != 0; } -bool QDeclarativeType::isExtendedType() const +bool QQmlType::isExtendedType() const { d->init(); return !d->m_metaObjects.isEmpty(); } -bool QDeclarativeType::isInterface() const +bool QQmlType::isInterface() const { return d->m_isInterface; } -int QDeclarativeType::typeId() const +int QQmlType::typeId() const { return d->m_typeId; } -int QDeclarativeType::qListTypeId() const +int QQmlType::qListTypeId() const { return d->m_listId; } -const QMetaObject *QDeclarativeType::metaObject() const +const QMetaObject *QQmlType::metaObject() const { d->init(); @@ -594,29 +594,29 @@ const QMetaObject *QDeclarativeType::metaObject() const } -const QMetaObject *QDeclarativeType::baseMetaObject() const +const QMetaObject *QQmlType::baseMetaObject() const { return d->m_baseMetaObject; } -bool QDeclarativeType::containsRevisionedAttributes() const +bool QQmlType::containsRevisionedAttributes() const { d->init(); return d->m_containsRevisionedAttributes; } -int QDeclarativeType::metaObjectRevision() const +int QQmlType::metaObjectRevision() const { return d->m_revision; } -QDeclarativeAttachedPropertiesFunc QDeclarativeType::attachedPropertiesFunction() const +QQmlAttachedPropertiesFunc QQmlType::attachedPropertiesFunction() const { return d->m_attachedPropertiesFunc; } -const QMetaObject *QDeclarativeType::attachedPropertiesType() const +const QMetaObject *QQmlType::attachedPropertiesType() const { return d->m_attachedPropertiesType; } @@ -626,37 +626,37 @@ This is the id passed to qmlAttachedPropertiesById(). This is different from th for the case that a single class is registered under two or more names (eg. Item in Qt 4.7 and QtQuick 1.0). */ -int QDeclarativeType::attachedPropertiesId() const +int QQmlType::attachedPropertiesId() const { return d->m_attachedPropertiesId; } -int QDeclarativeType::parserStatusCast() const +int QQmlType::parserStatusCast() const { return d->m_parserStatusCast; } -int QDeclarativeType::propertyValueSourceCast() const +int QQmlType::propertyValueSourceCast() const { return d->m_propertyValueSourceCast; } -int QDeclarativeType::propertyValueInterceptorCast() const +int QQmlType::propertyValueInterceptorCast() const { return d->m_propertyValueInterceptorCast; } -const char *QDeclarativeType::interfaceIId() const +const char *QQmlType::interfaceIId() const { return d->m_iid; } -int QDeclarativeType::index() const +int QQmlType::index() const { return d->m_index; } -int QDeclarativeType::enumValue(const QHashedStringRef &name) const +int QQmlType::enumValue(const QHashedStringRef &name) const { d->initEnums(); @@ -664,7 +664,7 @@ int QDeclarativeType::enumValue(const QHashedStringRef &name) const return rv?*rv:-1; } -int QDeclarativeType::enumValue(const QHashedV8String &name) const +int QQmlType::enumValue(const QHashedV8String &name) const { d->initEnums(); @@ -672,44 +672,44 @@ int QDeclarativeType::enumValue(const QHashedV8String &name) const return rv?*rv:-1; } -QDeclarativeTypeModule::QDeclarativeTypeModule() -: d(new QDeclarativeTypeModulePrivate) +QQmlTypeModule::QQmlTypeModule() +: d(new QQmlTypeModulePrivate) { } -QDeclarativeTypeModule::~QDeclarativeTypeModule() +QQmlTypeModule::~QQmlTypeModule() { delete d; d = 0; } -QString QDeclarativeTypeModule::module() const +QString QQmlTypeModule::module() const { return d->uri.uri; } -int QDeclarativeTypeModule::majorVersion() const +int QQmlTypeModule::majorVersion() const { return d->uri.majorVersion; } -int QDeclarativeTypeModule::minimumMinorVersion() const +int QQmlTypeModule::minimumMinorVersion() const { return d->minMinorVersion; } -int QDeclarativeTypeModule::maximumMinorVersion() const +int QQmlTypeModule::maximumMinorVersion() const { return d->maxMinorVersion; } -void QDeclarativeTypeModulePrivate::add(QDeclarativeType *type) +void QQmlTypeModulePrivate::add(QQmlType *type) { types << type; minMinorVersion = qMin(minMinorVersion, type->minorVersion()); maxMinorVersion = qMax(maxMinorVersion, type->minorVersion()); - QList<QDeclarativeType *> &list = typeHash[type->elementName()]; + QList<QQmlType *> &list = typeHash[type->elementName()]; for (int ii = 0; ii < list.count(); ++ii) { if (list.at(ii)->minorVersion() < type->minorVersion()) { list.insert(ii, type); @@ -719,18 +719,18 @@ void QDeclarativeTypeModulePrivate::add(QDeclarativeType *type) list.append(type); } -QList<QDeclarativeType *> QDeclarativeTypeModule::types() +QList<QQmlType *> QQmlTypeModule::types() { - QList<QDeclarativeType *> rv; + QList<QQmlType *> rv; QReadLocker lock(metaTypeDataLock()); rv = d->types; return rv; } -QList<QDeclarativeType *> QDeclarativeTypeModule::type(const QString &name) +QList<QQmlType *> QQmlTypeModule::type(const QString &name) { QReadLocker lock(metaTypeDataLock()); - QList<QDeclarativeType *> rv; + QList<QQmlType *> rv; for (int ii = 0; ii < d->types.count(); ++ii) { if (d->types.at(ii)->elementName() == name) rv << d->types.at(ii); @@ -738,11 +738,11 @@ QList<QDeclarativeType *> QDeclarativeTypeModule::type(const QString &name) return rv; } -QDeclarativeType *QDeclarativeTypeModule::type(const QHashedStringRef &name, int minor) +QQmlType *QQmlTypeModule::type(const QHashedStringRef &name, int minor) { QReadLocker lock(metaTypeDataLock()); - QList<QDeclarativeType *> *types = d->typeHash.value(name); + QList<QQmlType *> *types = d->typeHash.value(name); if (!types) return 0; for (int ii = 0; ii < types->count(); ++ii) @@ -752,11 +752,11 @@ QDeclarativeType *QDeclarativeTypeModule::type(const QHashedStringRef &name, int return 0; } -QDeclarativeType *QDeclarativeTypeModule::type(const QHashedV8String &name, int minor) +QQmlType *QQmlTypeModule::type(const QHashedV8String &name, int minor) { QReadLocker lock(metaTypeDataLock()); - QList<QDeclarativeType *> *types = d->typeHash.value(name); + QList<QQmlType *> *types = d->typeHash.value(name); if (!types) return 0; for (int ii = 0; ii < types->count(); ++ii) @@ -767,74 +767,74 @@ QDeclarativeType *QDeclarativeTypeModule::type(const QHashedV8String &name, int } -QDeclarativeTypeModuleVersion::QDeclarativeTypeModuleVersion() +QQmlTypeModuleVersion::QQmlTypeModuleVersion() : m_module(0), m_minor(0) { } -QDeclarativeTypeModuleVersion::QDeclarativeTypeModuleVersion(QDeclarativeTypeModule *module, int minor) +QQmlTypeModuleVersion::QQmlTypeModuleVersion(QQmlTypeModule *module, int minor) : m_module(module), m_minor(minor) { Q_ASSERT(m_module); Q_ASSERT(m_minor >= 0); } -QDeclarativeTypeModuleVersion::QDeclarativeTypeModuleVersion(const QDeclarativeTypeModuleVersion &o) +QQmlTypeModuleVersion::QQmlTypeModuleVersion(const QQmlTypeModuleVersion &o) : m_module(o.m_module), m_minor(o.m_minor) { } -QDeclarativeTypeModuleVersion &QDeclarativeTypeModuleVersion::operator=(const QDeclarativeTypeModuleVersion &o) +QQmlTypeModuleVersion &QQmlTypeModuleVersion::operator=(const QQmlTypeModuleVersion &o) { m_module = o.m_module; m_minor = o.m_minor; return *this; } -QDeclarativeTypeModule *QDeclarativeTypeModuleVersion::module() const +QQmlTypeModule *QQmlTypeModuleVersion::module() const { return m_module; } -int QDeclarativeTypeModuleVersion::minorVersion() const +int QQmlTypeModuleVersion::minorVersion() const { return m_minor; } -QDeclarativeType *QDeclarativeTypeModuleVersion::type(const QHashedStringRef &name) const +QQmlType *QQmlTypeModuleVersion::type(const QHashedStringRef &name) const { if (m_module) return m_module->type(name, m_minor); else return 0; } -QDeclarativeType *QDeclarativeTypeModuleVersion::type(const QHashedV8String &name) const +QQmlType *QQmlTypeModuleVersion::type(const QHashedV8String &name) const { if (m_module) return m_module->type(name, m_minor); else return 0; } -int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &autoparent) +int registerAutoParentFunction(QQmlPrivate::RegisterAutoParent &autoparent) { QWriteLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); data->parentFunctions.append(autoparent.function); return data->parentFunctions.count() - 1; } -int registerInterface(const QDeclarativePrivate::RegisterInterface &interface) +int registerInterface(const QQmlPrivate::RegisterInterface &interface) { if (interface.version > 0) qFatal("qmlRegisterType(): Cannot mix incompatible QML versions."); QWriteLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); int index = data->types.count(); - QDeclarativeType *type = new QDeclarativeType(index, interface); + QQmlType *type = new QQmlType(index, interface); data->types.append(type); data->idToType.insert(type->typeId(), type); @@ -853,7 +853,7 @@ int registerInterface(const QDeclarativePrivate::RegisterInterface &interface) return index; } -int registerType(const QDeclarativePrivate::RegisterType &type) +int registerType(const QQmlPrivate::RegisterType &type) { if (type.elementName) { for (int ii = 0; type.elementName[ii]; ++ii) { @@ -865,10 +865,10 @@ int registerType(const QDeclarativePrivate::RegisterType &type) } QWriteLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); int index = data->types.count(); - QDeclarativeType *dtype = new QDeclarativeType(index, type); + QQmlType *dtype = new QQmlType(index, type); data->types.append(dtype); data->idToType.insert(dtype->typeId(), dtype); @@ -889,10 +889,10 @@ int registerType(const QDeclarativePrivate::RegisterType &type) if (type.uri) { QString mod = QString::fromUtf8(type.uri); - QDeclarativeMetaTypeData::VersionedUri versionedUri(mod, type.versionMajor); - QDeclarativeTypeModule *module = data->uriToModule.value(versionedUri); + QQmlMetaTypeData::VersionedUri versionedUri(mod, type.versionMajor); + QQmlTypeModule *module = data->uriToModule.value(versionedUri); if (!module) { - module = new QDeclarativeTypeModule; + module = new QQmlTypeModule; module->d->uri = versionedUri; data->uriToModule.insert(versionedUri, module); } @@ -902,13 +902,13 @@ int registerType(const QDeclarativePrivate::RegisterType &type) return index; } -int registerModuleApi(const QDeclarativePrivate::RegisterModuleApi &api) +int registerModuleApi(const QQmlPrivate::RegisterModuleApi &api) { QWriteLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); QString uri = QString::fromUtf8(api.uri); - QDeclarativeMetaType::ModuleApi import; + QQmlMetaType::ModuleApi import; import.major = api.versionMajor; import.minor = api.versionMinor; import.script = api.scriptApi; @@ -916,9 +916,9 @@ int registerModuleApi(const QDeclarativePrivate::RegisterModuleApi &api) int index = data->moduleApiCount++; - QDeclarativeMetaTypeData::ModuleApis::Iterator iter = data->moduleApis.find(uri); + QQmlMetaTypeData::ModuleApis::Iterator iter = data->moduleApis.find(uri); if (iter == data->moduleApis.end()) { - QDeclarativeMetaTypeData::ModuleApiList apis; + QQmlMetaTypeData::ModuleApiList apis; apis.moduleApis << import; data->moduleApis.insert(uri, apis); } else { @@ -934,7 +934,7 @@ int registerModuleApi(const QDeclarativePrivate::RegisterModuleApi &api) This method is "over generalized" to allow us to (potentially) register more types of things in the future without adding exported symbols. */ -int QDeclarativePrivate::qmlregister(RegistrationType type, void *data) +int QQmlPrivate::qmlregister(RegistrationType type, void *data) { if (type == TypeRegistration) { return registerType(*reinterpret_cast<RegisterType *>(data)); @@ -951,12 +951,12 @@ int QDeclarativePrivate::qmlregister(RegistrationType type, void *data) /* Returns true if a module \a uri of any version is installed. */ -bool QDeclarativeMetaType::isAnyModule(const QString &uri) +bool QQmlMetaType::isAnyModule(const QString &uri) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); - for (QDeclarativeMetaTypeData::TypeModules::ConstIterator iter = data->uriToModule.begin(); + for (QQmlMetaTypeData::TypeModules::ConstIterator iter = data->uriToModule.begin(); iter != data->uriToModule.end(); ++iter) { if ((*iter)->module() == uri) return true; @@ -972,21 +972,21 @@ bool QDeclarativeMetaType::isAnyModule(const QString &uri) So if only 4.7 and 4.9 have been registered, 4.7,4.8, and 4.9 are valid, but not 4.6 nor 4.10. */ -bool QDeclarativeMetaType::isModule(const QString &module, int versionMajor, int versionMinor) +bool QQmlMetaType::isModule(const QString &module, int versionMajor, int versionMinor) { Q_ASSERT(versionMajor >= 0 && versionMinor >= 0); QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); // first, check Types - QDeclarativeTypeModule *tm = - data->uriToModule.value(QDeclarativeMetaTypeData::VersionedUri(module, versionMajor)); + QQmlTypeModule *tm = + data->uriToModule.value(QQmlMetaTypeData::VersionedUri(module, versionMajor)); if (tm && tm->minimumMinorVersion() <= versionMinor && tm->maximumMinorVersion() >= versionMinor) return true; // then, check ModuleApis - foreach (const QDeclarativeMetaType::ModuleApi &mApi, data->moduleApis.value(module).moduleApis) { + foreach (const QQmlMetaType::ModuleApi &mApi, data->moduleApis.value(module).moduleApis) { if (mApi.major == versionMajor && mApi.minor == versionMinor) // XXX is this correct? return true; } @@ -994,32 +994,32 @@ bool QDeclarativeMetaType::isModule(const QString &module, int versionMajor, int return false; } -QDeclarativeTypeModule *QDeclarativeMetaType::typeModule(const QString &uri, int majorVersion) +QQmlTypeModule *QQmlMetaType::typeModule(const QString &uri, int majorVersion) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); - return data->uriToModule.value(QDeclarativeMetaTypeData::VersionedUri(uri, majorVersion)); + QQmlMetaTypeData *data = metaTypeData(); + return data->uriToModule.value(QQmlMetaTypeData::VersionedUri(uri, majorVersion)); } -QList<QDeclarativePrivate::AutoParentFunction> QDeclarativeMetaType::parentFunctions() +QList<QQmlPrivate::AutoParentFunction> QQmlMetaType::parentFunctions() { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return data->parentFunctions; } -static bool operator<(const QDeclarativeMetaType::ModuleApi &lhs, const QDeclarativeMetaType::ModuleApi &rhs) +static bool operator<(const QQmlMetaType::ModuleApi &lhs, const QQmlMetaType::ModuleApi &rhs) { return lhs.major < rhs.major || (lhs.major == rhs.major && lhs.minor < rhs.minor); } -QDeclarativeMetaType::ModuleApi -QDeclarativeMetaType::moduleApi(const QString &uri, int versionMajor, int versionMinor) +QQmlMetaType::ModuleApi +QQmlMetaType::moduleApi(const QString &uri, int versionMajor, int versionMinor) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); - QDeclarativeMetaTypeData::ModuleApis::Iterator iter = data->moduleApis.find(uri); + QQmlMetaTypeData::ModuleApis::Iterator iter = data->moduleApis.find(uri); if (iter == data->moduleApis.end()) return ModuleApi(); @@ -1037,13 +1037,13 @@ QDeclarativeMetaType::moduleApi(const QString &uri, int versionMajor, int versio return ModuleApi(); } -QHash<QString, QList<QDeclarativeMetaType::ModuleApi> > QDeclarativeMetaType::moduleApis() +QHash<QString, QList<QQmlMetaType::ModuleApi> > QQmlMetaType::moduleApis() { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); QHash<QString, QList<ModuleApi> > moduleApis; - QHashIterator<QString, QDeclarativeMetaTypeData::ModuleApiList> it(data->moduleApis); + QHashIterator<QString, QQmlMetaTypeData::ModuleApiList> it(data->moduleApis); while (it.hasNext()) { it.next(); moduleApis[it.key()] = it.value().moduleApis; @@ -1052,7 +1052,7 @@ QHash<QString, QList<QDeclarativeMetaType::ModuleApi> > QDeclarativeMetaType::mo return moduleApis; } -QObject *QDeclarativeMetaType::toQObject(const QVariant &v, bool *ok) +QObject *QQmlMetaType::toQObject(const QVariant &v, bool *ok) { if (!isQObject(v.userType())) { if (ok) *ok = false; @@ -1064,52 +1064,52 @@ QObject *QDeclarativeMetaType::toQObject(const QVariant &v, bool *ok) return *(QObject **)v.constData(); } -bool QDeclarativeMetaType::isQObject(int userType) +bool QQmlMetaType::isQObject(int userType) { if (userType == QMetaType::QObjectStar) return true; QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return userType >= 0 && userType < data->objects.size() && data->objects.testBit(userType); } /* Returns the item type for a list of type \a id. */ -int QDeclarativeMetaType::listType(int id) +int QQmlMetaType::listType(int id) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); - QDeclarativeType *type = data->idToType.value(id); + QQmlMetaTypeData *data = metaTypeData(); + QQmlType *type = data->idToType.value(id); if (type && type->qListTypeId() == id) return type->typeId(); else return 0; } -int QDeclarativeMetaType::attachedPropertiesFuncId(const QMetaObject *mo) +int QQmlMetaType::attachedPropertiesFuncId(const QMetaObject *mo) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); - QDeclarativeType *type = data->metaObjectToType.value(mo); + QQmlType *type = data->metaObjectToType.value(mo); if (type && type->attachedPropertiesFunction()) return type->attachedPropertiesId(); else return -1; } -QDeclarativeAttachedPropertiesFunc QDeclarativeMetaType::attachedPropertiesFuncById(int id) +QQmlAttachedPropertiesFunc QQmlMetaType::attachedPropertiesFuncById(int id) { if (id < 0) return 0; QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return data->types.at(id)->attachedPropertiesFunction(); } -QMetaProperty QDeclarativeMetaType::defaultProperty(const QMetaObject *metaObject) +QMetaProperty QQmlMetaType::defaultProperty(const QMetaObject *metaObject) { int idx = metaObject->indexOfClassInfo("DefaultProperty"); if (-1 == idx) @@ -1126,7 +1126,7 @@ QMetaProperty QDeclarativeMetaType::defaultProperty(const QMetaObject *metaObjec return metaObject->property(idx); } -QMetaProperty QDeclarativeMetaType::defaultProperty(QObject *obj) +QMetaProperty QQmlMetaType::defaultProperty(QObject *obj) { if (!obj) return QMetaProperty(); @@ -1135,7 +1135,7 @@ QMetaProperty QDeclarativeMetaType::defaultProperty(QObject *obj) return defaultProperty(metaObject); } -QMetaMethod QDeclarativeMetaType::defaultMethod(const QMetaObject *metaObject) +QMetaMethod QQmlMetaType::defaultMethod(const QMetaObject *metaObject) { int idx = metaObject->indexOfClassInfo("DefaultMethod"); if (-1 == idx) @@ -1152,7 +1152,7 @@ QMetaMethod QDeclarativeMetaType::defaultMethod(const QMetaObject *metaObject) return metaObject->method(idx); } -QMetaMethod QDeclarativeMetaType::defaultMethod(QObject *obj) +QMetaMethod QQmlMetaType::defaultMethod(QObject *obj) { if (!obj) return QMetaMethod(); @@ -1161,7 +1161,7 @@ QMetaMethod QDeclarativeMetaType::defaultMethod(QObject *obj) return defaultMethod(metaObject); } -QDeclarativeMetaType::TypeCategory QDeclarativeMetaType::typeCategory(int userType) +QQmlMetaType::TypeCategory QQmlMetaType::typeCategory(int userType) { if (userType < 0) return Unknown; @@ -1169,7 +1169,7 @@ QDeclarativeMetaType::TypeCategory QDeclarativeMetaType::typeCategory(int userTy return Object; QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); if (userType < data->objects.size() && data->objects.testBit(userType)) return Object; else if (userType < data->lists.size() && data->lists.testBit(userType)) @@ -1178,18 +1178,18 @@ QDeclarativeMetaType::TypeCategory QDeclarativeMetaType::typeCategory(int userTy return Unknown; } -bool QDeclarativeMetaType::isInterface(int userType) +bool QQmlMetaType::isInterface(int userType) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return userType >= 0 && userType < data->interfaces.size() && data->interfaces.testBit(userType); } -const char *QDeclarativeMetaType::interfaceIId(int userType) +const char *QQmlMetaType::interfaceIId(int userType) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); - QDeclarativeType *type = data->idToType.value(userType); + QQmlMetaTypeData *data = metaTypeData(); + QQmlType *type = data->idToType.value(userType); lock.unlock(); if (type && type->isInterface() && type->typeId() == userType) return type->interfaceIId(); @@ -1197,10 +1197,10 @@ const char *QDeclarativeMetaType::interfaceIId(int userType) return 0; } -bool QDeclarativeMetaType::isList(int userType) +bool QQmlMetaType::isList(int userType) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return userType >= 0 && userType < data->lists.size() && data->lists.testBit(userType); } @@ -1219,11 +1219,11 @@ bool QDeclarativeMetaType::isList(int userType) QVariant (*StringConverter)(const QString &); \endcode */ -void QDeclarativeMetaType::registerCustomStringConverter(int type, StringConverter converter) +void QQmlMetaType::registerCustomStringConverter(int type, StringConverter converter) { QWriteLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); if (data->stringConverters.contains(type)) return; data->stringConverters.insert(type, converter); @@ -1233,11 +1233,11 @@ void QDeclarativeMetaType::registerCustomStringConverter(int type, StringConvert Return the custom string converter for \a type, previously installed through registerCustomStringConverter() */ -QDeclarativeMetaType::StringConverter QDeclarativeMetaType::customStringConverter(int type) +QQmlMetaType::StringConverter QQmlMetaType::customStringConverter(int type) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return data->stringConverters.value(type); } @@ -1245,15 +1245,15 @@ QDeclarativeMetaType::StringConverter QDeclarativeMetaType::customStringConverte Returns the type (if any) of URI-qualified named \a name in version specified by \a version_major and \a version_minor. */ -QDeclarativeType *QDeclarativeMetaType::qmlType(const QString &name, int version_major, int version_minor) +QQmlType *QQmlMetaType::qmlType(const QString &name, int version_major, int version_minor) { Q_ASSERT(version_major >= 0 && version_minor >= 0); QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); - QDeclarativeMetaTypeData::Names::ConstIterator it = data->nameToType.find(name); + QQmlMetaTypeData::Names::ConstIterator it = data->nameToType.find(name); while (it != data->nameToType.end()) { - // XXX version_major<0 just a kludge for QDeclarativePropertyPrivate::initProperty + // XXX version_major<0 just a kludge for QQmlPropertyPrivate::initProperty if (it.key() == name && (version_major<0 || (*it)->availableInVersion(version_major,version_minor))) return (*it); ++it; @@ -1266,10 +1266,10 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(const QString &name, int version Returns the type (if any) that corresponds to the \a metaObject. Returns null if no type is registered. */ -QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject) +QQmlType *QQmlMetaType::qmlType(const QMetaObject *metaObject) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return data->metaObjectToType.value(metaObject); } @@ -1279,15 +1279,15 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject) by \a version_major and \a version_minor in module specified by \a uri. Returns null if no type is registered. */ -QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject, const QString &module, int version_major, int version_minor) +QQmlType *QQmlMetaType::qmlType(const QMetaObject *metaObject, const QString &module, int version_major, int version_minor) { Q_ASSERT(version_major >= 0 && version_minor >= 0); QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); - QDeclarativeMetaTypeData::MetaObjects::const_iterator it = data->metaObjectToType.find(metaObject); + QQmlMetaTypeData::MetaObjects::const_iterator it = data->metaObjectToType.find(metaObject); while (it != data->metaObjectToType.end() && it.key() == metaObject) { - QDeclarativeType *t = *it; + QQmlType *t = *it; if (version_major < 0 || t->availableInVersion(module, version_major,version_minor)) return t; ++it; @@ -1300,12 +1300,12 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject, c Returns the type (if any) that corresponds to the QVariant::Type \a userType. Returns null if no type is registered. */ -QDeclarativeType *QDeclarativeMetaType::qmlType(int userType) +QQmlType *QQmlMetaType::qmlType(int userType) { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); - QDeclarativeType *type = data->idToType.value(userType); + QQmlType *type = data->idToType.value(userType); if (type && type->typeId() == userType) return type; else @@ -1315,10 +1315,10 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(int userType) /*! Returns the list of registered QML type names. */ -QList<QString> QDeclarativeMetaType::qmlTypeNames() +QList<QString> QQmlMetaType::qmlTypeNames() { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return data->nameToType.keys(); } @@ -1326,15 +1326,15 @@ QList<QString> QDeclarativeMetaType::qmlTypeNames() /*! Returns the list of registered QML types. */ -QList<QDeclarativeType*> QDeclarativeMetaType::qmlTypes() +QList<QQmlType*> QQmlMetaType::qmlTypes() { QReadLocker lock(metaTypeDataLock()); - QDeclarativeMetaTypeData *data = metaTypeData(); + QQmlMetaTypeData *data = metaTypeData(); return data->nameToType.values(); } -int QDeclarativeMetaType::QQuickAnchorLineMetaTypeId() +int QQmlMetaType::QQuickAnchorLineMetaTypeId() { static int id = 0; if (!id) { @@ -1343,14 +1343,14 @@ int QDeclarativeMetaType::QQuickAnchorLineMetaTypeId() return id; } -QDeclarativeMetaType::CompareFunction QDeclarativeMetaType::anchorLineCompareFunction = 0; +QQmlMetaType::CompareFunction QQmlMetaType::anchorLineCompareFunction = 0; -void QDeclarativeMetaType::setQQuickAnchorLineCompareFunction(CompareFunction fun) +void QQmlMetaType::setQQuickAnchorLineCompareFunction(CompareFunction fun) { anchorLineCompareFunction = fun; } -bool QDeclarativeMetaType::QQuickAnchorLineCompare(const void *p1, const void *p2) +bool QQmlMetaType::QQuickAnchorLineCompare(const void *p1, const void *p2) { Q_ASSERT(anchorLineCompareFunction != 0); return anchorLineCompareFunction(p1, p2); diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/qml/qml/qqmlmetatype_p.h index b2a6aa40f6..ad6a2aa055 100644 --- a/src/declarative/qml/qdeclarativemetatype_p.h +++ b/src/qml/qml/qqmlmetatype_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEMETATYPE_P_H -#define QDECLARATIVEMETATYPE_P_H +#ifndef QQMLMETATYPE_P_H +#define QQMLMETATYPE_P_H // // W A R N I N G @@ -53,31 +53,31 @@ // We mean it. // -#include "qdeclarative.h" +#include "qqml.h" +#include <private/qtqmlglobal_p.h> #include <QtCore/qglobal.h> #include <QtCore/qvariant.h> #include <QtCore/qbitarray.h> -#include <private/qdeclarativeglobal_p.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> QT_BEGIN_NAMESPACE -class QDeclarativeType; -class QDeclarativeCustomParser; -class QDeclarativeTypePrivate; -class QDeclarativeTypeModule; +class QQmlType; +class QQmlCustomParser; +class QQmlTypePrivate; +class QQmlTypeModule; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeMetaType +class Q_QML_PRIVATE_EXPORT QQmlMetaType { public: static QList<QString> qmlTypeNames(); - static QList<QDeclarativeType*> qmlTypes(); + static QList<QQmlType*> qmlTypes(); - static QDeclarativeType *qmlType(const QString &, int, int); - static QDeclarativeType *qmlType(const QMetaObject *); - static QDeclarativeType *qmlType(const QMetaObject *metaObject, const QString &module, int version_major, int version_minor); - static QDeclarativeType *qmlType(int); + static QQmlType *qmlType(const QString &, int, int); + static QQmlType *qmlType(const QMetaObject *); + static QQmlType *qmlType(const QMetaObject *metaObject, const QString &module, int version_major, int version_minor); + static QQmlType *qmlType(int); static QMetaProperty defaultProperty(const QMetaObject *); static QMetaProperty defaultProperty(QObject *); @@ -89,7 +89,7 @@ public: static int listType(int); static int attachedPropertiesFuncId(const QMetaObject *); - static QDeclarativeAttachedPropertiesFunc attachedPropertiesFuncById(int); + static QQmlAttachedPropertiesFunc attachedPropertiesFuncById(int); enum TypeCategory { Unknown, Object, List }; static TypeCategory typeCategory(int); @@ -104,9 +104,9 @@ public: static bool isAnyModule(const QString &uri); static bool isModule(const QString &module, int versionMajor, int versionMinor); - static QDeclarativeTypeModule *typeModule(const QString &uri, int majorVersion); + static QQmlTypeModule *typeModule(const QString &uri, int majorVersion); - static QList<QDeclarativePrivate::AutoParentFunction> parentFunctions(); + static QList<QQmlPrivate::AutoParentFunction> parentFunctions(); static int QQuickAnchorLineMetaTypeId(); typedef bool (*CompareFunction)(const void *, const void *); @@ -117,8 +117,8 @@ public: ModuleApiInstance() : scriptCallback(0), qobjectCallback(0), qobjectApi(0) {} - QJSValue (*scriptCallback)(QDeclarativeEngine *, QJSEngine *); - QObject *(*qobjectCallback)(QDeclarativeEngine *, QJSEngine *); + QJSValue (*scriptCallback)(QQmlEngine *, QJSEngine *); + QObject *(*qobjectCallback)(QQmlEngine *, QJSEngine *); QJSValue scriptApi; QObject *qobjectApi; }; @@ -127,8 +127,8 @@ public: inline bool operator==(const ModuleApi &) const; int major; int minor; - QJSValue (*script)(QDeclarativeEngine *, QJSEngine *); - QObject *(*qobject)(QDeclarativeEngine *, QJSEngine *); + QJSValue (*script)(QQmlEngine *, QJSEngine *); + QObject *(*qobject)(QQmlEngine *, QJSEngine *); }; static ModuleApi moduleApi(const QString &, int, int); static QHash<QString, QList<ModuleApi> > moduleApis(); @@ -139,7 +139,7 @@ private: class QHashedStringRef; class QHashedV8String; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeType +class Q_QML_PRIVATE_EXPORT QQmlType { public: QByteArray typeName() const; @@ -160,7 +160,7 @@ public: CreateFunc createFunction() const; int createSize() const; - QDeclarativeCustomParser *customParser() const; + QQmlCustomParser *customParser() const; bool isCreatable() const; bool isExtendedType() const; @@ -175,7 +175,7 @@ public: int metaObjectRevision() const; bool containsRevisionedAttributes() const; - QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction() const; + QQmlAttachedPropertiesFunc attachedPropertiesFunction() const; const QMetaObject *attachedPropertiesType() const; int attachedPropertiesId() const; @@ -190,20 +190,20 @@ public: int enumValue(const QHashedStringRef &) const; int enumValue(const QHashedV8String &) const; private: - QDeclarativeType *superType() const; - friend class QDeclarativeTypePrivate; - friend struct QDeclarativeMetaTypeData; - friend int registerType(const QDeclarativePrivate::RegisterType &); - friend int registerInterface(const QDeclarativePrivate::RegisterInterface &); - QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &); - QDeclarativeType(int, const QDeclarativePrivate::RegisterType &); - ~QDeclarativeType(); - - QDeclarativeTypePrivate *d; + QQmlType *superType() const; + friend class QQmlTypePrivate; + friend struct QQmlMetaTypeData; + friend int registerType(const QQmlPrivate::RegisterType &); + friend int registerInterface(const QQmlPrivate::RegisterInterface &); + QQmlType(int, const QQmlPrivate::RegisterInterface &); + QQmlType(int, const QQmlPrivate::RegisterType &); + ~QQmlType(); + + QQmlTypePrivate *d; }; -class QDeclarativeTypeModulePrivate; -class QDeclarativeTypeModule +class QQmlTypeModulePrivate; +class QQmlTypeModule { public: QString module() const; @@ -212,39 +212,39 @@ public: int minimumMinorVersion() const; int maximumMinorVersion() const; - QList<QDeclarativeType *> types(); - QList<QDeclarativeType *> type(const QString &); + QList<QQmlType *> types(); + QList<QQmlType *> type(const QString &); - QDeclarativeType *type(const QHashedStringRef &, int); - QDeclarativeType *type(const QHashedV8String &, int); + QQmlType *type(const QHashedStringRef &, int); + QQmlType *type(const QHashedV8String &, int); private: - friend int registerType(const QDeclarativePrivate::RegisterType &); - QDeclarativeTypeModule(); - ~QDeclarativeTypeModule(); - QDeclarativeTypeModulePrivate *d; + friend int registerType(const QQmlPrivate::RegisterType &); + QQmlTypeModule(); + ~QQmlTypeModule(); + QQmlTypeModulePrivate *d; }; -class QDeclarativeTypeModuleVersion +class QQmlTypeModuleVersion { public: - QDeclarativeTypeModuleVersion(); - QDeclarativeTypeModuleVersion(QDeclarativeTypeModule *, int); - QDeclarativeTypeModuleVersion(const QDeclarativeTypeModuleVersion &); - QDeclarativeTypeModuleVersion &operator=(const QDeclarativeTypeModuleVersion &); + QQmlTypeModuleVersion(); + QQmlTypeModuleVersion(QQmlTypeModule *, int); + QQmlTypeModuleVersion(const QQmlTypeModuleVersion &); + QQmlTypeModuleVersion &operator=(const QQmlTypeModuleVersion &); - QDeclarativeTypeModule *module() const; + QQmlTypeModule *module() const; int minorVersion() const; - QDeclarativeType *type(const QHashedStringRef &) const; - QDeclarativeType *type(const QHashedV8String &) const; + QQmlType *type(const QHashedStringRef &) const; + QQmlType *type(const QHashedV8String &) const; private: - QDeclarativeTypeModule *m_module; + QQmlTypeModule *m_module; int m_minor; }; -QDeclarativeMetaType::ModuleApi::ModuleApi() +QQmlMetaType::ModuleApi::ModuleApi() { major = 0; minor = 0; @@ -252,17 +252,17 @@ QDeclarativeMetaType::ModuleApi::ModuleApi() qobject = 0; } -bool QDeclarativeMetaType::ModuleApi::operator==(const ModuleApi &other) const +bool QQmlMetaType::ModuleApi::operator==(const ModuleApi &other) const { return major == other.major && minor == other.minor && script == other.script && qobject == other.qobject; } -inline uint qHash(const QDeclarativeMetaType::ModuleApi &import) +inline uint qHash(const QQmlMetaType::ModuleApi &import) { return import.major ^ import.minor ^ quintptr(import.script) ^ quintptr(import.qobject); } QT_END_NAMESPACE -#endif // QDECLARATIVEMETATYPE_P_H +#endif // QQMLMETATYPE_P_H diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/qml/qml/qqmlnetworkaccessmanagerfactory.cpp index ee8c8c5f71..cc33f387d9 100644 --- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp +++ b/src/qml/qml/qqmlnetworkaccessmanagerfactory.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,23 +39,23 @@ ** ****************************************************************************/ -#include "qdeclarativenetworkaccessmanagerfactory.h" +#include "qqmlnetworkaccessmanagerfactory.h" QT_BEGIN_NAMESPACE /*! - \class QDeclarativeNetworkAccessManagerFactory + \class QQmlNetworkAccessManagerFactory \since 4.7 - \brief The QDeclarativeNetworkAccessManagerFactory class creates QNetworkAccessManager instances for a QML engine. + \brief The QQmlNetworkAccessManagerFactory class creates QNetworkAccessManager instances for a QML engine. A QML engine uses QNetworkAccessManager for all network access. By implementing a factory, it is possible to provide the QML engine with custom QNetworkAccessManager instances with specialized caching, proxy and cookies support. - To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and + To implement a factory, subclass QQmlNetworkAccessManagerFactory and implement the virtual create() method, then assign it to the relevant QML - engine using QDeclarativeEngine::setNetworkAccessManagerFactory(). + engine using QQmlEngine::setNetworkAccessManagerFactory(). Note the QML engine may create QNetworkAccessManager instances from multiple threads. Because of this, the implementation of the create() @@ -85,12 +85,12 @@ QT_BEGIN_NAMESPACE /*! Destroys the factory. The default implementation does nothing. */ -QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory() +QQmlNetworkAccessManagerFactory::~QQmlNetworkAccessManagerFactory() { } /*! - \fn QNetworkAccessManager *QDeclarativeNetworkAccessManagerFactory::create(QObject *parent) + \fn QNetworkAccessManager *QQmlNetworkAccessManagerFactory::create(QObject *parent) Creates and returns a network access manager with the specified \a parent. This method must return a new QNetworkAccessManager instance each time diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h b/src/qml/qml/qqmlnetworkaccessmanagerfactory.h index 34ffe3fb51..ac3583cf4c 100644 --- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h +++ b/src/qml/qml/qqmlnetworkaccessmanagerfactory.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVENETWORKACCESSMANAGERFACTORY_H -#define QDECLARATIVENETWORKACCESSMANAGERFACTORY_H +#ifndef QQMLNETWORKACCESSMANAGERFACTORY_H +#define QQMLNETWORKACCESSMANAGERFACTORY_H +#include <QtQml/qtqmlglobal.h> #include <QtCore/qobject.h> QT_BEGIN_HEADER @@ -50,10 +51,10 @@ QT_BEGIN_NAMESPACE class QNetworkAccessManager; -class Q_DECLARATIVE_EXPORT QDeclarativeNetworkAccessManagerFactory +class Q_QML_EXPORT QQmlNetworkAccessManagerFactory { public: - virtual ~QDeclarativeNetworkAccessManagerFactory(); + virtual ~QQmlNetworkAccessManagerFactory(); virtual QNetworkAccessManager *create(QObject *parent) = 0; }; @@ -62,4 +63,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVENETWORKACCESSMANAGERFACTORY_H +#endif // QQMLNETWORKACCESSMANAGERFACTORY_H diff --git a/src/declarative/qml/qdeclarativenotifier.cpp b/src/qml/qml/qqmlnotifier.cpp index 100a42d029..270eee52b4 100644 --- a/src/declarative/qml/qdeclarativenotifier.cpp +++ b/src/qml/qml/qqmlnotifier.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#include "qdeclarativenotifier_p.h" -#include "qdeclarativeproperty_p.h" +#include "qqmlnotifier_p.h" +#include "qqmlproperty_p.h" QT_BEGIN_NAMESPACE -void QDeclarativeNotifier::emitNotify(QDeclarativeNotifierEndpoint *endpoint) +void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint) { - QDeclarativeNotifierEndpoint **oldDisconnected = endpoint->disconnected; + QQmlNotifierEndpoint **oldDisconnected = endpoint->disconnected; endpoint->disconnected = &endpoint; endpoint->notifying = 1; @@ -67,18 +67,18 @@ void QDeclarativeNotifier::emitNotify(QDeclarativeNotifierEndpoint *endpoint) else if (endpoint) endpoint->notifying = 0; } -void QDeclarativeNotifierEndpoint::connect(QObject *source, int sourceSignal) +void QQmlNotifierEndpoint::connect(QObject *source, int sourceSignal) { disconnect(); this->source = source; this->sourceSignal = sourceSignal; - QDeclarativePropertyPrivate::flushSignal(source, sourceSignal); - QDeclarativeData *ddata = QDeclarativeData::get(source, true); + QQmlPropertyPrivate::flushSignal(source, sourceSignal); + QQmlData *ddata = QQmlData::get(source, true); ddata->addNotify(sourceSignal, this); } -void QDeclarativeNotifierEndpoint::copyAndClear(QDeclarativeNotifierEndpoint &other) +void QQmlNotifierEndpoint::copyAndClear(QQmlNotifierEndpoint &other) { if (&other == this) return; diff --git a/src/declarative/qml/qdeclarativenotifier_p.h b/src/qml/qml/qqmlnotifier_p.h index 1e37de8bb6..ab0711341d 100644 --- a/src/declarative/qml/qdeclarativenotifier_p.h +++ b/src/qml/qml/qqmlnotifier_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,77 +39,77 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVENOTIFIER_P_H -#define QDECLARATIVENOTIFIER_P_H +#ifndef QQMLNOTIFIER_P_H +#define QQMLNOTIFIER_P_H -#include "qdeclarativedata_p.h" -#include "qdeclarativeguard_p.h" +#include "qqmldata_p.h" +#include "qqmlguard_p.h" QT_BEGIN_NAMESPACE -class QDeclarativeNotifierEndpoint; -class Q_DECLARATIVE_EXPORT QDeclarativeNotifier +class QQmlNotifierEndpoint; +class Q_QML_EXPORT QQmlNotifier { public: - inline QDeclarativeNotifier(); - inline ~QDeclarativeNotifier(); + inline QQmlNotifier(); + inline ~QQmlNotifier(); inline void notify(); private: - friend class QDeclarativeData; - friend class QDeclarativeNotifierEndpoint; + friend class QQmlData; + friend class QQmlNotifierEndpoint; - static void emitNotify(QDeclarativeNotifierEndpoint *); - QDeclarativeNotifierEndpoint *endpoints; + static void emitNotify(QQmlNotifierEndpoint *); + QQmlNotifierEndpoint *endpoints; }; -class QDeclarativeNotifierEndpoint +class QQmlNotifierEndpoint { public: - inline QDeclarativeNotifierEndpoint(); - inline ~QDeclarativeNotifierEndpoint(); + inline QQmlNotifierEndpoint(); + inline ~QQmlNotifierEndpoint(); - typedef void (*Callback)(QDeclarativeNotifierEndpoint *); + typedef void (*Callback)(QQmlNotifierEndpoint *); Callback callback; inline bool isConnected(); inline bool isConnected(QObject *source, int sourceSignal); - inline bool isConnected(QDeclarativeNotifier *); + inline bool isConnected(QQmlNotifier *); void connect(QObject *source, int sourceSignal); - inline void connect(QDeclarativeNotifier *); + inline void connect(QQmlNotifier *); inline void disconnect(); inline bool isNotifying() const; inline void cancelNotify(); - void copyAndClear(QDeclarativeNotifierEndpoint &other); + void copyAndClear(QQmlNotifierEndpoint &other); private: - friend class QDeclarativeData; - friend class QDeclarativeNotifier; + friend class QQmlData; + friend class QQmlNotifier; union { - QDeclarativeNotifier *notifier; + QQmlNotifier *notifier; QObject *source; }; unsigned int notifying : 1; signed int sourceSignal : 31; - QDeclarativeNotifierEndpoint **disconnected; - QDeclarativeNotifierEndpoint *next; - QDeclarativeNotifierEndpoint **prev; + QQmlNotifierEndpoint **disconnected; + QQmlNotifierEndpoint *next; + QQmlNotifierEndpoint **prev; }; -QDeclarativeNotifier::QDeclarativeNotifier() +QQmlNotifier::QQmlNotifier() : endpoints(0) { } -QDeclarativeNotifier::~QDeclarativeNotifier() +QQmlNotifier::~QQmlNotifier() { - QDeclarativeNotifierEndpoint *endpoint = endpoints; + QQmlNotifierEndpoint *endpoint = endpoints; while (endpoint) { - QDeclarativeNotifierEndpoint *n = endpoint; + QQmlNotifierEndpoint *n = endpoint; endpoint = n->next; n->next = 0; @@ -122,37 +122,37 @@ QDeclarativeNotifier::~QDeclarativeNotifier() endpoints = 0; } -void QDeclarativeNotifier::notify() +void QQmlNotifier::notify() { if (endpoints) emitNotify(endpoints); } -QDeclarativeNotifierEndpoint::QDeclarativeNotifierEndpoint() +QQmlNotifierEndpoint::QQmlNotifierEndpoint() : callback(0), notifier(0), notifying(0), sourceSignal(-1), disconnected(0), next(0), prev(0) { } -QDeclarativeNotifierEndpoint::~QDeclarativeNotifierEndpoint() +QQmlNotifierEndpoint::~QQmlNotifierEndpoint() { disconnect(); } -bool QDeclarativeNotifierEndpoint::isConnected() +bool QQmlNotifierEndpoint::isConnected() { return prev != 0; } -bool QDeclarativeNotifierEndpoint::isConnected(QObject *source, int sourceSignal) +bool QQmlNotifierEndpoint::isConnected(QObject *source, int sourceSignal) { return this->sourceSignal != -1 && this->source == source && this->sourceSignal == sourceSignal; } -bool QDeclarativeNotifierEndpoint::isConnected(QDeclarativeNotifier *notifier) +bool QQmlNotifierEndpoint::isConnected(QQmlNotifier *notifier) { return sourceSignal == -1 && this->notifier == notifier; } -void QDeclarativeNotifierEndpoint::connect(QDeclarativeNotifier *notifier) +void QQmlNotifierEndpoint::connect(QQmlNotifier *notifier) { disconnect(); @@ -163,7 +163,7 @@ void QDeclarativeNotifierEndpoint::connect(QDeclarativeNotifier *notifier) this->notifier = notifier; } -void QDeclarativeNotifierEndpoint::disconnect() +void QQmlNotifierEndpoint::disconnect() { if (next) next->prev = prev; if (prev) *prev = next; @@ -177,13 +177,13 @@ void QDeclarativeNotifierEndpoint::disconnect() } /*! -Returns true if a notify is in progress. This means that the signal or QDeclarativeNotifier +Returns true if a notify is in progress. This means that the signal or QQmlNotifier that this endpoing is connected to has been triggered, but this endpoint's callback has not yet been called. An in progress notify can be cancelled by calling cancelNotify. */ -bool QDeclarativeNotifierEndpoint::isNotifying() const +bool QQmlNotifierEndpoint::isNotifying() const { return notifying == 1; } @@ -191,7 +191,7 @@ bool QDeclarativeNotifierEndpoint::isNotifying() const /*! Cancel any notifies that are in progress. */ -void QDeclarativeNotifierEndpoint::cancelNotify() +void QQmlNotifierEndpoint::cancelNotify() { notifying = 0; if (disconnected) { @@ -202,5 +202,5 @@ void QDeclarativeNotifierEndpoint::cancelNotify() QT_END_NAMESPACE -#endif // QDECLARATIVENOTIFIER_P_H +#endif // QQMLNOTIFIER_P_H diff --git a/src/declarative/qml/qdeclarativenullablevalue_p_p.h b/src/qml/qml/qqmlnullablevalue_p_p.h index 9c5aa368a1..b19e2722cf 100644 --- a/src/declarative/qml/qdeclarativenullablevalue_p_p.h +++ b/src/qml/qml/qqmlnullablevalue_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVENULLABLEVALUE_P_H -#define QDECLARATIVENULLABLEVALUE_P_H +#ifndef QQMLNULLABLEVALUE_P_H +#define QQMLNULLABLEVALUE_P_H // // W A R N I N G @@ -56,17 +56,17 @@ QT_BEGIN_NAMESPACE template<typename T> -struct QDeclarativeNullableValue +struct QQmlNullableValue { - QDeclarativeNullableValue() + QQmlNullableValue() : isNull(true), value(T()) {} - QDeclarativeNullableValue(const QDeclarativeNullableValue<T> &o) + QQmlNullableValue(const QQmlNullableValue<T> &o) : isNull(o.isNull), value(o.value) {} - QDeclarativeNullableValue(const T &t) + QQmlNullableValue(const T &t) : isNull(false), value(t) {} - QDeclarativeNullableValue<T> &operator=(const T &t) + QQmlNullableValue<T> &operator=(const T &t) { isNull = false; value = t; return *this; } - QDeclarativeNullableValue<T> &operator=(const QDeclarativeNullableValue<T> &o) + QQmlNullableValue<T> &operator=(const QQmlNullableValue<T> &o) { isNull = o.isNull; value = o.value; return *this; } operator T() const { return value; } @@ -78,4 +78,4 @@ struct QDeclarativeNullableValue QT_END_NAMESPACE -#endif // QDECLARATIVENULLABLEVALUE_P_H +#endif // QQMLNULLABLEVALUE_P_H diff --git a/src/declarative/qml/qdeclarativeopenmetaobject.cpp b/src/qml/qml/qqmlopenmetaobject.cpp index ca11d03135..221cb3a314 100644 --- a/src/declarative/qml/qdeclarativeopenmetaobject.cpp +++ b/src/qml/qml/qqmlopenmetaobject.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,19 +39,19 @@ ** ****************************************************************************/ -#include "qdeclarativeopenmetaobject_p.h" -#include <private/qdeclarativepropertycache_p.h> -#include <private/qdeclarativedata_p.h> +#include "qqmlopenmetaobject_p.h" +#include <private/qqmlpropertycache_p.h> +#include <private/qqmldata_p.h> #include <private/qmetaobjectbuilder_p.h> #include <qdebug.h> QT_BEGIN_NAMESPACE -class QDeclarativeOpenMetaObjectTypePrivate +class QQmlOpenMetaObjectTypePrivate { public: - QDeclarativeOpenMetaObjectTypePrivate() : mem(0), cache(0), engine(0) {} + QQmlOpenMetaObjectTypePrivate() : mem(0), cache(0), engine(0) {} void init(const QMetaObject *metaObj); @@ -60,19 +60,19 @@ public: QHash<QByteArray, int> names; QMetaObjectBuilder mob; QMetaObject *mem; - QDeclarativePropertyCache *cache; - QDeclarativeEngine *engine; - QSet<QDeclarativeOpenMetaObject*> referers; + QQmlPropertyCache *cache; + QQmlEngine *engine; + QSet<QQmlOpenMetaObject*> referers; }; -QDeclarativeOpenMetaObjectType::QDeclarativeOpenMetaObjectType(const QMetaObject *base, QDeclarativeEngine *engine) - : QDeclarativeCleanup(engine), d(new QDeclarativeOpenMetaObjectTypePrivate) +QQmlOpenMetaObjectType::QQmlOpenMetaObjectType(const QMetaObject *base, QQmlEngine *engine) + : QQmlCleanup(engine), d(new QQmlOpenMetaObjectTypePrivate) { d->engine = engine; d->init(base); } -QDeclarativeOpenMetaObjectType::~QDeclarativeOpenMetaObjectType() +QQmlOpenMetaObjectType::~QQmlOpenMetaObjectType() { if (d->mem) free(d->mem); @@ -81,22 +81,22 @@ QDeclarativeOpenMetaObjectType::~QDeclarativeOpenMetaObjectType() delete d; } -void QDeclarativeOpenMetaObjectType::clear() +void QQmlOpenMetaObjectType::clear() { d->engine = 0; } -int QDeclarativeOpenMetaObjectType::propertyOffset() const +int QQmlOpenMetaObjectType::propertyOffset() const { return d->propertyOffset; } -int QDeclarativeOpenMetaObjectType::signalOffset() const +int QQmlOpenMetaObjectType::signalOffset() const { return d->signalOffset; } -int QDeclarativeOpenMetaObjectType::createProperty(const QByteArray &name) +int QQmlOpenMetaObjectType::createProperty(const QByteArray &name) { int id = d->mob.propertyCount(); d->mob.addSignal("__" + QByteArray::number(id) + "()"); @@ -105,9 +105,9 @@ int QDeclarativeOpenMetaObjectType::createProperty(const QByteArray &name) free(d->mem); d->mem = d->mob.toMetaObject(); d->names.insert(name, id); - QSet<QDeclarativeOpenMetaObject*>::iterator it = d->referers.begin(); + QSet<QQmlOpenMetaObject*>::iterator it = d->referers.begin(); while (it != d->referers.end()) { - QDeclarativeOpenMetaObject *omo = *it; + QQmlOpenMetaObject *omo = *it; *static_cast<QMetaObject *>(omo) = *d->mem; if (d->cache) d->cache->update(d->engine, omo); @@ -117,13 +117,13 @@ int QDeclarativeOpenMetaObjectType::createProperty(const QByteArray &name) return d->propertyOffset + id; } -void QDeclarativeOpenMetaObjectType::propertyCreated(int id, QMetaPropertyBuilder &builder) +void QQmlOpenMetaObjectType::propertyCreated(int id, QMetaPropertyBuilder &builder) { if (d->referers.count()) (*d->referers.begin())->propertyCreated(id, builder); } -void QDeclarativeOpenMetaObjectTypePrivate::init(const QMetaObject *metaObj) +void QQmlOpenMetaObjectTypePrivate::init(const QMetaObject *metaObj) { if (!mem) { mob.setSuperClass(metaObj); @@ -139,10 +139,10 @@ void QDeclarativeOpenMetaObjectTypePrivate::init(const QMetaObject *metaObj) //---------------------------------------------------------------------------- -class QDeclarativeOpenMetaObjectPrivate +class QQmlOpenMetaObjectPrivate { public: - QDeclarativeOpenMetaObjectPrivate(QDeclarativeOpenMetaObject *_q) + QQmlOpenMetaObjectPrivate(QQmlOpenMetaObject *_q) : q(_q), parent(0), type(0), cacheProperties(false) {} inline QVariant &getData(int idx) { @@ -171,21 +171,21 @@ public: } bool autoCreate; - QDeclarativeOpenMetaObject *q; + QQmlOpenMetaObject *q; QAbstractDynamicMetaObject *parent; QList<QPair<QVariant, bool> > data; QObject *object; - QDeclarativeOpenMetaObjectType *type; + QQmlOpenMetaObjectType *type; bool cacheProperties; }; -QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, bool automatic) -: d(new QDeclarativeOpenMetaObjectPrivate(this)) +QQmlOpenMetaObject::QQmlOpenMetaObject(QObject *obj, bool automatic) +: d(new QQmlOpenMetaObjectPrivate(this)) { d->autoCreate = automatic; d->object = obj; - d->type = new QDeclarativeOpenMetaObjectType(obj->metaObject(), 0); + d->type = new QQmlOpenMetaObjectType(obj->metaObject(), 0); d->type->d->referers.insert(this); QObjectPrivate *op = QObjectPrivate::get(obj); @@ -194,8 +194,8 @@ QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, bool automa op->metaObject = this; } -QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, QDeclarativeOpenMetaObjectType *type, bool automatic) -: d(new QDeclarativeOpenMetaObjectPrivate(this)) +QQmlOpenMetaObject::QQmlOpenMetaObject(QObject *obj, QQmlOpenMetaObjectType *type, bool automatic) +: d(new QQmlOpenMetaObjectPrivate(this)) { d->autoCreate = automatic; d->object = obj; @@ -210,7 +210,7 @@ QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, QDeclarativ op->metaObject = this; } -QDeclarativeOpenMetaObject::~QDeclarativeOpenMetaObject() +QQmlOpenMetaObject::~QQmlOpenMetaObject() { if (d->parent) delete d->parent; @@ -219,12 +219,12 @@ QDeclarativeOpenMetaObject::~QDeclarativeOpenMetaObject() delete d; } -QDeclarativeOpenMetaObjectType *QDeclarativeOpenMetaObject::type() const +QQmlOpenMetaObjectType *QQmlOpenMetaObject::type() const { return d->type; } -int QDeclarativeOpenMetaObject::metaCall(QMetaObject::Call c, int id, void **a) +int QQmlOpenMetaObject::metaCall(QMetaObject::Call c, int id, void **a) { if (( c == QMetaObject::ReadProperty || c == QMetaObject::WriteProperty) && id >= d->type->d->propertyOffset) { @@ -249,23 +249,23 @@ int QDeclarativeOpenMetaObject::metaCall(QMetaObject::Call c, int id, void **a) } } -QAbstractDynamicMetaObject *QDeclarativeOpenMetaObject::parent() const +QAbstractDynamicMetaObject *QQmlOpenMetaObject::parent() const { return d->parent; } -QVariant QDeclarativeOpenMetaObject::value(int id) const +QVariant QQmlOpenMetaObject::value(int id) const { return d->getData(id); } -void QDeclarativeOpenMetaObject::setValue(int id, const QVariant &value) +void QQmlOpenMetaObject::setValue(int id, const QVariant &value) { d->writeData(id, value); activate(d->object, id + d->type->d->signalOffset, 0); } -QVariant QDeclarativeOpenMetaObject::value(const QByteArray &name) const +QVariant QQmlOpenMetaObject::value(const QByteArray &name) const { QHash<QByteArray, int>::ConstIterator iter = d->type->d->names.find(name); if (iter == d->type->d->names.end()) @@ -274,7 +274,7 @@ QVariant QDeclarativeOpenMetaObject::value(const QByteArray &name) const return d->getData(*iter); } -QVariant &QDeclarativeOpenMetaObject::operator[](const QByteArray &name) +QVariant &QQmlOpenMetaObject::operator[](const QByteArray &name) { QHash<QByteArray, int>::ConstIterator iter = d->type->d->names.find(name); Q_ASSERT(iter != d->type->d->names.end()); @@ -282,12 +282,12 @@ QVariant &QDeclarativeOpenMetaObject::operator[](const QByteArray &name) return d->getData(*iter); } -QVariant &QDeclarativeOpenMetaObject::operator[](int id) +QVariant &QQmlOpenMetaObject::operator[](int id) { return d->getData(id); } -bool QDeclarativeOpenMetaObject::setValue(const QByteArray &name, const QVariant &val) +bool QQmlOpenMetaObject::setValue(const QByteArray &name, const QVariant &val) { QHash<QByteArray, int>::ConstIterator iter = d->type->d->names.find(name); @@ -312,22 +312,22 @@ bool QDeclarativeOpenMetaObject::setValue(const QByteArray &name, const QVariant } // returns true if this value has been initialized by a call to either value() or setValue() -bool QDeclarativeOpenMetaObject::hasValue(int id) const +bool QQmlOpenMetaObject::hasValue(int id) const { return d->hasData(id); } -void QDeclarativeOpenMetaObject::setCached(bool c) +void QQmlOpenMetaObject::setCached(bool c) { if (c == d->cacheProperties || !d->type->d->engine) return; d->cacheProperties = c; - QDeclarativeData *qmldata = QDeclarativeData::get(d->object, true); + QQmlData *qmldata = QQmlData::get(d->object, true); if (d->cacheProperties) { if (!d->type->d->cache) - d->type->d->cache = new QDeclarativePropertyCache(d->type->d->engine, this); + d->type->d->cache = new QQmlPropertyCache(d->type->d->engine, this); qmldata->propertyCache = d->type->d->cache; d->type->d->cache->addref(); } else { @@ -338,7 +338,7 @@ void QDeclarativeOpenMetaObject::setCached(bool c) } -int QDeclarativeOpenMetaObject::createProperty(const char *name, const char *) +int QQmlOpenMetaObject::createProperty(const char *name, const char *) { if (d->autoCreate) return d->type->createProperty(name); @@ -346,40 +346,40 @@ int QDeclarativeOpenMetaObject::createProperty(const char *name, const char *) return -1; } -void QDeclarativeOpenMetaObject::propertyRead(int) +void QQmlOpenMetaObject::propertyRead(int) { } -void QDeclarativeOpenMetaObject::propertyWrite(int) +void QQmlOpenMetaObject::propertyWrite(int) { } -void QDeclarativeOpenMetaObject::propertyWritten(int) +void QQmlOpenMetaObject::propertyWritten(int) { } -void QDeclarativeOpenMetaObject::propertyCreated(int, QMetaPropertyBuilder &) +void QQmlOpenMetaObject::propertyCreated(int, QMetaPropertyBuilder &) { } -QVariant QDeclarativeOpenMetaObject::initialValue(int) +QVariant QQmlOpenMetaObject::initialValue(int) { return QVariant(); } -int QDeclarativeOpenMetaObject::count() const +int QQmlOpenMetaObject::count() const { return d->type->d->names.count(); } -QByteArray QDeclarativeOpenMetaObject::name(int idx) const +QByteArray QQmlOpenMetaObject::name(int idx) const { Q_ASSERT(idx >= 0 && idx < d->type->d->names.count()); return d->type->d->mob.property(idx).name(); } -QObject *QDeclarativeOpenMetaObject::object() const +QObject *QQmlOpenMetaObject::object() const { return d->object; } diff --git a/src/declarative/qml/qdeclarativeopenmetaobject_p.h b/src/qml/qml/qqmlopenmetaobject_p.h index b6b17c0984..188192edc1 100644 --- a/src/declarative/qml/qdeclarativeopenmetaobject_p.h +++ b/src/qml/qml/qqmlopenmetaobject_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEOPENMETAOBJECT_H -#define QDECLARATIVEOPENMETAOBJECT_H +#ifndef QQMLOPENMETAOBJECT_H +#define QQMLOPENMETAOBJECT_H #include <QtCore/QMetaObject> #include <QtCore/QObject> -#include <private/qdeclarativerefcount_p.h> -#include <private/qdeclarativecleanup_p.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlrefcount_p.h> +#include <private/qqmlcleanup_p.h> +#include <private/qtqmlglobal_p.h> #include <private/qobject_p.h> QT_BEGIN_HEADER @@ -55,14 +55,14 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; class QMetaPropertyBuilder; -class QDeclarativeOpenMetaObjectTypePrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeOpenMetaObjectType : public QDeclarativeRefCount, public QDeclarativeCleanup +class QQmlOpenMetaObjectTypePrivate; +class Q_QML_PRIVATE_EXPORT QQmlOpenMetaObjectType : public QQmlRefCount, public QQmlCleanup { public: - QDeclarativeOpenMetaObjectType(const QMetaObject *base, QDeclarativeEngine *engine); - ~QDeclarativeOpenMetaObjectType(); + QQmlOpenMetaObjectType(const QMetaObject *base, QQmlEngine *engine); + ~QQmlOpenMetaObjectType(); int createProperty(const QByteArray &name); @@ -74,18 +74,18 @@ protected: virtual void clear(); private: - QDeclarativeOpenMetaObjectTypePrivate *d; - friend class QDeclarativeOpenMetaObject; - friend class QDeclarativeOpenMetaObjectPrivate; + QQmlOpenMetaObjectTypePrivate *d; + friend class QQmlOpenMetaObject; + friend class QQmlOpenMetaObjectPrivate; }; -class QDeclarativeOpenMetaObjectPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeOpenMetaObject : public QAbstractDynamicMetaObject +class QQmlOpenMetaObjectPrivate; +class Q_QML_PRIVATE_EXPORT QQmlOpenMetaObject : public QAbstractDynamicMetaObject { public: - QDeclarativeOpenMetaObject(QObject *, bool = true); - QDeclarativeOpenMetaObject(QObject *, QDeclarativeOpenMetaObjectType *, bool = true); - ~QDeclarativeOpenMetaObject(); + QQmlOpenMetaObject(QObject *, bool = true); + QQmlOpenMetaObject(QObject *, QQmlOpenMetaObjectType *, bool = true); + ~QQmlOpenMetaObject(); QVariant value(const QByteArray &) const; bool setValue(const QByteArray &, const QVariant &); @@ -105,7 +105,7 @@ public: // longer automatically called for new properties. void setCached(bool); - QDeclarativeOpenMetaObjectType *type() const; + QQmlOpenMetaObjectType *type() const; protected: virtual int metaCall(QMetaObject::Call _c, int _id, void **_a); @@ -119,12 +119,12 @@ protected: QAbstractDynamicMetaObject *parent() const; private: - QDeclarativeOpenMetaObjectPrivate *d; - friend class QDeclarativeOpenMetaObjectType; + QQmlOpenMetaObjectPrivate *d; + friend class QQmlOpenMetaObjectType; }; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEOPENMETAOBJECT_H +#endif // QQMLOPENMETAOBJECT_H diff --git a/src/declarative/qml/qdeclarativeparserstatus.cpp b/src/qml/qml/qqmlparserstatus.cpp index 39538b51dd..d4e415a069 100644 --- a/src/declarative/qml/qdeclarativeparserstatus.cpp +++ b/src/qml/qml/qqmlparserstatus.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativeparserstatus.h" +#include "qqmlparserstatus.h" QT_BEGIN_NAMESPACE /*! - \class QDeclarativeParserStatus + \class QQmlParserStatus \since 4.7 - \brief The QDeclarativeParserStatus class provides updates on the QML parser state. + \brief The QQmlParserStatus class provides updates on the QML parser state. - QDeclarativeParserStatus provides a mechanism for classes instantiated by - a QDeclarativeEngine to receive notification at key points in their creation. + QQmlParserStatus provides a mechanism for classes instantiated by + a QQmlEngine to receive notification at key points in their creation. This class is often used for optimization purposes, as it allows you to defer an expensive operation until after all the properties have been set on an @@ -59,14 +59,14 @@ QT_BEGIN_NAMESPACE when the \c font is assigned, and relayout again when the \c width is assigned, and so on). - To use QDeclarativeParserStatus, you must inherit both a QObject-derived class - and QDeclarativeParserStatus, and use the Q_INTERFACES() macro. + To use QQmlParserStatus, you must inherit both a QObject-derived class + and QQmlParserStatus, and use the Q_INTERFACES() macro. \code - class MyObject : public QObject, public QDeclarativeParserStatus + class MyObject : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: MyObject(QObject *parent = 0); @@ -78,26 +78,26 @@ QT_BEGIN_NAMESPACE */ /*! \internal */ -QDeclarativeParserStatus::QDeclarativeParserStatus() +QQmlParserStatus::QQmlParserStatus() : d(0) { } /*! \internal */ -QDeclarativeParserStatus::~QDeclarativeParserStatus() +QQmlParserStatus::~QQmlParserStatus() { if(d) (*d) = 0; } /*! - \fn void QDeclarativeParserStatus::classBegin() + \fn void QQmlParserStatus::classBegin() Invoked after class creation, but before any properties have been set. */ /*! - \fn void QDeclarativeParserStatus::componentComplete() + \fn void QQmlParserStatus::componentComplete() Invoked after the root component that caused this instantiation has completed construction. At this point all static values and binding values diff --git a/src/declarative/qml/qdeclarativeparserstatus.h b/src/qml/qml/qqmlparserstatus.h index d8544310bd..9f06f45b06 100644 --- a/src/declarative/qml/qdeclarativeparserstatus.h +++ b/src/qml/qml/qqmlparserstatus.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPARSERSTATUS_H -#define QDECLARATIVEPARSERSTATUS_H +#ifndef QQMLPARSERSTATUS_H +#define QQMLPARSERSTATUS_H +#include <QtQml/qtqmlglobal.h> #include <QtCore/qobject.h> QT_BEGIN_HEADER @@ -49,26 +50,26 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class Q_DECLARATIVE_EXPORT QDeclarativeParserStatus +class Q_QML_EXPORT QQmlParserStatus { public: - QDeclarativeParserStatus(); - virtual ~QDeclarativeParserStatus(); + QQmlParserStatus(); + virtual ~QQmlParserStatus(); virtual void classBegin()=0; virtual void componentComplete()=0; private: - friend class QDeclarativeVME; - friend class QDeclarativeComponent; - friend class QDeclarativeComponentPrivate; - friend class QDeclarativeEnginePrivate; - QDeclarativeParserStatus **d; + friend class QQmlVME; + friend class QQmlComponent; + friend class QQmlComponentPrivate; + friend class QQmlEnginePrivate; + QQmlParserStatus **d; }; -Q_DECLARE_INTERFACE(QDeclarativeParserStatus, "com.trolltech.qml.QDeclarativeParserStatus") +Q_DECLARE_INTERFACE(QQmlParserStatus, "com.trolltech.qml.QQmlParserStatus") QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEPARSERSTATUS_H +#endif // QQMLPARSERSTATUS_H diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/qml/qml/qqmlprivate.h index 3477d469af..b4c6fc3a12 100644 --- a/src/declarative/qml/qdeclarativeprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPRIVATE_H -#define QDECLARATIVEPRIVATE_H +#ifndef QQMLPRIVATE_H +#define QQMLPRIVATE_H // // W A R N I N G @@ -53,6 +53,8 @@ // We mean it. // +#include <QtQml/qtqmlglobal.h> + #include <QtCore/qglobal.h> #include <QtCore/qvariant.h> @@ -61,10 +63,10 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -typedef QObject *(*QDeclarativeAttachedPropertiesFunc)(QObject *); +typedef QObject *(*QQmlAttachedPropertiesFunc)(QObject *); template <typename TYPE> -class QDeclarativeTypeInfo +class QQmlTypeInfo { public: enum { @@ -75,22 +77,22 @@ public: class QJSValue; class QJSEngine; -class QDeclarativeEngine; -class QDeclarativeCustomParser; -namespace QDeclarativePrivate +class QQmlEngine; +class QQmlCustomParser; +namespace QQmlPrivate { - void Q_DECLARATIVE_EXPORT qdeclarativeelement_destructor(QObject *); + void Q_QML_EXPORT qdeclarativeelement_destructor(QObject *); template<typename T> - class QDeclarativeElement : public T + class QQmlElement : public T { public: - virtual ~QDeclarativeElement() { - QDeclarativePrivate::qdeclarativeelement_destructor(this); + virtual ~QQmlElement() { + QQmlPrivate::qdeclarativeelement_destructor(this); } }; template<typename T> - void createInto(void *memory) { new (memory) QDeclarativeElement<T>; } + void createInto(void *memory) { new (memory) QQmlElement<T>; } template<typename T> QObject *createParent(QObject *p) { return new T(p); } @@ -125,7 +127,7 @@ namespace QDeclarativePrivate template <typename T> struct has_attachedPropertiesMember { - static bool const value = QDeclarativeTypeInfo<T>::hasAttachedProperties; + static bool const value = QQmlTypeInfo<T>::hasAttachedProperties; }; template <typename T, bool hasMember> @@ -153,7 +155,7 @@ namespace QDeclarativePrivate class AttachedPropertySelector { public: - static inline QDeclarativeAttachedPropertiesFunc func() { return 0; } + static inline QQmlAttachedPropertiesFunc func() { return 0; } static inline const QMetaObject *metaObject() { return 0; } }; template<typename T> @@ -167,7 +169,7 @@ namespace QDeclarativePrivate return &ReturnType::staticMetaObject; } public: - static inline QDeclarativeAttachedPropertiesFunc func() { + static inline QQmlAttachedPropertiesFunc func() { return &attachedProperties; } static inline const QMetaObject *metaObject() { @@ -176,7 +178,7 @@ namespace QDeclarativePrivate }; template<typename T> - inline QDeclarativeAttachedPropertiesFunc attachedPropertiesFunc() + inline QQmlAttachedPropertiesFunc attachedPropertiesFunc() { return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func(); } @@ -205,7 +207,7 @@ namespace QDeclarativePrivate const char *elementName; const QMetaObject *metaObject; - QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction; + QQmlAttachedPropertiesFunc attachedPropertiesFunction; const QMetaObject *attachedPropertiesMetaObject; int parserStatusCast; @@ -215,7 +217,7 @@ namespace QDeclarativePrivate QObject *(*extensionObjectCreate)(QObject *); const QMetaObject *extensionMetaObject; - QDeclarativeCustomParser *customParser; + QQmlCustomParser *customParser; int revision; // If this is extended ensure "version" is bumped!!! }; @@ -242,8 +244,8 @@ namespace QDeclarativePrivate int versionMajor; int versionMinor; - QJSValue (*scriptApi)(QDeclarativeEngine *, QJSEngine *); - QObject *(*qobjectApi)(QDeclarativeEngine *, QJSEngine *); + QJSValue (*scriptApi)(QQmlEngine *, QJSEngine *); + QObject *(*qobjectApi)(QQmlEngine *, QJSEngine *); }; enum RegistrationType { @@ -253,11 +255,11 @@ namespace QDeclarativePrivate ModuleApiRegistration = 3 }; - int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *); + int Q_QML_EXPORT qmlregister(RegistrationType, void *); } QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEPRIVATE_H +#endif // QQMLPRIVATE_H diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/qml/qml/qqmlproperty.cpp index 7ba801d72f..6321592e9a 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,22 +39,22 @@ ** ****************************************************************************/ -#include "qdeclarativeproperty.h" -#include "qdeclarativeproperty_p.h" - -#include "qdeclarative.h" -#include "qdeclarativebinding_p.h" -#include "qdeclarativecontext.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativeboundsignal_p.h" -#include "qdeclarativeengine.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativedata_p.h" -#include "qdeclarativestringconverters_p.h" -#include "qdeclarativelist_p.h" -#include "qdeclarativecompiler_p.h" -#include "qdeclarativevmemetaobject_p.h" -#include "qdeclarativeexpression_p.h" +#include "qqmlproperty.h" +#include "qqmlproperty_p.h" + +#include "qqml.h" +#include "qqmlbinding_p.h" +#include "qqmlcontext.h" +#include "qqmlcontext_p.h" +#include "qqmlboundsignal_p.h" +#include "qqmlengine.h" +#include "qqmlengine_p.h" +#include "qqmldata_p.h" +#include "qqmlstringconverters_p.h" +#include "qqmllist_p.h" +#include "qqmlcompiler_p.h" +#include "qqmlvmemetaobject_p.h" +#include "qqmlexpression_p.h" #include <QStringList> #include <QtCore/qdebug.h> @@ -70,18 +70,18 @@ Q_DECLARE_METATYPE(QList<QUrl>) QT_BEGIN_NAMESPACE /*! -\class QDeclarativeProperty +\class QQmlProperty \since 4.7 -\brief The QDeclarativeProperty class abstracts accessing properties on objects created from QML. +\brief The QQmlProperty class abstracts accessing properties on objects created from QML. As QML uses Qt's meta-type system all of the existing QMetaObject classes can be used to introspect and interact with objects created by QML. However, some of the new features provided by QML - such -as type safety and attached properties - are most easily used through the QDeclarativeProperty class +as type safety and attached properties - are most easily used through the QQmlProperty class that simplifies some of their natural complexity. -Unlike QMetaProperty which represents a property on a class type, QDeclarativeProperty encapsulates +Unlike QMetaProperty which represents a property on a class type, QQmlProperty encapsulates a property on a specific object instance. To read a property's value, programmers create a -QDeclarativeProperty instance and call the read() method. Likewise to write a property value the +QQmlProperty instance and call the read() method. Likewise to write a property value the write() method is used. For example, for the following QML code: @@ -93,16 +93,16 @@ import QtQuick 2.0 Text { text: "A bit of text" } \endqml -The \l Text object's properties could be accessed using QDeclarativeProperty, like this: +The \l Text object's properties could be accessed using QQmlProperty, like this: \code -#include <QDeclarativeProperty> +#include <QQmlProperty> #include <QGraphicsObject> ... -QDeclarativeView view(QUrl::fromLocalFile("MyItem.qml")); -QDeclarativeProperty property(view.rootObject(), "font.pixelSize"); +QQuickView view(QUrl::fromLocalFile("MyItem.qml")); +QQmlProperty property(view.rootObject(), "font.pixelSize"); qWarning() << "Current pixel size:" << property.read().toInt(); property.write(24); qWarning() << "Pixel size should now be 24:" << property.read().toInt(); @@ -110,15 +110,15 @@ qWarning() << "Pixel size should now be 24:" << property.read().toInt(); */ /*! - Create an invalid QDeclarativeProperty. + Create an invalid QQmlProperty. */ -QDeclarativeProperty::QDeclarativeProperty() +QQmlProperty::QQmlProperty() : d(0) { } /*! \internal */ -QDeclarativeProperty::~QDeclarativeProperty() +QQmlProperty::~QQmlProperty() { if (d) d->release(); @@ -126,37 +126,37 @@ QDeclarativeProperty::~QDeclarativeProperty() } /*! - Creates a QDeclarativeProperty for the default property of \a obj. If there is no - default property, an invalid QDeclarativeProperty will be created. + Creates a QQmlProperty for the default property of \a obj. If there is no + default property, an invalid QQmlProperty will be created. */ -QDeclarativeProperty::QDeclarativeProperty(QObject *obj) -: d(new QDeclarativePropertyPrivate) +QQmlProperty::QQmlProperty(QObject *obj) +: d(new QQmlPropertyPrivate) { d->initDefault(obj); } /*! - Creates a QDeclarativeProperty for the default property of \a obj - using the \l{QDeclarativeContext} {context} \a ctxt. If there is - no default property, an invalid QDeclarativeProperty will be + Creates a QQmlProperty for the default property of \a obj + using the \l{QQmlContext} {context} \a ctxt. If there is + no default property, an invalid QQmlProperty will be created. */ -QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ctxt) -: d(new QDeclarativePropertyPrivate) +QQmlProperty::QQmlProperty(QObject *obj, QQmlContext *ctxt) +: d(new QQmlPropertyPrivate) { - d->context = ctxt?QDeclarativeContextData::get(ctxt):0; + d->context = ctxt?QQmlContextData::get(ctxt):0; d->engine = ctxt?ctxt->engine():0; d->initDefault(obj); } /*! - Creates a QDeclarativeProperty for the default property of \a obj + Creates a QQmlProperty for the default property of \a obj using the environment for instantiating QML components that is provided by \a engine. If there is no default property, an - invalid QDeclarativeProperty will be created. + invalid QQmlProperty will be created. */ -QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeEngine *engine) - : d(new QDeclarativePropertyPrivate) +QQmlProperty::QQmlProperty(QObject *obj, QQmlEngine *engine) + : d(new QQmlPropertyPrivate) { d->context = 0; d->engine = engine; @@ -166,50 +166,50 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeEngine *eng /*! Initialize from the default property of \a obj */ -void QDeclarativePropertyPrivate::initDefault(QObject *obj) +void QQmlPropertyPrivate::initDefault(QObject *obj) { if (!obj) return; - QMetaProperty p = QDeclarativeMetaType::defaultProperty(obj); + QMetaProperty p = QQmlMetaType::defaultProperty(obj); core.load(p); if (core.isValid()) object = obj; } /*! - Creates a QDeclarativeProperty for the property \a name of \a obj. + Creates a QQmlProperty for the property \a name of \a obj. */ -QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name) -: d(new QDeclarativePropertyPrivate) +QQmlProperty::QQmlProperty(QObject *obj, const QString &name) +: d(new QQmlPropertyPrivate) { d->initProperty(obj, name); if (!isValid()) d->object = 0; } /*! - Creates a QDeclarativeProperty for the property \a name of \a obj - using the \l{QDeclarativeContext} {context} \a ctxt. + Creates a QQmlProperty for the property \a name of \a obj + using the \l{QQmlContext} {context} \a ctxt. - Creating a QDeclarativeProperty without a context will render some + Creating a QQmlProperty without a context will render some properties - like attached properties - inaccessible. */ -QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt) -: d(new QDeclarativePropertyPrivate) +QQmlProperty::QQmlProperty(QObject *obj, const QString &name, QQmlContext *ctxt) +: d(new QQmlPropertyPrivate) { - d->context = ctxt?QDeclarativeContextData::get(ctxt):0; + d->context = ctxt?QQmlContextData::get(ctxt):0; d->engine = ctxt?ctxt->engine():0; d->initProperty(obj, name); if (!isValid()) { d->object = 0; d->context = 0; d->engine = 0; } } /*! - Creates a QDeclarativeProperty for the property \a name of \a obj + Creates a QQmlProperty for the property \a name of \a obj using the environment for instantiating QML components that is provided by \a engine. */ -QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeEngine *engine) -: d(new QDeclarativePropertyPrivate) +QQmlProperty::QQmlProperty(QObject *obj, const QString &name, QQmlEngine *engine) +: d(new QQmlPropertyPrivate) { d->context = 0; d->engine = engine; @@ -217,25 +217,25 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QD if (!isValid()) { d->object = 0; d->context = 0; d->engine = 0; } } -Q_GLOBAL_STATIC(QDeclarativeValueTypeFactory, qmlValueTypes); +Q_GLOBAL_STATIC(QQmlValueTypeFactory, qmlValueTypes); -QDeclarativePropertyPrivate::QDeclarativePropertyPrivate() +QQmlPropertyPrivate::QQmlPropertyPrivate() : context(0), engine(0), object(0), isNameCached(false) { } -QDeclarativeContextData *QDeclarativePropertyPrivate::effectiveContext() const +QQmlContextData *QQmlPropertyPrivate::effectiveContext() const { if (context) return context; - else if (engine) return QDeclarativeContextData::get(engine->rootContext()); + else if (engine) return QQmlContextData::get(engine->rootContext()); else return 0; } -void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name) +void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name) { if (!obj) return; - QDeclarativeTypeNameCache *typeNameCache = context?context->imports:0; + QQmlTypeNameCache *typeNameCache = context?context->imports:0; QStringList path = name.split(QLatin1Char('.')); if (path.isEmpty()) return; @@ -247,10 +247,10 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name const QString &pathName = path.at(ii); if (typeNameCache) { - QDeclarativeTypeNameCache::Result r = typeNameCache->query(pathName); + QQmlTypeNameCache::Result r = typeNameCache->query(pathName); if (r.isValid()) { if (r.type) { - QDeclarativeAttachedPropertiesFunc func = r.type->attachedPropertiesFunction(); + QQmlAttachedPropertiesFunc func = r.type->attachedPropertiesFunction(); if (!func) return; // Not an attachable type currentObject = qmlAttachedPropertiesObjectById(r.type->attachedPropertiesId(), currentObject); @@ -261,7 +261,7 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name ++ii; r = typeNameCache->query(path.at(ii), r.importNamespace); if (!r.type) return; // Invalid type in namespace - QDeclarativeAttachedPropertiesFunc func = r.type->attachedPropertiesFunction(); + QQmlAttachedPropertiesFunc func = r.type->attachedPropertiesFunction(); if (!func) return; // Not an attachable type currentObject = qmlAttachedPropertiesObjectById(r.type->attachedPropertiesId(), currentObject); @@ -277,15 +277,15 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name } - QDeclarativePropertyData local; - QDeclarativePropertyData *property = - QDeclarativePropertyCache::property(engine, obj, pathName, local); + QQmlPropertyData local; + QQmlPropertyData *property = + QQmlPropertyCache::property(engine, obj, pathName, local); if (!property) return; // Not a property if (property->isFunction()) return; // Not an object property - if (ii == (path.count() - 2) && QDeclarativeValueTypeFactory::isValueType(property->propType)) { + if (ii == (path.count() - 2) && QQmlValueTypeFactory::isValueType(property->propType)) { // We're now at a value type property. We can use a global valuetypes array as we // never actually use the objects, just look up their properties. QObject *typeObject = (*qmlValueTypes())[property->propType]; @@ -296,7 +296,7 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name QMetaProperty vtProp = typeObject->metaObject()->property(idx); - typedef QDeclarativePropertyData PCD; + typedef QQmlPropertyData PCD; Q_ASSERT(PCD::flagsForProperty(vtProp) <= PCD::ValueTypeFlagMask); Q_ASSERT(vtProp.userType() <= 0xFF); @@ -341,9 +341,9 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name } // Property - QDeclarativePropertyData local; - QDeclarativePropertyData *property = - QDeclarativePropertyCache::property(engine, currentObject, terminal, local); + QQmlPropertyData local; + QQmlPropertyData *property = + QQmlPropertyCache::property(engine, currentObject, terminal, local); if (property && !property->isFunction()) { object = currentObject; core = *property; @@ -355,7 +355,7 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name /*! Create a copy of \a other. */ -QDeclarativeProperty::QDeclarativeProperty(const QDeclarativeProperty &other) +QQmlProperty::QQmlProperty(const QQmlProperty &other) { d = other.d; if (d) @@ -363,18 +363,18 @@ QDeclarativeProperty::QDeclarativeProperty(const QDeclarativeProperty &other) } /*! - \enum QDeclarativeProperty::PropertyTypeCategory + \enum QQmlProperty::PropertyTypeCategory This enum specifies a category of QML property. \value InvalidCategory The property is invalid, or is a signal property. - \value List The property is a QDeclarativeListProperty list property + \value List The property is a QQmlListProperty list property \value Object The property is a QObject derived type pointer \value Normal The property is a normal value property. */ /*! - \enum QDeclarativeProperty::Type + \enum QQmlProperty::Type This enum specifies a type of QML property. @@ -386,32 +386,32 @@ QDeclarativeProperty::QDeclarativeProperty(const QDeclarativeProperty &other) /*! Returns the property category. */ -QDeclarativeProperty::PropertyTypeCategory QDeclarativeProperty::propertyTypeCategory() const +QQmlProperty::PropertyTypeCategory QQmlProperty::propertyTypeCategory() const { return d ? d->propertyTypeCategory() : InvalidCategory; } -QDeclarativeProperty::PropertyTypeCategory -QDeclarativePropertyPrivate::propertyTypeCategory() const +QQmlProperty::PropertyTypeCategory +QQmlPropertyPrivate::propertyTypeCategory() const { uint type = this->type(); if (isValueType()) { - return QDeclarativeProperty::Normal; - } else if (type & QDeclarativeProperty::Property) { + return QQmlProperty::Normal; + } else if (type & QQmlProperty::Property) { int type = propertyType(); if (type == QVariant::Invalid) - return QDeclarativeProperty::InvalidCategory; - else if (QDeclarativeValueTypeFactory::isValueType((uint)type)) - return QDeclarativeProperty::Normal; + return QQmlProperty::InvalidCategory; + else if (QQmlValueTypeFactory::isValueType((uint)type)) + return QQmlProperty::Normal; else if (core.isQObject()) - return QDeclarativeProperty::Object; + return QQmlProperty::Object; else if (core.isQList()) - return QDeclarativeProperty::List; + return QQmlProperty::List; else - return QDeclarativeProperty::Normal; + return QQmlProperty::Normal; } else { - return QDeclarativeProperty::InvalidCategory; + return QQmlProperty::InvalidCategory; } } @@ -419,16 +419,16 @@ QDeclarativePropertyPrivate::propertyTypeCategory() const Returns the type name of the property, or 0 if the property has no type name. */ -const char *QDeclarativeProperty::propertyTypeName() const +const char *QQmlProperty::propertyTypeName() const { if (!d) return 0; if (d->isValueType()) { - QDeclarativeEnginePrivate *ep = d->engine?QDeclarativeEnginePrivate::get(d->engine):0; - QDeclarativeValueType *valueType = 0; + QQmlEnginePrivate *ep = d->engine?QQmlEnginePrivate::get(d->engine):0; + QQmlValueType *valueType = 0; if (ep) valueType = ep->valueTypes[d->core.propType]; - else valueType = QDeclarativeValueTypeFactory::valueType(d->core.propType); + else valueType = QQmlValueTypeFactory::valueType(d->core.propType); Q_ASSERT(valueType); const char *rv = valueType->metaObject()->property(d->core.valueTypeCoreIndex).typeName(); @@ -444,10 +444,10 @@ const char *QDeclarativeProperty::propertyTypeName() const } /*! - Returns true if \a other and this QDeclarativeProperty represent the same + Returns true if \a other and this QQmlProperty represent the same property. */ -bool QDeclarativeProperty::operator==(const QDeclarativeProperty &other) const +bool QQmlProperty::operator==(const QQmlProperty &other) const { if (!d || !other.d) return false; @@ -465,74 +465,74 @@ bool QDeclarativeProperty::operator==(const QDeclarativeProperty &other) const Returns the QVariant type of the property, or QVariant::Invalid if the property has no QVariant type. */ -int QDeclarativeProperty::propertyType() const +int QQmlProperty::propertyType() const { return d ? d->propertyType() : int(QVariant::Invalid); } -bool QDeclarativePropertyPrivate::isValueType() const +bool QQmlPropertyPrivate::isValueType() const { return core.isValueTypeVirtual(); } -int QDeclarativePropertyPrivate::propertyType() const +int QQmlPropertyPrivate::propertyType() const { uint type = this->type(); if (isValueType()) { return core.valueTypePropType; - } else if (type & QDeclarativeProperty::Property) { + } else if (type & QQmlProperty::Property) { return core.propType; } else { return QVariant::Invalid; } } -QDeclarativeProperty::Type QDeclarativePropertyPrivate::type() const +QQmlProperty::Type QQmlPropertyPrivate::type() const { if (core.isFunction()) - return QDeclarativeProperty::SignalProperty; + return QQmlProperty::SignalProperty; else if (core.isValid()) - return QDeclarativeProperty::Property; + return QQmlProperty::Property; else - return QDeclarativeProperty::Invalid; + return QQmlProperty::Invalid; } /*! Returns the type of the property. */ -QDeclarativeProperty::Type QDeclarativeProperty::type() const +QQmlProperty::Type QQmlProperty::type() const { return d ? d->type() : Invalid; } /*! - Returns true if this QDeclarativeProperty represents a regular Qt property. + Returns true if this QQmlProperty represents a regular Qt property. */ -bool QDeclarativeProperty::isProperty() const +bool QQmlProperty::isProperty() const { return type() & Property; } /*! - Returns true if this QDeclarativeProperty represents a QML signal property. + Returns true if this QQmlProperty represents a QML signal property. */ -bool QDeclarativeProperty::isSignalProperty() const +bool QQmlProperty::isSignalProperty() const { return type() & SignalProperty; } /*! - Returns the QDeclarativeProperty's QObject. + Returns the QQmlProperty's QObject. */ -QObject *QDeclarativeProperty::object() const +QObject *QQmlProperty::object() const { return d ? d->object : 0; } /*! - Assign \a other to this QDeclarativeProperty. + Assign \a other to this QQmlProperty. */ -QDeclarativeProperty &QDeclarativeProperty::operator=(const QDeclarativeProperty &other) +QQmlProperty &QQmlProperty::operator=(const QQmlProperty &other) { if (d) d->release(); @@ -546,7 +546,7 @@ QDeclarativeProperty &QDeclarativeProperty::operator=(const QDeclarativeProperty /*! Returns true if the property is writable, otherwise false. */ -bool QDeclarativeProperty::isWritable() const +bool QQmlProperty::isWritable() const { if (!d) return false; @@ -565,7 +565,7 @@ bool QDeclarativeProperty::isWritable() const /*! Returns true if the property is designable, otherwise false. */ -bool QDeclarativeProperty::isDesignable() const +bool QQmlProperty::isDesignable() const { if (!d) return false; @@ -578,7 +578,7 @@ bool QDeclarativeProperty::isDesignable() const /*! Returns true if the property is resettable, otherwise false. */ -bool QDeclarativeProperty::isResettable() const +bool QQmlProperty::isResettable() const { if (!d) return false; @@ -589,10 +589,10 @@ bool QDeclarativeProperty::isResettable() const } /*! - Returns true if the QDeclarativeProperty refers to a valid property, otherwise + Returns true if the QQmlProperty refers to a valid property, otherwise false. */ -bool QDeclarativeProperty::isValid() const +bool QQmlProperty::isValid() const { if (!d) return false; @@ -602,7 +602,7 @@ bool QDeclarativeProperty::isValid() const /*! Return the name of this QML property. */ -QString QDeclarativeProperty::name() const +QString QQmlProperty::name() const { if (!d) return QString(); @@ -612,10 +612,10 @@ QString QDeclarativeProperty::name() const } else if (d->isValueType()) { QString rv = d->core.name(d->object) + QLatin1Char('.'); - QDeclarativeEnginePrivate *ep = d->engine?QDeclarativeEnginePrivate::get(d->engine):0; - QDeclarativeValueType *valueType = 0; + QQmlEnginePrivate *ep = d->engine?QQmlEnginePrivate::get(d->engine):0; + QQmlValueType *valueType = 0; if (ep) valueType = ep->valueTypes[d->core.propType]; - else valueType = QDeclarativeValueTypeFactory::valueType(d->core.propType); + else valueType = QQmlValueTypeFactory::valueType(d->core.propType); Q_ASSERT(valueType); const char *vtName = valueType->metaObject()->property(d->core.valueTypeCoreIndex).name(); @@ -641,7 +641,7 @@ QString QDeclarativeProperty::name() const Returns the \l{QMetaProperty} {Qt property} associated with this QML property. */ -QMetaProperty QDeclarativeProperty::property() const +QMetaProperty QQmlProperty::property() const { if (!d) return QMetaProperty(); @@ -655,7 +655,7 @@ QMetaProperty QDeclarativeProperty::property() const Return the QMetaMethod for this property if it is a SignalProperty, otherwise returns an invalid QMetaMethod. */ -QMetaMethod QDeclarativeProperty::method() const +QMetaMethod QQmlProperty::method() const { if (!d) return QMetaMethod(); @@ -669,8 +669,8 @@ QMetaMethod QDeclarativeProperty::method() const Returns the binding associated with this property, or 0 if no binding exists. */ -QDeclarativeAbstractBinding * -QDeclarativePropertyPrivate::binding(const QDeclarativeProperty &that) +QQmlAbstractBinding * +QQmlPropertyPrivate::binding(const QQmlProperty &that) { if (!that.d || !that.isProperty() || !that.d->object) return 0; @@ -692,9 +692,9 @@ QDeclarativePropertyPrivate::binding(const QDeclarativeProperty &that) \a flags is passed through to the binding and is used for the initial update (when the binding sets the initial value, it will use these flags for the write). */ -QDeclarativeAbstractBinding * -QDeclarativePropertyPrivate::setBinding(const QDeclarativeProperty &that, - QDeclarativeAbstractBinding *newBinding, +QQmlAbstractBinding * +QQmlPropertyPrivate::setBinding(const QQmlProperty &that, + QQmlAbstractBinding *newBinding, WriteFlags flags) { if (!that.d || !that.isProperty() || !that.d->object) { @@ -720,18 +720,18 @@ QDeclarativePropertyPrivate::setBinding(const QDeclarativeProperty &that, } } -QDeclarativeAbstractBinding * -QDeclarativePropertyPrivate::binding(QObject *object, int coreIndex, int valueTypeIndex) +QQmlAbstractBinding * +QQmlPropertyPrivate::binding(QObject *object, int coreIndex, int valueTypeIndex) { - QDeclarativeData *data = QDeclarativeData::get(object); + QQmlData *data = QQmlData::get(object); if (!data) return 0; - QDeclarativePropertyData *propertyData = + QQmlPropertyData *propertyData = data->propertyCache?data->propertyCache->property(coreIndex):0; if (propertyData && propertyData->isAlias()) { - const QDeclarativeVMEMetaObject *vme = - static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); + const QQmlVMEMetaObject *vme = + static_cast<const QQmlVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1; if (!vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex) || aCoreIndex == -1) @@ -746,34 +746,34 @@ QDeclarativePropertyPrivate::binding(QObject *object, int coreIndex, int valueTy if (!data->hasBindingBit(coreIndex)) return 0; - QDeclarativeAbstractBinding *binding = data->bindings; + QQmlAbstractBinding *binding = data->bindings; while (binding && binding->propertyIndex() != coreIndex) binding = binding->m_nextBinding; if (binding && valueTypeIndex != -1) { - if (binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy) { + if (binding->bindingType() == QQmlAbstractBinding::ValueTypeProxy) { int index = coreIndex | (valueTypeIndex << 24); - binding = static_cast<QDeclarativeValueTypeProxyBinding *>(binding)->binding(index); + binding = static_cast<QQmlValueTypeProxyBinding *>(binding)->binding(index); } } return binding; } -void QDeclarativePropertyPrivate::findAliasTarget(QObject *object, int bindingIndex, +void QQmlPropertyPrivate::findAliasTarget(QObject *object, int bindingIndex, QObject **targetObject, int *targetBindingIndex) { int coreIndex = bindingIndex & 0xFFFFFF; int valueTypeIndex = bindingIndex >> 24; if (valueTypeIndex == 0) valueTypeIndex = -1; - QDeclarativeData *data = QDeclarativeData::get(object, false); + QQmlData *data = QQmlData::get(object, false); if (data) { - QDeclarativePropertyData *propertyData = + QQmlPropertyData *propertyData = data->propertyCache?data->propertyCache->property(coreIndex):0; if (propertyData && propertyData->isAlias()) { - const QDeclarativeVMEMetaObject *vme = - static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); + const QQmlVMEMetaObject *vme = + static_cast<const QQmlVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1; if (vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex)) { // This will either be a value type sub-reference or an alias to a value-type sub-reference not both @@ -795,19 +795,19 @@ void QDeclarativePropertyPrivate::findAliasTarget(QObject *object, int bindingIn *targetBindingIndex = bindingIndex; } -QDeclarativeAbstractBinding * -QDeclarativePropertyPrivate::setBinding(QObject *object, int coreIndex, int valueTypeIndex, - QDeclarativeAbstractBinding *newBinding, WriteFlags flags) +QQmlAbstractBinding * +QQmlPropertyPrivate::setBinding(QObject *object, int coreIndex, int valueTypeIndex, + QQmlAbstractBinding *newBinding, WriteFlags flags) { - QDeclarativeData *data = QDeclarativeData::get(object, 0 != newBinding); - QDeclarativeAbstractBinding *binding = 0; + QQmlData *data = QQmlData::get(object, 0 != newBinding); + QQmlAbstractBinding *binding = 0; if (data) { - QDeclarativePropertyData *propertyData = + QQmlPropertyData *propertyData = data->propertyCache?data->propertyCache->property(coreIndex):0; if (propertyData && propertyData->isAlias()) { - const QDeclarativeVMEMetaObject *vme = - static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); + const QQmlVMEMetaObject *vme = + static_cast<const QQmlVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1; if (!vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex)) { @@ -833,8 +833,8 @@ QDeclarativePropertyPrivate::setBinding(QObject *object, int coreIndex, int valu if (valueTypeIndex != -1) index |= (valueTypeIndex << 24); - if (binding && valueTypeIndex != -1 && binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy) - binding = static_cast<QDeclarativeValueTypeProxyBinding *>(binding)->binding(index); + if (binding && valueTypeIndex != -1 && binding->bindingType() == QQmlAbstractBinding::ValueTypeProxy) + binding = static_cast<QQmlValueTypeProxyBinding *>(binding)->binding(index); if (binding) { binding->removeFromObject(); @@ -855,19 +855,19 @@ QDeclarativePropertyPrivate::setBinding(QObject *object, int coreIndex, int valu return binding; } -QDeclarativeAbstractBinding * -QDeclarativePropertyPrivate::setBindingNoEnable(QObject *object, int coreIndex, int valueTypeIndex, - QDeclarativeAbstractBinding *newBinding) +QQmlAbstractBinding * +QQmlPropertyPrivate::setBindingNoEnable(QObject *object, int coreIndex, int valueTypeIndex, + QQmlAbstractBinding *newBinding) { - QDeclarativeData *data = QDeclarativeData::get(object, 0 != newBinding); - QDeclarativeAbstractBinding *binding = 0; + QQmlData *data = QQmlData::get(object, 0 != newBinding); + QQmlAbstractBinding *binding = 0; if (data) { - QDeclarativePropertyData *propertyData = + QQmlPropertyData *propertyData = data->propertyCache?data->propertyCache->property(coreIndex):0; if (propertyData && propertyData->isAlias()) { - const QDeclarativeVMEMetaObject *vme = - static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); + const QQmlVMEMetaObject *vme = + static_cast<const QQmlVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex)); QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1; if (!vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex)) { @@ -893,8 +893,8 @@ QDeclarativePropertyPrivate::setBindingNoEnable(QObject *object, int coreIndex, if (valueTypeIndex != -1) index |= (valueTypeIndex << 24); - if (binding && valueTypeIndex != -1 && binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy) - binding = static_cast<QDeclarativeValueTypeProxyBinding *>(binding)->binding(index); + if (binding && valueTypeIndex != -1 && binding->bindingType() == QQmlAbstractBinding::ValueTypeProxy) + binding = static_cast<QQmlValueTypeProxyBinding *>(binding)->binding(index); if (binding) binding->removeFromObject(); @@ -916,10 +916,10 @@ QDeclarativePropertyPrivate::setBindingNoEnable(QObject *object, int coreIndex, Returns the expression associated with this signal property, or 0 if no signal expression exists. */ -QDeclarativeExpression * -QDeclarativePropertyPrivate::signalExpression(const QDeclarativeProperty &that) +QQmlExpression * +QQmlPropertyPrivate::signalExpression(const QQmlProperty &that) { - if (!(that.type() & QDeclarativeProperty::SignalProperty)) + if (!(that.type() & QQmlProperty::SignalProperty)) return 0; const QObjectList &children = that.d->object->children(); @@ -927,7 +927,7 @@ QDeclarativePropertyPrivate::signalExpression(const QDeclarativeProperty &that) for (int ii = 0; ii < children.count(); ++ii) { QObject *child = children.at(ii); - QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child); + QQmlBoundSignal *signal = QQmlBoundSignal::cast(child); if (signal && signal->index() == that.index()) return signal->expression(); } @@ -942,11 +942,11 @@ QDeclarativePropertyPrivate::signalExpression(const QDeclarativeProperty &that) Ownership of \a expr transfers to QML. Ownership of the return value is assumed by the caller. */ -QDeclarativeExpression * -QDeclarativePropertyPrivate::setSignalExpression(const QDeclarativeProperty &that, - QDeclarativeExpression *expr) +QQmlExpression * +QQmlPropertyPrivate::setSignalExpression(const QQmlProperty &that, + QQmlExpression *expr) { - if (!(that.type() & QDeclarativeProperty::SignalProperty)) { + if (!(that.type() & QQmlProperty::SignalProperty)) { delete expr; return 0; } @@ -956,13 +956,13 @@ QDeclarativePropertyPrivate::setSignalExpression(const QDeclarativeProperty &tha for (int ii = 0; ii < children.count(); ++ii) { QObject *child = children.at(ii); - QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child); + QQmlBoundSignal *signal = QQmlBoundSignal::cast(child); if (signal && signal->index() == that.index()) return signal->setExpression(expr); } if (expr) { - QDeclarativeBoundSignal *signal = new QDeclarativeBoundSignal(that.d->object, that.method(), that.d->object); + QQmlBoundSignal *signal = new QQmlBoundSignal(that.d->object, that.method(), that.d->object); return signal->setExpression(expr); } else { return 0; @@ -972,7 +972,7 @@ QDeclarativePropertyPrivate::setSignalExpression(const QDeclarativeProperty &tha /*! Returns the property value. */ -QVariant QDeclarativeProperty::read() const +QVariant QQmlProperty::read() const { if (!d) return QVariant(); @@ -994,29 +994,29 @@ QVariant QDeclarativeProperty::read() const /*! Return the \a name property value of \a object. This method is equivalent to: \code - QDeclarativeProperty p(object, name); + QQmlProperty p(object, name); p.read(); \endcode */ -QVariant QDeclarativeProperty::read(QObject *object, const QString &name) +QVariant QQmlProperty::read(QObject *object, const QString &name) { - QDeclarativeProperty p(object, name); + QQmlProperty p(object, name); return p.read(); } /*! Return the \a name property value of \a object using the - \l{QDeclarativeContext} {context} \a ctxt. This method is + \l{QQmlContext} {context} \a ctxt. This method is equivalent to: \code - QDeclarativeProperty p(object, name, context); + QQmlProperty p(object, name, context); p.read(); \endcode */ -QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeContext *ctxt) +QVariant QQmlProperty::read(QObject *object, const QString &name, QQmlContext *ctxt) { - QDeclarativeProperty p(object, name, ctxt); + QQmlProperty p(object, name, ctxt); return p.read(); } @@ -1027,24 +1027,24 @@ QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDecla This method is equivalent to: \code - QDeclarativeProperty p(object, name, engine); + QQmlProperty p(object, name, engine); p.read(); \endcode */ -QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeEngine *engine) +QVariant QQmlProperty::read(QObject *object, const QString &name, QQmlEngine *engine) { - QDeclarativeProperty p(object, name, engine); + QQmlProperty p(object, name, engine); return p.read(); } -QVariant QDeclarativePropertyPrivate::readValueProperty() +QVariant QQmlPropertyPrivate::readValueProperty() { if (isValueType()) { - QDeclarativeEnginePrivate *ep = engine?QDeclarativeEnginePrivate::get(engine):0; - QDeclarativeValueType *valueType = 0; + QQmlEnginePrivate *ep = engine?QQmlEnginePrivate::get(engine):0; + QQmlValueType *valueType = 0; if (ep) valueType = ep->valueTypes[core.propType]; - else valueType = QDeclarativeValueTypeFactory::valueType(core.propType); + else valueType = QQmlValueTypeFactory::valueType(core.propType); Q_ASSERT(valueType); valueType->read(object, core.coreIndex); @@ -1056,10 +1056,10 @@ QVariant QDeclarativePropertyPrivate::readValueProperty() } else if (core.isQList()) { - QDeclarativeListProperty<QObject> prop; + QQmlListProperty<QObject> prop; void *args[] = { &prop, 0 }; QMetaObject::metacall(object, QMetaObject::ReadProperty, core.coreIndex, args); - return QVariant::fromValue(QDeclarativeListReferencePrivate::init(prop, core.propType, engine)); + return QVariant::fromValue(QQmlListReferencePrivate::init(prop, core.propType, engine)); } else if (core.isQObject()) { @@ -1092,7 +1092,7 @@ static QUrl urlFromUserString(const QString &data) } // helper function to allow assignment / binding to QList<QUrl> properties. -static QVariant resolvedUrlSequence(const QVariant &value, QDeclarativeContextData *context) +static QVariant resolvedUrlSequence(const QVariant &value, QQmlContextData *context) { QList<QUrl> urls; if (value.userType() == qMetaTypeId<QUrl>()) { @@ -1125,7 +1125,7 @@ static QVariant resolvedUrlSequence(const QVariant &value, QDeclarativeContextDa } //writeEnumProperty MIRRORS the relelvant bit of QMetaProperty::write AND MUST BE KEPT IN SYNC! -bool QDeclarativePropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags) +bool QQmlPropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags) { if (!object || !prop.isWritable()) return false; @@ -1165,20 +1165,20 @@ bool QDeclarativePropertyPrivate::writeEnumProperty(const QMetaProperty &prop, i return status; } -bool QDeclarativePropertyPrivate::writeValueProperty(const QVariant &value, WriteFlags flags) +bool QQmlPropertyPrivate::writeValueProperty(const QVariant &value, WriteFlags flags) { return writeValueProperty(object, engine, core, value, effectiveContext(), flags); } bool -QDeclarativePropertyPrivate::writeValueProperty(QObject *object, QDeclarativeEngine *engine, - const QDeclarativePropertyData &core, +QQmlPropertyPrivate::writeValueProperty(QObject *object, QQmlEngine *engine, + const QQmlPropertyData &core, const QVariant &value, - QDeclarativeContextData *context, WriteFlags flags) + QQmlContextData *context, WriteFlags flags) { // Remove any existing bindings on this property if (!(flags & DontRemoveBinding) && object) { - QDeclarativeAbstractBinding *binding = setBinding(object, core.coreIndex, + QQmlAbstractBinding *binding = setBinding(object, core.coreIndex, core.getValueTypeCoreIndex(), 0, flags); if (binding) binding->destroy(); @@ -1186,19 +1186,19 @@ QDeclarativePropertyPrivate::writeValueProperty(QObject *object, QDeclarativeEng bool rv = false; if (core.isValueTypeVirtual()) { - QDeclarativeEnginePrivate *ep = engine?QDeclarativeEnginePrivate::get(engine):0; + QQmlEnginePrivate *ep = engine?QQmlEnginePrivate::get(engine):0; - QDeclarativeValueType *writeBack = 0; + QQmlValueType *writeBack = 0; if (ep) { writeBack = ep->valueTypes[core.propType]; } else { - writeBack = QDeclarativeValueTypeFactory::valueType(core.propType); + writeBack = QQmlValueTypeFactory::valueType(core.propType); } writeBack->read(object, core.coreIndex); - QDeclarativePropertyData data = core; - data.setFlags(QDeclarativePropertyData::Flag(core.valueTypeFlags)); + QQmlPropertyData data = core; + data.setFlags(QQmlPropertyData::Flag(core.valueTypeFlags)); data.coreIndex = core.valueTypeCoreIndex; data.propType = core.valueTypePropType; @@ -1216,9 +1216,9 @@ QDeclarativePropertyPrivate::writeValueProperty(QObject *object, QDeclarativeEng return rv; } -bool QDeclarativePropertyPrivate::write(QObject *object, - const QDeclarativePropertyData &property, - const QVariant &value, QDeclarativeContextData *context, +bool QQmlPropertyPrivate::write(QObject *object, + const QQmlPropertyData &property, + const QVariant &value, QQmlContextData *context, WriteFlags flags) { int coreIdx = property.coreIndex; @@ -1240,7 +1240,7 @@ bool QDeclarativePropertyPrivate::write(QObject *object, int propertyType = property.propType; int variantType = value.userType(); - QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(context); + QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(context); if (propertyType == QVariant::Url) { @@ -1314,13 +1314,13 @@ bool QDeclarativePropertyPrivate::write(QObject *object, if (enginePriv) { listType = enginePriv->rawMetaObjectForType(enginePriv->listType(property.propType)); } else { - QDeclarativeType *type = QDeclarativeMetaType::qmlType(QDeclarativeMetaType::listType(property.propType)); + QQmlType *type = QQmlMetaType::qmlType(QQmlMetaType::listType(property.propType)); if (!type) return false; listType = type->baseMetaObject(); } if (!listType) return false; - QDeclarativeListProperty<void> prop; + QQmlListProperty<void> prop; void *args[] = { &prop, 0 }; QMetaObject::metacall(object, QMetaObject::ReadProperty, coreIdx, args); @@ -1328,8 +1328,8 @@ bool QDeclarativePropertyPrivate::write(QObject *object, prop.clear(&prop); - if (value.userType() == qMetaTypeId<QDeclarativeListReference>()) { - QDeclarativeListReference qdlr = value.value<QDeclarativeListReference>(); + if (value.userType() == qMetaTypeId<QQmlListReference>()) { + QQmlListReference qdlr = value.value<QQmlListReference>(); for (int ii = 0; ii < qdlr.count(); ++ii) { QObject *o = qdlr.at(ii); @@ -1347,7 +1347,7 @@ bool QDeclarativePropertyPrivate::write(QObject *object, prop.append(&prop, (void *)o); } } else { - QObject *o = enginePriv?enginePriv->toQObject(value):QDeclarativeMetaType::toQObject(value); + QObject *o = enginePriv?enginePriv->toQObject(value):QQmlMetaType::toQObject(value); if (o && !canConvert(o->metaObject(), listType)) o = 0; prop.append(&prop, (void *)o); @@ -1359,13 +1359,13 @@ bool QDeclarativePropertyPrivate::write(QObject *object, bool ok = false; QVariant v; if (variantType == QVariant::String) - v = QDeclarativeStringConverters::variantFromString(value.toString(), propertyType, &ok); + v = QQmlStringConverters::variantFromString(value.toString(), propertyType, &ok); if (!ok) { v = value; if (v.convert((QVariant::Type)propertyType)) { ok = true; } else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) { - QDeclarativeMetaType::StringConverter con = QDeclarativeMetaType::customStringConverter(propertyType); + QQmlMetaType::StringConverter con = QQmlMetaType::customStringConverter(propertyType); if (con) { v = con(value.toString()); if (v.userType() == propertyType) @@ -1417,18 +1417,18 @@ bool QDeclarativePropertyPrivate::write(QObject *object, } // Returns true if successful, false if an error description was set on expression -bool QDeclarativePropertyPrivate::writeBinding(QObject *object, - const QDeclarativePropertyData &core, - QDeclarativeContextData *context, - QDeclarativeJavaScriptExpression *expression, +bool QQmlPropertyPrivate::writeBinding(QObject *object, + const QQmlPropertyData &core, + QQmlContextData *context, + QQmlJavaScriptExpression *expression, v8::Handle<v8::Value> result, bool isUndefined, WriteFlags flags) { Q_ASSERT(object); Q_ASSERT(core.coreIndex != -1); - QDeclarativeEngine *engine = context->engine; - QV8Engine *v8engine = QDeclarativeEnginePrivate::getV8Engine(engine); + QQmlEngine *engine = context->engine; + QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine); #define QUICK_STORE(cpptype, conversion) \ { \ @@ -1468,7 +1468,7 @@ bool QDeclarativePropertyPrivate::writeBinding(QObject *object, int type = core.isValueTypeVirtual()?core.valueTypePropType:core.propType; - QDeclarativeJavaScriptExpression::DeleteWatcher watcher(expression); + QQmlJavaScriptExpression::DeleteWatcher watcher(expression); QVariant value; bool isVmeProperty = core.isVMEProperty(); @@ -1498,7 +1498,7 @@ bool QDeclarativePropertyPrivate::writeBinding(QObject *object, expression->delayedError()->error.setDescription(QLatin1String("Unable to assign a function to a property.")); return false; } else if (isVmeProperty) { - typedef QDeclarativeVMEMetaObject VMEMO; + typedef QQmlVMEMetaObject VMEMO; VMEMO *vmemo = static_cast<VMEMO *>(const_cast<QMetaObject *>(object->metaObject())); vmemo->setVMEProperty(core.coreIndex, result); } else if (!writeValueProperty(object, engine, core, value, context, flags)) { @@ -1520,13 +1520,13 @@ bool QDeclarativePropertyPrivate::writeBinding(QObject *object, return true; } -bool QDeclarativePropertyPrivate::writeBinding(const QDeclarativeProperty &that, - QDeclarativeContextData *context, - QDeclarativeJavaScriptExpression *expression, +bool QQmlPropertyPrivate::writeBinding(const QQmlProperty &that, + QQmlContextData *context, + QQmlJavaScriptExpression *expression, v8::Handle<v8::Value> result, bool isUndefined, WriteFlags flags) { - QDeclarativePropertyPrivate *pp = that.d; + QQmlPropertyPrivate *pp = that.d; if (!pp) return true; @@ -1538,12 +1538,12 @@ bool QDeclarativePropertyPrivate::writeBinding(const QDeclarativeProperty &that, return writeBinding(object, pp->core, context, expression, result, isUndefined, flags); } -const QMetaObject *QDeclarativePropertyPrivate::rawMetaObjectForType(QDeclarativeEnginePrivate *engine, int userType) +const QMetaObject *QQmlPropertyPrivate::rawMetaObjectForType(QQmlEnginePrivate *engine, int userType) { if (engine) { return engine->rawMetaObjectForType(userType); } else { - QDeclarativeType *type = QDeclarativeMetaType::qmlType(userType); + QQmlType *type = QQmlMetaType::qmlType(userType); return type?type->baseMetaObject():0; } } @@ -1553,9 +1553,9 @@ const QMetaObject *QDeclarativePropertyPrivate::rawMetaObjectForType(QDeclarativ Returns false if the property can't be set because the \a value is the wrong type, for example. */ -bool QDeclarativeProperty::write(const QVariant &value) const +bool QQmlProperty::write(const QVariant &value) const { - return QDeclarativePropertyPrivate::write(*this, value, 0); + return QQmlPropertyPrivate::write(*this, value, 0); } /*! @@ -1563,32 +1563,32 @@ bool QDeclarativeProperty::write(const QVariant &value) const is equivalent to: \code - QDeclarativeProperty p(object, name); + QQmlProperty p(object, name); p.write(value); \endcode */ -bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value) +bool QQmlProperty::write(QObject *object, const QString &name, const QVariant &value) { - QDeclarativeProperty p(object, name); + QQmlProperty p(object, name); return p.write(value); } /*! Writes \a value to the \a name property of \a object using the - \l{QDeclarativeContext} {context} \a ctxt. This method is + \l{QQmlContext} {context} \a ctxt. This method is equivalent to: \code - QDeclarativeProperty p(object, name, ctxt); + QQmlProperty p(object, name, ctxt); p.write(value); \endcode */ -bool QDeclarativeProperty::write(QObject *object, +bool QQmlProperty::write(QObject *object, const QString &name, const QVariant &value, - QDeclarativeContext *ctxt) + QQmlContext *ctxt) { - QDeclarativeProperty p(object, name, ctxt); + QQmlProperty p(object, name, ctxt); return p.write(value); } @@ -1599,14 +1599,14 @@ bool QDeclarativeProperty::write(QObject *object, \a engine. This method is equivalent to: \code - QDeclarativeProperty p(object, name, engine); + QQmlProperty p(object, name, engine); p.write(value); \endcode */ -bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value, - QDeclarativeEngine *engine) +bool QQmlProperty::write(QObject *object, const QString &name, const QVariant &value, + QQmlEngine *engine) { - QDeclarativeProperty p(object, name, engine); + QQmlProperty p(object, name, engine); return p.write(value); } @@ -1615,7 +1615,7 @@ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVa resettable. If the property is not resettable, nothing happens and false is returned. */ -bool QDeclarativeProperty::reset() const +bool QQmlProperty::reset() const { if (isResettable()) { void *args[] = { 0 }; @@ -1626,12 +1626,12 @@ bool QDeclarativeProperty::reset() const } } -bool QDeclarativePropertyPrivate::write(const QDeclarativeProperty &that, +bool QQmlPropertyPrivate::write(const QQmlProperty &that, const QVariant &value, WriteFlags flags) { if (!that.d) return false; - if (that.d->object && that.type() & QDeclarativeProperty::Property && + if (that.d->object && that.type() & QQmlProperty::Property && that.d->core.isValid() && that.isWritable()) return that.d->writeValueProperty(value, flags); else @@ -1641,7 +1641,7 @@ bool QDeclarativePropertyPrivate::write(const QDeclarativeProperty &that, /*! Returns true if the property has a change notifier signal, otherwise false. */ -bool QDeclarativeProperty::hasNotifySignal() const +bool QQmlProperty::hasNotifySignal() const { if (type() & Property && d->object) { return d->object->metaObject()->property(d->core.coreIndex).hasNotifySignal(); @@ -1656,7 +1656,7 @@ bool QDeclarativeProperty::hasNotifySignal() const Some properties, such as attached properties or those whose value never changes, do not require a change notifier. */ -bool QDeclarativeProperty::needsNotifySignal() const +bool QQmlProperty::needsNotifySignal() const { return type() & Property && !property().isConstant(); } @@ -1669,14 +1669,14 @@ bool QDeclarativeProperty::needsNotifySignal() const change notifier signal, or if the \a dest object does not have the specified \a method. */ -bool QDeclarativeProperty::connectNotifySignal(QObject *dest, int method) const +bool QQmlProperty::connectNotifySignal(QObject *dest, int method) const { if (!(type() & Property) || !d->object) return false; QMetaProperty prop = d->object->metaObject()->property(d->core.coreIndex); if (prop.hasNotifySignal()) { - return QDeclarativePropertyPrivate::connect(d->object, prop.notifySignalIndex(), dest, method, Qt::DirectConnection); + return QQmlPropertyPrivate::connect(d->object, prop.notifySignalIndex(), dest, method, Qt::DirectConnection); } else { return false; } @@ -1690,7 +1690,7 @@ bool QDeclarativeProperty::connectNotifySignal(QObject *dest, int method) const change notifier signal, or if the \a dest object does not have the specified \a slot. */ -bool QDeclarativeProperty::connectNotifySignal(QObject *dest, const char *slot) const +bool QQmlProperty::connectNotifySignal(QObject *dest, const char *slot) const { if (!(type() & Property) || !d->object) return false; @@ -1707,12 +1707,12 @@ bool QDeclarativeProperty::connectNotifySignal(QObject *dest, const char *slot) /*! Return the Qt metaobject index of the property. */ -int QDeclarativeProperty::index() const +int QQmlProperty::index() const { return d ? d->core.coreIndex : -1; } -int QDeclarativePropertyPrivate::valueTypeCoreIndex(const QDeclarativeProperty &that) +int QQmlPropertyPrivate::valueTypeCoreIndex(const QQmlProperty &that) { return that.d ? that.d->core.getValueTypeCoreIndex() : -1; } @@ -1721,14 +1721,14 @@ int QDeclarativePropertyPrivate::valueTypeCoreIndex(const QDeclarativeProperty & Returns the "property index" for use in bindings. The top 8 bits are the value type offset, and 0 otherwise. The bottom 24-bits are the regular property index. */ -int QDeclarativePropertyPrivate::bindingIndex(const QDeclarativeProperty &that) +int QQmlPropertyPrivate::bindingIndex(const QQmlProperty &that) { if (!that.d) return -1; return bindingIndex(that.d->core); } -int QDeclarativePropertyPrivate::bindingIndex(const QDeclarativePropertyData &that) +int QQmlPropertyPrivate::bindingIndex(const QQmlPropertyData &that) { int rv = that.coreIndex; if (rv != -1 && that.isValueTypeVirtual()) @@ -1736,30 +1736,30 @@ int QDeclarativePropertyPrivate::bindingIndex(const QDeclarativePropertyData &th return rv; } -QDeclarativePropertyData -QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObject, int index, +QQmlPropertyData +QQmlPropertyPrivate::saveValueType(const QMetaObject *metaObject, int index, const QMetaObject *subObject, int subIndex, - QDeclarativeEngine *) + QQmlEngine *) { QMetaProperty subProp = subObject->property(subIndex); - QDeclarativePropertyData core; + QQmlPropertyData core; core.load(metaObject->property(index)); - core.setFlags(core.getFlags() | QDeclarativePropertyData::IsValueTypeVirtual); - core.valueTypeFlags = QDeclarativePropertyData::flagsForProperty(subProp); + core.setFlags(core.getFlags() | QQmlPropertyData::IsValueTypeVirtual); + core.valueTypeFlags = QQmlPropertyData::flagsForProperty(subProp); core.valueTypeCoreIndex = subIndex; core.valueTypePropType = subProp.userType(); return core; } -QDeclarativeProperty -QDeclarativePropertyPrivate::restore(QObject *object, const QDeclarativePropertyData &data, - QDeclarativeContextData *ctxt) +QQmlProperty +QQmlPropertyPrivate::restore(QObject *object, const QQmlPropertyData &data, + QQmlContextData *ctxt) { - QDeclarativeProperty prop; + QQmlProperty prop; - prop.d = new QDeclarativePropertyPrivate; + prop.d = new QQmlPropertyPrivate; prop.d->object = object; prop.d->context = ctxt; prop.d->engine = ctxt?ctxt->engine:0; @@ -1772,7 +1772,7 @@ QDeclarativePropertyPrivate::restore(QObject *object, const QDeclarativeProperty /*! Returns true if lhs and rhs refer to the same metaobject data */ -bool QDeclarativePropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs) +bool QQmlPropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs) { return lhs == rhs || (1 && lhs && rhs && lhs->d.stringdata == rhs->d.stringdata); } @@ -1780,7 +1780,7 @@ bool QDeclarativePropertyPrivate::equal(const QMetaObject *lhs, const QMetaObjec /*! Returns true if from inherits to. */ -bool QDeclarativePropertyPrivate::canConvert(const QMetaObject *from, const QMetaObject *to) +bool QQmlPropertyPrivate::canConvert(const QMetaObject *from, const QMetaObject *to) { if (from && to == &QObject::staticMetaObject) return true; @@ -1797,7 +1797,7 @@ bool QDeclarativePropertyPrivate::canConvert(const QMetaObject *from, const QMet /*! Return the signal corresponding to \a name */ -QMetaMethod QDeclarativePropertyPrivate::findSignalByName(const QMetaObject *mo, const QByteArray &name) +QMetaMethod QQmlPropertyPrivate::findSignalByName(const QMetaObject *mo, const QByteArray &name) { Q_ASSERT(mo); int methods = mo->methodCount(); @@ -1856,9 +1856,9 @@ static inline int QMetaObject_properties(const QMetaObject *metaObject) static inline void flush_vme_signal(const QObject *object, int index) { - QDeclarativeData *data = static_cast<QDeclarativeData *>(QObjectPrivate::get(const_cast<QObject *>(object))->declarativeData); + QQmlData *data = static_cast<QQmlData *>(QObjectPrivate::get(const_cast<QObject *>(object))->declarativeData); if (data && data->propertyCache) { - QDeclarativePropertyData *property = data->propertyCache->method(index); + QQmlPropertyData *property = data->propertyCache->method(index); if (property && property->isVMESignal()) { const QMetaObject *metaObject = object->metaObject(); @@ -1869,8 +1869,8 @@ static inline void flush_vme_signal(const QObject *object, int index) methodOffset -= QMetaObject_methods(metaObject); } - QDeclarativeVMEMetaObject *vme = - static_cast<QDeclarativeVMEMetaObject *>(const_cast<QMetaObject *>(metaObject)); + QQmlVMEMetaObject *vme = + static_cast<QQmlVMEMetaObject *>(const_cast<QMetaObject *>(metaObject)); vme->connectAliasSignal(index); } @@ -1884,7 +1884,7 @@ it connects any lazy "proxy" signal connections set up by QML. It is possible that this logic should be moved to QMetaObject::connect(). */ -bool QDeclarativePropertyPrivate::connect(const QObject *sender, int signal_index, +bool QQmlPropertyPrivate::connect(const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type, int *types) { @@ -1894,7 +1894,7 @@ bool QDeclarativePropertyPrivate::connect(const QObject *sender, int signal_inde return QMetaObject::connect(sender, signal_index, receiver, method_index, type, types); } -void QDeclarativePropertyPrivate::flushSignal(const QObject *sender, int signal_index) +void QQmlPropertyPrivate::flushSignal(const QObject *sender, int signal_index) { flush_vme_signal(sender, signal_index); } @@ -1902,7 +1902,7 @@ void QDeclarativePropertyPrivate::flushSignal(const QObject *sender, int signal_ /*! Return \a metaObject's [super] meta object that provides data for \a property. */ -const QMetaObject *QDeclarativePropertyPrivate::metaObjectForProperty(const QMetaObject *metaObject, int property) +const QMetaObject *QQmlPropertyPrivate::metaObjectForProperty(const QMetaObject *metaObject, int property) { int propertyOffset = metaObject->propertyOffset(); diff --git a/src/declarative/qml/qdeclarativeproperty.h b/src/qml/qml/qqmlproperty.h index 5012d0065d..2c4b2544c1 100644 --- a/src/declarative/qml/qdeclarativeproperty.h +++ b/src/qml/qml/qqmlproperty.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROPERTY_H -#define QDECLARATIVEPROPERTY_H +#ifndef QQMLPROPERTY_H +#define QQMLPROPERTY_H +#include <QtQml/qtqmlglobal.h> #include <QtCore/qmetaobject.h> QT_BEGIN_HEADER @@ -51,11 +52,11 @@ QT_BEGIN_NAMESPACE class QObject; class QVariant; -class QDeclarativeContext; -class QDeclarativeEngine; +class QQmlContext; +class QQmlEngine; -class QDeclarativePropertyPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeProperty +class QQmlPropertyPrivate; +class Q_QML_EXPORT QQmlProperty { public: enum PropertyTypeCategory { @@ -71,21 +72,21 @@ public: SignalProperty }; - QDeclarativeProperty(); - ~QDeclarativeProperty(); + QQmlProperty(); + ~QQmlProperty(); - QDeclarativeProperty(QObject *); - QDeclarativeProperty(QObject *, QDeclarativeContext *); - QDeclarativeProperty(QObject *, QDeclarativeEngine *); + QQmlProperty(QObject *); + QQmlProperty(QObject *, QQmlContext *); + QQmlProperty(QObject *, QQmlEngine *); - QDeclarativeProperty(QObject *, const QString &); - QDeclarativeProperty(QObject *, const QString &, QDeclarativeContext *); - QDeclarativeProperty(QObject *, const QString &, QDeclarativeEngine *); + QQmlProperty(QObject *, const QString &); + QQmlProperty(QObject *, const QString &, QQmlContext *); + QQmlProperty(QObject *, const QString &, QQmlEngine *); - QDeclarativeProperty(const QDeclarativeProperty &); - QDeclarativeProperty &operator=(const QDeclarativeProperty &); + QQmlProperty(const QQmlProperty &); + QQmlProperty &operator=(const QQmlProperty &); - bool operator==(const QDeclarativeProperty &) const; + bool operator==(const QQmlProperty &) const; Type type() const; bool isValid() const; @@ -100,13 +101,13 @@ public: QVariant read() const; static QVariant read(QObject *, const QString &); - static QVariant read(QObject *, const QString &, QDeclarativeContext *); - static QVariant read(QObject *, const QString &, QDeclarativeEngine *); + static QVariant read(QObject *, const QString &, QQmlContext *); + static QVariant read(QObject *, const QString &, QQmlEngine *); bool write(const QVariant &) const; static bool write(QObject *, const QString &, const QVariant &); - static bool write(QObject *, const QString &, const QVariant &, QDeclarativeContext *); - static bool write(QObject *, const QString &, const QVariant &, QDeclarativeEngine *); + static bool write(QObject *, const QString &, const QVariant &, QQmlContext *); + static bool write(QObject *, const QString &, const QVariant &, QQmlEngine *); bool reset() const; @@ -125,12 +126,12 @@ public: QMetaMethod method() const; private: - friend class QDeclarativePropertyPrivate; - QDeclarativePropertyPrivate *d; + friend class QQmlPropertyPrivate; + QQmlPropertyPrivate *d; }; -typedef QList<QDeclarativeProperty> QDeclarativeProperties; +typedef QList<QQmlProperty> QQmlProperties; -inline uint qHash (const QDeclarativeProperty &key) +inline uint qHash (const QQmlProperty &key) { return qHash(key.object()) + qHash(key.name()); } @@ -139,4 +140,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEPROPERTY_H +#endif // QQMLPROPERTY_H diff --git a/src/declarative/qml/qdeclarativeproperty_p.h b/src/qml/qml/qqmlproperty_p.h index fc106cc463..0f97a63155 100644 --- a/src/declarative/qml/qdeclarativeproperty_p.h +++ b/src/qml/qml/qqmlproperty_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROPERTY_P_H -#define QDECLARATIVEPROPERTY_P_H +#ifndef QQMLPROPERTY_P_H +#define QQMLPROPERTY_P_H // // W A R N I N G @@ -53,20 +53,20 @@ // We mean it. // -#include "qdeclarativeproperty.h" +#include "qqmlproperty.h" #include <private/qobject_p.h> -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativepropertycache_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qtqmlglobal_p.h> +#include <private/qqmlpropertycache_p.h> +#include <private/qqmlguard_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeContext; -class QDeclarativeExpression; -class QDeclarativeEnginePrivate; -class QDeclarativeJavaScriptExpression; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePropertyPrivate : public QDeclarativeRefCount +class QQmlContext; +class QQmlExpression; +class QQmlEnginePrivate; +class QQmlJavaScriptExpression; +class Q_QML_PRIVATE_EXPORT QQmlPropertyPrivate : public QQmlRefCount { public: enum WriteFlag { @@ -76,86 +76,86 @@ public: }; Q_DECLARE_FLAGS(WriteFlags, WriteFlag) - QDeclarativeContextData *context; - QDeclarativeEngine *engine; - QDeclarativeGuard<QObject> object; + QQmlContextData *context; + QQmlEngine *engine; + QQmlGuard<QObject> object; - QDeclarativePropertyData core; + QQmlPropertyData core; bool isNameCached:1; QString nameCache; - QDeclarativePropertyPrivate(); + QQmlPropertyPrivate(); - inline QDeclarativeContextData *effectiveContext() const; + inline QQmlContextData *effectiveContext() const; void initProperty(QObject *obj, const QString &name); void initDefault(QObject *obj); bool isValueType() const; int propertyType() const; - QDeclarativeProperty::Type type() const; - QDeclarativeProperty::PropertyTypeCategory propertyTypeCategory() const; + QQmlProperty::Type type() const; + QQmlProperty::PropertyTypeCategory propertyTypeCategory() const; QVariant readValueProperty(); bool writeValueProperty(const QVariant &, WriteFlags); - static const QMetaObject *rawMetaObjectForType(QDeclarativeEnginePrivate *, int); + static const QMetaObject *rawMetaObjectForType(QQmlEnginePrivate *, int); static bool writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags); - static bool writeValueProperty(QObject *, QDeclarativeEngine *, - const QDeclarativePropertyData &, - const QVariant &, QDeclarativeContextData *, + static bool writeValueProperty(QObject *, QQmlEngine *, + const QQmlPropertyData &, + const QVariant &, QQmlContextData *, WriteFlags flags = 0); - static bool write(QObject *, const QDeclarativePropertyData &, const QVariant &, - QDeclarativeContextData *, WriteFlags flags = 0); + static bool write(QObject *, const QQmlPropertyData &, const QVariant &, + QQmlContextData *, WriteFlags flags = 0); static void findAliasTarget(QObject *, int, QObject **, int *); - static QDeclarativeAbstractBinding *setBinding(QObject *, int coreIndex, + static QQmlAbstractBinding *setBinding(QObject *, int coreIndex, int valueTypeIndex /* -1 */, - QDeclarativeAbstractBinding *, + QQmlAbstractBinding *, WriteFlags flags = DontRemoveBinding); - static QDeclarativeAbstractBinding *setBindingNoEnable(QObject *, int coreIndex, + static QQmlAbstractBinding *setBindingNoEnable(QObject *, int coreIndex, int valueTypeIndex /* -1 */, - QDeclarativeAbstractBinding *); - static QDeclarativeAbstractBinding *binding(QObject *, int coreIndex, + QQmlAbstractBinding *); + static QQmlAbstractBinding *binding(QObject *, int coreIndex, int valueTypeIndex /* -1 */); - static QDeclarativePropertyData saveValueType(const QMetaObject *, int, + static QQmlPropertyData saveValueType(const QMetaObject *, int, const QMetaObject *, int, - QDeclarativeEngine *); - static QDeclarativeProperty restore(QObject *, - const QDeclarativePropertyData &, - QDeclarativeContextData *); + QQmlEngine *); + static QQmlProperty restore(QObject *, + const QQmlPropertyData &, + QQmlContextData *); static bool equal(const QMetaObject *, const QMetaObject *); static bool canConvert(const QMetaObject *from, const QMetaObject *to); - static inline QDeclarativePropertyPrivate *get(const QDeclarativeProperty &p) { + static inline QQmlPropertyPrivate *get(const QQmlProperty &p) { return p.d; } // "Public" (to QML) methods - static QDeclarativeAbstractBinding *binding(const QDeclarativeProperty &that); - static QDeclarativeAbstractBinding *setBinding(const QDeclarativeProperty &that, - QDeclarativeAbstractBinding *, + static QQmlAbstractBinding *binding(const QQmlProperty &that); + static QQmlAbstractBinding *setBinding(const QQmlProperty &that, + QQmlAbstractBinding *, WriteFlags flags = DontRemoveBinding); - static QDeclarativeExpression *signalExpression(const QDeclarativeProperty &that); - static QDeclarativeExpression *setSignalExpression(const QDeclarativeProperty &that, - QDeclarativeExpression *) ; - static bool write(const QDeclarativeProperty &that, const QVariant &, WriteFlags); - static bool writeBinding(const QDeclarativeProperty &that, - QDeclarativeContextData *context, - QDeclarativeJavaScriptExpression *expression, + static QQmlExpression *signalExpression(const QQmlProperty &that); + static QQmlExpression *setSignalExpression(const QQmlProperty &that, + QQmlExpression *) ; + static bool write(const QQmlProperty &that, const QVariant &, WriteFlags); + static bool writeBinding(const QQmlProperty &that, + QQmlContextData *context, + QQmlJavaScriptExpression *expression, v8::Handle<v8::Value> result, bool isUndefined, WriteFlags flags); - static bool writeBinding(QObject *, const QDeclarativePropertyData &, - QDeclarativeContextData *context, - QDeclarativeJavaScriptExpression *expression, + static bool writeBinding(QObject *, const QQmlPropertyData &, + QQmlContextData *context, + QQmlJavaScriptExpression *expression, v8::Handle<v8::Value> result, bool isUndefined, WriteFlags flags); - static int valueTypeCoreIndex(const QDeclarativeProperty &that); - static int bindingIndex(const QDeclarativeProperty &that); - static int bindingIndex(const QDeclarativePropertyData &that); + static int valueTypeCoreIndex(const QQmlProperty &that); + static int bindingIndex(const QQmlProperty &that); + static int bindingIndex(const QQmlPropertyData &that); static QMetaMethod findSignalByName(const QMetaObject *mo, const QByteArray &); static bool connect(const QObject *sender, int signal_index, const QObject *receiver, int method_index, @@ -164,8 +164,8 @@ public: static void flushSignal(const QObject *sender, int signal_index); }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyPrivate::WriteFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlPropertyPrivate::WriteFlags) QT_END_NAMESPACE -#endif // QDECLARATIVEPROPERTY_P_H +#endif // QQMLPROPERTY_P_H diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index c8bfd98363..9b132a4647 100644 --- a/src/declarative/qml/qdeclarativepropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,79 +39,79 @@ ** ****************************************************************************/ -#include "qdeclarativepropertycache_p.h" +#include "qqmlpropertycache_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativebinding_p.h" +#include "qqmlengine_p.h" +#include "qqmlbinding_p.h" #include <private/qv8engine_p.h> #include <private/qmetaobject_p.h> -#include <private/qdeclarativeaccessors_p.h> +#include <private/qqmlaccessors_p.h> #include <QtCore/qdebug.h> Q_DECLARE_METATYPE(QJSValue) -Q_DECLARE_METATYPE(QDeclarativeV8Handle); +Q_DECLARE_METATYPE(QQmlV8Handle); QT_BEGIN_NAMESPACE #define Q_INT16_MAX 32767 -class QDeclarativePropertyCacheMethodArguments +class QQmlPropertyCacheMethodArguments { public: - QDeclarativePropertyCacheMethodArguments *next; + QQmlPropertyCacheMethodArguments *next; int arguments[0]; }; // Flags that do *NOT* depend on the property's QMetaProperty::userType() and thus are quick // to load -static QDeclarativePropertyData::Flags fastFlagsForProperty(const QMetaProperty &p) +static QQmlPropertyData::Flags fastFlagsForProperty(const QMetaProperty &p) { - QDeclarativePropertyData::Flags flags; + QQmlPropertyData::Flags flags; if (p.isConstant()) - flags |= QDeclarativePropertyData::IsConstant; + flags |= QQmlPropertyData::IsConstant; if (p.isWritable()) - flags |= QDeclarativePropertyData::IsWritable; + flags |= QQmlPropertyData::IsWritable; if (p.isResettable()) - flags |= QDeclarativePropertyData::IsResettable; + flags |= QQmlPropertyData::IsResettable; if (p.isFinal()) - flags |= QDeclarativePropertyData::IsFinal; + flags |= QQmlPropertyData::IsFinal; if (p.isEnumType()) - flags |= QDeclarativePropertyData::IsEnumType; + flags |= QQmlPropertyData::IsEnumType; return flags; } // Flags that do depend on the property's QMetaProperty::userType() and thus are slow to // load -static QDeclarativePropertyData::Flags flagsForPropertyType(int propType, QDeclarativeEngine *engine) +static QQmlPropertyData::Flags flagsForPropertyType(int propType, QQmlEngine *engine) { Q_ASSERT(propType != -1); - QDeclarativePropertyData::Flags flags; + QQmlPropertyData::Flags flags; if (propType == QMetaType::QObjectStar || propType == QMetaType::QWidgetStar) { - flags |= QDeclarativePropertyData::IsQObjectDerived; + flags |= QQmlPropertyData::IsQObjectDerived; } else if (propType == QMetaType::QVariant) { - flags |= QDeclarativePropertyData::IsQVariant; + flags |= QQmlPropertyData::IsQVariant; } else if (propType < (int)QVariant::UserType) { - } else if (propType == qMetaTypeId<QDeclarativeBinding *>()) { - flags |= QDeclarativePropertyData::IsQmlBinding; + } else if (propType == qMetaTypeId<QQmlBinding *>()) { + flags |= QQmlPropertyData::IsQmlBinding; } else if (propType == qMetaTypeId<QJSValue>()) { - flags |= QDeclarativePropertyData::IsQJSValue; - } else if (propType == qMetaTypeId<QDeclarativeV8Handle>()) { - flags |= QDeclarativePropertyData::IsV8Handle; + flags |= QQmlPropertyData::IsQJSValue; + } else if (propType == qMetaTypeId<QQmlV8Handle>()) { + flags |= QQmlPropertyData::IsV8Handle; } else { - QDeclarativeMetaType::TypeCategory cat = - engine ? QDeclarativeEnginePrivate::get(engine)->typeCategory(propType) - : QDeclarativeMetaType::typeCategory(propType); - - if (cat == QDeclarativeMetaType::Object) - flags |= QDeclarativePropertyData::IsQObjectDerived; - else if (cat == QDeclarativeMetaType::List) - flags |= QDeclarativePropertyData::IsQList; + QQmlMetaType::TypeCategory cat = + engine ? QQmlEnginePrivate::get(engine)->typeCategory(propType) + : QQmlMetaType::typeCategory(propType); + + if (cat == QQmlMetaType::Object) + flags |= QQmlPropertyData::IsQObjectDerived; + else if (cat == QQmlMetaType::List) + flags |= QQmlPropertyData::IsQList; } return flags; @@ -125,13 +125,13 @@ static int metaObjectSignalCount(const QMetaObject *metaObject) return signalCount; } -QDeclarativePropertyData::Flags -QDeclarativePropertyData::flagsForProperty(const QMetaProperty &p, QDeclarativeEngine *engine) +QQmlPropertyData::Flags +QQmlPropertyData::flagsForProperty(const QMetaProperty &p, QQmlEngine *engine) { return fastFlagsForProperty(p) | flagsForPropertyType(p.userType(), engine); } -void QDeclarativePropertyData::lazyLoad(const QMetaProperty &p, QDeclarativeEngine *engine) +void QQmlPropertyData::lazyLoad(const QMetaProperty &p, QQmlEngine *engine) { Q_UNUSED(engine); @@ -145,19 +145,19 @@ void QDeclarativePropertyData::lazyLoad(const QMetaProperty &p, QDeclarativeEngi int type = p.type(); if (type == QMetaType::QObjectStar || type == QMetaType::QWidgetStar) { propType = type; - flags |= QDeclarativePropertyData::IsQObjectDerived; + flags |= QQmlPropertyData::IsQObjectDerived; } else if (type == QMetaType::QVariant) { propType = type; - flags |= QDeclarativePropertyData::IsQVariant; + flags |= QQmlPropertyData::IsQVariant; } else if (type == QVariant::UserType || type == -1) { propTypeName = p.typeName(); - flags |= QDeclarativePropertyData::NotFullyResolved; + flags |= QQmlPropertyData::NotFullyResolved; } else { propType = type; } } -void QDeclarativePropertyData::load(const QMetaProperty &p, QDeclarativeEngine *engine) +void QQmlPropertyData::load(const QMetaProperty &p, QQmlEngine *engine) { propType = p.userType(); coreIndex = p.propertyIndex(); @@ -167,7 +167,7 @@ void QDeclarativePropertyData::load(const QMetaProperty &p, QDeclarativeEngine * revision = p.revision(); } -void QDeclarativePropertyData::load(const QMetaMethod &m) +void QQmlPropertyData::load(const QMetaMethod &m) { coreIndex = m.methodIndex(); arguments = 0; @@ -186,7 +186,7 @@ void QDeclarativePropertyData::load(const QMetaMethod &m) ++signature; if (*signature != ')') { flags |= HasArguments; - if (0 == ::strcmp(signature, "QDeclarativeV8Function*)")) { + if (0 == ::strcmp(signature, "QQmlV8Function*)")) { flags |= IsV8Function; } } @@ -195,7 +195,7 @@ void QDeclarativePropertyData::load(const QMetaMethod &m) revision = m.revision(); } -void QDeclarativePropertyData::lazyLoad(const QMetaMethod &m) +void QQmlPropertyData::lazyLoad(const QMetaMethod &m) { coreIndex = m.methodIndex(); arguments = 0; @@ -216,7 +216,7 @@ void QDeclarativePropertyData::lazyLoad(const QMetaMethod &m) ++signature; if (*signature != ')') { flags |= HasArguments; - if (0 == ::strcmp(signature, "QDeclarativeV8Function*)")) { + if (0 == ::strcmp(signature, "QQmlV8Function*)")) { flags |= IsV8Function; } } @@ -226,9 +226,9 @@ void QDeclarativePropertyData::lazyLoad(const QMetaMethod &m) } /*! -Creates a new empty QDeclarativePropertyCache. +Creates a new empty QQmlPropertyCache. */ -QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e) +QQmlPropertyCache::QQmlPropertyCache(QQmlEngine *e) : engine(e), parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0), signalHanderIndexCacheStart(0), metaObject(0), argumentsCache(0) { @@ -236,9 +236,9 @@ QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e) } /*! -Creates a new QDeclarativePropertyCache of \a metaObject. +Creates a new QQmlPropertyCache of \a metaObject. */ -QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e, const QMetaObject *metaObject) +QQmlPropertyCache::QQmlPropertyCache(QQmlEngine *e, const QMetaObject *metaObject) : engine(e), parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0), signalHanderIndexCacheStart(0), metaObject(0), argumentsCache(0) { @@ -248,13 +248,13 @@ QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e, cons update(engine, metaObject); } -QDeclarativePropertyCache::~QDeclarativePropertyCache() +QQmlPropertyCache::~QQmlPropertyCache() { clear(); - QDeclarativePropertyCacheMethodArguments *args = argumentsCache; + QQmlPropertyCacheMethodArguments *args = argumentsCache; while (args) { - QDeclarativePropertyCacheMethodArguments *next = args->next; + QQmlPropertyCacheMethodArguments *next = args->next; free(args); args = next; } @@ -267,26 +267,26 @@ QDeclarativePropertyCache::~QDeclarativePropertyCache() engine = 0; } -void QDeclarativePropertyCache::destroy() +void QQmlPropertyCache::destroy() { Q_ASSERT(engine || constructor.IsEmpty()); if (constructor.IsEmpty()) delete this; else - QDeclarativeEnginePrivate::deleteInEngineThread(engine, this); + QQmlEnginePrivate::deleteInEngineThread(engine, this); } -// This is inherited from QDeclarativeCleanup, so it should only clear the things -// that are tied to the specific QDeclarativeEngine. -void QDeclarativePropertyCache::clear() +// This is inherited from QQmlCleanup, so it should only clear the things +// that are tied to the specific QQmlEngine. +void QQmlPropertyCache::clear() { qPersistentDispose(constructor); engine = 0; } -QDeclarativePropertyCache *QDeclarativePropertyCache::copy(int reserve) +QQmlPropertyCache *QQmlPropertyCache::copy(int reserve) { - QDeclarativePropertyCache *cache = new QDeclarativePropertyCache(engine); + QQmlPropertyCache *cache = new QQmlPropertyCache(engine); cache->parent = this; cache->parent->addref(); cache->propertyIndexCacheStart = propertyIndexCache.count() + propertyIndexCacheStart; @@ -301,33 +301,33 @@ QDeclarativePropertyCache *QDeclarativePropertyCache::copy(int reserve) return cache; } -QDeclarativePropertyCache *QDeclarativePropertyCache::copy() +QQmlPropertyCache *QQmlPropertyCache::copy() { return copy(0); } -QDeclarativePropertyCache * -QDeclarativePropertyCache::copyAndAppend(QDeclarativeEngine *engine, const QMetaObject *metaObject, - QDeclarativePropertyData::Flag propertyFlags, - QDeclarativePropertyData::Flag methodFlags, - QDeclarativePropertyData::Flag signalFlags) +QQmlPropertyCache * +QQmlPropertyCache::copyAndAppend(QQmlEngine *engine, const QMetaObject *metaObject, + QQmlPropertyData::Flag propertyFlags, + QQmlPropertyData::Flag methodFlags, + QQmlPropertyData::Flag signalFlags) { return copyAndAppend(engine, metaObject, -1, propertyFlags, methodFlags, signalFlags); } -QDeclarativePropertyCache * -QDeclarativePropertyCache::copyAndAppend(QDeclarativeEngine *engine, const QMetaObject *metaObject, +QQmlPropertyCache * +QQmlPropertyCache::copyAndAppend(QQmlEngine *engine, const QMetaObject *metaObject, int revision, - QDeclarativePropertyData::Flag propertyFlags, - QDeclarativePropertyData::Flag methodFlags, - QDeclarativePropertyData::Flag signalFlags) + QQmlPropertyData::Flag propertyFlags, + QQmlPropertyData::Flag methodFlags, + QQmlPropertyData::Flag signalFlags) { Q_ASSERT(QMetaObjectPrivate::get(metaObject)->revision >= 4); // Reserve enough space in the name hash for all the methods (including signals), all the // signal handlers and all the properties. This assumes no name clashes, but this is the // common case. - QDeclarativePropertyCache *rv = copy(QMetaObjectPrivate::get(metaObject)->methodCount + + QQmlPropertyCache *rv = copy(QMetaObjectPrivate::get(metaObject)->methodCount + QMetaObjectPrivate::get(metaObject)->signalCount + QMetaObjectPrivate::get(metaObject)->propertyCount); @@ -336,19 +336,19 @@ QDeclarativePropertyCache::copyAndAppend(QDeclarativeEngine *engine, const QMeta return rv; } -void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaObject *metaObject, - QDeclarativePropertyData::Flag propertyFlags, - QDeclarativePropertyData::Flag methodFlags, - QDeclarativePropertyData::Flag signalFlags) +void QQmlPropertyCache::append(QQmlEngine *engine, const QMetaObject *metaObject, + QQmlPropertyData::Flag propertyFlags, + QQmlPropertyData::Flag methodFlags, + QQmlPropertyData::Flag signalFlags) { append(engine, metaObject, -1, propertyFlags, methodFlags, signalFlags); } -void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaObject *metaObject, +void QQmlPropertyCache::append(QQmlEngine *engine, const QMetaObject *metaObject, int revision, - QDeclarativePropertyData::Flag propertyFlags, - QDeclarativePropertyData::Flag methodFlags, - QDeclarativePropertyData::Flag signalFlags) + QQmlPropertyData::Flag propertyFlags, + QQmlPropertyData::Flag methodFlags, + QQmlPropertyData::Flag signalFlags) { Q_UNUSED(revision); Q_ASSERT(constructor.IsEmpty()); // We should not be appending to an in-use property cache @@ -364,11 +364,11 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb int signalCount = metaObjectSignalCount(metaObject); int classInfoCount = QMetaObjectPrivate::get(metaObject)->classInfoCount; - QDeclarativeAccessorProperties::Properties accessorProperties; + QQmlAccessorProperties::Properties accessorProperties; // Special case QObject as we don't want to add a qt_HasQmlAccessors classinfo to it if (metaObject == &QObject::staticMetaObject) { - accessorProperties = QDeclarativeAccessorProperties::properties(metaObject); + accessorProperties = QQmlAccessorProperties::properties(metaObject); } else if (classInfoCount) { int classInfoOffset = metaObject->classInfoOffset(); bool hasFastProperty = false; @@ -382,15 +382,15 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb } if (hasFastProperty) { - accessorProperties = QDeclarativeAccessorProperties::properties(metaObject); + accessorProperties = QQmlAccessorProperties::properties(metaObject); if (accessorProperties.count == 0) - qFatal("QDeclarativePropertyCache: %s has FastProperty class info, but has not " + qFatal("QQmlPropertyCache: %s has FastProperty class info, but has not " "installed property accessors", metaObject->className()); } else { #ifndef QT_NO_DEBUG - accessorProperties = QDeclarativeAccessorProperties::properties(metaObject); + accessorProperties = QQmlAccessorProperties::properties(metaObject); if (accessorProperties.count != 0) - qFatal("QDeclarativePropertyCache: %s has fast property accessors, but is missing " + qFatal("QQmlPropertyCache: %s has fast property accessors, but is missing " "FastProperty class info", metaObject->className()); #endif } @@ -421,8 +421,8 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb ++cptr; } - QDeclarativePropertyData *data = &methodIndexCache[ii - methodIndexCacheStart]; - QDeclarativePropertyData *sigdata = 0; + QQmlPropertyData *data = &methodIndexCache[ii - methodIndexCacheStart]; + QQmlPropertyData *sigdata = 0; data->lazyLoad(m); @@ -432,7 +432,7 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb data->flags |= methodFlags; if (!dynamicMetaObject) - data->flags |= QDeclarativePropertyData::IsDirect; + data->flags |= QQmlPropertyData::IsDirect; Q_ASSERT((allowedRevisionCache.count() - 1) < Q_INT16_MAX); data->metaObjectOffset = allowedRevisionCache.count() - 1; @@ -440,14 +440,14 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb if (data->isSignal()) { sigdata = &signalHandlerIndexCache[signalHandlerIndex - signalHanderIndexCacheStart]; *sigdata = *data; - sigdata->flags |= QDeclarativePropertyData::IsSignalHandler; + sigdata->flags |= QQmlPropertyData::IsSignalHandler; } - QDeclarativePropertyData *old = 0; + QQmlPropertyData *old = 0; if (utf8) { QHashedString methodName(QString::fromUtf8(signature, cptr - signature)); - if (QDeclarativePropertyData **it = stringCache.value(methodName)) + if (QQmlPropertyData **it = stringCache.value(methodName)) old = *it; stringCache.insert(methodName, data); @@ -458,7 +458,7 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb } } else { QHashedCStringRef methodName(signature, cptr - signature); - if (QDeclarativePropertyData **it = stringCache.value(methodName)) + if (QQmlPropertyData **it = stringCache.value(methodName)) old = *it; stringCache.insert(methodName, data); @@ -482,7 +482,7 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb if (old) { // We only overload methods in the same class, exactly like C++ if (old->isFunction() && old->coreIndex >= methodOffset) - data->flags |= QDeclarativePropertyData::IsOverload; + data->flags |= QQmlPropertyData::IsOverload; data->overrideIndexIsProperty = !old->isFunction(); data->overrideIndex = old->coreIndex; } @@ -507,38 +507,38 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb ++cptr; } - QDeclarativePropertyData *data = &propertyIndexCache[ii - propertyIndexCacheStart]; + QQmlPropertyData *data = &propertyIndexCache[ii - propertyIndexCacheStart]; data->lazyLoad(p, engine); data->flags |= propertyFlags; if (!dynamicMetaObject) - data->flags |= QDeclarativePropertyData::IsDirect; + data->flags |= QQmlPropertyData::IsDirect; Q_ASSERT((allowedRevisionCache.count() - 1) < Q_INT16_MAX); data->metaObjectOffset = allowedRevisionCache.count() - 1; - QDeclarativePropertyData *old = 0; + QQmlPropertyData *old = 0; if (utf8) { QHashedString propName(QString::fromUtf8(str, cptr - str)); - if (QDeclarativePropertyData **it = stringCache.value(propName)) + if (QQmlPropertyData **it = stringCache.value(propName)) old = *it; stringCache.insert(propName, data); } else { QHashedCStringRef propName(str, cptr - str); - if (QDeclarativePropertyData **it = stringCache.value(propName)) + if (QQmlPropertyData **it = stringCache.value(propName)) old = *it; stringCache.insert(propName, data); } - QDeclarativeAccessorProperties::Property *accessorProperty = accessorProperties.property(str); + QQmlAccessorProperties::Property *accessorProperty = accessorProperties.property(str); // Fast properties may not be overrides or revisioned Q_ASSERT(accessorProperty == 0 || (old == 0 && data->revision == 0)); if (accessorProperty) { - data->flags |= QDeclarativePropertyData::HasAccessors; + data->flags |= QQmlPropertyData::HasAccessors; data->accessors = accessorProperty->accessors; data->accessorData = accessorProperty->data; } else if (old) { @@ -548,7 +548,7 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb } } -void QDeclarativePropertyCache::resolve(QDeclarativePropertyData *data) const +void QQmlPropertyCache::resolve(QQmlPropertyData *data) const { Q_ASSERT(data->notFullyResolved()); @@ -557,10 +557,10 @@ void QDeclarativePropertyCache::resolve(QDeclarativePropertyData *data) const if (!data->isFunction()) data->flags |= flagsForPropertyType(data->propType, engine); - data->flags &= ~QDeclarativePropertyData::NotFullyResolved; + data->flags &= ~QQmlPropertyData::NotFullyResolved; } -void QDeclarativePropertyCache::updateRecur(QDeclarativeEngine *engine, const QMetaObject *metaObject) +void QQmlPropertyCache::updateRecur(QQmlEngine *engine, const QMetaObject *metaObject) { if (!metaObject) return; @@ -570,7 +570,7 @@ void QDeclarativePropertyCache::updateRecur(QDeclarativeEngine *engine, const QM append(engine, metaObject); } -void QDeclarativePropertyCache::update(QDeclarativeEngine *engine, const QMetaObject *metaObject) +void QQmlPropertyCache::update(QQmlEngine *engine, const QMetaObject *metaObject) { Q_ASSERT(engine); Q_ASSERT(metaObject); @@ -593,8 +593,8 @@ void QDeclarativePropertyCache::update(QDeclarativeEngine *engine, const QMetaOb updateRecur(engine,metaObject); } -QDeclarativePropertyData * -QDeclarativePropertyCache::property(int index) const +QQmlPropertyData * +QQmlPropertyCache::property(int index) const { if (index < 0 || index >= (propertyIndexCacheStart + propertyIndexCache.count())) return 0; @@ -602,13 +602,13 @@ QDeclarativePropertyCache::property(int index) const if (index < propertyIndexCacheStart) return parent->property(index); - QDeclarativePropertyData *rv = const_cast<QDeclarativePropertyData *>(&propertyIndexCache.at(index - propertyIndexCacheStart)); + QQmlPropertyData *rv = const_cast<QQmlPropertyData *>(&propertyIndexCache.at(index - propertyIndexCacheStart)); if (rv->notFullyResolved()) resolve(rv); return rv; } -QDeclarativePropertyData * -QDeclarativePropertyCache::method(int index) const +QQmlPropertyData * +QQmlPropertyCache::method(int index) const { if (index < 0 || index >= (methodIndexCacheStart + methodIndexCache.count())) return 0; @@ -616,36 +616,36 @@ QDeclarativePropertyCache::method(int index) const if (index < methodIndexCacheStart) return parent->method(index); - QDeclarativePropertyData *rv = const_cast<QDeclarativePropertyData *>(&methodIndexCache.at(index - methodIndexCacheStart)); + QQmlPropertyData *rv = const_cast<QQmlPropertyData *>(&methodIndexCache.at(index - methodIndexCacheStart)); if (rv->notFullyResolved()) resolve(rv); return rv; } -QDeclarativePropertyData * -QDeclarativePropertyCache::property(const QHashedStringRef &str) const +QQmlPropertyData * +QQmlPropertyCache::property(const QHashedStringRef &str) const { - QDeclarativePropertyData **rv = stringCache.value(str); + QQmlPropertyData **rv = stringCache.value(str); if (rv && (*rv)->notFullyResolved()) resolve(*rv); return rv?*rv:0; } -QDeclarativePropertyData * -QDeclarativePropertyCache::property(const QHashedCStringRef &str) const +QQmlPropertyData * +QQmlPropertyCache::property(const QHashedCStringRef &str) const { - QDeclarativePropertyData **rv = stringCache.value(str); + QQmlPropertyData **rv = stringCache.value(str); if (rv && (*rv)->notFullyResolved()) resolve(*rv); return rv?*rv:0; } -QDeclarativePropertyData * -QDeclarativePropertyCache::property(const QString &str) const +QQmlPropertyData * +QQmlPropertyCache::property(const QString &str) const { - QDeclarativePropertyData **rv = stringCache.value(str); + QQmlPropertyData **rv = stringCache.value(str); if (rv && (*rv)->notFullyResolved()) resolve(*rv); return rv?*rv:0; } -QString QDeclarativePropertyData::name(QObject *object) +QString QQmlPropertyData::name(QObject *object) { if (!object) return QString(); @@ -653,7 +653,7 @@ QString QDeclarativePropertyData::name(QObject *object) return name(object->metaObject()); } -QString QDeclarativePropertyData::name(const QMetaObject *metaObject) +QString QQmlPropertyData::name(const QMetaObject *metaObject) { if (!metaObject || coreIndex == -1) return QString(); @@ -672,7 +672,7 @@ QString QDeclarativePropertyData::name(const QMetaObject *metaObject) } } -QStringList QDeclarativePropertyCache::propertyNames() const +QStringList QQmlPropertyCache::propertyNames() const { QStringList keys; for (StringCache::ConstIterator iter = stringCache.begin(); iter != stringCache.end(); ++iter) @@ -701,24 +701,24 @@ static int EnumType(const QMetaObject *meta, const QByteArray &str) // Returns an array of the arguments for method \a index. The first entry in the array // is the number of arguments. -int *QDeclarativePropertyCache::methodParameterTypes(QObject *object, int index, +int *QQmlPropertyCache::methodParameterTypes(QObject *object, int index, QVarLengthArray<int, 9> &dummy, QByteArray *unknownTypeError) { Q_ASSERT(object && index >= 0); - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); if (ddata && ddata->propertyCache) { - typedef QDeclarativePropertyCacheMethodArguments A; + typedef QQmlPropertyCacheMethodArguments A; - QDeclarativePropertyCache *c = ddata->propertyCache; + QQmlPropertyCache *c = ddata->propertyCache; Q_ASSERT(index < c->methodIndexCacheStart + c->methodIndexCache.count()); while (index < c->methodIndexCacheStart) c = c->parent; - QDeclarativePropertyData *rv = const_cast<QDeclarativePropertyData *>(&c->methodIndexCache.at(index - c->methodIndexCacheStart)); + QQmlPropertyData *rv = const_cast<QQmlPropertyData *>(&c->methodIndexCache.at(index - c->methodIndexCacheStart)); if (rv->arguments) return static_cast<A *>(rv->arguments)->arguments; @@ -768,12 +768,12 @@ int *QDeclarativePropertyCache::methodParameterTypes(QObject *object, int index, } } -QDeclarativePropertyData qDeclarativePropertyCacheCreate(const QMetaObject *metaObject, +QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QString &property) { Q_ASSERT(metaObject); - QDeclarativePropertyData rv; + QQmlPropertyData rv; { const QMetaObject *cmo = metaObject; const QByteArray propertyName = property.toUtf8(); @@ -817,46 +817,46 @@ QDeclarativePropertyData qDeclarativePropertyCacheCreate(const QMetaObject *meta return rv; } -inline const QString &qDeclarativePropertyCacheToString(const QString &string) +inline const QString &qQmlPropertyCacheToString(const QString &string) { return string; } -inline QString qDeclarativePropertyCacheToString(const QHashedV8String &string) +inline QString qQmlPropertyCacheToString(const QHashedV8String &string) { return QV8Engine::toStringStatic(string.string()); } template<typename T> -QDeclarativePropertyData * -qDeclarativePropertyCacheProperty(QDeclarativeEngine *engine, QObject *obj, - const T &name, QDeclarativePropertyData &local) +QQmlPropertyData * +qQmlPropertyCacheProperty(QQmlEngine *engine, QObject *obj, + const T &name, QQmlPropertyData &local) { - QDeclarativePropertyCache *cache = 0; + QQmlPropertyCache *cache = 0; if (engine) { - QDeclarativeData *ddata = QDeclarativeData::get(obj); + QQmlData *ddata = QQmlData::get(obj); if (ddata && ddata->propertyCache) { cache = ddata->propertyCache; } else if (engine) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); cache = ep->cache(obj); if (cache) { - ddata = QDeclarativeData::get(obj, true); + ddata = QQmlData::get(obj, true); cache->addref(); ddata->propertyCache = cache; } } } - QDeclarativePropertyData *rv = 0; + QQmlPropertyData *rv = 0; if (cache) { rv = cache->property(name); } else { - local = qDeclarativePropertyCacheCreate(obj->metaObject(), - qDeclarativePropertyCacheToString(name)); + local = qQmlPropertyCacheCreate(obj->metaObject(), + qQmlPropertyCacheToString(name)); if (local.isValid()) rv = &local; } @@ -864,24 +864,24 @@ qDeclarativePropertyCacheProperty(QDeclarativeEngine *engine, QObject *obj, return rv; } -QDeclarativePropertyData * -QDeclarativePropertyCache::property(QDeclarativeEngine *engine, QObject *obj, - const QHashedV8String &name, QDeclarativePropertyData &local) +QQmlPropertyData * +QQmlPropertyCache::property(QQmlEngine *engine, QObject *obj, + const QHashedV8String &name, QQmlPropertyData &local) { - return qDeclarativePropertyCacheProperty<QHashedV8String>(engine, obj, name, local); + return qQmlPropertyCacheProperty<QHashedV8String>(engine, obj, name, local); } -QDeclarativePropertyData * -QDeclarativePropertyCache::property(QDeclarativeEngine *engine, QObject *obj, - const QString &name, QDeclarativePropertyData &local) +QQmlPropertyData * +QQmlPropertyCache::property(QQmlEngine *engine, QObject *obj, + const QString &name, QQmlPropertyData &local) { - return qDeclarativePropertyCacheProperty<QString>(engine, obj, name, local); + return qQmlPropertyCacheProperty<QString>(engine, obj, name, local); } static inline const QMetaObjectPrivate *priv(const uint* data) { return reinterpret_cast<const QMetaObjectPrivate*>(data); } -bool QDeclarativePropertyCache::isDynamicMetaObject(const QMetaObject *mo) +bool QQmlPropertyCache::isDynamicMetaObject(const QMetaObject *mo) { return priv(mo->d.data)->revision >= 3 && priv(mo->d.data)->flags & DynamicMetaObject; } diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index d5d7095667..095ee79867 100644 --- a/src/declarative/qml/qdeclarativepropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROPERTYCACHE_P_H -#define QDECLARATIVEPROPERTYCACHE_P_H +#ifndef QQMLPROPERTYCACHE_P_H +#define QQMLPROPERTYCACHE_P_H // // W A R N I N G @@ -53,9 +53,9 @@ // We mean it. // -#include <private/qdeclarativerefcount_p.h> -#include "qdeclarativecleanup_p.h" -#include "qdeclarativenotifier_p.h" +#include <private/qqmlrefcount_p.h> +#include "qqmlcleanup_p.h" +#include "qqmlnotifier_p.h" #include <private/qhashedstring_p.h> #include <QtCore/qvarlengtharray.h> @@ -66,15 +66,15 @@ QT_BEGIN_NAMESPACE class QV8Engine; class QMetaProperty; class QV8QObjectWrapper; -class QDeclarativeEngine; -class QDeclarativePropertyData; -class QDeclarativeAccessors; -class QDeclarativePropertyCacheMethodArguments; +class QQmlEngine; +class QQmlPropertyData; +class QQmlAccessors; +class QQmlPropertyCacheMethodArguments; // We have this somewhat awful split between RawData and Data so that RawData can be // used in unions. In normal code, you should always use Data which initializes RawData // to an invalid state on construction. -class QDeclarativePropertyRawData +class QQmlPropertyRawData { public: enum Flag { @@ -95,9 +95,9 @@ public: IsQObjectDerived = 0x00000100, // Property type is a QObject* derived type IsEnumType = 0x00000200, // Property type is an enum IsQList = 0x00000400, // Property type is a QML list - IsQmlBinding = 0x00000800, // Property type is a QDeclarativeBinding* + IsQmlBinding = 0x00000800, // Property type is a QQmlBinding* IsQJSValue = 0x00001000, // Property type is a QScriptValue - IsV8Handle = 0x00002000, // Property type is a QDeclarativeV8Handle + IsV8Handle = 0x00002000, // Property type is a QQmlV8Handle IsVMEProperty = 0x00004000, // Property type is a "var" property of VMEMO IsValueTypeVirtual = 0x00008000, // Property is a value type "virtual" property IsQVariant = 0x00010000, // Property is a QVariant @@ -107,11 +107,11 @@ public: HasArguments = 0x00040000, // Function takes arguments IsSignal = 0x00080000, // Function is a signal IsVMESignal = 0x00100000, // Signal was added by QML - IsV8Function = 0x00200000, // Function takes QDeclarativeV8Function* args + IsV8Function = 0x00200000, // Function takes QQmlV8Function* args IsSignalHandler = 0x00400000, // Function is a signal handler IsOverload = 0x00800000, // Function is an overload of another function - // Internal QDeclarativePropertyCache flags + // Internal QQmlPropertyCache flags NotFullyResolved = 0x01000000 // True if the type data is to be lazily resolved }; Q_DECLARE_FLAGS(Flags, Flag) @@ -189,84 +189,84 @@ public: }; }; struct { // When HasAccessors - QDeclarativeAccessors *accessors; + QQmlAccessors *accessors; intptr_t accessorData; }; }; private: - friend class QDeclarativePropertyData; - friend class QDeclarativePropertyCache; + friend class QQmlPropertyData; + friend class QQmlPropertyCache; quint32 flags; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyRawData::Flags); +Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlPropertyRawData::Flags); -class QDeclarativePropertyData : public QDeclarativePropertyRawData +class QQmlPropertyData : public QQmlPropertyRawData { public: - inline QDeclarativePropertyData(); - inline QDeclarativePropertyData(const QDeclarativePropertyRawData &); + inline QQmlPropertyData(); + inline QQmlPropertyData(const QQmlPropertyRawData &); - inline bool operator==(const QDeclarativePropertyRawData &); + inline bool operator==(const QQmlPropertyRawData &); - static Flags flagsForProperty(const QMetaProperty &, QDeclarativeEngine *engine = 0); - void load(const QMetaProperty &, QDeclarativeEngine *engine = 0); + static Flags flagsForProperty(const QMetaProperty &, QQmlEngine *engine = 0); + void load(const QMetaProperty &, QQmlEngine *engine = 0); void load(const QMetaMethod &); QString name(QObject *); QString name(const QMetaObject *); private: - friend class QDeclarativePropertyCache; - void lazyLoad(const QMetaProperty &, QDeclarativeEngine *engine = 0); + friend class QQmlPropertyCache; + void lazyLoad(const QMetaProperty &, QQmlEngine *engine = 0); void lazyLoad(const QMetaMethod &); bool notFullyResolved() const { return flags & NotFullyResolved; } }; -class Q_DECLARATIVE_EXPORT QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup +class Q_QML_EXPORT QQmlPropertyCache : public QQmlRefCount, public QQmlCleanup { public: - QDeclarativePropertyCache(QDeclarativeEngine *); - QDeclarativePropertyCache(QDeclarativeEngine *, const QMetaObject *); - virtual ~QDeclarativePropertyCache(); - - void update(QDeclarativeEngine *, const QMetaObject *); - - QDeclarativePropertyCache *copy(); - - QDeclarativePropertyCache *copyAndAppend(QDeclarativeEngine *, const QMetaObject *, - QDeclarativePropertyData::Flag propertyFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag methodFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag signalFlags = QDeclarativePropertyData::NoFlags); - QDeclarativePropertyCache *copyAndAppend(QDeclarativeEngine *, const QMetaObject *, int revision, - QDeclarativePropertyData::Flag propertyFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag methodFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag signalFlags = QDeclarativePropertyData::NoFlags); - - void append(QDeclarativeEngine *, const QMetaObject *, - QDeclarativePropertyData::Flag propertyFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag methodFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag signalFlags = QDeclarativePropertyData::NoFlags); - void append(QDeclarativeEngine *, const QMetaObject *, int revision, - QDeclarativePropertyData::Flag propertyFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag methodFlags = QDeclarativePropertyData::NoFlags, - QDeclarativePropertyData::Flag signalFlags = QDeclarativePropertyData::NoFlags); - - inline QDeclarativePropertyData *property(const QHashedV8String &) const; - QDeclarativePropertyData *property(const QHashedStringRef &) const; - QDeclarativePropertyData *property(const QHashedCStringRef &) const; - QDeclarativePropertyData *property(const QString &) const; - QDeclarativePropertyData *property(int) const; - QDeclarativePropertyData *method(int) const; + QQmlPropertyCache(QQmlEngine *); + QQmlPropertyCache(QQmlEngine *, const QMetaObject *); + virtual ~QQmlPropertyCache(); + + void update(QQmlEngine *, const QMetaObject *); + + QQmlPropertyCache *copy(); + + QQmlPropertyCache *copyAndAppend(QQmlEngine *, const QMetaObject *, + QQmlPropertyData::Flag propertyFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag methodFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag signalFlags = QQmlPropertyData::NoFlags); + QQmlPropertyCache *copyAndAppend(QQmlEngine *, const QMetaObject *, int revision, + QQmlPropertyData::Flag propertyFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag methodFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag signalFlags = QQmlPropertyData::NoFlags); + + void append(QQmlEngine *, const QMetaObject *, + QQmlPropertyData::Flag propertyFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag methodFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag signalFlags = QQmlPropertyData::NoFlags); + void append(QQmlEngine *, const QMetaObject *, int revision, + QQmlPropertyData::Flag propertyFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag methodFlags = QQmlPropertyData::NoFlags, + QQmlPropertyData::Flag signalFlags = QQmlPropertyData::NoFlags); + + inline QQmlPropertyData *property(const QHashedV8String &) const; + QQmlPropertyData *property(const QHashedStringRef &) const; + QQmlPropertyData *property(const QHashedCStringRef &) const; + QQmlPropertyData *property(const QString &) const; + QQmlPropertyData *property(int) const; + QQmlPropertyData *method(int) const; QStringList propertyNames() const; - inline QDeclarativePropertyData *overrideData(QDeclarativePropertyData *) const; - inline bool isAllowedInRevision(QDeclarativePropertyData *) const; + inline QQmlPropertyData *overrideData(QQmlPropertyData *) const; + inline bool isAllowedInRevision(QQmlPropertyData *) const; - inline QDeclarativeEngine *qmlEngine() const; - static QDeclarativePropertyData *property(QDeclarativeEngine *, QObject *, const QString &, - QDeclarativePropertyData &); - static QDeclarativePropertyData *property(QDeclarativeEngine *, QObject *, const QHashedV8String &, - QDeclarativePropertyData &); + inline QQmlEngine *qmlEngine() const; + static QQmlPropertyData *property(QQmlEngine *, QObject *, const QString &, + QQmlPropertyData &); + static QQmlPropertyData *property(QQmlEngine *, QObject *, const QHashedV8String &, + QQmlPropertyData &); static int *methodParameterTypes(QObject *, int index, QVarLengthArray<int, 9> &dummy, QByteArray *unknownTypeError); @@ -276,24 +276,24 @@ protected: virtual void clear(); private: - friend class QDeclarativeEnginePrivate; + friend class QQmlEnginePrivate; friend class QV8QObjectWrapper; - inline QDeclarativePropertyCache *copy(int reserve); + inline QQmlPropertyCache *copy(int reserve); // Implemented in v8/qv8qobjectwrapper.cpp v8::Local<v8::Object> newQObject(QObject *, QV8Engine *); - typedef QVector<QDeclarativePropertyData> IndexCache; - typedef QStringHash<QDeclarativePropertyData *> StringCache; + typedef QVector<QQmlPropertyData> IndexCache; + typedef QStringHash<QQmlPropertyData *> StringCache; typedef QVector<int> AllowedRevisionCache; - void resolve(QDeclarativePropertyData *) const; - void updateRecur(QDeclarativeEngine *, const QMetaObject *); + void resolve(QQmlPropertyData *) const; + void updateRecur(QQmlEngine *, const QMetaObject *); - QDeclarativeEngine *engine; + QQmlEngine *engine; - QDeclarativePropertyCache *parent; + QQmlPropertyCache *parent; int propertyIndexCacheStart; int methodIndexCacheStart; int signalHanderIndexCacheStart; @@ -306,10 +306,10 @@ private: v8::Persistent<v8::Function> constructor; const QMetaObject *metaObject; - QDeclarativePropertyCacheMethodArguments *argumentsCache; + QQmlPropertyCacheMethodArguments *argumentsCache; }; -QDeclarativePropertyData::QDeclarativePropertyData() +QQmlPropertyData::QQmlPropertyData() { propType = 0; coreIndex = -1; @@ -321,12 +321,12 @@ QDeclarativePropertyData::QDeclarativePropertyData() flags = 0; } -QDeclarativePropertyData::QDeclarativePropertyData(const QDeclarativePropertyRawData &d) +QQmlPropertyData::QQmlPropertyData(const QQmlPropertyRawData &d) { - *(static_cast<QDeclarativePropertyRawData *>(this)) = d; + *(static_cast<QQmlPropertyRawData *>(this)) = d; } -bool QDeclarativePropertyData::operator==(const QDeclarativePropertyRawData &other) +bool QQmlPropertyData::operator==(const QQmlPropertyRawData &other) { return flags == other.flags && propType == other.propType && @@ -338,18 +338,18 @@ bool QDeclarativePropertyData::operator==(const QDeclarativePropertyRawData &oth valueTypePropType == other.valueTypePropType)); } -int QDeclarativePropertyRawData::getValueTypeCoreIndex() const +int QQmlPropertyRawData::getValueTypeCoreIndex() const { return isValueTypeVirtual()?valueTypeCoreIndex:-1; } -int QDeclarativePropertyRawData::encodedIndex() const +int QQmlPropertyRawData::encodedIndex() const { return isValueTypeVirtual()?(coreIndex | (valueTypeCoreIndex << 24)):coreIndex; } -QDeclarativePropertyData * -QDeclarativePropertyCache::overrideData(QDeclarativePropertyData *data) const +QQmlPropertyData * +QQmlPropertyCache::overrideData(QQmlPropertyData *data) const { if (!data->hasOverride()) return 0; @@ -360,24 +360,24 @@ QDeclarativePropertyCache::overrideData(QDeclarativePropertyData *data) const return method(data->overrideIndex); } -bool QDeclarativePropertyCache::isAllowedInRevision(QDeclarativePropertyData *data) const +bool QQmlPropertyCache::isAllowedInRevision(QQmlPropertyData *data) const { return (data->hasAccessors() || (data->metaObjectOffset == -1 && data->revision == 0)) || (allowedRevisionCache[data->metaObjectOffset] >= data->revision); } -QDeclarativeEngine *QDeclarativePropertyCache::qmlEngine() const +QQmlEngine *QQmlPropertyCache::qmlEngine() const { return engine; } -QDeclarativePropertyData *QDeclarativePropertyCache::property(const QHashedV8String &str) const +QQmlPropertyData *QQmlPropertyCache::property(const QHashedV8String &str) const { - QDeclarativePropertyData **rv = stringCache.value(str); + QQmlPropertyData **rv = stringCache.value(str); if (rv && (*rv)->notFullyResolved()) resolve(*rv); return rv?*rv:0; } QT_END_NAMESPACE -#endif // QDECLARATIVEPROPERTYCACHE_P_H +#endif // QQMLPROPERTYCACHE_P_H diff --git a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp b/src/qml/qml/qqmlpropertyvalueinterceptor.cpp index 4abe5a4e1f..331b90da5c 100644 --- a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp +++ b/src/qml/qml/qqmlpropertyvalueinterceptor.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qdeclarativepropertyvalueinterceptor_p.h" +#include "qqmlpropertyvalueinterceptor_p.h" -#include "qdeclarative.h" +#include "qqml.h" QT_BEGIN_NAMESPACE /*! - \class QDeclarativePropertyValueInterceptor - \brief The QDeclarativePropertyValueInterceptor class is inherited by property interceptors such as Behavior. + \class QQmlPropertyValueInterceptor + \brief The QQmlPropertyValueInterceptor class is inherited by property interceptors such as Behavior. \internal This class intercepts property writes, allowing for custom handling. For example, Behavior uses this @@ -55,24 +55,24 @@ QT_BEGIN_NAMESPACE */ /*! - Constructs a QDeclarativePropertyValueInterceptor. + Constructs a QQmlPropertyValueInterceptor. */ -QDeclarativePropertyValueInterceptor::QDeclarativePropertyValueInterceptor() +QQmlPropertyValueInterceptor::QQmlPropertyValueInterceptor() { } -QDeclarativePropertyValueInterceptor::~QDeclarativePropertyValueInterceptor() +QQmlPropertyValueInterceptor::~QQmlPropertyValueInterceptor() { } /*! - \fn void QDeclarativePropertyValueInterceptor::setTarget(const QDeclarativeProperty &property) + \fn void QQmlPropertyValueInterceptor::setTarget(const QQmlProperty &property) Set the target \a property for the value interceptor. This method will be called by the QML engine when assigning a value interceptor. */ /*! - \fn void QDeclarativePropertyValueInterceptor::write(const QVariant &value) + \fn void QQmlPropertyValueInterceptor::write(const QVariant &value) This method will be called when a new \a value is assigned to the property being intercepted. */ diff --git a/src/declarative/qml/qdeclarativepropertyvalueinterceptor_p.h b/src/qml/qml/qqmlpropertyvalueinterceptor_p.h index ed5e54f646..f8b8643a00 100644 --- a/src/declarative/qml/qdeclarativepropertyvalueinterceptor_p.h +++ b/src/qml/qml/qqmlpropertyvalueinterceptor_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROPERTYVALUEINTERCEPTOR_P_H -#define QDECLARATIVEPROPERTYVALUEINTERCEPTOR_P_H +#ifndef QQMLPROPERTYVALUEINTERCEPTOR_P_H +#define QQMLPROPERTYVALUEINTERCEPTOR_P_H // // W A R N I N G @@ -53,21 +53,22 @@ // We mean it. // +#include <QtQml/qtqmlglobal.h> #include <QtCore/qobject.h> QT_BEGIN_NAMESPACE -class QDeclarativeProperty; -class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueInterceptor +class QQmlProperty; +class Q_QML_EXPORT QQmlPropertyValueInterceptor { public: - QDeclarativePropertyValueInterceptor(); - virtual ~QDeclarativePropertyValueInterceptor(); - virtual void setTarget(const QDeclarativeProperty &property) = 0; + QQmlPropertyValueInterceptor(); + virtual ~QQmlPropertyValueInterceptor(); + virtual void setTarget(const QQmlProperty &property) = 0; virtual void write(const QVariant &value) = 0; }; -Q_DECLARE_INTERFACE(QDeclarativePropertyValueInterceptor, "com.trolltech.qml.QDeclarativePropertyValueInterceptor") +Q_DECLARE_INTERFACE(QQmlPropertyValueInterceptor, "com.trolltech.qml.QQmlPropertyValueInterceptor") QT_END_NAMESPACE -#endif // QDECLARATIVEPROPERTYVALUEINTERCEPTOR_P_H +#endif // QQMLPROPERTYVALUEINTERCEPTOR_P_H diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp b/src/qml/qml/qqmlpropertyvaluesource.cpp index 2f91bc388c..bd1ca05b81 100644 --- a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp +++ b/src/qml/qml/qqmlpropertyvaluesource.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,36 +39,36 @@ ** ****************************************************************************/ -#include "qdeclarativepropertyvaluesource.h" +#include "qqmlpropertyvaluesource.h" -#include "qdeclarative.h" +#include "qqml.h" QT_BEGIN_NAMESPACE /*! - \class QDeclarativePropertyValueSource - \brief The QDeclarativePropertyValueSource class is an interface for property value sources such as animations and bindings. + \class QQmlPropertyValueSource + \brief The QQmlPropertyValueSource class is an interface for property value sources such as animations and bindings. See \l{Property Value Sources} for information on writing custom property value sources. */ /*! - Constructs a QDeclarativePropertyValueSource. + Constructs a QQmlPropertyValueSource. */ -QDeclarativePropertyValueSource::QDeclarativePropertyValueSource() +QQmlPropertyValueSource::QQmlPropertyValueSource() { } /*! Destroys the value source. */ -QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource() +QQmlPropertyValueSource::~QQmlPropertyValueSource() { } /*! - \fn void QDeclarativePropertyValueSource::setTarget(const QDeclarativeProperty &property) + \fn void QQmlPropertyValueSource::setTarget(const QQmlProperty &property) Set the target \a property for the value source. This method will be called by the QML engine when assigning a value source. */ diff --git a/src/qml/qml/qqmlpropertyvaluesource.h b/src/qml/qml/qqmlpropertyvaluesource.h new file mode 100644 index 0000000000..910b23877e --- /dev/null +++ b/src/qml/qml/qqmlpropertyvaluesource.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QQMLPROPERTYVALUESOURCE_H +#define QQMLPROPERTYVALUESOURCE_H + +#include <QtQml/qtqmlglobal.h> +#include <QtCore/qobject.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QQmlProperty; +class Q_QML_EXPORT QQmlPropertyValueSource +{ +public: + QQmlPropertyValueSource(); + virtual ~QQmlPropertyValueSource(); + virtual void setTarget(const QQmlProperty &) = 0; +}; +Q_DECLARE_INTERFACE(QQmlPropertyValueSource, "com.trolltech.qml.QQmlPropertyValueSource") + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QQMLPROPERTYVALUESOURCE_H diff --git a/src/declarative/qml/qdeclarativeproxymetaobject.cpp b/src/qml/qml/qqmlproxymetaobject.cpp index 6c48640da1..55bf67739d 100644 --- a/src/declarative/qml/qdeclarativeproxymetaobject.cpp +++ b/src/qml/qml/qqmlproxymetaobject.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qdeclarativeproxymetaobject_p.h" -#include "qdeclarativeproperty_p.h" +#include "qqmlproxymetaobject_p.h" +#include "qqmlproperty_p.h" QT_BEGIN_NAMESPACE -QDeclarativeProxyMetaObject::QDeclarativeProxyMetaObject(QObject *obj, QList<ProxyData> *mList) +QQmlProxyMetaObject::QQmlProxyMetaObject(QObject *obj, QList<ProxyData> *mList) : metaObjects(mList), proxies(0), parent(0), object(obj) { *static_cast<QMetaObject *>(this) = *metaObjects->first().metaObject; @@ -56,7 +56,7 @@ QDeclarativeProxyMetaObject::QDeclarativeProxyMetaObject(QObject *obj, QList<Pro op->metaObject = this; } -QDeclarativeProxyMetaObject::~QDeclarativeProxyMetaObject() +QQmlProxyMetaObject::~QQmlProxyMetaObject() { if (parent) delete parent; @@ -67,7 +67,7 @@ QDeclarativeProxyMetaObject::~QDeclarativeProxyMetaObject() proxies = 0; } -int QDeclarativeProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a) +int QQmlProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a) { if ((c == QMetaObject::ReadProperty || c == QMetaObject::WriteProperty) && @@ -96,7 +96,7 @@ int QDeclarativeProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a) QMetaMethod method = metaObject->method(jj + methodOffset); if (method.methodType() == QMetaMethod::Signal) - QDeclarativePropertyPrivate::connect(proxy, methodOffset + jj, object, localOffset + jj); + QQmlPropertyPrivate::connect(proxy, methodOffset + jj, object, localOffset + jj); } } diff --git a/src/declarative/qml/qdeclarativeproxymetaobject_p.h b/src/qml/qml/qqmlproxymetaobject_p.h index 04c6f93dc3..ec9df42f7f 100644 --- a/src/declarative/qml/qdeclarativeproxymetaobject_p.h +++ b/src/qml/qml/qqmlproxymetaobject_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROXYMETAOBJECT_P_H -#define QDECLARATIVEPROXYMETAOBJECT_P_H +#ifndef QQMLPROXYMETAOBJECT_P_H +#define QQMLPROXYMETAOBJECT_P_H // // W A R N I N G @@ -54,7 +54,7 @@ // #include <private/qmetaobjectbuilder_p.h> -#include "qdeclarative.h" +#include "qqml.h" #include <QtCore/QMetaObject> #include <QtCore/QObject> @@ -66,7 +66,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeProxyMetaObject : public QAbstractDynamicMetaObject +class QQmlProxyMetaObject : public QAbstractDynamicMetaObject { public: struct ProxyData { @@ -77,8 +77,8 @@ public: int methodOffset; }; - QDeclarativeProxyMetaObject(QObject *, QList<ProxyData> *); - virtual ~QDeclarativeProxyMetaObject(); + QQmlProxyMetaObject(QObject *, QList<ProxyData> *); + virtual ~QQmlProxyMetaObject(); protected: virtual int metaCall(QMetaObject::Call _c, int _id, void **_a); @@ -95,5 +95,5 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEPROXYMETAOBJECT_P_H +#endif // QQMLPROXYMETAOBJECT_P_H diff --git a/src/declarative/qml/qdeclarativerewrite.cpp b/src/qml/qml/qqmlrewrite.cpp index 77da943704..828f7bf641 100644 --- a/src/declarative/qml/qdeclarativerewrite.cpp +++ b/src/qml/qml/qqmlrewrite.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qdeclarativerewrite_p.h" +#include "qqmlrewrite_p.h" -#include "qdeclarativeglobal_p.h" +#include <private/qqmlglobal_p.h> #include <QtCore/qdebug.h> @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(rewriteDump, QML_REWRITE_DUMP); -namespace QDeclarativeRewrite { +namespace QQmlRewrite { bool SharedBindingTester::isSharable(const QString &code) { @@ -91,7 +91,7 @@ QString RewriteBinding::operator()(const QString &code, bool *ok, bool *sharable return rewrite(code, 0, parser.statement()); } -QString RewriteBinding::operator()(QDeclarativeJS::AST::Node *node, const QString &code, bool *sharable) +QString RewriteBinding::operator()(QQmlJS::AST::Node *node, const QString &code, bool *sharable) { if (!node) return code; @@ -101,8 +101,8 @@ QString RewriteBinding::operator()(QDeclarativeJS::AST::Node *node, const QStrin *sharable = tester.isSharable(node); } - QDeclarativeJS::AST::ExpressionNode *expression = node->expressionCast(); - QDeclarativeJS::AST::Statement *statement = node->statementCast(); + QQmlJS::AST::ExpressionNode *expression = node->expressionCast(); + QQmlJS::AST::Statement *statement = node->statementCast(); if(!expression && !statement) return code; @@ -404,7 +404,7 @@ void RewriteSignalHandler::rewriteMultilineStrings(QString &code) code.replace(replaceR[ii], 1, QLatin1String("\\r")); } -QString RewriteSignalHandler::operator()(QDeclarativeJS::AST::Node *node, const QString &code, const QString &name) +QString RewriteSignalHandler::operator()(QQmlJS::AST::Node *node, const QString &code, const QString &name) { if (rewriteDump()) { qWarning() << "============================================================="; @@ -412,8 +412,8 @@ QString RewriteSignalHandler::operator()(QDeclarativeJS::AST::Node *node, const qWarning() << qPrintable(code); } - QDeclarativeJS::AST::ExpressionNode *expression = node->expressionCast(); - QDeclarativeJS::AST::Statement *statement = node->statementCast(); + QQmlJS::AST::ExpressionNode *expression = node->expressionCast(); + QQmlJS::AST::Statement *statement = node->statementCast(); if (!expression && !statement) return code; @@ -436,6 +436,6 @@ QString RewriteSignalHandler::operator()(QDeclarativeJS::AST::Node *node, const return rewritten; } -} // namespace QDeclarativeRewrite +} // namespace QQmlRewrite QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativerewrite_p.h b/src/qml/qml/qqmlrewrite_p.h index 74c408cd21..e915d797df 100644 --- a/src/declarative/qml/qdeclarativerewrite_p.h +++ b/src/qml/qml/qqmlrewrite_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEREWRITE_P_H -#define QDECLARATIVEREWRITE_P_H +#ifndef QQMLREWRITE_P_H +#define QQMLREWRITE_P_H // // W A R N I N G @@ -54,14 +54,14 @@ // #include <private/textwriter_p.h> -#include <private/qdeclarativejslexer_p.h> -#include <private/qdeclarativejsparser_p.h> -#include <private/qdeclarativejsmemorypool_p.h> +#include <private/qqmljslexer_p.h> +#include <private/qqmljsparser_p.h> +#include <private/qqmljsmemorypool_p.h> QT_BEGIN_NAMESPACE -namespace QDeclarativeRewrite { -using namespace QDeclarativeJS; +namespace QQmlRewrite { +using namespace QQmlJS; class SharedBindingTester : protected AST::Visitor { @@ -84,7 +84,7 @@ class RewriteBinding: protected AST::Visitor public: QString operator()(const QString &code, bool *ok = 0, bool *sharable = 0); - QString operator()(QDeclarativeJS::AST::Node *node, const QString &code, bool *sharable = 0); + QString operator()(QQmlJS::AST::Node *node, const QString &code, bool *sharable = 0); //name of the function: used for the debugger void setName(const QString &name) { _name = name; } @@ -131,7 +131,7 @@ class RewriteSignalHandler: protected AST::Visitor int _position; public: - QString operator()(QDeclarativeJS::AST::Node *node, const QString &code, const QString &name); + QString operator()(QQmlJS::AST::Node *node, const QString &code, const QString &name); protected: void rewriteMultilineStrings(QString &code); @@ -141,9 +141,9 @@ protected: virtual bool visit(AST::StringLiteral *ast); }; -} // namespace QDeclarativeRewrite +} // namespace QQmlRewrite QT_END_NAMESPACE -#endif // QDECLARATIVEREWRITE_P_H +#endif // QQMLREWRITE_P_H diff --git a/src/declarative/qml/qdeclarativescript.cpp b/src/qml/qml/qqmlscript.cpp index 7a2247fac0..d1c2faa138 100644 --- a/src/declarative/qml/qdeclarativescript.cpp +++ b/src/qml/qml/qqmlscript.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qdeclarativescript_p.h" +#include "qqmlscript_p.h" -#include "parser/qdeclarativejsengine_p.h" -#include "parser/qdeclarativejsparser_p.h" -#include "parser/qdeclarativejslexer_p.h" -#include "parser/qdeclarativejsmemorypool_p.h" -#include "parser/qdeclarativejsastvisitor_p.h" -#include "parser/qdeclarativejsast_p.h" -#include <private/qdeclarativerewrite_p.h> +#include "parser/qqmljsengine_p.h" +#include "parser/qqmljsparser_p.h" +#include "parser/qqmljslexer_p.h" +#include "parser/qqmljsmemorypool_p.h" +#include "parser/qqmljsastvisitor_p.h" +#include "parser/qqmljsast_p.h" +#include <private/qqmlrewrite_p.h> #include <QStack> #include <QCoreApplication> @@ -55,19 +55,19 @@ QT_BEGIN_NAMESPACE -using namespace QDeclarativeJS; -using namespace QDeclarativeScript; +using namespace QQmlJS; +using namespace QQmlScript; // // Parser IR classes // -QDeclarativeScript::Object::Object() +QQmlScript::Object::Object() : type(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1), componentCompileState(0), nextAliasingObject(0), nextIdObject(0) { } -QDeclarativeScript::Object::~Object() +QQmlScript::Object::~Object() { if (synthCache) synthCache->release(); } @@ -89,7 +89,7 @@ const QMetaObject *Object::metaObject() const return metatype; } -QDeclarativeScript::Property *Object::getDefaultProperty() +QQmlScript::Property *Object::getDefaultProperty() { if (!defaultProperty) { defaultProperty = pool()->New<Property>(); @@ -98,38 +98,38 @@ QDeclarativeScript::Property *Object::getDefaultProperty() return defaultProperty; } -void QDeclarativeScript::Object::addValueProperty(Property *p) +void QQmlScript::Object::addValueProperty(Property *p) { valueProperties.append(p); } -void QDeclarativeScript::Object::addSignalProperty(Property *p) +void QQmlScript::Object::addSignalProperty(Property *p) { signalProperties.append(p); } -void QDeclarativeScript::Object::addAttachedProperty(Property *p) +void QQmlScript::Object::addAttachedProperty(Property *p) { attachedProperties.append(p); } -void QDeclarativeScript::Object::addGroupedProperty(Property *p) +void QQmlScript::Object::addGroupedProperty(Property *p) { groupedProperties.append(p); } -void QDeclarativeScript::Object::addValueTypeProperty(Property *p) +void QQmlScript::Object::addValueTypeProperty(Property *p) { valueTypeProperties.append(p); } -void QDeclarativeScript::Object::addScriptStringProperty(Property *p) +void QQmlScript::Object::addScriptStringProperty(Property *p) { scriptStringProperties.append(p); } // This lookup is optimized for missing, and having to create a new property. -Property *QDeclarativeScript::Object::getProperty(const QHashedStringRef &name, bool create) +Property *QQmlScript::Object::getProperty(const QHashedStringRef &name, bool create) { if (create) { quint32 h = name.hash(); @@ -156,12 +156,12 @@ Property *QDeclarativeScript::Object::getProperty(const QHashedStringRef &name, return 0; } -Property *QDeclarativeScript::Object::getProperty(const QStringRef &name, bool create) +Property *QQmlScript::Object::getProperty(const QStringRef &name, bool create) { return getProperty(QHashedStringRef(name), create); } -Property *QDeclarativeScript::Object::getProperty(const QString &name, bool create) +Property *QQmlScript::Object::getProperty(const QString &name, bool create) { for (Property *p = properties.first(); p; p = properties.next(p)) { if (p->name() == name) @@ -181,19 +181,19 @@ Property *QDeclarativeScript::Object::getProperty(const QString &name, bool crea } } -QDeclarativeScript::Object::DynamicProperty::DynamicProperty() +QQmlScript::Object::DynamicProperty::DynamicProperty() : isDefaultProperty(false), isReadOnly(false), type(Variant), defaultValue(0), nextProperty(0), resolvedCustomTypeName(0) { } -QDeclarativeScript::Object::DynamicSignal::DynamicSignal() +QQmlScript::Object::DynamicSignal::DynamicSignal() : nextSignal(0) { } // Returns length in utf8 bytes -int QDeclarativeScript::Object::DynamicSignal::parameterTypesLength() const +int QQmlScript::Object::DynamicSignal::parameterTypesLength() const { int rv = 0; for (int ii = 0; ii < parameterTypes.count(); ++ii) @@ -202,7 +202,7 @@ int QDeclarativeScript::Object::DynamicSignal::parameterTypesLength() const } // Returns length in utf8 bytes -int QDeclarativeScript::Object::DynamicSignal::parameterNamesLength() const +int QQmlScript::Object::DynamicSignal::parameterNamesLength() const { int rv = 0; for (int ii = 0; ii < parameterNames.count(); ++ii) @@ -210,12 +210,12 @@ int QDeclarativeScript::Object::DynamicSignal::parameterNamesLength() const return rv; } -QDeclarativeScript::Object::DynamicSlot::DynamicSlot() +QQmlScript::Object::DynamicSlot::DynamicSlot() : nextSlot(0) { } -int QDeclarativeScript::Object::DynamicSlot::parameterNamesLength() const +int QQmlScript::Object::DynamicSlot::parameterNamesLength() const { int rv = 0; for (int ii = 0; ii < parameterNames.count(); ++ii) @@ -223,70 +223,70 @@ int QDeclarativeScript::Object::DynamicSlot::parameterNamesLength() const return rv; } -QDeclarativeScript::Property::Property() +QQmlScript::Property::Property() : parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false), isValueTypeSubProperty(false), isAlias(false), isReadOnlyDeclaration(false), scriptStringScope(-1), nextMainProperty(0), nextProperty(0) { } -QDeclarativeScript::Object *QDeclarativeScript::Property::getValue(const LocationSpan &l) +QQmlScript::Object *QQmlScript::Property::getValue(const LocationSpan &l) { if (!value) { value = pool()->New<Object>(); value->location = l; } return value; } -void QDeclarativeScript::Property::addValue(Value *v) +void QQmlScript::Property::addValue(Value *v) { values.append(v); } -void QDeclarativeScript::Property::addOnValue(Value *v) +void QQmlScript::Property::addOnValue(Value *v) { onValues.append(v); } -bool QDeclarativeScript::Property::isEmpty() const +bool QQmlScript::Property::isEmpty() const { return !value && values.isEmpty() && onValues.isEmpty(); } -QDeclarativeScript::Value::Value() +QQmlScript::Value::Value() : type(Unknown), object(0), bindingReference(0), nextValue(0) { } -QDeclarativeScript::Variant::Variant() +QQmlScript::Variant::Variant() : t(Invalid) { } -QDeclarativeScript::Variant::Variant(const Variant &o) +QQmlScript::Variant::Variant(const Variant &o) : t(o.t), d(o.d), asWritten(o.asWritten) { } -QDeclarativeScript::Variant::Variant(bool v) +QQmlScript::Variant::Variant(bool v) : t(Boolean), b(v) { } -QDeclarativeScript::Variant::Variant(double v, const QStringRef &asWritten) +QQmlScript::Variant::Variant(double v, const QStringRef &asWritten) : t(Number), d(v), asWritten(asWritten) { } -QDeclarativeScript::Variant::Variant(QDeclarativeJS::AST::StringLiteral *v) +QQmlScript::Variant::Variant(QQmlJS::AST::StringLiteral *v) : t(String), l(v) { } -QDeclarativeScript::Variant::Variant(const QStringRef &asWritten, QDeclarativeJS::AST::Node *n) +QQmlScript::Variant::Variant(const QStringRef &asWritten, QQmlJS::AST::Node *n) : t(Script), n(n), asWritten(asWritten) { } -QDeclarativeScript::Variant &QDeclarativeScript::Variant::operator=(const Variant &o) +QQmlScript::Variant &QQmlScript::Variant::operator=(const Variant &o) { t = o.t; d = o.d; @@ -294,17 +294,17 @@ QDeclarativeScript::Variant &QDeclarativeScript::Variant::operator=(const Varian return *this; } -QDeclarativeScript::Variant::Type QDeclarativeScript::Variant::type() const +QQmlScript::Variant::Type QQmlScript::Variant::type() const { return t; } -bool QDeclarativeScript::Variant::asBoolean() const +bool QQmlScript::Variant::asBoolean() const { return b; } -QString QDeclarativeScript::Variant::asString() const +QString QQmlScript::Variant::asString() const { if (t == String) { return l->value.toString(); @@ -313,7 +313,7 @@ QString QDeclarativeScript::Variant::asString() const } } -double QDeclarativeScript::Variant::asNumber() const +double QQmlScript::Variant::asNumber() const { return d; } @@ -361,7 +361,7 @@ QString escapedString(const QString &string) return tmp; } -QString QDeclarativeScript::Variant::asScript() const +QString QQmlScript::Variant::asScript() const { switch(type()) { default: @@ -384,7 +384,7 @@ QString QDeclarativeScript::Variant::asScript() const } } -QDeclarativeJS::AST::Node *QDeclarativeScript::Variant::asAST() const +QQmlJS::AST::Node *QQmlScript::Variant::asAST() const { if (type() == Script) return n; @@ -392,7 +392,7 @@ QDeclarativeJS::AST::Node *QDeclarativeScript::Variant::asAST() const return 0; } -bool QDeclarativeScript::Variant::isStringList() const +bool QQmlScript::Variant::isStringList() const { if (isString()) return true; @@ -417,7 +417,7 @@ bool QDeclarativeScript::Variant::isStringList() const return true; } -QStringList QDeclarativeScript::Variant::asStringList() const +QStringList QQmlScript::Variant::asStringList() const { QStringList rv; if (isString()) { @@ -446,7 +446,7 @@ QStringList QDeclarativeScript::Variant::asStringList() const // // Actual parser classes // -void QDeclarativeScript::Import::extractVersion(int *maj, int *min) const +void QQmlScript::Import::extractVersion(int *maj, int *min) const { *maj = -1; *min = -1; @@ -468,16 +468,16 @@ class ProcessAST: protected AST::Visitor { struct State { State() : object(0), property(0) {} - State(QDeclarativeScript::Object *o) : object(o), property(0) {} - State(QDeclarativeScript::Object *o, Property *p) : object(o), property(p) {} + State(QQmlScript::Object *o) : object(o), property(0) {} + State(QQmlScript::Object *o, Property *p) : object(o), property(p) {} - QDeclarativeScript::Object *object; + QQmlScript::Object *object; Property *property; }; struct StateStack : public QStack<State> { - void pushObject(QDeclarativeScript::Object *obj) + void pushObject(QQmlScript::Object *obj) { push(State(obj)); } @@ -516,21 +516,21 @@ class ProcessAST: protected AST::Visitor }; public: - ProcessAST(QDeclarativeScript::Parser *parser); + ProcessAST(QQmlScript::Parser *parser); virtual ~ProcessAST(); void operator()(const QString &code, AST::Node *node); protected: - QDeclarativeScript::Object *defineObjectBinding(AST::UiQualifiedId *propertyName, bool onAssignment, + QQmlScript::Object *defineObjectBinding(AST::UiQualifiedId *propertyName, bool onAssignment, const QString &objectType, AST::SourceLocation typeLocation, LocationSpan location, AST::UiObjectInitializer *initializer = 0); - QDeclarativeScript::Variant getVariant(AST::Statement *stmt); - QDeclarativeScript::Variant getVariant(AST::ExpressionNode *expr); + QQmlScript::Variant getVariant(AST::Statement *stmt); + QQmlScript::Variant getVariant(AST::ExpressionNode *expr); LocationSpan location(AST::SourceLocation start, AST::SourceLocation end); LocationSpan location(AST::UiQualifiedId *); @@ -553,7 +553,7 @@ protected: QString asString(AST::UiQualifiedId *node) const; const State state() const; - QDeclarativeScript::Object *currentObject() const; + QQmlScript::Object *currentObject() const; Property *currentProperty() const; QString qualifiedNameId() const; @@ -607,13 +607,13 @@ protected: } private: - QDeclarativeScript::Parser *_parser; + QQmlScript::Parser *_parser; StateStack _stateStack; QStringList _scope; const QString *_contents; }; -ProcessAST::ProcessAST(QDeclarativeScript::Parser *parser) +ProcessAST::ProcessAST(QQmlScript::Parser *parser) : _parser(parser) { } @@ -641,7 +641,7 @@ const ProcessAST::State ProcessAST::state() const return _stateStack.back(); } -QDeclarativeScript::Object *ProcessAST::currentObject() const +QQmlScript::Object *ProcessAST::currentObject() const { return state().object; } @@ -670,7 +670,7 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const return s; } -QDeclarativeScript::Object * +QQmlScript::Object * ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, bool onAssignment, const QString &objectType, @@ -691,8 +691,8 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, } if (!onAssignment && propertyCount && currentProperty() && !currentProperty()->values.isEmpty()) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Property value set multiple times")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Property value set multiple times")); error.setLine(this->location(propertyName).start.line); error.setColumn(this->location(propertyName).start.column); _parser->_errors << error; @@ -707,7 +707,7 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, const QString qualifier(objectType.left(lastTypeDot)); for (int ii = 0; ii < _parser->_imports.count(); ++ii) { - const QDeclarativeScript::Import &import = _parser->_imports.at(ii); + const QQmlScript::Import &import = _parser->_imports.at(ii); if (import.qualifier == qualifier) { // The qualifier is a namespace - expect a type here namespaceLength = qualifier.length() + 1; @@ -717,8 +717,8 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, } if (propertyCount || !currentObject() || namespaceLength) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected type name")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Expected type name")); error.setLine(typeLocation.startLine); error.setColumn(typeLocation.startColumn + namespaceLength); _parser->_errors << error; @@ -742,9 +742,9 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, if (lastTypeDot >= 0) resolvableObjectType.replace(QLatin1Char('.'),QLatin1Char('/')); - QDeclarativeScript::Object *obj = _parser->_pool.New<QDeclarativeScript::Object>(); + QQmlScript::Object *obj = _parser->_pool.New<QQmlScript::Object>(); - QDeclarativeScript::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType); + QQmlScript::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType); obj->type = typeRef->id; typeRef->refObjects.append(obj); @@ -758,7 +758,7 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, if (propertyCount) { Property *prop = currentProperty(); - QDeclarativeScript::Value *v = _parser->_pool.New<QDeclarativeScript::Value>(); + QQmlScript::Value *v = _parser->_pool.New<QQmlScript::Value>(); v->object = obj; v->location = obj->location; if (onAssignment) @@ -775,7 +775,7 @@ ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName, _parser->setTree(obj); } else { const State state = _stateStack.top(); - QDeclarativeScript::Value *v = _parser->_pool.New<QDeclarativeScript::Value>(); + QQmlScript::Value *v = _parser->_pool.New<QQmlScript::Value>(); v->object = obj; v->location = obj->location; if (state.property) { @@ -829,18 +829,18 @@ bool ProcessAST::visit(AST::UiProgram *node) bool ProcessAST::visit(AST::UiImport *node) { QString uri; - QDeclarativeScript::Import import; + QQmlScript::Import import; if (!node->fileName.isNull()) { uri = node->fileName.toString(); if (uri.endsWith(QLatin1String(".js"))) { - import.type = QDeclarativeScript::Import::Script; + import.type = QQmlScript::Import::Script; } else { - import.type = QDeclarativeScript::Import::File; + import.type = QQmlScript::Import::File; } } else { - import.type = QDeclarativeScript::Import::Library; + import.type = QQmlScript::Import::Library; uri = asString(node->importUri); } @@ -851,16 +851,16 @@ bool ProcessAST::visit(AST::UiImport *node) if (!node->importId.isNull()) { import.qualifier = node->importId.toString(); if (!import.qualifier.at(0).isUpper()) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid import qualifier ID")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Invalid import qualifier ID")); error.setLine(node->importIdToken.startLine); error.setColumn(node->importIdToken.startColumn); _parser->_errors << error; return false; } if (import.qualifier == QLatin1String("Qt")) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Reserved name \"Qt\" cannot be used as an qualifier")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Reserved name \"Qt\" cannot be used as an qualifier")); error.setLine(node->importIdToken.startLine); error.setColumn(node->importIdToken.startColumn); _parser->_errors << error; @@ -868,14 +868,14 @@ bool ProcessAST::visit(AST::UiImport *node) } // Check for script qualifier clashes - bool isScript = import.type == QDeclarativeScript::Import::Script; + bool isScript = import.type == QQmlScript::Import::Script; for (int ii = 0; ii < _parser->_imports.count(); ++ii) { - const QDeclarativeScript::Import &other = _parser->_imports.at(ii); - bool otherIsScript = other.type == QDeclarativeScript::Import::Script; + const QQmlScript::Import &other = _parser->_imports.at(ii); + bool otherIsScript = other.type == QQmlScript::Import::Script; if ((isScript || otherIsScript) && import.qualifier == other.qualifier) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Script import qualifiers must be unique.")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Script import qualifiers must be unique.")); error.setLine(node->importIdToken.startLine); error.setColumn(node->importIdToken.startColumn); _parser->_errors << error; @@ -883,9 +883,9 @@ bool ProcessAST::visit(AST::UiImport *node) } } - } else if (import.type == QDeclarativeScript::Import::Script) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Script import requires a qualifier")); + } else if (import.type == QQmlScript::Import::Script) { + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Script import requires a qualifier")); error.setLine(node->fileNameToken.startLine); error.setColumn(node->fileNameToken.startColumn); _parser->_errors << error; @@ -894,9 +894,9 @@ bool ProcessAST::visit(AST::UiImport *node) if (node->versionToken.isValid()) { import.version = textAt(node->versionToken); - } else if (import.type == QDeclarativeScript::Import::Library) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Library import requires a version")); + } else if (import.type == QQmlScript::Import::Library) { + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Library import requires a version")); error.setLine(node->importIdToken.startLine); error.setColumn(node->importIdToken.startColumn); _parser->_errors << error; @@ -970,8 +970,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node) } if (!type) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected parameter type")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Expected parameter type")); error.setLine(node->typeToken.startLine); error.setColumn(node->typeToken.startColumn); _parser->_errors << error; @@ -1017,8 +1017,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node) QHashedString::compare(typeModifier.constData(), "list", strlen("list"))) { type = Object::DynamicProperty::CustomList; } else { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid property type modifier")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Invalid property type modifier")); error.setLine(node->typeModifierToken.startLine); error.setColumn(node->typeModifierToken.startColumn); _parser->_errors << error; @@ -1026,8 +1026,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node) } typeFound = true; } else if (!node->typeModifier.isNull()) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Unexpected property type modifier")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Unexpected property type modifier")); error.setLine(node->typeModifierToken.startLine); error.setColumn(node->typeModifierToken.startColumn); _parser->_errors << error; @@ -1035,8 +1035,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node) } if(!typeFound) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected property type")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Expected property type")); error.setLine(node->typeToken.startLine); error.setColumn(node->typeToken.startColumn); _parser->_errors << error; @@ -1050,7 +1050,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) property->nameLocation.line = node->identifierToken.startLine; property->nameLocation.column = node->identifierToken.startColumn; if (type >= Object::DynamicProperty::Custom) { - QDeclarativeScript::TypeReference *typeRef = + QQmlScript::TypeReference *typeRef = _parser->findOrCreateType(memberType.toString()); typeRef->refObjects.append(_stateStack.top().object); property->customType = memberType; @@ -1066,7 +1066,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) property->defaultValue->location = location(node->statement->firstSourceLocation(), node->statement->lastSourceLocation()); - QDeclarativeScript::Value *value = _parser->_pool.New<QDeclarativeScript::Value>(); + QQmlScript::Value *value = _parser->_pool.New<QQmlScript::Value>(); value->location = location(node->statement->firstSourceLocation(), node->statement->lastSourceLocation()); value->value = getVariant(node->statement); @@ -1114,37 +1114,37 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) return false; } -QDeclarativeScript::Variant ProcessAST::getVariant(AST::Statement *stmt) +QQmlScript::Variant ProcessAST::getVariant(AST::Statement *stmt) { if (stmt) { if (AST::ExpressionStatement *exprStmt = AST::cast<AST::ExpressionStatement *>(stmt)) return getVariant(exprStmt->expression); - return QDeclarativeScript::Variant(asStringRef(stmt), stmt); + return QQmlScript::Variant(asStringRef(stmt), stmt); } - return QDeclarativeScript::Variant(); + return QQmlScript::Variant(); } -QDeclarativeScript::Variant ProcessAST::getVariant(AST::ExpressionNode *expr) +QQmlScript::Variant ProcessAST::getVariant(AST::ExpressionNode *expr) { if (AST::StringLiteral *lit = AST::cast<AST::StringLiteral *>(expr)) { - return QDeclarativeScript::Variant(lit); + return QQmlScript::Variant(lit); } else if (expr->kind == AST::Node::Kind_TrueLiteral) { - return QDeclarativeScript::Variant(true); + return QQmlScript::Variant(true); } else if (expr->kind == AST::Node::Kind_FalseLiteral) { - return QDeclarativeScript::Variant(false); + return QQmlScript::Variant(false); } else if (AST::NumericLiteral *lit = AST::cast<AST::NumericLiteral *>(expr)) { - return QDeclarativeScript::Variant(lit->value, asStringRef(expr)); + return QQmlScript::Variant(lit->value, asStringRef(expr)); } else { if (AST::UnaryMinusExpression *unaryMinus = AST::cast<AST::UnaryMinusExpression *>(expr)) { if (AST::NumericLiteral *lit = AST::cast<AST::NumericLiteral *>(unaryMinus->expression)) { - return QDeclarativeScript::Variant(-lit->value, asStringRef(expr)); + return QQmlScript::Variant(-lit->value, asStringRef(expr)); } } - return QDeclarativeScript::Variant(asStringRef(expr), expr); + return QQmlScript::Variant(asStringRef(expr), expr); } } @@ -1163,25 +1163,25 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) Property *prop = currentProperty(); if (!prop->values.isEmpty()) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Property value set multiple times")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Property value set multiple times")); error.setLine(this->location(propertyName).start.line); error.setColumn(this->location(propertyName).start.column); _parser->_errors << error; return 0; } - QDeclarativeScript::Variant primitive; + QQmlScript::Variant primitive; if (AST::ExpressionStatement *stmt = AST::cast<AST::ExpressionStatement *>(node->statement)) { primitive = getVariant(stmt->expression); } else { // do binding - primitive = QDeclarativeScript::Variant(asStringRef(node->statement), node->statement); + primitive = QQmlScript::Variant(asStringRef(node->statement), node->statement); } prop->location.range.length = prop->location.range.offset + prop->location.range.length - node->qualifiedId->identifierToken.offset; prop->location.range.offset = node->qualifiedId->identifierToken.offset; - QDeclarativeScript::Value *v = _parser->_pool.New<QDeclarativeScript::Value>(); + QQmlScript::Value *v = _parser->_pool.New<QQmlScript::Value>(); v->value = primitive; v->location = location(node->statement->firstSourceLocation(), node->statement->lastSourceLocation()); @@ -1208,8 +1208,8 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) Property* prop = currentProperty(); if (!prop->values.isEmpty()) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Property value set multiple times")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","Property value set multiple times")); error.setLine(this->location(propertyName).start.line); error.setColumn(this->location(propertyName).start.column); _parser->_errors << error; @@ -1230,7 +1230,7 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) bool ProcessAST::visit(AST::UiSourceElement *node) { - QDeclarativeScript::Object *obj = currentObject(); + QQmlScript::Object *obj = currentObject(); if (AST::FunctionDeclaration *funDecl = AST::cast<AST::FunctionDeclaration *>(node->sourceElement)) { @@ -1252,8 +1252,8 @@ bool ProcessAST::visit(AST::UiSourceElement *node) obj->dynamicSlots.append(slot); } else { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","JavaScript declaration outside Script element")); + QQmlError error; + error.setDescription(QCoreApplication::translate("QQmlParser","JavaScript declaration outside Script element")); error.setLine(node->firstSourceLocation().startLine); error.setColumn(node->firstSourceLocation().startColumn); _parser->_errors << error; @@ -1264,18 +1264,18 @@ bool ProcessAST::visit(AST::UiSourceElement *node) } // end of anonymous namespace -QDeclarativeScript::Parser::Parser() +QQmlScript::Parser::Parser() : root(0), data(0) { } -QDeclarativeScript::Parser::~Parser() +QQmlScript::Parser::~Parser() { clear(); } -namespace QDeclarativeScript { +namespace QQmlScript { class ParserJsASTData { public: @@ -1287,7 +1287,7 @@ public: }; } -bool QDeclarativeScript::Parser::parse(const QByteArray &qmldata, const QUrl &url, +bool QQmlScript::Parser::parse(const QByteArray &qmldata, const QUrl &url, const QString &urlString) { clear(); @@ -1305,12 +1305,12 @@ bool QDeclarativeScript::Parser::parse(const QByteArray &qmldata, const QUrl &ur #endif QString *code = _pool.NewString(stream.readAll()); - data = new QDeclarativeScript::ParserJsASTData(_scriptFile); + data = new QQmlScript::ParserJsASTData(_scriptFile); Lexer lexer(&data->engine); lexer.setCode(*code, /*line = */ 1); - QDeclarativeJS::Parser parser(&data->engine); + QQmlJS::Parser parser(&data->engine); if (! parser.parse() || !_errors.isEmpty()) { @@ -1320,7 +1320,7 @@ bool QDeclarativeScript::Parser::parse(const QByteArray &qmldata, const QUrl &ur if (m.isWarning()) continue; - QDeclarativeError error; + QQmlError error; error.setUrl(url); error.setDescription(m.message); error.setLine(m.loc.startLine); @@ -1342,22 +1342,22 @@ bool QDeclarativeScript::Parser::parse(const QByteArray &qmldata, const QUrl &ur return _errors.isEmpty(); } -QList<QDeclarativeScript::TypeReference*> QDeclarativeScript::Parser::referencedTypes() const +QList<QQmlScript::TypeReference*> QQmlScript::Parser::referencedTypes() const { return _refTypes; } -QDeclarativeScript::Object *QDeclarativeScript::Parser::tree() const +QQmlScript::Object *QQmlScript::Parser::tree() const { return root; } -QList<QDeclarativeScript::Import> QDeclarativeScript::Parser::imports() const +QList<QQmlScript::Import> QQmlScript::Parser::imports() const { return _imports; } -QList<QDeclarativeError> QDeclarativeScript::Parser::errors() const +QList<QQmlError> QQmlScript::Parser::errors() const { return _errors; } @@ -1370,10 +1370,10 @@ static void replaceWithSpace(QString &str, int idx, int n) *data++ = space; } -static QDeclarativeScript::LocationSpan -locationFromLexer(const QDeclarativeJS::Lexer &lex, int startLine, int startColumn, int startOffset) +static QQmlScript::LocationSpan +locationFromLexer(const QQmlJS::Lexer &lex, int startLine, int startColumn, int startOffset) { - QDeclarativeScript::LocationSpan l; + QQmlScript::LocationSpan l; l.start.line = startLine; l.start.column = startColumn; l.end.line = lex.tokenEndLine(); l.end.column = lex.tokenEndColumn(); @@ -1388,20 +1388,20 @@ Searches for ".pragma <value>" declarations within \a script. Currently support are: library */ -QDeclarativeScript::Object::ScriptBlock::Pragmas QDeclarativeScript::Parser::extractPragmas(QString &script) +QQmlScript::Object::ScriptBlock::Pragmas QQmlScript::Parser::extractPragmas(QString &script) { - QDeclarativeScript::Object::ScriptBlock::Pragmas rv = QDeclarativeScript::Object::ScriptBlock::None; + QQmlScript::Object::ScriptBlock::Pragmas rv = QQmlScript::Object::ScriptBlock::None; const QString pragma(QLatin1String("pragma")); const QString library(QLatin1String("library")); - QDeclarativeJS::Lexer l(0); + QQmlJS::Lexer l(0); l.setCode(script, 0); int token = l.lex(); while (true) { - if (token != QDeclarativeJSGrammar::T_DOT) + if (token != QQmlJSGrammar::T_DOT) return rv; int startOffset = l.tokenOffset(); @@ -1409,14 +1409,14 @@ QDeclarativeScript::Object::ScriptBlock::Pragmas QDeclarativeScript::Parser::ext token = l.lex(); - if (token != QDeclarativeJSGrammar::T_IDENTIFIER || + if (token != QQmlJSGrammar::T_IDENTIFIER || l.tokenStartLine() != startLine || script.mid(l.tokenOffset(), l.tokenLength()) != pragma) return rv; token = l.lex(); - if (token != QDeclarativeJSGrammar::T_IDENTIFIER || + if (token != QQmlJSGrammar::T_IDENTIFIER || l.tokenStartLine() != startLine) return rv; @@ -1428,7 +1428,7 @@ QDeclarativeScript::Object::ScriptBlock::Pragmas QDeclarativeScript::Parser::ext return rv; if (pragmaValue == library) { - rv |= QDeclarativeScript::Object::ScriptBlock::Shared; + rv |= QQmlScript::Object::ScriptBlock::Shared; replaceWithSpace(script, startOffset, endOffset - startOffset); } else { return rv; @@ -1438,52 +1438,52 @@ QDeclarativeScript::Object::ScriptBlock::Pragmas QDeclarativeScript::Parser::ext } #define CHECK_LINE if (l.tokenStartLine() != startLine) return rv; -#define CHECK_TOKEN(t) if (token != QDeclarativeJSGrammar:: t) return rv; +#define CHECK_TOKEN(t) if (token != QQmlJSGrammar:: t) return rv; static const int uriTokens[] = { - QDeclarativeJSGrammar::T_IDENTIFIER, - QDeclarativeJSGrammar::T_PROPERTY, - QDeclarativeJSGrammar::T_SIGNAL, - QDeclarativeJSGrammar::T_READONLY, - QDeclarativeJSGrammar::T_ON, - QDeclarativeJSGrammar::T_BREAK, - QDeclarativeJSGrammar::T_CASE, - QDeclarativeJSGrammar::T_CATCH, - QDeclarativeJSGrammar::T_CONTINUE, - QDeclarativeJSGrammar::T_DEFAULT, - QDeclarativeJSGrammar::T_DELETE, - QDeclarativeJSGrammar::T_DO, - QDeclarativeJSGrammar::T_ELSE, - QDeclarativeJSGrammar::T_FALSE, - QDeclarativeJSGrammar::T_FINALLY, - QDeclarativeJSGrammar::T_FOR, - QDeclarativeJSGrammar::T_FUNCTION, - QDeclarativeJSGrammar::T_IF, - QDeclarativeJSGrammar::T_IN, - QDeclarativeJSGrammar::T_INSTANCEOF, - QDeclarativeJSGrammar::T_NEW, - QDeclarativeJSGrammar::T_NULL, - QDeclarativeJSGrammar::T_RETURN, - QDeclarativeJSGrammar::T_SWITCH, - QDeclarativeJSGrammar::T_THIS, - QDeclarativeJSGrammar::T_THROW, - QDeclarativeJSGrammar::T_TRUE, - QDeclarativeJSGrammar::T_TRY, - QDeclarativeJSGrammar::T_TYPEOF, - QDeclarativeJSGrammar::T_VAR, - QDeclarativeJSGrammar::T_VOID, - QDeclarativeJSGrammar::T_WHILE, - QDeclarativeJSGrammar::T_CONST, - QDeclarativeJSGrammar::T_DEBUGGER, - QDeclarativeJSGrammar::T_RESERVED_WORD, - QDeclarativeJSGrammar::T_WITH, - - QDeclarativeJSGrammar::EOF_SYMBOL + QQmlJSGrammar::T_IDENTIFIER, + QQmlJSGrammar::T_PROPERTY, + QQmlJSGrammar::T_SIGNAL, + QQmlJSGrammar::T_READONLY, + QQmlJSGrammar::T_ON, + QQmlJSGrammar::T_BREAK, + QQmlJSGrammar::T_CASE, + QQmlJSGrammar::T_CATCH, + QQmlJSGrammar::T_CONTINUE, + QQmlJSGrammar::T_DEFAULT, + QQmlJSGrammar::T_DELETE, + QQmlJSGrammar::T_DO, + QQmlJSGrammar::T_ELSE, + QQmlJSGrammar::T_FALSE, + QQmlJSGrammar::T_FINALLY, + QQmlJSGrammar::T_FOR, + QQmlJSGrammar::T_FUNCTION, + QQmlJSGrammar::T_IF, + QQmlJSGrammar::T_IN, + QQmlJSGrammar::T_INSTANCEOF, + QQmlJSGrammar::T_NEW, + QQmlJSGrammar::T_NULL, + QQmlJSGrammar::T_RETURN, + QQmlJSGrammar::T_SWITCH, + QQmlJSGrammar::T_THIS, + QQmlJSGrammar::T_THROW, + QQmlJSGrammar::T_TRUE, + QQmlJSGrammar::T_TRY, + QQmlJSGrammar::T_TYPEOF, + QQmlJSGrammar::T_VAR, + QQmlJSGrammar::T_VOID, + QQmlJSGrammar::T_WHILE, + QQmlJSGrammar::T_CONST, + QQmlJSGrammar::T_DEBUGGER, + QQmlJSGrammar::T_RESERVED_WORD, + QQmlJSGrammar::T_WITH, + + QQmlJSGrammar::EOF_SYMBOL }; static inline bool isUriToken(int token) { const int *current = uriTokens; - while (*current != QDeclarativeJSGrammar::EOF_SYMBOL) { + while (*current != QQmlJSGrammar::EOF_SYMBOL) { if (*current == token) return true; ++current; @@ -1491,23 +1491,23 @@ static inline bool isUriToken(int token) return false; } -QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extractMetaData(QString &script) +QQmlScript::Parser::JavaScriptMetaData QQmlScript::Parser::extractMetaData(QString &script) { JavaScriptMetaData rv; - QDeclarativeScript::Object::ScriptBlock::Pragmas &pragmas = rv.pragmas; + QQmlScript::Object::ScriptBlock::Pragmas &pragmas = rv.pragmas; const QString pragma(QLatin1String("pragma")); const QString js(QLatin1String(".js")); const QString library(QLatin1String("library")); - QDeclarativeJS::Lexer l(0); + QQmlJS::Lexer l(0); l.setCode(script, 0); int token = l.lex(); while (true) { - if (token != QDeclarativeJSGrammar::T_DOT) + if (token != QQmlJSGrammar::T_DOT) return rv; int startOffset = l.tokenOffset(); @@ -1518,7 +1518,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra CHECK_LINE; - if (token == QDeclarativeJSGrammar::T_IMPORT) { + if (token == QQmlJSGrammar::T_IMPORT) { // .import <URI> <Version> as <Identifier> // .import <file.js> as <Identifier> @@ -1527,7 +1527,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra CHECK_LINE; - if (token == QDeclarativeJSGrammar::T_STRING_LITERAL) { + if (token == QQmlJSGrammar::T_STRING_LITERAL) { QString file = l.tokenText(); @@ -1551,7 +1551,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra if (!importId.at(0).isUpper()) return rv; - QDeclarativeScript::LocationSpan location = + QQmlScript::LocationSpan location = locationFromLexer(l, startLine, startColumn, startOffset); token = l.lex(); @@ -1580,7 +1580,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra token = l.lex(); CHECK_LINE; - if (token != QDeclarativeJSGrammar::T_DOT) + if (token != QQmlJSGrammar::T_DOT) break; uri.append(QLatin1Char('.')); @@ -1609,7 +1609,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra if (!importId.at(0).isUpper()) return rv; - QDeclarativeScript::LocationSpan location = + QQmlScript::LocationSpan location = locationFromLexer(l, startLine, startColumn, startOffset); token = l.lex(); @@ -1628,7 +1628,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra rv.imports << import; } - } else if (token == QDeclarativeJSGrammar::T_IDENTIFIER && + } else if (token == QQmlJSGrammar::T_IDENTIFIER && script.mid(l.tokenOffset(), l.tokenLength()) == pragma) { token = l.lex(); @@ -1640,7 +1640,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra int endOffset = l.tokenLength() + l.tokenOffset(); if (pragmaValue == library) { - pragmas |= QDeclarativeScript::Object::ScriptBlock::Shared; + pragmas |= QQmlScript::Object::ScriptBlock::Shared; replaceWithSpace(script, startOffset, endOffset - startOffset); } else { return rv; @@ -1657,7 +1657,7 @@ QDeclarativeScript::Parser::JavaScriptMetaData QDeclarativeScript::Parser::extra return rv; } -void QDeclarativeScript::Parser::clear() +void QQmlScript::Parser::clear() { _imports.clear(); qDeleteAll(_refTypes); @@ -1672,7 +1672,7 @@ void QDeclarativeScript::Parser::clear() _pool.clear(); } -QDeclarativeScript::TypeReference *QDeclarativeScript::Parser::findOrCreateType(const QString &name) +QQmlScript::TypeReference *QQmlScript::Parser::findOrCreateType(const QString &name) { TypeReference *type = 0; int i = 0; @@ -1690,7 +1690,7 @@ QDeclarativeScript::TypeReference *QDeclarativeScript::Parser::findOrCreateType( return type; } -void QDeclarativeScript::Parser::setTree(QDeclarativeScript::Object *tree) +void QQmlScript::Parser::setTree(QQmlScript::Object *tree) { Q_ASSERT(! root); diff --git a/src/declarative/qml/qdeclarativescript_p.h b/src/qml/qml/qqmlscript_p.h index 86fc1c5bfd..ddf4c9a392 100644 --- a/src/declarative/qml/qdeclarativescript_p.h +++ b/src/qml/qml/qqmlscript_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -38,8 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QDECLARATIVESCRIPT_P_H -#define QDECLARATIVESCRIPT_P_H +#ifndef QQMLSCRIPT_P_H +#define QQMLSCRIPT_P_H // // W A R N I N G @@ -52,13 +52,13 @@ // We mean it. // -#include <QtDeclarative/qdeclarativeerror.h> +#include <QtQml/qqmlerror.h> #include <private/qfieldlist_p.h> #include <private/qhashfield_p.h> #include <private/qfastmetabuilder_p.h> -#include <private/qdeclarativepool_p.h> -#include <private/qdeclarativepropertycache_p.h> +#include <private/qqmlpool_p.h> +#include <private/qqmlpropertycache_p.h> #include <QtCore/QList> #include <QtCore/QUrl> @@ -69,11 +69,11 @@ QT_BEGIN_NAMESPACE class QByteArray; -class QDeclarativePropertyCache; -namespace QDeclarativeJS { namespace AST { class Node; class StringLiteral; } } -namespace QDeclarativeCompilerTypes { struct BindingReference; struct ComponentCompileState; } +class QQmlPropertyCache; +namespace QQmlJS { namespace AST { class Node; class StringLiteral; } } +namespace QQmlCompilerTypes { struct BindingReference; struct ComponentCompileState; } -namespace QDeclarativeScript { +namespace QQmlScript { struct Location { @@ -120,7 +120,7 @@ public: void extractVersion(int *maj, int *min) const; - QDeclarativeScript::LocationSpan location; + QQmlScript::LocationSpan location; }; class Object; @@ -133,13 +133,13 @@ public: // type as it has been referenced in Qml QString name; // objects in parse tree referencing the type - QList<QDeclarativeScript::Object*> refObjects; + QList<QQmlScript::Object*> refObjects; }; class Object; class Property; -class Q_DECLARATIVE_EXPORT Variant +class Q_QML_EXPORT Variant { public: enum Type { @@ -154,8 +154,8 @@ public: Variant(const Variant &); explicit Variant(bool); explicit Variant(double, const QStringRef &asWritten = QStringRef()); - explicit Variant(QDeclarativeJS::AST::StringLiteral *); - explicit Variant(const QStringRef &asWritten, QDeclarativeJS::AST::Node *); + explicit Variant(QQmlJS::AST::StringLiteral *); + explicit Variant(const QStringRef &asWritten, QQmlJS::AST::Node *); Variant &operator=(const Variant &); Type type() const; @@ -170,7 +170,7 @@ public: QString asString() const; double asNumber() const; QString asScript() const; - QDeclarativeJS::AST::Node *asAST() const; + QQmlJS::AST::Node *asAST() const; QStringList asStringList() const; private: @@ -178,13 +178,13 @@ private: union { bool b; double d; - QDeclarativeJS::AST::StringLiteral *l; - QDeclarativeJS::AST::Node *n; + QQmlJS::AST::StringLiteral *l; + QQmlJS::AST::Node *n; }; QStringRef asWritten; }; -class Value : public QDeclarativePool::POD +class Value : public QQmlPool::POD { public: Value(); @@ -196,9 +196,9 @@ public: Literal, // This is used as a property binding assignment PropertyBinding, - // This is used as a QDeclarativePropertyValueSource assignment + // This is used as a QQmlPropertyValueSource assignment ValueSource, - // This is used as a QDeclarativePropertyValueInterceptor assignment + // This is used as a QQmlPropertyValueInterceptor assignment ValueInterceptor, // This is used as a property QObject assignment CreatedObject, @@ -223,7 +223,7 @@ public: // Used by compiler union { - QDeclarativeCompilerTypes::BindingReference *bindingReference; + QQmlCompilerTypes::BindingReference *bindingReference; int signalExpressionContextStack; }; @@ -231,7 +231,7 @@ public: Value *nextValue; }; -class Property : public QDeclarativePool::POD +class Property : public QQmlPool::POD { public: Property(); @@ -251,7 +251,7 @@ public: // The core data in the case of a regular property. // XXX This has to be a value now as the synthCache may change during // compilation which invalidates pointers. We should fix this. - QDeclarativePropertyData core; + QQmlPropertyData core; // Returns true if this is an empty property - both value and values // are unset. @@ -273,12 +273,12 @@ public: // True if this property was accessed as the default property. bool isDefault; // True if the setting of this property will be deferred. Set by the - // QDeclarativeCompiler + // QQmlCompiler bool isDeferred; // True if this property is a value-type pseudo-property bool isValueTypeSubProperty; // True if this property is a property alias. Set by the - // QDeclarativeCompiler + // QQmlCompiler bool isAlias; // True if this is a readonly property declaration bool isReadOnlyDeclaration; @@ -300,22 +300,22 @@ private: QHashedStringRef _name; }; -class Object : public QDeclarativePool::Class +class Object : public QQmlPool::Class { public: Object(); virtual ~Object(); // Type of the object. The integer is an index into the - // QDeclarativeCompiledData::types array, or -1 if the object is a property + // QQmlCompiledData::types array, or -1 if the object is a property // group. int type; // The fully-qualified name of this type QString typeName; - // The id assigned to the object (if any). Set by the QDeclarativeCompiler + // The id assigned to the object (if any). Set by the QQmlCompiler QString id; - // The id index assigned to the object (if any). Set by the QDeclarativeCompiler + // The id index assigned to the object (if any). Set by the QQmlCompiler int idIndex; // Custom parsed data QByteArray custom; @@ -333,7 +333,7 @@ public: QAbstractDynamicMetaObject extObject; QByteArray metadata; // Generated by compiler QByteArray synthdata; // Generated by compiler - QDeclarativePropertyCache *synthCache; // Generated by compiler + QQmlPropertyCache *synthCache; // Generated by compiler Property *getDefaultProperty(); // name ptr must be guarenteed to remain valid @@ -377,14 +377,14 @@ public: Pragmas pragmas; }; - // The bytes to cast instances by to get to the QDeclarativeParserStatus + // The bytes to cast instances by to get to the QQmlParserStatus // interface. -1 indicates the type doesn't support this interface. - // Set by the QDeclarativeCompiler. + // Set by the QQmlCompiler. int parserStatusCast; LocationSpan location; - struct DynamicProperty : public QDeclarativePool::POD + struct DynamicProperty : public QQmlPool::POD { DynamicProperty(); @@ -398,7 +398,7 @@ public: QHashedStringRef customType; QHashedStringRef name; - QDeclarativeScript::Property *defaultValue; + QQmlScript::Property *defaultValue; LocationSpan location; Location nameLocation; @@ -412,13 +412,13 @@ public: QFastMetaBuilder::StringRef changedSignatureRef; }; - struct DynamicSignal : public QDeclarativePool::POD + struct DynamicSignal : public QQmlPool::POD { DynamicSignal(); QHashedStringRef name; - QDeclarativePool::List<QHashedCStringRef> parameterTypes; - QDeclarativePool::List<QHashedStringRef> parameterNames; + QQmlPool::List<QHashedCStringRef> parameterTypes; + QQmlPool::List<QHashedStringRef> parameterNames; int parameterTypesLength() const; int parameterNamesLength() const; @@ -432,7 +432,7 @@ public: LocationSpan location; }; - struct DynamicSlot : public QDeclarativePool::Class + struct DynamicSlot : public QQmlPool::Class { DynamicSlot(); @@ -462,7 +462,7 @@ public: DynamicSlotList dynamicSlots; // Used by compiler - QDeclarativeCompilerTypes::ComponentCompileState *componentCompileState; + QQmlCompilerTypes::ComponentCompileState *componentCompileState; // Used by ComponentCompileState::AliasingObjectsList Object *nextAliasingObject; @@ -482,38 +482,38 @@ public: QList<TypeReference*> referencedTypes() const; - QDeclarativeScript::Object *tree() const; + QQmlScript::Object *tree() const; QList<Import> imports() const; void clear(); - QList<QDeclarativeError> errors() const; + QList<QQmlError> errors() const; class JavaScriptMetaData { public: JavaScriptMetaData() - : pragmas(QDeclarativeScript::Object::ScriptBlock::None) {} + : pragmas(QQmlScript::Object::ScriptBlock::None) {} - QDeclarativeScript::Object::ScriptBlock::Pragmas pragmas; + QQmlScript::Object::ScriptBlock::Pragmas pragmas; QList<Import> imports; }; - static QDeclarativeScript::Object::ScriptBlock::Pragmas extractPragmas(QString &); + static QQmlScript::Object::ScriptBlock::Pragmas extractPragmas(QString &); static JavaScriptMetaData extractMetaData(QString &); // ### private: TypeReference *findOrCreateType(const QString &name); - void setTree(QDeclarativeScript::Object *tree); + void setTree(QQmlScript::Object *tree); void setScriptFile(const QString &filename) {_scriptFile = filename; } QString scriptFile() const { return _scriptFile; } // ### private: - QList<QDeclarativeError> _errors; + QList<QQmlError> _errors; - QDeclarativePool _pool; - QDeclarativeScript::Object *root; + QQmlPool _pool; + QQmlScript::Object *root; QList<Import> _imports; QList<TypeReference*> _refTypes; QString _scriptFile; @@ -522,12 +522,12 @@ public: } -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeScript::Object::ScriptBlock::Pragmas); +Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlScript::Object::ScriptBlock::Pragmas); QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeScript::Variant) +Q_DECLARE_METATYPE(QQmlScript::Variant) QT_END_HEADER -#endif // QDECLARATIVESCRIPT_P_H +#endif // QQMLSCRIPT_P_H diff --git a/src/declarative/qml/qdeclarativescriptstring.cpp b/src/qml/qml/qqmlscriptstring.cpp index b409908902..ed7a6affa1 100644 --- a/src/declarative/qml/qdeclarativescriptstring.cpp +++ b/src/qml/qml/qqmlscriptstring.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativescriptstring.h" -#include "qdeclarativescriptstring_p.h" +#include "qqmlscriptstring.h" +#include "qqmlscriptstring_p.h" QT_BEGIN_NAMESPACE /*! -\class QDeclarativeScriptString +\class QQmlScriptString \since 4.7 -\brief The QDeclarativeScriptString class encapsulates a script and its context. +\brief The QQmlScriptString class encapsulates a script and its context. -QDeclarativeScriptString is used to create QObject properties that accept a script "assignment" from QML. +QQmlScriptString is used to create QObject properties that accept a script "assignment" from QML. Normally, the following QML would result in a binding being established for the \c script property; i.e. \c script would be assigned the value obtained from running \c {myObj.value = Math.max(myValue, 100)} @@ -60,31 +60,31 @@ MyType { } \endqml -If instead the property had a type of QDeclarativeScriptString, +If instead the property had a type of QQmlScriptString, the script itself -- \e {myObj.value = Math.max(myValue, 100)} -- would be passed to the \c script property and the class could choose how to handle it. Typically, the class will evaluate -the script at some later time using a QDeclarativeExpression. +the script at some later time using a QQmlExpression. \code -QDeclarativeExpression expr(scriptString); +QQmlExpression expr(scriptString); expr.evaluate(); \endcode -\sa QDeclarativeExpression +\sa QQmlExpression */ /*! Constructs an empty instance. */ -QDeclarativeScriptString::QDeclarativeScriptString() -: d(new QDeclarativeScriptStringPrivate) +QQmlScriptString::QQmlScriptString() +: d(new QQmlScriptStringPrivate) { } /*! Copies \a other. */ -QDeclarativeScriptString::QDeclarativeScriptString(const QDeclarativeScriptString &other) +QQmlScriptString::QQmlScriptString(const QQmlScriptString &other) : d(other.d) { } @@ -92,14 +92,14 @@ QDeclarativeScriptString::QDeclarativeScriptString(const QDeclarativeScriptStrin /*! \internal */ -QDeclarativeScriptString::~QDeclarativeScriptString() +QQmlScriptString::~QQmlScriptString() { } /*! Assigns \a other to this. */ -QDeclarativeScriptString &QDeclarativeScriptString::operator=(const QDeclarativeScriptString &other) +QQmlScriptString &QQmlScriptString::operator=(const QQmlScriptString &other) { d = other.d; return *this; @@ -108,7 +108,7 @@ QDeclarativeScriptString &QDeclarativeScriptString::operator=(const QDeclarative /*! Returns the context for the script. */ -QDeclarativeContext *QDeclarativeScriptString::context() const +QQmlContext *QQmlScriptString::context() const { return d->context; } @@ -116,7 +116,7 @@ QDeclarativeContext *QDeclarativeScriptString::context() const /*! Sets the \a context for the script. */ -void QDeclarativeScriptString::setContext(QDeclarativeContext *context) +void QQmlScriptString::setContext(QQmlContext *context) { d->context = context; } @@ -124,7 +124,7 @@ void QDeclarativeScriptString::setContext(QDeclarativeContext *context) /*! Returns the scope object for the script. */ -QObject *QDeclarativeScriptString::scopeObject() const +QObject *QQmlScriptString::scopeObject() const { return d->scope; } @@ -132,7 +132,7 @@ QObject *QDeclarativeScriptString::scopeObject() const /*! Sets the scope \a object for the script. */ -void QDeclarativeScriptString::setScopeObject(QObject *object) +void QQmlScriptString::setScopeObject(QObject *object) { d->scope = object; } @@ -140,7 +140,7 @@ void QDeclarativeScriptString::setScopeObject(QObject *object) /*! Returns the script text. */ -QString QDeclarativeScriptString::script() const +QString QQmlScriptString::script() const { return d->script; } @@ -148,7 +148,7 @@ QString QDeclarativeScriptString::script() const /*! Sets the \a script text. */ -void QDeclarativeScriptString::setScript(const QString &script) +void QQmlScriptString::setScript(const QString &script) { d->script = script; } diff --git a/src/declarative/qml/qdeclarativescriptstring.h b/src/qml/qml/qqmlscriptstring.h index 86357c8cb4..15db9088f7 100644 --- a/src/declarative/qml/qdeclarativescriptstring.h +++ b/src/qml/qml/qqmlscriptstring.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESCRIPTSTRING_H -#define QDECLARATIVESCRIPTSTRING_H +#ifndef QQMLSCRIPTSTRING_H +#define QQMLSCRIPTSTRING_H +#include <QtQml/qtqmlglobal.h> #include <QtCore/qstring.h> #include <QtCore/qshareddata.h> #include <QtCore/qmetatype.h> @@ -52,19 +53,19 @@ QT_BEGIN_NAMESPACE class QObject; -class QDeclarativeContext; -class QDeclarativeScriptStringPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeScriptString +class QQmlContext; +class QQmlScriptStringPrivate; +class Q_QML_EXPORT QQmlScriptString { public: - QDeclarativeScriptString(); - QDeclarativeScriptString(const QDeclarativeScriptString &); - ~QDeclarativeScriptString(); + QQmlScriptString(); + QQmlScriptString(const QQmlScriptString &); + ~QQmlScriptString(); - QDeclarativeScriptString &operator=(const QDeclarativeScriptString &); + QQmlScriptString &operator=(const QQmlScriptString &); - QDeclarativeContext *context() const; - void setContext(QDeclarativeContext *); + QQmlContext *context() const; + void setContext(QQmlContext *); QObject *scopeObject() const; void setScopeObject(QObject *); @@ -73,17 +74,17 @@ public: void setScript(const QString &); private: - QSharedDataPointer<QDeclarativeScriptStringPrivate> d; + QSharedDataPointer<QQmlScriptStringPrivate> d; - friend class QDeclarativeVME; - friend class QDeclarativeExpression; + friend class QQmlVME; + friend class QQmlExpression; }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeScriptString) +Q_DECLARE_METATYPE(QQmlScriptString) QT_END_HEADER -#endif // QDECLARATIVESCRIPTSTRING_H +#endif // QQMLSCRIPTSTRING_H diff --git a/src/declarative/qml/qdeclarativescriptstring_p.h b/src/qml/qml/qqmlscriptstring_p.h index 5f8c1e6c10..15786c7aae 100644 --- a/src/declarative/qml/qdeclarativescriptstring_p.h +++ b/src/qml/qml/qqmlscriptstring_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,19 +39,19 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESCRIPTSTRING_P_H -#define QDECLARATIVESCRIPTSTRING_P_H +#ifndef QQMLSCRIPTSTRING_P_H +#define QQMLSCRIPTSTRING_P_H -#include <QtDeclarative/qdeclarativecontext.h> +#include <QtQml/qqmlcontext.h> QT_BEGIN_NAMESPACE -class QDeclarativeScriptStringPrivate : public QSharedData +class QQmlScriptStringPrivate : public QSharedData { public: - QDeclarativeScriptStringPrivate() : context(0), scope(0), bindingId(-1), lineNumber(-1), columnNumber(-1) {} + QQmlScriptStringPrivate() : context(0), scope(0), bindingId(-1), lineNumber(-1), columnNumber(-1) {} - QDeclarativeContext *context; + QQmlContext *context; QObject *scope; QString script; int bindingId; @@ -61,4 +61,4 @@ public: QT_END_NAMESPACE -#endif // QDECLARATIVESCRIPTSTRING_P_H +#endif // QQMLSCRIPTSTRING_P_H diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/qml/qml/qqmlstringconverters.cpp index ce35a63727..2c7f6c9f6e 100644 --- a/src/declarative/qml/qdeclarativestringconverters.cpp +++ b/src/qml/qml/qqmlstringconverters.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativestringconverters_p.h" +#include "qqmlstringconverters_p.h" #include <QtGui/qcolor.h> #include <QtGui/qvector3d.h> @@ -79,7 +79,7 @@ static uchar fromHex(const QString &s, int idx) return fromHex(c, c2); } -QVariant QDeclarativeStringConverters::variantFromString(const QString &s) +QVariant QQmlStringConverters::variantFromString(const QString &s) { if (s.isEmpty()) return QVariant(s); @@ -100,7 +100,7 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s) return QVariant(s); } -QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int preferredType, bool *ok) +QVariant QQmlStringConverters::variantFromString(const QString &s, int preferredType, bool *ok) { switch (preferredType) { case QMetaType::Int: @@ -139,7 +139,7 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int p } } -QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok) +QColor QQmlStringConverters::colorFromString(const QString &s, bool *ok) { if (s.length() == 9 && s.startsWith(QLatin1Char('#'))) { uchar a = fromHex(s, 1); @@ -156,21 +156,21 @@ QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok) } #ifndef QT_NO_DATESTRING -QDate QDeclarativeStringConverters::dateFromString(const QString &s, bool *ok) +QDate QQmlStringConverters::dateFromString(const QString &s, bool *ok) { QDate d = QDate::fromString(s, Qt::ISODate); if (ok) *ok = d.isValid(); return d; } -QTime QDeclarativeStringConverters::timeFromString(const QString &s, bool *ok) +QTime QQmlStringConverters::timeFromString(const QString &s, bool *ok) { QTime t = QTime::fromString(s, Qt::ISODate); if (ok) *ok = t.isValid(); return t; } -QDateTime QDeclarativeStringConverters::dateTimeFromString(const QString &s, bool *ok) +QDateTime QQmlStringConverters::dateTimeFromString(const QString &s, bool *ok) { QDateTime d = QDateTime::fromString(s, Qt::ISODate); if (ok) *ok = d.isValid(); @@ -179,7 +179,7 @@ QDateTime QDeclarativeStringConverters::dateTimeFromString(const QString &s, boo #endif // QT_NO_DATESTRING //expects input of "x,y" -QPointF QDeclarativeStringConverters::pointFFromString(const QString &s, bool *ok) +QPointF QQmlStringConverters::pointFFromString(const QString &s, bool *ok) { if (s.count(QLatin1Char(',')) != 1) { if (ok) @@ -203,7 +203,7 @@ QPointF QDeclarativeStringConverters::pointFFromString(const QString &s, bool *o } //expects input of "widthxheight" -QSizeF QDeclarativeStringConverters::sizeFFromString(const QString &s, bool *ok) +QSizeF QQmlStringConverters::sizeFFromString(const QString &s, bool *ok) { if (s.count(QLatin1Char('x')) != 1) { if (ok) @@ -227,7 +227,7 @@ QSizeF QDeclarativeStringConverters::sizeFFromString(const QString &s, bool *ok) } //expects input of "x,y,widthxheight" //### use space instead of second comma? -QRectF QDeclarativeStringConverters::rectFFromString(const QString &s, bool *ok) +QRectF QQmlStringConverters::rectFFromString(const QString &s, bool *ok) { if (s.count(QLatin1Char(',')) != 2 || s.count(QLatin1Char('x')) != 1) { if (ok) @@ -255,7 +255,7 @@ QRectF QDeclarativeStringConverters::rectFFromString(const QString &s, bool *ok) } //expects input of "x,y,z" -QVector3D QDeclarativeStringConverters::vector3DFromString(const QString &s, bool *ok) +QVector3D QQmlStringConverters::vector3DFromString(const QString &s, bool *ok) { if (s.count(QLatin1Char(',')) != 2) { if (ok) @@ -281,7 +281,7 @@ QVector3D QDeclarativeStringConverters::vector3DFromString(const QString &s, boo } //expects input of "x,y,z,w" -QVector4D QDeclarativeStringConverters::vector4DFromString(const QString &s, bool *ok) +QVector4D QQmlStringConverters::vector4DFromString(const QString &s, bool *ok) { if (s.count(QLatin1Char(',')) != 3) { if (ok) diff --git a/src/declarative/qml/qdeclarativestringconverters_p.h b/src/qml/qml/qqmlstringconverters_p.h index c9a83b6be8..8f6fb2485d 100644 --- a/src/declarative/qml/qdeclarativestringconverters_p.h +++ b/src/qml/qml/qqmlstringconverters_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESTRINGCONVERTERS_P_H -#define QDECLARATIVESTRINGCONVERTERS_P_H +#ifndef QQMLSTRINGCONVERTERS_P_H +#define QQMLSTRINGCONVERTERS_P_H // // W A R N I N G @@ -56,7 +56,7 @@ #include <QtCore/qglobal.h> #include <QtCore/qvariant.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qtqmlglobal_p.h> QT_BEGIN_NAMESPACE @@ -70,24 +70,24 @@ class QVector3D; class QVector4D; // XXX - Bauhaus currently uses these methods which is why they're exported -namespace QDeclarativeStringConverters +namespace QQmlStringConverters { - QVariant Q_DECLARATIVE_PRIVATE_EXPORT variantFromString(const QString &); - QVariant Q_DECLARATIVE_PRIVATE_EXPORT variantFromString(const QString &, int preferredType, bool *ok = 0); + QVariant Q_QML_PRIVATE_EXPORT variantFromString(const QString &); + QVariant Q_QML_PRIVATE_EXPORT variantFromString(const QString &, int preferredType, bool *ok = 0); - QColor Q_DECLARATIVE_PRIVATE_EXPORT colorFromString(const QString &, bool *ok = 0); + QColor Q_QML_PRIVATE_EXPORT colorFromString(const QString &, bool *ok = 0); #ifndef QT_NO_DATESTRING - QDate Q_DECLARATIVE_PRIVATE_EXPORT dateFromString(const QString &, bool *ok = 0); - QTime Q_DECLARATIVE_PRIVATE_EXPORT timeFromString(const QString &, bool *ok = 0); - QDateTime Q_DECLARATIVE_PRIVATE_EXPORT dateTimeFromString(const QString &, bool *ok = 0); + QDate Q_QML_PRIVATE_EXPORT dateFromString(const QString &, bool *ok = 0); + QTime Q_QML_PRIVATE_EXPORT timeFromString(const QString &, bool *ok = 0); + QDateTime Q_QML_PRIVATE_EXPORT dateTimeFromString(const QString &, bool *ok = 0); #endif - QPointF Q_DECLARATIVE_PRIVATE_EXPORT pointFFromString(const QString &, bool *ok = 0); - QSizeF Q_DECLARATIVE_PRIVATE_EXPORT sizeFFromString(const QString &, bool *ok = 0); - QRectF Q_DECLARATIVE_PRIVATE_EXPORT rectFFromString(const QString &, bool *ok = 0); - QVector3D Q_DECLARATIVE_PRIVATE_EXPORT vector3DFromString(const QString &, bool *ok = 0); - QVector4D Q_DECLARATIVE_PRIVATE_EXPORT vector4DFromString(const QString &, bool *ok = 0); + QPointF Q_QML_PRIVATE_EXPORT pointFFromString(const QString &, bool *ok = 0); + QSizeF Q_QML_PRIVATE_EXPORT sizeFFromString(const QString &, bool *ok = 0); + QRectF Q_QML_PRIVATE_EXPORT rectFFromString(const QString &, bool *ok = 0); + QVector3D Q_QML_PRIVATE_EXPORT vector3DFromString(const QString &, bool *ok = 0); + QVector4D Q_QML_PRIVATE_EXPORT vector4DFromString(const QString &, bool *ok = 0); } QT_END_NAMESPACE -#endif // QDECLARATIVESTRINGCONVERTERS_P_H +#endif // QQMLSTRINGCONVERTERS_P_H diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 0524d5d661..cde2885f0c 100644 --- a/src/declarative/qml/qdeclarativetypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#include "qdeclarativetypeloader_p.h" +#include "qqmltypeloader_p.h" -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativethread_p.h> -#include <private/qdeclarativecompiler_p.h> -#include <private/qdeclarativecomponent_p.h> -#include <private/qdeclarativeprofilerservice_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlthread_p.h> +#include <private/qqmlcompiler_p.h> +#include <private/qqmlcomponent_p.h> +#include <private/qqmlprofilerservice_p.h> #include <QtCore/qdir.h> #include <QtCore/qfile.h> @@ -55,8 +55,8 @@ #include <QtCore/qthread.h> #include <QtCore/qdiriterator.h> #include <QtCore/qwaitcondition.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeextensioninterface.h> +#include <QtQml/qqmlcomponent.h> +#include <QtQml/qqmlextensioninterface.h> #if defined (Q_OS_UNIX) #include <sys/types.h> @@ -67,9 +67,9 @@ #ifdef DATABLOB_DEBUG -#define ASSERT_MAINTHREAD() do { if(m_thread->isThisThread()) qFatal("QDeclarativeDataLoader: Caller not in main thread"); } while(false) -#define ASSERT_LOADTHREAD() do { if(!m_thread->isThisThread()) qFatal("QDeclarativeDataLoader: Caller not in load thread"); } while(false) -#define ASSERT_CALLBACK() do { if(!m_manager || !m_manager->m_thread->isThisThread()) qFatal("QDeclarativeDataBlob: An API call was made outside a callback"); } while(false) +#define ASSERT_MAINTHREAD() do { if(m_thread->isThisThread()) qFatal("QQmlDataLoader: Caller not in main thread"); } while(false) +#define ASSERT_LOADTHREAD() do { if(!m_thread->isThisThread()) qFatal("QQmlDataLoader: Caller not in load thread"); } while(false) +#define ASSERT_CALLBACK() do { if(!m_manager || !m_manager->m_thread->isThisThread()) qFatal("QQmlDataBlob: An API call was made outside a callback"); } while(false) #else @@ -83,62 +83,62 @@ QT_BEGIN_NAMESPACE // This is a lame object that we need to ensure that slots connected to // QNetworkReply get called in the correct thread (the loader thread). -// As QDeclarativeDataLoader lives in the main thread, and we can't use +// As QQmlDataLoader lives in the main thread, and we can't use // Qt::DirectConnection connections from a QNetworkReply (because then // sender() wont work), we need to insert this object in the middle. -class QDeclarativeDataLoaderNetworkReplyProxy : public QObject +class QQmlDataLoaderNetworkReplyProxy : public QObject { Q_OBJECT public: - QDeclarativeDataLoaderNetworkReplyProxy(QDeclarativeDataLoader *l); + QQmlDataLoaderNetworkReplyProxy(QQmlDataLoader *l); public slots: void finished(); void downloadProgress(qint64, qint64); private: - QDeclarativeDataLoader *l; + QQmlDataLoader *l; }; -class QDeclarativeDataLoaderThread : public QDeclarativeThread +class QQmlDataLoaderThread : public QQmlThread { - typedef QDeclarativeDataLoaderThread This; + typedef QQmlDataLoaderThread This; public: - QDeclarativeDataLoaderThread(QDeclarativeDataLoader *loader); + QQmlDataLoaderThread(QQmlDataLoader *loader); QNetworkAccessManager *networkAccessManager() const; - QDeclarativeDataLoaderNetworkReplyProxy *networkReplyProxy() const; + QQmlDataLoaderNetworkReplyProxy *networkReplyProxy() const; - void load(QDeclarativeDataBlob *b); - void loadAsync(QDeclarativeDataBlob *b); - void loadWithStaticData(QDeclarativeDataBlob *b, const QByteArray &); - void loadWithStaticDataAsync(QDeclarativeDataBlob *b, const QByteArray &); - void callCompleted(QDeclarativeDataBlob *b); - void callDownloadProgressChanged(QDeclarativeDataBlob *b, qreal p); - void initializeEngine(QDeclarativeExtensionInterface *, const char *); + void load(QQmlDataBlob *b); + void loadAsync(QQmlDataBlob *b); + void loadWithStaticData(QQmlDataBlob *b, const QByteArray &); + void loadWithStaticDataAsync(QQmlDataBlob *b, const QByteArray &); + void callCompleted(QQmlDataBlob *b); + void callDownloadProgressChanged(QQmlDataBlob *b, qreal p); + void initializeEngine(QQmlExtensionInterface *, const char *); protected: virtual void shutdownThread(); private: - void loadThread(QDeclarativeDataBlob *b); - void loadWithStaticDataThread(QDeclarativeDataBlob *b, const QByteArray &); - void callCompletedMain(QDeclarativeDataBlob *b); - void callDownloadProgressChangedMain(QDeclarativeDataBlob *b, qreal p); - void initializeEngineMain(QDeclarativeExtensionInterface *iface, const char *uri); + void loadThread(QQmlDataBlob *b); + void loadWithStaticDataThread(QQmlDataBlob *b, const QByteArray &); + void callCompletedMain(QQmlDataBlob *b); + void callDownloadProgressChangedMain(QQmlDataBlob *b, qreal p); + void initializeEngineMain(QQmlExtensionInterface *iface, const char *uri); - QDeclarativeDataLoader *m_loader; + QQmlDataLoader *m_loader; mutable QNetworkAccessManager *m_networkAccessManager; - mutable QDeclarativeDataLoaderNetworkReplyProxy *m_networkReplyProxy; + mutable QQmlDataLoaderNetworkReplyProxy *m_networkReplyProxy; }; -QDeclarativeDataLoaderNetworkReplyProxy::QDeclarativeDataLoaderNetworkReplyProxy(QDeclarativeDataLoader *l) +QQmlDataLoaderNetworkReplyProxy::QQmlDataLoaderNetworkReplyProxy(QQmlDataLoader *l) : l(l) { } -void QDeclarativeDataLoaderNetworkReplyProxy::finished() +void QQmlDataLoaderNetworkReplyProxy::finished() { Q_ASSERT(sender()); Q_ASSERT(qobject_cast<QNetworkReply *>(sender())); @@ -146,7 +146,7 @@ void QDeclarativeDataLoaderNetworkReplyProxy::finished() l->networkReplyFinished(reply); } -void QDeclarativeDataLoaderNetworkReplyProxy::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) +void QQmlDataLoaderNetworkReplyProxy::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { Q_ASSERT(sender()); Q_ASSERT(qobject_cast<QNetworkReply *>(sender())); @@ -233,26 +233,26 @@ static QStringHash<bool> *qmlFilesInDirectory(const QString &path) /*! -\class QDeclarativeDataBlob -\brief The QDeclarativeDataBlob encapsulates a data request that can be issued to a QDeclarativeDataLoader. +\class QQmlDataBlob +\brief The QQmlDataBlob encapsulates a data request that can be issued to a QQmlDataLoader. \internal -QDeclarativeDataBlob's are loaded by a QDeclarativeDataLoader. The user creates the QDeclarativeDataBlob -and then calls QDeclarativeDataLoader::load() or QDeclarativeDataLoader::loadWithStaticData() to load it. -The QDeclarativeDataLoader invokes callbacks on the QDeclarativeDataBlob as data becomes available. +QQmlDataBlob's are loaded by a QQmlDataLoader. The user creates the QQmlDataBlob +and then calls QQmlDataLoader::load() or QQmlDataLoader::loadWithStaticData() to load it. +The QQmlDataLoader invokes callbacks on the QQmlDataBlob as data becomes available. */ /*! -\enum QDeclarativeDataBlob::Status +\enum QQmlDataBlob::Status This enum describes the status of the data blob. \list -\o Null The blob has not yet been loaded by a QDeclarativeDataLoader -\o Loading The blob is loading network data. The QDeclarativeDataBlob::setData() callback has not yet been +\o Null The blob has not yet been loaded by a QQmlDataLoader +\o Loading The blob is loading network data. The QQmlDataBlob::setData() callback has not yet been invoked or has not yet returned. \o WaitingForDependencies The blob is waiting for dependencies to be done before continueing. This status -only occurs after the QDeclarativeDataBlob::setData() callback has been made, and when the blob has outstanding +only occurs after the QQmlDataBlob::setData() callback has been made, and when the blob has outstanding dependencies. \o Complete The blob's data has been loaded and all dependencies are done. \o Error An error has been set on this blob. @@ -260,28 +260,28 @@ dependencies. */ /*! -\enum QDeclarativeDataBlob::Type +\enum QQmlDataBlob::Type This enum describes the type of the data blob. \list -\o QmlFile This is a QDeclarativeTypeData -\o JavaScriptFile This is a QDeclarativeScriptData -\o QmldirFile This is a QDeclarativeQmldirData +\o QmlFile This is a QQmlTypeData +\o JavaScriptFile This is a QQmlScriptData +\o QmldirFile This is a QQmlQmldirData \endlist */ /*! -Create a new QDeclarativeDataBlob for \a url and of the provided \a type. +Create a new QQmlDataBlob for \a url and of the provided \a type. */ -QDeclarativeDataBlob::QDeclarativeDataBlob(const QUrl &url, Type type) +QQmlDataBlob::QQmlDataBlob(const QUrl &url, Type type) : m_type(type), m_url(url), m_finalUrl(url), m_manager(0), m_redirectCount(0), m_inCallback(false), m_isDone(false) { } /*! \internal */ -QDeclarativeDataBlob::~QDeclarativeDataBlob() +QQmlDataBlob::~QQmlDataBlob() { Q_ASSERT(m_waitingOnMe.isEmpty()); @@ -291,7 +291,7 @@ QDeclarativeDataBlob::~QDeclarativeDataBlob() /*! Returns the type provided to the constructor. */ -QDeclarativeDataBlob::Type QDeclarativeDataBlob::type() const +QQmlDataBlob::Type QQmlDataBlob::type() const { return m_type; } @@ -299,7 +299,7 @@ QDeclarativeDataBlob::Type QDeclarativeDataBlob::type() const /*! Returns the blob's status. */ -QDeclarativeDataBlob::Status QDeclarativeDataBlob::status() const +QQmlDataBlob::Status QQmlDataBlob::status() const { return m_data.status(); } @@ -307,7 +307,7 @@ QDeclarativeDataBlob::Status QDeclarativeDataBlob::status() const /*! Returns true if the status is Null. */ -bool QDeclarativeDataBlob::isNull() const +bool QQmlDataBlob::isNull() const { return status() == Null; } @@ -315,7 +315,7 @@ bool QDeclarativeDataBlob::isNull() const /*! Returns true if the status is Loading. */ -bool QDeclarativeDataBlob::isLoading() const +bool QQmlDataBlob::isLoading() const { return status() == Loading; } @@ -323,7 +323,7 @@ bool QDeclarativeDataBlob::isLoading() const /*! Returns true if the status is WaitingForDependencies. */ -bool QDeclarativeDataBlob::isWaiting() const +bool QQmlDataBlob::isWaiting() const { return status() == WaitingForDependencies; } @@ -331,7 +331,7 @@ bool QDeclarativeDataBlob::isWaiting() const /*! Returns true if the status is Complete. */ -bool QDeclarativeDataBlob::isComplete() const +bool QQmlDataBlob::isComplete() const { return status() == Complete; } @@ -339,7 +339,7 @@ bool QDeclarativeDataBlob::isComplete() const /*! Returns true if the status is Error. */ -bool QDeclarativeDataBlob::isError() const +bool QQmlDataBlob::isError() const { return status() == Error; } @@ -347,7 +347,7 @@ bool QDeclarativeDataBlob::isError() const /*! Returns true if the status is Complete or Error. */ -bool QDeclarativeDataBlob::isCompleteOrError() const +bool QQmlDataBlob::isCompleteOrError() const { Status s = status(); return s == Error || s == Complete; @@ -356,7 +356,7 @@ bool QDeclarativeDataBlob::isCompleteOrError() const /*! Returns the data download progress from 0 to 1. */ -qreal QDeclarativeDataBlob::progress() const +qreal QQmlDataBlob::progress() const { quint8 p = m_data.progress(); if (p == 0xFF) return 1.; @@ -369,7 +369,7 @@ happens while fetching the data, this url remains the same. \sa finalUrl() */ -QUrl QDeclarativeDataBlob::url() const +QUrl QQmlDataBlob::url() const { return m_url; } @@ -381,7 +381,7 @@ is updated to reflect the new location. May only be called from the load thread, or after the blob isCompleteOrError(). */ -QUrl QDeclarativeDataBlob::finalUrl() const +QUrl QQmlDataBlob::finalUrl() const { Q_ASSERT(isCompleteOrError() || (m_manager && m_manager->m_thread->isThisThread())); return m_finalUrl; @@ -390,7 +390,7 @@ QUrl QDeclarativeDataBlob::finalUrl() const /*! Returns the finalUrl() as a string. */ -QString QDeclarativeDataBlob::finalUrlString() const +QString QQmlDataBlob::finalUrlString() const { Q_ASSERT(isCompleteOrError() || (m_manager && m_manager->m_thread->isThisThread())); if (m_finalUrlString.isEmpty()) @@ -404,7 +404,7 @@ Return the errors on this blob. May only be called from the load thread, or after the blob isCompleteOrError(). */ -QList<QDeclarativeError> QDeclarativeDataBlob::errors() const +QList<QQmlError> QQmlDataBlob::errors() const { Q_ASSERT(isCompleteOrError() || (m_manager && m_manager->m_thread->isThisThread())); return m_errors; @@ -416,13 +416,13 @@ Mark this blob as having \a errors. All outstanding dependencies will be cancelled. Requests to add new dependencies will be ignored. Entry into the Error state is irreversable. -The setError() method may only be called from within a QDeclarativeDataBlob callback. +The setError() method may only be called from within a QQmlDataBlob callback. */ -void QDeclarativeDataBlob::setError(const QDeclarativeError &errors) +void QQmlDataBlob::setError(const QQmlError &errors) { ASSERT_CALLBACK(); - QList<QDeclarativeError> l; + QList<QQmlError> l; l << errors; setError(l); } @@ -430,7 +430,7 @@ void QDeclarativeDataBlob::setError(const QDeclarativeError &errors) /*! \overload */ -void QDeclarativeDataBlob::setError(const QList<QDeclarativeError> &errors) +void QQmlDataBlob::setError(const QList<QQmlError> &errors) { ASSERT_CALLBACK(); @@ -450,9 +450,9 @@ void QDeclarativeDataBlob::setError(const QList<QDeclarativeError> &errors) Wait for \a blob to become complete or to error. If \a blob is already complete or in error, or this blob is already complete, this has no effect. -The setError() method may only be called from within a QDeclarativeDataBlob callback. +The setError() method may only be called from within a QQmlDataBlob callback. */ -void QDeclarativeDataBlob::addDependency(QDeclarativeDataBlob *blob) +void QQmlDataBlob::addDependency(QQmlDataBlob *blob) { ASSERT_CALLBACK(); @@ -473,7 +473,7 @@ void QDeclarativeDataBlob::addDependency(QDeclarativeDataBlob *blob) } /*! -\fn void QDeclarativeDataBlob::dataReceived(const QByteArray &data) +\fn void QQmlDataBlob::dataReceived(const QByteArray &data) Invoked when data for the blob is received. Implementors should use this callback to determine a blob's dependencies. Within this callback you may call setError() @@ -492,20 +492,20 @@ The default implementation does nothing. XXX Rename processData() or some such to avoid confusion between done() (processing thread) and completed() (main thread) */ -void QDeclarativeDataBlob::done() +void QQmlDataBlob::done() { } /*! Invoked if there is a network error while fetching this blob. -The default implementation sets an appropriate QDeclarativeError. +The default implementation sets an appropriate QQmlError. */ -void QDeclarativeDataBlob::networkError(QNetworkReply::NetworkError networkError) +void QQmlDataBlob::networkError(QNetworkReply::NetworkError networkError) { Q_UNUSED(networkError); - QDeclarativeError error; + QQmlError error; error.setUrl(m_finalUrl); const char *errorString = 0; @@ -554,7 +554,7 @@ Called if \a blob, which was previously waited for, has an error. The default implementation does nothing. */ -void QDeclarativeDataBlob::dependencyError(QDeclarativeDataBlob *blob) +void QQmlDataBlob::dependencyError(QQmlDataBlob *blob) { Q_UNUSED(blob); } @@ -564,7 +564,7 @@ Called if \a blob, which was previously waited for, has completed. The default implementation does nothing. */ -void QDeclarativeDataBlob::dependencyComplete(QDeclarativeDataBlob *blob) +void QQmlDataBlob::dependencyComplete(QQmlDataBlob *blob) { Q_UNUSED(blob); } @@ -575,7 +575,7 @@ whether they are in error, or complete state. The default implementation does nothing. */ -void QDeclarativeDataBlob::allDependenciesDone() +void QQmlDataBlob::allDependenciesDone() { } @@ -590,7 +590,7 @@ operation. The default implementation does nothing. */ -void QDeclarativeDataBlob::downloadProgressChanged(qreal progress) +void QQmlDataBlob::downloadProgressChanged(qreal progress) { Q_UNUSED(progress); } @@ -609,19 +609,19 @@ operation. The default implementation does nothing. */ -void QDeclarativeDataBlob::completed() +void QQmlDataBlob::completed() { } -void QDeclarativeDataBlob::tryDone() +void QQmlDataBlob::tryDone() { if (status() != Loading && m_waitingFor.isEmpty() && !m_isDone) { m_isDone = true; addref(); #ifdef DATABLOB_DEBUG - qWarning("QDeclarativeDataBlob::done() %s", qPrintable(url().toString())); + qWarning("QQmlDataBlob::done() %s", qPrintable(url().toString())); #endif done(); @@ -634,7 +634,7 @@ void QDeclarativeDataBlob::tryDone() // already be protected against the blob being completed (as set above); if (m_data.isAsync()) { #ifdef DATABLOB_DEBUG - qWarning("QDeclarativeDataBlob: Dispatching completed"); + qWarning("QQmlDataBlob: Dispatching completed"); #endif m_manager->m_thread->callCompleted(this); } @@ -643,10 +643,10 @@ void QDeclarativeDataBlob::tryDone() } } -void QDeclarativeDataBlob::cancelAllWaitingFor() +void QQmlDataBlob::cancelAllWaitingFor() { while (m_waitingFor.count()) { - QDeclarativeDataBlob *blob = m_waitingFor.takeLast(); + QQmlDataBlob *blob = m_waitingFor.takeLast(); Q_ASSERT(blob->m_waitingOnMe.contains(this)); @@ -656,10 +656,10 @@ void QDeclarativeDataBlob::cancelAllWaitingFor() } } -void QDeclarativeDataBlob::notifyAllWaitingOnMe() +void QQmlDataBlob::notifyAllWaitingOnMe() { while (m_waitingOnMe.count()) { - QDeclarativeDataBlob *blob = m_waitingOnMe.takeLast(); + QQmlDataBlob *blob = m_waitingOnMe.takeLast(); Q_ASSERT(blob->m_waitingFor.contains(this)); @@ -667,7 +667,7 @@ void QDeclarativeDataBlob::notifyAllWaitingOnMe() } } -void QDeclarativeDataBlob::notifyComplete(QDeclarativeDataBlob *blob) +void QQmlDataBlob::notifyComplete(QQmlDataBlob *blob) { Q_ASSERT(m_waitingFor.contains(blob)); Q_ASSERT(blob->status() == Error || blob->status() == Complete); @@ -697,17 +697,17 @@ void QDeclarativeDataBlob::notifyComplete(QDeclarativeDataBlob *blob) #define TD_PROGRESS_SHIFT 16 #define TD_ASYNC_MASK 0x80000000 -QDeclarativeDataBlob::ThreadData::ThreadData() +QQmlDataBlob::ThreadData::ThreadData() : _p(0) { } -QDeclarativeDataBlob::Status QDeclarativeDataBlob::ThreadData::status() const +QQmlDataBlob::Status QQmlDataBlob::ThreadData::status() const { - return QDeclarativeDataBlob::Status((_p.load() & TD_STATUS_MASK) >> TD_STATUS_SHIFT); + return QQmlDataBlob::Status((_p.load() & TD_STATUS_MASK) >> TD_STATUS_SHIFT); } -void QDeclarativeDataBlob::ThreadData::setStatus(QDeclarativeDataBlob::Status status) +void QQmlDataBlob::ThreadData::setStatus(QQmlDataBlob::Status status) { while (true) { int d = _p.load(); @@ -716,12 +716,12 @@ void QDeclarativeDataBlob::ThreadData::setStatus(QDeclarativeDataBlob::Status st } } -bool QDeclarativeDataBlob::ThreadData::isAsync() const +bool QQmlDataBlob::ThreadData::isAsync() const { return _p.load() & TD_ASYNC_MASK; } -void QDeclarativeDataBlob::ThreadData::setIsAsync(bool v) +void QQmlDataBlob::ThreadData::setIsAsync(bool v) { while (true) { int d = _p.load(); @@ -730,12 +730,12 @@ void QDeclarativeDataBlob::ThreadData::setIsAsync(bool v) } } -quint8 QDeclarativeDataBlob::ThreadData::progress() const +quint8 QQmlDataBlob::ThreadData::progress() const { return quint8((_p.load() & TD_PROGRESS_MASK) >> TD_PROGRESS_SHIFT); } -void QDeclarativeDataBlob::ThreadData::setProgress(quint8 v) +void QQmlDataBlob::ThreadData::setProgress(quint8 v) { while (true) { int d = _p.load(); @@ -744,72 +744,72 @@ void QDeclarativeDataBlob::ThreadData::setProgress(quint8 v) } } -QDeclarativeDataLoaderThread::QDeclarativeDataLoaderThread(QDeclarativeDataLoader *loader) +QQmlDataLoaderThread::QQmlDataLoaderThread(QQmlDataLoader *loader) : m_loader(loader), m_networkAccessManager(0), m_networkReplyProxy(0) { } -QNetworkAccessManager *QDeclarativeDataLoaderThread::networkAccessManager() const +QNetworkAccessManager *QQmlDataLoaderThread::networkAccessManager() const { Q_ASSERT(isThisThread()); if (!m_networkAccessManager) { - m_networkAccessManager = QDeclarativeEnginePrivate::get(m_loader->engine())->createNetworkAccessManager(0); - m_networkReplyProxy = new QDeclarativeDataLoaderNetworkReplyProxy(m_loader); + m_networkAccessManager = QQmlEnginePrivate::get(m_loader->engine())->createNetworkAccessManager(0); + m_networkReplyProxy = new QQmlDataLoaderNetworkReplyProxy(m_loader); } return m_networkAccessManager; } -QDeclarativeDataLoaderNetworkReplyProxy *QDeclarativeDataLoaderThread::networkReplyProxy() const +QQmlDataLoaderNetworkReplyProxy *QQmlDataLoaderThread::networkReplyProxy() const { Q_ASSERT(isThisThread()); Q_ASSERT(m_networkReplyProxy); // Must call networkAccessManager() first return m_networkReplyProxy; } -void QDeclarativeDataLoaderThread::load(QDeclarativeDataBlob *b) +void QQmlDataLoaderThread::load(QQmlDataBlob *b) { b->addref(); callMethodInThread(&This::loadThread, b); } -void QDeclarativeDataLoaderThread::loadAsync(QDeclarativeDataBlob *b) +void QQmlDataLoaderThread::loadAsync(QQmlDataBlob *b) { b->addref(); postMethodToThread(&This::loadThread, b); } -void QDeclarativeDataLoaderThread::loadWithStaticData(QDeclarativeDataBlob *b, const QByteArray &d) +void QQmlDataLoaderThread::loadWithStaticData(QQmlDataBlob *b, const QByteArray &d) { b->addref(); callMethodInThread(&This::loadWithStaticDataThread, b, d); } -void QDeclarativeDataLoaderThread::loadWithStaticDataAsync(QDeclarativeDataBlob *b, const QByteArray &d) +void QQmlDataLoaderThread::loadWithStaticDataAsync(QQmlDataBlob *b, const QByteArray &d) { b->addref(); postMethodToThread(&This::loadWithStaticDataThread, b, d); } -void QDeclarativeDataLoaderThread::callCompleted(QDeclarativeDataBlob *b) +void QQmlDataLoaderThread::callCompleted(QQmlDataBlob *b) { b->addref(); postMethodToMain(&This::callCompletedMain, b); } -void QDeclarativeDataLoaderThread::callDownloadProgressChanged(QDeclarativeDataBlob *b, qreal p) +void QQmlDataLoaderThread::callDownloadProgressChanged(QQmlDataBlob *b, qreal p) { b->addref(); postMethodToMain(&This::callDownloadProgressChangedMain, b, p); } -void QDeclarativeDataLoaderThread::initializeEngine(QDeclarativeExtensionInterface *iface, +void QQmlDataLoaderThread::initializeEngine(QQmlExtensionInterface *iface, const char *uri) { callMethodInMain(&This::initializeEngineMain, iface, uri); } -void QDeclarativeDataLoaderThread::shutdownThread() +void QQmlDataLoaderThread::shutdownThread() { delete m_networkAccessManager; m_networkAccessManager = 0; @@ -817,38 +817,38 @@ void QDeclarativeDataLoaderThread::shutdownThread() m_networkReplyProxy = 0; } -void QDeclarativeDataLoaderThread::loadThread(QDeclarativeDataBlob *b) +void QQmlDataLoaderThread::loadThread(QQmlDataBlob *b) { m_loader->loadThread(b); b->release(); } -void QDeclarativeDataLoaderThread::loadWithStaticDataThread(QDeclarativeDataBlob *b, const QByteArray &d) +void QQmlDataLoaderThread::loadWithStaticDataThread(QQmlDataBlob *b, const QByteArray &d) { m_loader->loadWithStaticDataThread(b, d); b->release(); } -void QDeclarativeDataLoaderThread::callCompletedMain(QDeclarativeDataBlob *b) +void QQmlDataLoaderThread::callCompletedMain(QQmlDataBlob *b) { #ifdef DATABLOB_DEBUG - qWarning("QDeclarativeDataLoaderThread: %s completed() callback", qPrintable(b->url().toString())); + qWarning("QQmlDataLoaderThread: %s completed() callback", qPrintable(b->url().toString())); #endif b->completed(); b->release(); } -void QDeclarativeDataLoaderThread::callDownloadProgressChangedMain(QDeclarativeDataBlob *b, qreal p) +void QQmlDataLoaderThread::callDownloadProgressChangedMain(QQmlDataBlob *b, qreal p) { #ifdef DATABLOB_DEBUG - qWarning("QDeclarativeDataLoaderThread: %s downloadProgressChanged(%f) callback", + qWarning("QQmlDataLoaderThread: %s downloadProgressChanged(%f) callback", qPrintable(b->url().toString()), p); #endif b->downloadProgressChanged(p); b->release(); } -void QDeclarativeDataLoaderThread::initializeEngineMain(QDeclarativeExtensionInterface *iface, +void QQmlDataLoaderThread::initializeEngineMain(QQmlExtensionInterface *iface, const char *uri) { Q_ASSERT(m_loader->engine()->thread() == QThread::currentThread()); @@ -856,45 +856,45 @@ void QDeclarativeDataLoaderThread::initializeEngineMain(QDeclarativeExtensionInt } /*! -\class QDeclarativeDataLoader -\brief The QDeclarativeDataLoader class abstracts loading files and their dependencies over the network. +\class QQmlDataLoader +\brief The QQmlDataLoader class abstracts loading files and their dependencies over the network. \internal -The QDeclarativeDataLoader class is provided for the exclusive use of the QDeclarativeTypeLoader class. +The QQmlDataLoader class is provided for the exclusive use of the QQmlTypeLoader class. -Clients create QDeclarativeDataBlob instances and submit them to the QDeclarativeDataLoader class -through the QDeclarativeDataLoader::load() or QDeclarativeDataLoader::loadWithStaticData() methods. +Clients create QQmlDataBlob instances and submit them to the QQmlDataLoader class +through the QQmlDataLoader::load() or QQmlDataLoader::loadWithStaticData() methods. The loader then fetches the data over the network or from the local file system in an efficient way. -QDeclarativeDataBlob is an abstract class, so should always be specialized. +QQmlDataBlob is an abstract class, so should always be specialized. -Once data is received, the QDeclarativeDataBlob::dataReceived() method is invoked on the blob. The +Once data is received, the QQmlDataBlob::dataReceived() method is invoked on the blob. The derived class should use this callback to process the received data. Processing of the data can -result in an error being set (QDeclarativeDataBlob::setError()), or one or more dependencies being -created (QDeclarativeDataBlob::addDependency()). Dependencies are other QDeclarativeDataBlob's that +result in an error being set (QQmlDataBlob::setError()), or one or more dependencies being +created (QQmlDataBlob::addDependency()). Dependencies are other QQmlDataBlob's that are required before processing can fully complete. -To complete processing, the QDeclarativeDataBlob::done() callback is invoked. done() is called when +To complete processing, the QQmlDataBlob::done() callback is invoked. done() is called when one of these three preconditions are met. \list 1 -\o The QDeclarativeDataBlob has no dependencies. -\o The QDeclarativeDataBlob has an error set. -\o All the QDeclarativeDataBlob's dependencies are themselves "done()". +\o The QQmlDataBlob has no dependencies. +\o The QQmlDataBlob has an error set. +\o All the QQmlDataBlob's dependencies are themselves "done()". \endlist -Thus QDeclarativeDataBlob::done() will always eventually be called, even if the blob has an error set. +Thus QQmlDataBlob::done() will always eventually be called, even if the blob has an error set. */ /*! -Create a new QDeclarativeDataLoader for \a engine. +Create a new QQmlDataLoader for \a engine. */ -QDeclarativeDataLoader::QDeclarativeDataLoader(QDeclarativeEngine *engine) -: m_engine(engine), m_thread(new QDeclarativeDataLoaderThread(this)) +QQmlDataLoader::QQmlDataLoader(QQmlEngine *engine) +: m_engine(engine), m_thread(new QQmlDataLoaderThread(this)) { } /*! \internal */ -QDeclarativeDataLoader::~QDeclarativeDataLoader() +QQmlDataLoader::~QQmlDataLoader() { for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter) (*iter)->release(); @@ -903,12 +903,12 @@ QDeclarativeDataLoader::~QDeclarativeDataLoader() delete m_thread; } -void QDeclarativeDataLoader::lock() +void QQmlDataLoader::lock() { m_thread->lock(); } -void QDeclarativeDataLoader::unlock() +void QQmlDataLoader::unlock() { m_thread->unlock(); } @@ -918,17 +918,17 @@ Load the provided \a blob from the network or filesystem. The loader must be locked. */ -void QDeclarativeDataLoader::load(QDeclarativeDataBlob *blob, Mode mode) +void QQmlDataLoader::load(QQmlDataBlob *blob, Mode mode) { #ifdef DATABLOB_DEBUG - qWarning("QDeclarativeDataLoader::load(%s): %s thread", qPrintable(blob->m_url.toString()), + qWarning("QQmlDataLoader::load(%s): %s thread", qPrintable(blob->m_url.toString()), m_thread->isThisThread()?"Compile":"Engine"); #endif - Q_ASSERT(blob->status() == QDeclarativeDataBlob::Null); + Q_ASSERT(blob->status() == QQmlDataBlob::Null); Q_ASSERT(blob->m_manager == 0); - blob->m_data.setStatus(QDeclarativeDataBlob::Loading); + blob->m_data.setStatus(QQmlDataBlob::Loading); blob->m_manager = this; if (m_thread->isThisThread()) { @@ -955,17 +955,17 @@ Load the provided \a blob with \a data. The blob's URL is not used by the data The loader must be locked. */ -void QDeclarativeDataLoader::loadWithStaticData(QDeclarativeDataBlob *blob, const QByteArray &data, Mode mode) +void QQmlDataLoader::loadWithStaticData(QQmlDataBlob *blob, const QByteArray &data, Mode mode) { #ifdef DATABLOB_DEBUG - qWarning("QDeclarativeDataLoader::loadWithStaticData(%s, data): %s thread", qPrintable(blob->m_url.toString()), + qWarning("QQmlDataLoader::loadWithStaticData(%s, data): %s thread", qPrintable(blob->m_url.toString()), m_thread->isThisThread()?"Compile":"Engine"); #endif - Q_ASSERT(blob->status() == QDeclarativeDataBlob::Null); + Q_ASSERT(blob->status() == QQmlDataBlob::Null); Q_ASSERT(blob->m_manager == 0); - blob->m_data.setStatus(QDeclarativeDataBlob::Loading); + blob->m_data.setStatus(QQmlDataBlob::Loading); blob->m_manager = this; if (m_thread->isThisThread()) { @@ -987,29 +987,29 @@ void QDeclarativeDataLoader::loadWithStaticData(QDeclarativeDataBlob *blob, cons } } -void QDeclarativeDataLoader::loadWithStaticDataThread(QDeclarativeDataBlob *blob, const QByteArray &data) +void QQmlDataLoader::loadWithStaticDataThread(QQmlDataBlob *blob, const QByteArray &data) { ASSERT_LOADTHREAD(); setData(blob, data); } -void QDeclarativeDataLoader::loadThread(QDeclarativeDataBlob *blob) +void QQmlDataLoader::loadThread(QQmlDataBlob *blob) { ASSERT_LOADTHREAD(); if (blob->m_url.isEmpty()) { - QDeclarativeError error; + QQmlError error; error.setDescription(QLatin1String("Invalid null URL")); blob->setError(error); return; } - QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(blob->m_url); + QString lf = QQmlEnginePrivate::urlToLocalFileOrQrc(blob->m_url); if (!lf.isEmpty()) { - if (!QDeclarative_isFileCaseCorrect(lf)) { - QDeclarativeError error; + if (!QQml_isFileCaseCorrect(lf)) { + QQmlError error; error.setUrl(blob->m_url); error.setDescription(QLatin1String("File name case mismatch")); blob->setError(error); @@ -1044,13 +1044,13 @@ void QDeclarativeDataLoader::loadThread(QDeclarativeDataBlob *blob) #define DATALOADER_MAXIMUM_REDIRECT_RECURSION 16 -void QDeclarativeDataLoader::networkReplyFinished(QNetworkReply *reply) +void QQmlDataLoader::networkReplyFinished(QNetworkReply *reply) { Q_ASSERT(m_thread->isThisThread()); reply->deleteLater(); - QDeclarativeDataBlob *blob = m_networkReplies.take(reply); + QQmlDataBlob *blob = m_networkReplies.take(reply); Q_ASSERT(blob); @@ -1080,12 +1080,12 @@ void QDeclarativeDataLoader::networkReplyFinished(QNetworkReply *reply) blob->release(); } -void QDeclarativeDataLoader::networkReplyProgress(QNetworkReply *reply, +void QQmlDataLoader::networkReplyProgress(QNetworkReply *reply, qint64 bytesReceived, qint64 bytesTotal) { Q_ASSERT(m_thread->isThisThread()); - QDeclarativeDataBlob *blob = m_networkReplies.value(reply); + QQmlDataBlob *blob = m_networkReplies.value(reply); Q_ASSERT(blob); @@ -1098,18 +1098,18 @@ void QDeclarativeDataLoader::networkReplyProgress(QNetworkReply *reply, } /*! -Return the QDeclarativeEngine associated with this loader +Return the QQmlEngine associated with this loader */ -QDeclarativeEngine *QDeclarativeDataLoader::engine() const +QQmlEngine *QQmlDataLoader::engine() const { return m_engine; } /*! -Call the initializeEngine() method on \a iface. Used by QDeclarativeImportDatabase to ensure it +Call the initializeEngine() method on \a iface. Used by QQmlImportDatabase to ensure it gets called in the correct thread. */ -void QDeclarativeDataLoader::initializeEngine(QDeclarativeExtensionInterface *iface, +void QQmlDataLoader::initializeEngine(QQmlExtensionInterface *iface, const char *uri) { Q_ASSERT(m_thread->isThisThread() || engine()->thread() == QThread::currentThread()); @@ -1123,7 +1123,7 @@ void QDeclarativeDataLoader::initializeEngine(QDeclarativeExtensionInterface *if } -void QDeclarativeDataLoader::setData(QDeclarativeDataBlob *blob, const QByteArray &data) +void QQmlDataLoader::setData(QQmlDataBlob *blob, const QByteArray &data) { blob->m_inCallback = true; @@ -1132,8 +1132,8 @@ void QDeclarativeDataLoader::setData(QDeclarativeDataBlob *blob, const QByteArra if (!blob->isError() && !blob->isWaiting()) blob->allDependenciesDone(); - if (blob->status() != QDeclarativeDataBlob::Error) - blob->m_data.setStatus(QDeclarativeDataBlob::WaitingForDependencies); + if (blob->status() != QQmlDataBlob::Error) + blob->m_data.setStatus(QQmlDataBlob::WaitingForDependencies); blob->m_inCallback = false; @@ -1143,8 +1143,8 @@ void QDeclarativeDataLoader::setData(QDeclarativeDataBlob *blob, const QByteArra /*! Constructs a new type loader that uses the given \a engine. */ -QDeclarativeTypeLoader::QDeclarativeTypeLoader(QDeclarativeEngine *engine) -: QDeclarativeDataLoader(engine) +QQmlTypeLoader::QQmlTypeLoader(QQmlEngine *engine) +: QQmlDataLoader(engine) { } @@ -1152,13 +1152,13 @@ QDeclarativeTypeLoader::QDeclarativeTypeLoader(QDeclarativeEngine *engine) Destroys the type loader, first clearing the cache of any information about loaded files. */ -QDeclarativeTypeLoader::~QDeclarativeTypeLoader() +QQmlTypeLoader::~QQmlTypeLoader() { clearCache(); } /*! -\enum QDeclarativeTypeLoader::Option +\enum QQmlTypeLoader::Option This enum defines the options that control the way type data is handled. @@ -1169,22 +1169,22 @@ This enum defines the options that control the way type data is handled. */ /*! -Returns a QDeclarativeTypeData for the specified \a url. The QDeclarativeTypeData may be cached. +Returns a QQmlTypeData for the specified \a url. The QQmlTypeData may be cached. */ -QDeclarativeTypeData *QDeclarativeTypeLoader::get(const QUrl &url) +QQmlTypeData *QQmlTypeLoader::get(const QUrl &url) { Q_ASSERT(!url.isRelative() && - (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() || - !QDir::isRelativePath(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url)))); + (QQmlEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() || + !QDir::isRelativePath(QQmlEnginePrivate::urlToLocalFileOrQrc(url)))); lock(); - QDeclarativeTypeData *typeData = m_typeCache.value(url); + QQmlTypeData *typeData = m_typeCache.value(url); if (!typeData) { - typeData = new QDeclarativeTypeData(url, None, this); + typeData = new QQmlTypeData(url, None, this); m_typeCache.insert(url, typeData); - QDeclarativeDataLoader::load(typeData); + QQmlDataLoader::load(typeData); } typeData->addref(); @@ -1195,17 +1195,17 @@ QDeclarativeTypeData *QDeclarativeTypeLoader::get(const QUrl &url) } /*! -Returns a QDeclarativeTypeData for the given \a data with the provided base \a url. The -QDeclarativeTypeData will not be cached. +Returns a QQmlTypeData for the given \a data with the provided base \a url. The +QQmlTypeData will not be cached. The specified \a options control how the loader handles type data. */ -QDeclarativeTypeData *QDeclarativeTypeLoader::get(const QByteArray &data, const QUrl &url, Options options) +QQmlTypeData *QQmlTypeLoader::get(const QByteArray &data, const QUrl &url, Options options) { lock(); - QDeclarativeTypeData *typeData = new QDeclarativeTypeData(url, options, this); - QDeclarativeDataLoader::loadWithStaticData(typeData, data); + QQmlTypeData *typeData = new QQmlTypeData(url, options, this); + QQmlDataLoader::loadWithStaticData(typeData, data); unlock(); @@ -1213,22 +1213,22 @@ QDeclarativeTypeData *QDeclarativeTypeLoader::get(const QByteArray &data, const } /*! -Return a QDeclarativeScriptBlob for \a url. The QDeclarativeScriptData may be cached. +Return a QQmlScriptBlob for \a url. The QQmlScriptData may be cached. */ -QDeclarativeScriptBlob *QDeclarativeTypeLoader::getScript(const QUrl &url) +QQmlScriptBlob *QQmlTypeLoader::getScript(const QUrl &url) { Q_ASSERT(!url.isRelative() && - (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() || - !QDir::isRelativePath(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url)))); + (QQmlEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() || + !QDir::isRelativePath(QQmlEnginePrivate::urlToLocalFileOrQrc(url)))); lock(); - QDeclarativeScriptBlob *scriptBlob = m_scriptCache.value(url); + QQmlScriptBlob *scriptBlob = m_scriptCache.value(url); if (!scriptBlob) { - scriptBlob = new QDeclarativeScriptBlob(url, this); + scriptBlob = new QQmlScriptBlob(url, this); m_scriptCache.insert(url, scriptBlob); - QDeclarativeDataLoader::load(scriptBlob); + QQmlDataLoader::load(scriptBlob); } scriptBlob->addref(); @@ -1239,22 +1239,22 @@ QDeclarativeScriptBlob *QDeclarativeTypeLoader::getScript(const QUrl &url) } /*! -Returns a QDeclarativeQmldirData for \a url. The QDeclarativeQmldirData may be cached. +Returns a QQmlQmldirData for \a url. The QQmlQmldirData may be cached. */ -QDeclarativeQmldirData *QDeclarativeTypeLoader::getQmldir(const QUrl &url) +QQmlQmldirData *QQmlTypeLoader::getQmldir(const QUrl &url) { Q_ASSERT(!url.isRelative() && - (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() || - !QDir::isRelativePath(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url)))); + (QQmlEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() || + !QDir::isRelativePath(QQmlEnginePrivate::urlToLocalFileOrQrc(url)))); lock(); - QDeclarativeQmldirData *qmldirData = m_qmldirCache.value(url); + QQmlQmldirData *qmldirData = m_qmldirCache.value(url); if (!qmldirData) { - qmldirData = new QDeclarativeQmldirData(url); + qmldirData = new QQmlQmldirData(url); m_qmldirCache.insert(url, qmldirData); - QDeclarativeDataLoader::load(qmldirData); + QQmlDataLoader::load(qmldirData); } qmldirData->addref(); @@ -1269,7 +1269,7 @@ Returns the absolute filename of path via a directory cache for files named "qmldir", "*.qml", "*.js", and plugins. Returns a empty string if the path does not exist. */ -QString QDeclarativeTypeLoader::absoluteFilePath(const QString &path) +QString QQmlTypeLoader::absoluteFilePath(const QString &path) { if (path.isEmpty()) return QString(); @@ -1316,7 +1316,7 @@ QString QDeclarativeTypeLoader::absoluteFilePath(const QString &path) Returns true if the path is a directory via a directory cache. Cache is shared with absoluteFilePath(). */ -bool QDeclarativeTypeLoader::directoryExists(const QString &path) +bool QQmlTypeLoader::directoryExists(const QString &path) { if (path.isEmpty()) return false; @@ -1352,14 +1352,14 @@ bool QDeclarativeTypeLoader::directoryExists(const QString &path) /*! -Return a QDeclarativeDirParser for absoluteFilePath. The QDeclarativeDirParser may be cached. +Return a QQmlDirParser for absoluteFilePath. The QQmlDirParser may be cached. */ -const QDeclarativeDirParser *QDeclarativeTypeLoader::qmlDirParser(const QString &absoluteFilePath) +const QQmlDirParser *QQmlTypeLoader::qmlDirParser(const QString &absoluteFilePath) { - QDeclarativeDirParser *qmldirParser; - QDeclarativeDirParser **val = m_importQmlDirCache.value(absoluteFilePath); + QQmlDirParser *qmldirParser; + QQmlDirParser **val = m_importQmlDirCache.value(absoluteFilePath); if (!val) { - qmldirParser = new QDeclarativeDirParser; + qmldirParser = new QQmlDirParser; qmldirParser->setFileSource(absoluteFilePath); qmldirParser->setUrl(QUrl::fromLocalFile(absoluteFilePath)); qmldirParser->parse(); @@ -1376,7 +1376,7 @@ const QDeclarativeDirParser *QDeclarativeTypeLoader::qmlDirParser(const QString Clears cached information about loaded files, including any type data, scripts and qmldir information. */ -void QDeclarativeTypeLoader::clearCache() +void QQmlTypeLoader::clearCache() { for (TypeCache::Iterator iter = m_typeCache.begin(); iter != m_typeCache.end(); ++iter) (*iter)->release(); @@ -1395,14 +1395,14 @@ void QDeclarativeTypeLoader::clearCache() } -QDeclarativeTypeData::QDeclarativeTypeData(const QUrl &url, QDeclarativeTypeLoader::Options options, - QDeclarativeTypeLoader *manager) -: QDeclarativeDataBlob(url, QmlFile), m_options(options), m_imports(manager), m_typesResolved(false), +QQmlTypeData::QQmlTypeData(const QUrl &url, QQmlTypeLoader::Options options, + QQmlTypeLoader *manager) +: QQmlDataBlob(url, QmlFile), m_options(options), m_imports(manager), m_typesResolved(false), m_compiledData(0), m_typeLoader(manager) { } -QDeclarativeTypeData::~QDeclarativeTypeData() +QQmlTypeData::~QQmlTypeData() { for (int ii = 0; ii < m_scripts.count(); ++ii) m_scripts.at(ii).script->release(); @@ -1414,37 +1414,37 @@ QDeclarativeTypeData::~QDeclarativeTypeData() m_compiledData->release(); } -QDeclarativeTypeLoader *QDeclarativeTypeData::typeLoader() const +QQmlTypeLoader *QQmlTypeData::typeLoader() const { return m_typeLoader; } -const QDeclarativeImports &QDeclarativeTypeData::imports() const +const QQmlImports &QQmlTypeData::imports() const { return m_imports; } -const QDeclarativeScript::Parser &QDeclarativeTypeData::parser() const +const QQmlScript::Parser &QQmlTypeData::parser() const { return scriptParser; } -const QList<QDeclarativeTypeData::TypeReference> &QDeclarativeTypeData::resolvedTypes() const +const QList<QQmlTypeData::TypeReference> &QQmlTypeData::resolvedTypes() const { return m_types; } -const QList<QDeclarativeTypeData::ScriptReference> &QDeclarativeTypeData::resolvedScripts() const +const QList<QQmlTypeData::ScriptReference> &QQmlTypeData::resolvedScripts() const { return m_scripts; } -const QSet<QString> &QDeclarativeTypeData::namespaces() const +const QSet<QString> &QQmlTypeData::namespaces() const { return m_namespaces; } -QDeclarativeCompiledData *QDeclarativeTypeData::compiledData() const +QQmlCompiledData *QQmlTypeData::compiledData() const { if (m_compiledData) m_compiledData->addref(); @@ -1452,32 +1452,32 @@ QDeclarativeCompiledData *QDeclarativeTypeData::compiledData() const return m_compiledData; } -void QDeclarativeTypeData::registerCallback(TypeDataCallback *callback) +void QQmlTypeData::registerCallback(TypeDataCallback *callback) { Q_ASSERT(!m_callbacks.contains(callback)); m_callbacks.append(callback); } -void QDeclarativeTypeData::unregisterCallback(TypeDataCallback *callback) +void QQmlTypeData::unregisterCallback(TypeDataCallback *callback) { Q_ASSERT(m_callbacks.contains(callback)); m_callbacks.removeOne(callback); Q_ASSERT(!m_callbacks.contains(callback)); } -void QDeclarativeTypeData::done() +void QQmlTypeData::done() { // Check all script dependencies for errors for (int ii = 0; !isError() && ii < m_scripts.count(); ++ii) { const ScriptReference &script = m_scripts.at(ii); Q_ASSERT(script.script->isCompleteOrError()); if (script.script->isError()) { - QList<QDeclarativeError> errors = script.script->errors(); - QDeclarativeError error; + QList<QQmlError> errors = script.script->errors(); + QQmlError error; error.setUrl(finalUrl()); error.setLine(script.location.line); error.setColumn(script.location.column); - error.setDescription(QDeclarativeTypeLoader::tr("Script %1 unavailable").arg(script.script->url().toString())); + error.setDescription(QQmlTypeLoader::tr("Script %1 unavailable").arg(script.script->url().toString())); errors.prepend(error); setError(errors); } @@ -1490,12 +1490,12 @@ void QDeclarativeTypeData::done() if (type.typeData && type.typeData->isError()) { QString typeName = scriptParser.referencedTypes().at(ii)->name; - QList<QDeclarativeError> errors = type.typeData->errors(); - QDeclarativeError error; + QList<QQmlError> errors = type.typeData->errors(); + QQmlError error; error.setUrl(finalUrl()); error.setLine(type.location.line); error.setColumn(type.location.column); - error.setDescription(QDeclarativeTypeLoader::tr("Type %1 unavailable").arg(typeName)); + error.setDescription(QQmlTypeLoader::tr("Type %1 unavailable").arg(typeName)); errors.prepend(error); setError(errors); } @@ -1505,11 +1505,11 @@ void QDeclarativeTypeData::done() if (!isError()) compile(); - if (!(m_options & QDeclarativeTypeLoader::PreserveParser)) + if (!(m_options & QQmlTypeLoader::PreserveParser)) scriptParser.clear(); } -void QDeclarativeTypeData::completed() +void QQmlTypeData::completed() { // Notify callbacks while (!m_callbacks.isEmpty()) { @@ -1518,7 +1518,7 @@ void QDeclarativeTypeData::completed() } } -void QDeclarativeTypeData::dataReceived(const QByteArray &data) +void QQmlTypeData::dataReceived(const QByteArray &data) { if (!scriptParser.parse(data, finalUrl(), finalUrlString())) { setError(scriptParser.errors()); @@ -1527,17 +1527,17 @@ void QDeclarativeTypeData::dataReceived(const QByteArray &data) m_imports.setBaseUrl(finalUrl(), finalUrlString()); - foreach (const QDeclarativeScript::Import &import, scriptParser.imports()) { - if (import.type == QDeclarativeScript::Import::File && import.qualifier.isEmpty()) { + foreach (const QQmlScript::Import &import, scriptParser.imports()) { + if (import.type == QQmlScript::Import::File && import.qualifier.isEmpty()) { QUrl importUrl = finalUrl().resolved(QUrl(import.uri + QLatin1String("/qmldir"))); - if (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(importUrl).isEmpty()) { - QDeclarativeQmldirData *data = typeLoader()->getQmldir(importUrl); + if (QQmlEnginePrivate::urlToLocalFileOrQrc(importUrl).isEmpty()) { + QQmlQmldirData *data = typeLoader()->getQmldir(importUrl); addDependency(data); m_qmldirs << data; } - } else if (import.type == QDeclarativeScript::Import::Script) { + } else if (import.type == QQmlScript::Import::Script) { QUrl scriptUrl = finalUrl().resolved(QUrl(import.uri)); - QDeclarativeScriptBlob *blob = typeLoader()->getScript(scriptUrl); + QQmlScriptBlob *blob = typeLoader()->getScript(scriptUrl); addDependency(blob); ScriptReference ref; @@ -1551,15 +1551,15 @@ void QDeclarativeTypeData::dataReceived(const QByteArray &data) if (!finalUrl().scheme().isEmpty()) { QUrl importUrl = finalUrl().resolved(QUrl(QLatin1String("qmldir"))); - if (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(importUrl).isEmpty()) { - QDeclarativeQmldirData *data = typeLoader()->getQmldir(importUrl); + if (QQmlEnginePrivate::urlToLocalFileOrQrc(importUrl).isEmpty()) { + QQmlQmldirData *data = typeLoader()->getQmldir(importUrl); addDependency(data); m_qmldirs << data; } } } -void QDeclarativeTypeData::allDependenciesDone() +void QQmlTypeData::allDependenciesDone() { if (!m_typesResolved) { resolveTypes(); @@ -1567,7 +1567,7 @@ void QDeclarativeTypeData::allDependenciesDone() } } -void QDeclarativeTypeData::downloadProgressChanged(qreal p) +void QQmlTypeData::downloadProgressChanged(qreal p) { for (int ii = 0; ii < m_callbacks.count(); ++ii) { TypeDataCallback *callback = m_callbacks.at(ii); @@ -1575,51 +1575,51 @@ void QDeclarativeTypeData::downloadProgressChanged(qreal p) } } -void QDeclarativeTypeData::compile() +void QQmlTypeData::compile() { Q_ASSERT(m_compiledData == 0); - QDeclarativeProfilerService::startRange(QDeclarativeProfilerService::Compiling); + QQmlProfilerService::startRange(QQmlProfilerService::Compiling); - m_compiledData = new QDeclarativeCompiledData(typeLoader()->engine()); + m_compiledData = new QQmlCompiledData(typeLoader()->engine()); m_compiledData->url = finalUrl(); m_compiledData->name = finalUrlString(); - QDeclarativeProfilerService::rangeLocation(QDeclarativeProfilerService::Compiling, QUrl(m_compiledData->name),1,1); - QDeclarativeProfilerService::rangeData(QDeclarativeProfilerService::Compiling, m_compiledData->name); + QQmlProfilerService::rangeLocation(QQmlProfilerService::Compiling, QUrl(m_compiledData->name),1,1); + QQmlProfilerService::rangeData(QQmlProfilerService::Compiling, m_compiledData->name); - QDeclarativeCompiler compiler(&scriptParser._pool); + QQmlCompiler compiler(&scriptParser._pool); if (!compiler.compile(typeLoader()->engine(), this, m_compiledData)) { setError(compiler.errors()); m_compiledData->release(); m_compiledData = 0; } - QDeclarativeProfilerService::endRange(QDeclarativeProfilerService::Compiling); + QQmlProfilerService::endRange(QQmlProfilerService::Compiling); } -void QDeclarativeTypeData::resolveTypes() +void QQmlTypeData::resolveTypes() { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(m_typeLoader->engine()); - QDeclarativeImportDatabase *importDatabase = &ep->importDatabase; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(m_typeLoader->engine()); + QQmlImportDatabase *importDatabase = &ep->importDatabase; // For local urls, add an implicit import "." as first (most overridden) lookup. // This will also trigger the loading of the qmldir and the import of any native // types from available plugins. - QList<QDeclarativeError> errors; - if (QDeclarativeQmldirData *qmldir = qmldirForUrl(finalUrl().resolved(QUrl(QLatin1String("./qmldir"))))) { + QList<QQmlError> errors; + if (QQmlQmldirData *qmldir = qmldirForUrl(finalUrl().resolved(QUrl(QLatin1String("./qmldir"))))) { m_imports.addImport(importDatabase, QLatin1String("."), - QString(), -1, -1, QDeclarativeScript::Import::File, + QString(), -1, -1, QQmlScript::Import::File, qmldir->dirComponents(), &errors); } else { m_imports.addImport(importDatabase, QLatin1String("."), - QString(), -1, -1, QDeclarativeScript::Import::File, - QDeclarativeDirComponents(), &errors); + QString(), -1, -1, QQmlScript::Import::File, + QQmlDirComponents(), &errors); } // remove any errors which are due to the implicit import which aren't real errors. // for example, if the implicitly included qmldir file doesn't exist, that is not an error. - QList<QDeclarativeError> realErrors; + QList<QQmlError> realErrors; for (int i = 0; i < errors.size(); ++i) { - if (errors.at(i).description() != QDeclarativeImportDatabase::tr("import \".\" has no qmldir and no namespace") - && errors.at(i).description() != QDeclarativeImportDatabase::tr("\".\": no such directory")) { + if (errors.at(i).description() != QQmlImportDatabase::tr("import \".\" has no qmldir and no namespace") + && errors.at(i).description() != QQmlImportDatabase::tr("\".\": no such directory")) { realErrors.prepend(errors.at(i)); // this is a real error. } } @@ -1630,14 +1630,14 @@ void QDeclarativeTypeData::resolveTypes() return; } - foreach (const QDeclarativeScript::Import &import, scriptParser.imports()) { - QDeclarativeDirComponents qmldircomponentsnetwork; - if (import.type == QDeclarativeScript::Import::Script) + foreach (const QQmlScript::Import &import, scriptParser.imports()) { + QQmlDirComponents qmldircomponentsnetwork; + if (import.type == QQmlScript::Import::Script) continue; - if (import.type == QDeclarativeScript::Import::File && import.qualifier.isEmpty()) { + if (import.type == QQmlScript::Import::File && import.qualifier.isEmpty()) { QUrl qmldirUrl = finalUrl().resolved(QUrl(import.uri + QLatin1String("/qmldir"))); - if (QDeclarativeQmldirData *qmldir = qmldirForUrl(qmldirUrl)) + if (QQmlQmldirData *qmldir = qmldirForUrl(qmldirUrl)) qmldircomponentsnetwork = qmldir->dirComponents(); } @@ -1645,16 +1645,16 @@ void QDeclarativeTypeData::resolveTypes() int vmin = -1; import.extractVersion(&vmaj, &vmin); - QList<QDeclarativeError> errors; + QList<QQmlError> errors; if (!m_imports.addImport(importDatabase, import.uri, import.qualifier, vmaj, vmin, import.type, qmldircomponentsnetwork, &errors)) { - QDeclarativeError error; + QQmlError error; if (errors.size()) { error = errors.takeFirst(); } else { // this should not be possible! // Description should come from error provided by addImport() function. - error.setDescription(QDeclarativeTypeLoader::tr("Unreported error adding script import to import database")); + error.setDescription(QQmlTypeLoader::tr("Unreported error adding script import to import database")); } error.setUrl(m_imports.baseUrl()); error.setLine(import.location.start.line); @@ -1667,9 +1667,9 @@ void QDeclarativeTypeData::resolveTypes() } // Add any imported scripts to our resolved set - foreach (const QDeclarativeImports::ScriptReference &script, m_imports.resolvedScripts()) + foreach (const QQmlImports::ScriptReference &script, m_imports.resolvedScripts()) { - QDeclarativeScriptBlob *blob = typeLoader()->getScript(script.location); + QQmlScriptBlob *blob = typeLoader()->getScript(script.location); addDependency(blob); ScriptReference ref; @@ -1687,39 +1687,39 @@ void QDeclarativeTypeData::resolveTypes() m_scripts << ref; } - foreach (QDeclarativeScript::TypeReference *parserRef, scriptParser.referencedTypes()) { + foreach (QQmlScript::TypeReference *parserRef, scriptParser.referencedTypes()) { TypeReference ref; QString url; int majorVersion; int minorVersion; - QDeclarativeImportedNamespace *typeNamespace = 0; - QList<QDeclarativeError> errors; + QQmlImportedNamespace *typeNamespace = 0; + QList<QQmlError> errors; if (!m_imports.resolveType(parserRef->name, &ref.type, &url, &majorVersion, &minorVersion, &typeNamespace, &errors) || typeNamespace) { // Known to not be a type: // - known to be a namespace (Namespace {}) // - type with unknown namespace (UnknownNamespace.SomeType {}) - QDeclarativeError error; + QQmlError error; QString userTypeName = parserRef->name; userTypeName.replace(QLatin1Char('/'),QLatin1Char('.')); if (typeNamespace) { - error.setDescription(QDeclarativeTypeLoader::tr("Namespace %1 cannot be used as a type").arg(userTypeName)); + error.setDescription(QQmlTypeLoader::tr("Namespace %1 cannot be used as a type").arg(userTypeName)); } else { if (errors.size()) { error = errors.takeFirst(); } else { // this should not be possible! // Description should come from error provided by addImport() function. - error.setDescription(QDeclarativeTypeLoader::tr("Unreported error adding script import to import database")); + error.setDescription(QQmlTypeLoader::tr("Unreported error adding script import to import database")); } error.setUrl(m_imports.baseUrl()); - error.setDescription(QDeclarativeTypeLoader::tr("%1 %2").arg(userTypeName).arg(error.description())); + error.setDescription(QQmlTypeLoader::tr("%1 %2").arg(userTypeName).arg(error.description())); } if (!parserRef->refObjects.isEmpty()) { - QDeclarativeScript::Object *obj = parserRef->refObjects.first(); + QQmlScript::Object *obj = parserRef->refObjects.first(); error.setLine(obj->location.start.line); error.setColumn(obj->location.start.column); } @@ -1744,7 +1744,7 @@ void QDeclarativeTypeData::resolveTypes() } } -QDeclarativeQmldirData *QDeclarativeTypeData::qmldirForUrl(const QUrl &url) +QQmlQmldirData *QQmlTypeData::qmldirForUrl(const QUrl &url) { for (int ii = 0; ii < m_qmldirs.count(); ++ii) { if (m_qmldirs.at(ii)->url() == url) @@ -1753,16 +1753,16 @@ QDeclarativeQmldirData *QDeclarativeTypeData::qmldirForUrl(const QUrl &url) return 0; } -QDeclarativeScriptData::QDeclarativeScriptData() -: importCache(0), pragmas(QDeclarativeScript::Object::ScriptBlock::None), m_loaded(false) +QQmlScriptData::QQmlScriptData() +: importCache(0), pragmas(QQmlScript::Object::ScriptBlock::None), m_loaded(false) { } -QDeclarativeScriptData::~QDeclarativeScriptData() +QQmlScriptData::~QQmlScriptData() { } -void QDeclarativeScriptData::clear() +void QQmlScriptData::clear() { if (importCache) { importCache->release(); @@ -1776,17 +1776,17 @@ void QDeclarativeScriptData::clear() qPersistentDispose(m_program); qPersistentDispose(m_value); - // An addref() was made when the QDeclarativeCleanup was added to the engine. + // An addref() was made when the QQmlCleanup was added to the engine. release(); } -QDeclarativeScriptBlob::QDeclarativeScriptBlob(const QUrl &url, QDeclarativeTypeLoader *loader) -: QDeclarativeDataBlob(url, JavaScriptFile), m_pragmas(QDeclarativeScript::Object::ScriptBlock::None), +QQmlScriptBlob::QQmlScriptBlob(const QUrl &url, QQmlTypeLoader *loader) +: QQmlDataBlob(url, JavaScriptFile), m_pragmas(QQmlScript::Object::ScriptBlock::None), m_imports(loader), m_scriptData(0), m_typeLoader(loader) { } -QDeclarativeScriptBlob::~QDeclarativeScriptBlob() +QQmlScriptBlob::~QQmlScriptBlob() { if (m_scriptData) { m_scriptData->release(); @@ -1794,46 +1794,46 @@ QDeclarativeScriptBlob::~QDeclarativeScriptBlob() } } -QDeclarativeScript::Object::ScriptBlock::Pragmas QDeclarativeScriptBlob::pragmas() const +QQmlScript::Object::ScriptBlock::Pragmas QQmlScriptBlob::pragmas() const { return m_pragmas; } -QDeclarativeTypeLoader *QDeclarativeScriptBlob::typeLoader() const +QQmlTypeLoader *QQmlScriptBlob::typeLoader() const { return m_typeLoader; } -const QDeclarativeImports &QDeclarativeScriptBlob::imports() const +const QQmlImports &QQmlScriptBlob::imports() const { return m_imports; } -QDeclarativeScriptData *QDeclarativeScriptBlob::scriptData() const +QQmlScriptData *QQmlScriptBlob::scriptData() const { return m_scriptData; } -void QDeclarativeScriptBlob::dataReceived(const QByteArray &data) +void QQmlScriptBlob::dataReceived(const QByteArray &data) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(m_typeLoader->engine()); - QDeclarativeImportDatabase *importDatabase = &ep->importDatabase; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(m_typeLoader->engine()); + QQmlImportDatabase *importDatabase = &ep->importDatabase; m_source = QString::fromUtf8(data); - QDeclarativeScript::Parser::JavaScriptMetaData metadata = - QDeclarativeScript::Parser::extractMetaData(m_source); + QQmlScript::Parser::JavaScriptMetaData metadata = + QQmlScript::Parser::extractMetaData(m_source); m_imports.setBaseUrl(finalUrl(), finalUrlString()); m_pragmas = metadata.pragmas; - foreach (const QDeclarativeScript::Import &import, metadata.imports) { - Q_ASSERT(import.type != QDeclarativeScript::Import::File); + foreach (const QQmlScript::Import &import, metadata.imports) { + Q_ASSERT(import.type != QQmlScript::Import::File); - if (import.type == QDeclarativeScript::Import::Script) { + if (import.type == QQmlScript::Import::Script) { QUrl scriptUrl = finalUrl().resolved(QUrl(import.uri)); - QDeclarativeScriptBlob *blob = typeLoader()->getScript(scriptUrl); + QQmlScriptBlob *blob = typeLoader()->getScript(scriptUrl); addDependency(blob); ScriptReference ref; @@ -1842,15 +1842,15 @@ void QDeclarativeScriptBlob::dataReceived(const QByteArray &data) ref.script = blob; m_scripts << ref; } else { - Q_ASSERT(import.type == QDeclarativeScript::Import::Library); + Q_ASSERT(import.type == QQmlScript::Import::Library); int vmaj = -1; int vmin = -1; import.extractVersion(&vmaj, &vmin); - QList<QDeclarativeError> errors; + QList<QQmlError> errors; if (!m_imports.addImport(importDatabase, import.uri, import.qualifier, vmaj, vmin, - import.type, QDeclarativeDirComponents(), &errors)) { - QDeclarativeError error = errors.takeFirst(); + import.type, QQmlDirComponents(), &errors)) { + QQmlError error = errors.takeFirst(); // description should be set by addImport(). error.setUrl(m_imports.baseUrl()); error.setLine(import.location.start.line); @@ -1864,15 +1864,15 @@ void QDeclarativeScriptBlob::dataReceived(const QByteArray &data) } } -void QDeclarativeScriptBlob::done() +void QQmlScriptBlob::done() { // Check all script dependencies for errors for (int ii = 0; !isError() && ii < m_scripts.count(); ++ii) { const ScriptReference &script = m_scripts.at(ii); Q_ASSERT(script.script->isCompleteOrError()); if (script.script->isError()) { - QList<QDeclarativeError> errors = script.script->errors(); - QDeclarativeError error; + QList<QQmlError> errors = script.script->errors(); + QQmlError error; error.setUrl(finalUrl()); error.setLine(script.location.line); error.setColumn(script.location.column); @@ -1885,11 +1885,11 @@ void QDeclarativeScriptBlob::done() if (isError()) return; - QDeclarativeEngine *engine = typeLoader()->engine(); - m_scriptData = new QDeclarativeScriptData(); + QQmlEngine *engine = typeLoader()->engine(); + m_scriptData = new QQmlScriptData(); m_scriptData->url = finalUrl(); m_scriptData->urlString = finalUrlString(); - m_scriptData->importCache = new QDeclarativeTypeNameCache(); + m_scriptData->importCache = new QQmlTypeNameCache(); for (int ii = 0; !isError() && ii < m_scripts.count(); ++ii) { const ScriptReference &script = m_scripts.at(ii); @@ -1905,19 +1905,19 @@ void QDeclarativeScriptBlob::done() m_source.clear(); } -QDeclarativeQmldirData::QDeclarativeQmldirData(const QUrl &url) -: QDeclarativeDataBlob(url, QmldirFile) +QQmlQmldirData::QQmlQmldirData(const QUrl &url) +: QQmlDataBlob(url, QmldirFile) { } -const QDeclarativeDirComponents &QDeclarativeQmldirData::dirComponents() const +const QQmlDirComponents &QQmlQmldirData::dirComponents() const { return m_components; } -void QDeclarativeQmldirData::dataReceived(const QByteArray &data) +void QQmlQmldirData::dataReceived(const QByteArray &data) { - QDeclarativeDirParser parser; + QQmlDirParser parser; parser.setSource(QString::fromUtf8(data)); parser.parse(); m_components = parser.components(); @@ -1925,4 +1925,4 @@ void QDeclarativeQmldirData::dataReceived(const QByteArray &data) QT_END_NAMESPACE -#include "qdeclarativetypeloader.moc" +#include "qqmltypeloader.moc" diff --git a/src/declarative/qml/qdeclarativetypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index 7b35fea916..0dd7adecac 100644 --- a/src/declarative/qml/qdeclarativetypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETYPELOADER_P_H -#define QDECLARATIVETYPELOADER_P_H +#ifndef QQMLTYPELOADER_P_H +#define QQMLTYPELOADER_P_H // // W A R N I N G @@ -56,34 +56,34 @@ #include <QtCore/qobject.h> #include <QtCore/qatomic.h> #include <QtNetwork/qnetworkreply.h> -#include <QtDeclarative/qdeclarativeerror.h> -#include <QtDeclarative/qdeclarativeengine.h> +#include <QtQml/qqmlerror.h> +#include <QtQml/qqmlengine.h> #include <private/qv8_p.h> #include <private/qhashedstring_p.h> -#include <private/qdeclarativescript_p.h> -#include <private/qdeclarativeimport_p.h> -#include <private/qdeclarativecleanup_p.h> -#include <private/qdeclarativedirparser_p.h> +#include <private/qqmlscript_p.h> +#include <private/qqmlimport_p.h> +#include <private/qqmlcleanup_p.h> +#include <private/qqmldirparser_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeScriptData; -class QDeclarativeScriptBlob; -class QDeclarativeQmldirData; -class QDeclarativeTypeLoader; -class QDeclarativeCompiledData; -class QDeclarativeComponentPrivate; -class QDeclarativeTypeData; -class QDeclarativeDataLoader; -class QDeclarativeExtensionInterface; +class QQmlScriptData; +class QQmlScriptBlob; +class QQmlQmldirData; +class QQmlTypeLoader; +class QQmlCompiledData; +class QQmlComponentPrivate; +class QQmlTypeData; +class QQmlDataLoader; +class QQmlExtensionInterface; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDataBlob : public QDeclarativeRefCount +class Q_QML_PRIVATE_EXPORT QQmlDataBlob : public QQmlRefCount { public: enum Status { - Null, // Prior to QDeclarativeDataLoader::load() + Null, // Prior to QQmlDataLoader::load() Loading, // Prior to data being received and dataReceived() being called WaitingForDependencies, // While there are outstanding addDependency()s Complete, // Finished @@ -96,8 +96,8 @@ public: QmldirFile }; - QDeclarativeDataBlob(const QUrl &, Type); - virtual ~QDeclarativeDataBlob(); + QQmlDataBlob(const QUrl &, Type); + virtual ~QQmlDataBlob(); Type type() const; @@ -115,38 +115,38 @@ public: QUrl finalUrl() const; QString finalUrlString() const; - QList<QDeclarativeError> errors() const; + QList<QQmlError> errors() const; protected: // Can be called from within callbacks - void setError(const QDeclarativeError &); - void setError(const QList<QDeclarativeError> &errors); - void addDependency(QDeclarativeDataBlob *); + void setError(const QQmlError &); + void setError(const QList<QQmlError> &errors); + void addDependency(QQmlDataBlob *); // Callbacks made in load thread virtual void dataReceived(const QByteArray &) = 0; virtual void done(); virtual void networkError(QNetworkReply::NetworkError); - virtual void dependencyError(QDeclarativeDataBlob *); - virtual void dependencyComplete(QDeclarativeDataBlob *); + virtual void dependencyError(QQmlDataBlob *); + virtual void dependencyComplete(QQmlDataBlob *); virtual void allDependenciesDone(); // Callbacks made in main thread virtual void downloadProgressChanged(qreal); virtual void completed(); private: - friend class QDeclarativeDataLoader; - friend class QDeclarativeDataLoaderThread; + friend class QQmlDataLoader; + friend class QQmlDataLoaderThread; void tryDone(); void cancelAllWaitingFor(); void notifyAllWaitingOnMe(); - void notifyComplete(QDeclarativeDataBlob *); + void notifyComplete(QQmlDataBlob *); struct ThreadData { inline ThreadData(); - inline QDeclarativeDataBlob::Status status() const; - inline void setStatus(QDeclarativeDataBlob::Status); + inline QQmlDataBlob::Status status() const; + inline void setStatus(QQmlDataBlob::Status); inline bool isAsync() const; inline void setIsAsync(bool); inline quint8 progress() const; @@ -161,7 +161,7 @@ private: // We use the status change as a memory fence around m_errors so that locking // isn't required. Once the status is set to Error (or Complete), m_errors // cannot be changed. - QList<QDeclarativeError> m_errors; + QList<QQmlError> m_errors; Type m_type; @@ -169,26 +169,26 @@ private: QUrl m_finalUrl; mutable QString m_finalUrlString; - // List of QDeclarativeDataBlob's that are waiting for me to complete. - QList<QDeclarativeDataBlob *> m_waitingOnMe; + // List of QQmlDataBlob's that are waiting for me to complete. + QList<QQmlDataBlob *> m_waitingOnMe; - // List of QDeclarativeDataBlob's that I am waiting for to complete. - QList<QDeclarativeDataBlob *> m_waitingFor; + // List of QQmlDataBlob's that I am waiting for to complete. + QList<QQmlDataBlob *> m_waitingFor; // Manager that is currently fetching data for me - QDeclarativeDataLoader *m_manager; + QQmlDataLoader *m_manager; int m_redirectCount:30; bool m_inCallback:1; bool m_isDone:1; }; -class QDeclarativeDataLoaderThread; +class QQmlDataLoaderThread; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDataLoader +class Q_QML_PRIVATE_EXPORT QQmlDataLoader { public: - QDeclarativeDataLoader(QDeclarativeEngine *); - ~QDeclarativeDataLoader(); + QQmlDataLoader(QQmlEngine *); + ~QQmlDataLoader(); void lock(); void unlock(); @@ -197,38 +197,38 @@ public: enum Mode { PreferSynchronous, Asynchronous }; - void load(QDeclarativeDataBlob *, Mode = PreferSynchronous); - void loadWithStaticData(QDeclarativeDataBlob *, const QByteArray &, Mode = PreferSynchronous); + void load(QQmlDataBlob *, Mode = PreferSynchronous); + void loadWithStaticData(QQmlDataBlob *, const QByteArray &, Mode = PreferSynchronous); - QDeclarativeEngine *engine() const; - void initializeEngine(QDeclarativeExtensionInterface *, const char *); + QQmlEngine *engine() const; + void initializeEngine(QQmlExtensionInterface *, const char *); private: - friend class QDeclarativeDataBlob; - friend class QDeclarativeDataLoaderThread; - friend class QDeclarativeDataLoaderNetworkReplyProxy; + friend class QQmlDataBlob; + friend class QQmlDataLoaderThread; + friend class QQmlDataLoaderNetworkReplyProxy; - void loadThread(QDeclarativeDataBlob *); - void loadWithStaticDataThread(QDeclarativeDataBlob *, const QByteArray &); + void loadThread(QQmlDataBlob *); + void loadWithStaticDataThread(QQmlDataBlob *, const QByteArray &); void networkReplyFinished(QNetworkReply *); void networkReplyProgress(QNetworkReply *, qint64, qint64); - typedef QHash<QNetworkReply *, QDeclarativeDataBlob *> NetworkReplies; + typedef QHash<QNetworkReply *, QQmlDataBlob *> NetworkReplies; - void setData(QDeclarativeDataBlob *, const QByteArray &); + void setData(QQmlDataBlob *, const QByteArray &); - QDeclarativeEngine *m_engine; - QDeclarativeDataLoaderThread *m_thread; + QQmlEngine *m_engine; + QQmlDataLoaderThread *m_thread; NetworkReplies m_networkReplies; }; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeTypeLoader : public QDeclarativeDataLoader +class Q_QML_PRIVATE_EXPORT QQmlTypeLoader : public QQmlDataLoader { - Q_DECLARE_TR_FUNCTIONS(QDeclarativeTypeLoader) + Q_DECLARE_TR_FUNCTIONS(QQmlTypeLoader) public: - QDeclarativeTypeLoader(QDeclarativeEngine *); - ~QDeclarativeTypeLoader(); + QQmlTypeLoader(QQmlEngine *); + ~QQmlTypeLoader(); enum Option { None, @@ -236,23 +236,23 @@ public: }; Q_DECLARE_FLAGS(Options, Option) - QDeclarativeTypeData *get(const QUrl &url); - QDeclarativeTypeData *get(const QByteArray &, const QUrl &url, Options = None); + QQmlTypeData *get(const QUrl &url); + QQmlTypeData *get(const QByteArray &, const QUrl &url, Options = None); void clearCache(); - QDeclarativeScriptBlob *getScript(const QUrl &); - QDeclarativeQmldirData *getQmldir(const QUrl &); + QQmlScriptBlob *getScript(const QUrl &); + QQmlQmldirData *getQmldir(const QUrl &); QString absoluteFilePath(const QString &path); bool directoryExists(const QString &path); - const QDeclarativeDirParser *qmlDirParser(const QString &absoluteFilePath); + const QQmlDirParser *qmlDirParser(const QString &absoluteFilePath); private: - typedef QHash<QUrl, QDeclarativeTypeData *> TypeCache; - typedef QHash<QUrl, QDeclarativeScriptBlob *> ScriptCache; - typedef QHash<QUrl, QDeclarativeQmldirData *> QmldirCache; + typedef QHash<QUrl, QQmlTypeData *> TypeCache; + typedef QHash<QUrl, QQmlScriptBlob *> ScriptCache; + typedef QHash<QUrl, QQmlQmldirData *> QmldirCache; typedef QStringHash<bool> StringSet; typedef QStringHash<StringSet*> ImportDirCache; - typedef QStringHash<QDeclarativeDirParser*> ImportQmlDirCache; + typedef QStringHash<QQmlDirParser*> ImportQmlDirCache; TypeCache m_typeCache; ScriptCache m_scriptCache; @@ -261,50 +261,50 @@ private: ImportQmlDirCache m_importQmlDirCache; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeTypeLoader::Options) +Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlTypeLoader::Options) -class Q_AUTOTEST_EXPORT QDeclarativeTypeData : public QDeclarativeDataBlob +class Q_AUTOTEST_EXPORT QQmlTypeData : public QQmlDataBlob { public: struct TypeReference { TypeReference() : type(0), majorVersion(0), minorVersion(0), typeData(0) {} - QDeclarativeScript::Location location; - QDeclarativeType *type; + QQmlScript::Location location; + QQmlType *type; int majorVersion; int minorVersion; - QDeclarativeTypeData *typeData; + QQmlTypeData *typeData; }; struct ScriptReference { ScriptReference() : script(0) {} - QDeclarativeScript::Location location; + QQmlScript::Location location; QString qualifier; - QDeclarativeScriptBlob *script; + QQmlScriptBlob *script; }; - QDeclarativeTypeData(const QUrl &, QDeclarativeTypeLoader::Options, QDeclarativeTypeLoader *); - ~QDeclarativeTypeData(); + QQmlTypeData(const QUrl &, QQmlTypeLoader::Options, QQmlTypeLoader *); + ~QQmlTypeData(); - QDeclarativeTypeLoader *typeLoader() const; + QQmlTypeLoader *typeLoader() const; - const QDeclarativeImports &imports() const; - const QDeclarativeScript::Parser &parser() const; + const QQmlImports &imports() const; + const QQmlScript::Parser &parser() const; const QList<TypeReference> &resolvedTypes() const; const QList<ScriptReference> &resolvedScripts() const; const QSet<QString> &namespaces() const; - QDeclarativeCompiledData *compiledData() const; + QQmlCompiledData *compiledData() const; - // Used by QDeclarativeComponent to get notifications + // Used by QQmlComponent to get notifications struct TypeDataCallback { ~TypeDataCallback() {} - virtual void typeDataProgress(QDeclarativeTypeData *, qreal) {} - virtual void typeDataReady(QDeclarativeTypeData *) {} + virtual void typeDataProgress(QQmlTypeData *, qreal) {} + virtual void typeDataReady(QQmlTypeData *) {} }; void registerCallback(TypeDataCallback *); void unregisterCallback(TypeDataCallback *); @@ -320,57 +320,57 @@ private: void resolveTypes(); void compile(); - QDeclarativeTypeLoader::Options m_options; + QQmlTypeLoader::Options m_options; - QDeclarativeQmldirData *qmldirForUrl(const QUrl &); + QQmlQmldirData *qmldirForUrl(const QUrl &); - QDeclarativeScript::Parser scriptParser; - QDeclarativeImports m_imports; + QQmlScript::Parser scriptParser; + QQmlImports m_imports; QList<ScriptReference> m_scripts; - QList<QDeclarativeQmldirData *> m_qmldirs; + QList<QQmlQmldirData *> m_qmldirs; QSet<QString> m_namespaces; QList<TypeReference> m_types; bool m_typesResolved:1; - QDeclarativeCompiledData *m_compiledData; + QQmlCompiledData *m_compiledData; QList<TypeDataCallback *> m_callbacks; - QDeclarativeTypeLoader *m_typeLoader; + QQmlTypeLoader *m_typeLoader; }; -// QDeclarativeScriptData instances are created, uninitialized, by the loader in the +// QQmlScriptData instances are created, uninitialized, by the loader in the // load thread. The first time they are used by the VME, they are initialized which // creates their v8 objects and they are referenced and added to the engine's cleanup -// list. During QDeclarativeCleanup::clear() all v8 resources are destroyed, and the +// list. During QQmlCleanup::clear() all v8 resources are destroyed, and the // reference that was created is released but final deletion only occurs once all the // references as released. This is all intended to ensure that the v8 resources are // only created and destroyed in the main thread :) -class Q_AUTOTEST_EXPORT QDeclarativeScriptData : public QDeclarativeCleanup, - public QDeclarativeRefCount +class Q_AUTOTEST_EXPORT QQmlScriptData : public QQmlCleanup, + public QQmlRefCount { public: - QDeclarativeScriptData(); - ~QDeclarativeScriptData(); + QQmlScriptData(); + ~QQmlScriptData(); QUrl url; QString urlString; - QDeclarativeTypeNameCache *importCache; - QList<QDeclarativeScriptBlob *> scripts; - QDeclarativeScript::Object::ScriptBlock::Pragmas pragmas; + QQmlTypeNameCache *importCache; + QList<QQmlScriptBlob *> scripts; + QQmlScript::Object::ScriptBlock::Pragmas pragmas; bool isInitialized() const { return hasEngine(); } - void initialize(QDeclarativeEngine *); + void initialize(QQmlEngine *); protected: - virtual void clear(); // From QDeclarativeCleanup + virtual void clear(); // From QQmlCleanup private: - friend class QDeclarativeVME; - friend class QDeclarativeScriptBlob; + friend class QQmlVME; + friend class QQmlScriptBlob; bool m_loaded; QByteArray m_programSource; @@ -378,58 +378,58 @@ private: v8::Persistent<v8::Object> m_value; }; -class Q_AUTOTEST_EXPORT QDeclarativeScriptBlob : public QDeclarativeDataBlob +class Q_AUTOTEST_EXPORT QQmlScriptBlob : public QQmlDataBlob { public: - QDeclarativeScriptBlob(const QUrl &, QDeclarativeTypeLoader *); - ~QDeclarativeScriptBlob(); + QQmlScriptBlob(const QUrl &, QQmlTypeLoader *); + ~QQmlScriptBlob(); struct ScriptReference { ScriptReference() : script(0) {} - QDeclarativeScript::Location location; + QQmlScript::Location location; QString qualifier; - QDeclarativeScriptBlob *script; + QQmlScriptBlob *script; }; - QDeclarativeScript::Object::ScriptBlock::Pragmas pragmas() const; + QQmlScript::Object::ScriptBlock::Pragmas pragmas() const; - QDeclarativeTypeLoader *typeLoader() const; - const QDeclarativeImports &imports() const; + QQmlTypeLoader *typeLoader() const; + const QQmlImports &imports() const; - QDeclarativeScriptData *scriptData() const; + QQmlScriptData *scriptData() const; protected: virtual void dataReceived(const QByteArray &); virtual void done(); private: - QDeclarativeScript::Object::ScriptBlock::Pragmas m_pragmas; + QQmlScript::Object::ScriptBlock::Pragmas m_pragmas; QString m_source; - QDeclarativeImports m_imports; + QQmlImports m_imports; QList<ScriptReference> m_scripts; - QDeclarativeScriptData *m_scriptData; + QQmlScriptData *m_scriptData; - QDeclarativeTypeLoader *m_typeLoader; + QQmlTypeLoader *m_typeLoader; }; -class Q_AUTOTEST_EXPORT QDeclarativeQmldirData : public QDeclarativeDataBlob +class Q_AUTOTEST_EXPORT QQmlQmldirData : public QQmlDataBlob { public: - QDeclarativeQmldirData(const QUrl &); + QQmlQmldirData(const QUrl &); - const QDeclarativeDirComponents &dirComponents() const; + const QQmlDirComponents &dirComponents() const; protected: virtual void dataReceived(const QByteArray &); private: - QDeclarativeDirComponents m_components; + QQmlDirComponents m_components; }; QT_END_NAMESPACE -#endif // QDECLARATIVETYPELOADER_P_H +#endif // QQMLTYPELOADER_P_H diff --git a/src/declarative/qml/qdeclarativetypenamecache.cpp b/src/qml/qml/qqmltypenamecache.cpp index 9d433d4472..f9d3e7704c 100644 --- a/src/declarative/qml/qdeclarativetypenamecache.cpp +++ b/src/qml/qml/qqmltypenamecache.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,21 +39,21 @@ ** ****************************************************************************/ -#include "qdeclarativetypenamecache_p.h" +#include "qqmltypenamecache_p.h" -#include "qdeclarativeengine_p.h" +#include "qqmlengine_p.h" QT_BEGIN_NAMESPACE -QDeclarativeTypeNameCache::QDeclarativeTypeNameCache() +QQmlTypeNameCache::QQmlTypeNameCache() { } -QDeclarativeTypeNameCache::~QDeclarativeTypeNameCache() +QQmlTypeNameCache::~QQmlTypeNameCache() { } -void QDeclarativeTypeNameCache::add(const QHashedString &name, int importedScriptIndex, const QHashedString &nameSpace) +void QQmlTypeNameCache::add(const QHashedString &name, int importedScriptIndex, const QHashedString &nameSpace) { Import import; import.scriptIndex = importedScriptIndex; @@ -71,7 +71,7 @@ void QDeclarativeTypeNameCache::add(const QHashedString &name, int importedScrip m_namedImports.insert(name, import); } -QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashedStringRef &name) +QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QHashedStringRef &name) { Result result = query(m_namedImports, name); @@ -81,7 +81,7 @@ QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashed return result; } -QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashedStringRef &name, +QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QHashedStringRef &name, const void *importNamespace) { Q_ASSERT(importNamespace); @@ -91,7 +91,7 @@ QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashed return typeSearch(i->modules, name); } -QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashedV8String &name) +QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QHashedV8String &name) { Result result = query(m_namedImports, name); @@ -101,7 +101,7 @@ QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashed return result; } -QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashedV8String &name, const void *importNamespace) +QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QHashedV8String &name, const void *importNamespace) { Q_ASSERT(importNamespace); const Import *i = static_cast<const Import *>(importNamespace); @@ -114,7 +114,7 @@ QDeclarativeTypeNameCache::Result QDeclarativeTypeNameCache::query(const QHashed return typeSearch(i->modules, name); } -QDeclarativeMetaType::ModuleApiInstance *QDeclarativeTypeNameCache::moduleApi(const void *importNamespace) +QQmlMetaType::ModuleApiInstance *QQmlTypeNameCache::moduleApi(const void *importNamespace) { Q_ASSERT(importNamespace); const Import *i = static_cast<const Import *>(importNamespace); diff --git a/src/declarative/qml/qdeclarativetypenamecache_p.h b/src/qml/qml/qqmltypenamecache_p.h index 9cf52f9d72..a9268db37a 100644 --- a/src/declarative/qml/qdeclarativetypenamecache_p.h +++ b/src/qml/qml/qqmltypenamecache_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETYPENAMECACHE_P_H -#define QDECLARATIVETYPENAMECACHE_P_H +#ifndef QQMLTYPENAMECACHE_P_H +#define QQMLTYPENAMECACHE_P_H // // W A R N I N G @@ -53,9 +53,9 @@ // We mean it. // -#include <private/qdeclarativerefcount_p.h> -#include "qdeclarativecleanup_p.h" -#include "qdeclarativemetatype_p.h" +#include <private/qqmlrefcount_p.h> +#include "qqmlcleanup_p.h" +#include "qqmlmetatype_p.h" #include <private/qhashedstring_p.h> @@ -63,13 +63,13 @@ QT_BEGIN_NAMESPACE -class QDeclarativeType; -class QDeclarativeEngine; -class QDeclarativeTypeNameCache : public QDeclarativeRefCount +class QQmlType; +class QQmlEngine; +class QQmlTypeNameCache : public QQmlRefCount { public: - QDeclarativeTypeNameCache(); - virtual ~QDeclarativeTypeNameCache(); + QQmlTypeNameCache(); + virtual ~QQmlTypeNameCache(); inline bool isEmpty() const; @@ -78,13 +78,13 @@ public: struct Result { inline Result(); inline Result(const void *importNamespace); - inline Result(QDeclarativeType *type); + inline Result(QQmlType *type); inline Result(int scriptIndex); inline Result(const Result &); inline bool isValid() const; - QDeclarativeType *type; + QQmlType *type; const void *importNamespace; int scriptIndex; }; @@ -92,16 +92,16 @@ public: Result query(const QHashedStringRef &, const void *importNamespace); Result query(const QHashedV8String &); Result query(const QHashedV8String &, const void *importNamespace); - QDeclarativeMetaType::ModuleApiInstance *moduleApi(const void *importNamespace); + QQmlMetaType::ModuleApiInstance *moduleApi(const void *importNamespace); private: - friend class QDeclarativeImports; + friend class QQmlImports; struct Import { inline Import(); // Imported module - QDeclarativeMetaType::ModuleApiInstance *moduleApi; - QVector<QDeclarativeTypeModuleVersion> modules; + QQmlMetaType::ModuleApiInstance *moduleApi; + QVector<QQmlTypeModuleVersion> modules; // Or, imported script int scriptIndex; @@ -123,11 +123,11 @@ private: } template<typename Key> - Result typeSearch(const QVector<QDeclarativeTypeModuleVersion> &modules, Key key) + Result typeSearch(const QVector<QQmlTypeModuleVersion> &modules, Key key) { - QVector<QDeclarativeTypeModuleVersion>::const_iterator end = modules.constEnd(); - for (QVector<QDeclarativeTypeModuleVersion>::const_iterator it = modules.constBegin(); it != end; ++it) { - if (QDeclarativeType *type = it->type(key)) + QVector<QQmlTypeModuleVersion>::const_iterator end = modules.constEnd(); + for (QVector<QQmlTypeModuleVersion>::const_iterator it = modules.constBegin(); it != end; ++it) { + if (QQmlType *type = it->type(key)) return Result(type); } @@ -136,52 +136,52 @@ private: QStringHash<Import> m_namedImports; QMap<const Import *, QStringHash<Import> > m_namespacedImports; - QVector<QDeclarativeTypeModuleVersion> m_anonymousImports; + QVector<QQmlTypeModuleVersion> m_anonymousImports; - QDeclarativeEngine *engine; + QQmlEngine *engine; }; -QDeclarativeTypeNameCache::Result::Result() +QQmlTypeNameCache::Result::Result() : type(0), importNamespace(0), scriptIndex(-1) { } -QDeclarativeTypeNameCache::Result::Result(const void *importNamespace) +QQmlTypeNameCache::Result::Result(const void *importNamespace) : type(0), importNamespace(importNamespace), scriptIndex(-1) { } -QDeclarativeTypeNameCache::Result::Result(QDeclarativeType *type) +QQmlTypeNameCache::Result::Result(QQmlType *type) : type(type), importNamespace(0), scriptIndex(-1) { } -QDeclarativeTypeNameCache::Result::Result(int scriptIndex) +QQmlTypeNameCache::Result::Result(int scriptIndex) : type(0), importNamespace(0), scriptIndex(scriptIndex) { } -QDeclarativeTypeNameCache::Result::Result(const Result &o) +QQmlTypeNameCache::Result::Result(const Result &o) : type(o.type), importNamespace(o.importNamespace), scriptIndex(o.scriptIndex) { } -bool QDeclarativeTypeNameCache::Result::isValid() const +bool QQmlTypeNameCache::Result::isValid() const { return type || importNamespace || scriptIndex != -1; } -QDeclarativeTypeNameCache::Import::Import() +QQmlTypeNameCache::Import::Import() : moduleApi(0), scriptIndex(-1) { } -bool QDeclarativeTypeNameCache::isEmpty() const +bool QQmlTypeNameCache::isEmpty() const { return m_namedImports.isEmpty() && m_anonymousImports.isEmpty(); } QT_END_NAMESPACE -#endif // QDECLARATIVETYPENAMECACHE_P_H +#endif // QQMLTYPENAMECACHE_P_H diff --git a/src/declarative/qml/qdeclarativetypenotavailable.cpp b/src/qml/qml/qqmltypenotavailable.cpp index ed24b4e8be..6eb891af71 100644 --- a/src/declarative/qml/qdeclarativetypenotavailable.cpp +++ b/src/qml/qml/qqmltypenotavailable.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qdeclarativetypenotavailable_p.h" +#include "qqmltypenotavailable_p.h" QT_BEGIN_NAMESPACE int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message) { - return qmlRegisterUncreatableType<QDeclarativeTypeNotAvailable>(uri,versionMajor,versionMinor,qmlName,message); + return qmlRegisterUncreatableType<QQmlTypeNotAvailable>(uri,versionMajor,versionMinor,qmlName,message); } -QDeclarativeTypeNotAvailable::QDeclarativeTypeNotAvailable() { } +QQmlTypeNotAvailable::QQmlTypeNotAvailable() { } QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativetypenotavailable_p.h b/src/qml/qml/qqmltypenotavailable_p.h index 05ed6fd5ff..d0618a0686 100644 --- a/src/declarative/qml/qdeclarativetypenotavailable_p.h +++ b/src/qml/qml/qqmltypenotavailable_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,26 +39,26 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETYPENOTAVAILABLE_H -#define QDECLARATIVETYPENOTAVAILABLE_H +#ifndef QQMLTYPENOTAVAILABLE_H +#define QQMLTYPENOTAVAILABLE_H -#include <qdeclarative.h> +#include <qqml.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeTypeNotAvailable : public QObject { +class QQmlTypeNotAvailable : public QObject { Q_OBJECT public: - QDeclarativeTypeNotAvailable(); + QQmlTypeNotAvailable(); }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeTypeNotAvailable) +QML_DECLARE_TYPE(QQmlTypeNotAvailable) QT_END_HEADER -#endif // QDECLARATIVETYPENOTAVAILABLE_H +#endif // QQMLTYPENOTAVAILABLE_H diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp index 6dd3a84dc9..4ade00f9b4 100644 --- a/src/declarative/qml/qdeclarativevaluetype.cpp +++ b/src/qml/qml/qqmlvaluetype.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qdeclarativevaluetype_p.h" +#include "qqmlvaluetype_p.h" -#include "qdeclarativemetatype_p.h" +#include "qqmlmetatype_p.h" #include <private/qfont_p.h> #include <QtCore/qdebug.h> @@ -55,7 +55,7 @@ int qmlRegisterValueTypeEnums(const char *uri, int versionMajor, int versionMino QByteArray pointerName(name + '*'); - QDeclarativePrivate::RegisterType type = { + QQmlPrivate::RegisterType type = { 0, qRegisterMetaType<T *>(pointerName.constData()), 0, 0, 0, @@ -74,23 +74,23 @@ int qmlRegisterValueTypeEnums(const char *uri, int versionMajor, int versionMino 0 }; - return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type); + return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); } -QDeclarativeValueTypeFactory::QDeclarativeValueTypeFactory() +QQmlValueTypeFactory::QQmlValueTypeFactory() { // ### Optimize for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii) valueTypes[ii] = valueType(ii); } -QDeclarativeValueTypeFactory::~QDeclarativeValueTypeFactory() +QQmlValueTypeFactory::~QQmlValueTypeFactory() { for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii) delete valueTypes[ii]; } -bool QDeclarativeValueTypeFactory::isValueType(int idx) +bool QQmlValueTypeFactory::isValueType(int idx) { if ((uint)idx < QVariant::UserType && idx != QVariant::StringList @@ -103,63 +103,63 @@ bool QDeclarativeValueTypeFactory::isValueType(int idx) return false; } -void QDeclarativeValueTypeFactory::registerBaseTypes(const char *uri, int versionMajor, int versionMinor) +void QQmlValueTypeFactory::registerBaseTypes(const char *uri, int versionMajor, int versionMinor) { - qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>(uri, versionMajor, versionMinor, "Easing"); - qmlRegisterValueTypeEnums<QDeclarativeFontValueType>(uri, versionMajor, versionMinor, "Font"); + qmlRegisterValueTypeEnums<QQmlEasingValueType>(uri, versionMajor, versionMinor, "Easing"); + qmlRegisterValueTypeEnums<QQmlFontValueType>(uri, versionMajor, versionMinor, "Font"); } -void QDeclarativeValueTypeFactory::registerValueTypes() +void QQmlValueTypeFactory::registerValueTypes() { registerBaseTypes("QtQuick", 2, 0); } -QDeclarativeValueType *QDeclarativeValueTypeFactory::valueType(int t) +QQmlValueType *QQmlValueTypeFactory::valueType(int t) { - QDeclarativeValueType *rv = 0; + QQmlValueType *rv = 0; switch (t) { case QVariant::Point: - rv = new QDeclarativePointValueType; + rv = new QQmlPointValueType; break; case QVariant::PointF: - rv = new QDeclarativePointFValueType; + rv = new QQmlPointFValueType; break; case QVariant::Size: - rv = new QDeclarativeSizeValueType; + rv = new QQmlSizeValueType; break; case QVariant::SizeF: - rv = new QDeclarativeSizeFValueType; + rv = new QQmlSizeFValueType; break; case QVariant::Rect: - rv = new QDeclarativeRectValueType; + rv = new QQmlRectValueType; break; case QVariant::RectF: - rv = new QDeclarativeRectFValueType; + rv = new QQmlRectFValueType; break; case QVariant::Vector2D: - rv = new QDeclarativeVector2DValueType; + rv = new QQmlVector2DValueType; break; case QVariant::Vector3D: - rv = new QDeclarativeVector3DValueType; + rv = new QQmlVector3DValueType; break; case QVariant::Vector4D: - rv = new QDeclarativeVector4DValueType; + rv = new QQmlVector4DValueType; break; case QVariant::Quaternion: - rv = new QDeclarativeQuaternionValueType; + rv = new QQmlQuaternionValueType; break; case QVariant::Matrix4x4: - rv = new QDeclarativeMatrix4x4ValueType; + rv = new QQmlMatrix4x4ValueType; break; case QVariant::EasingCurve: - rv = new QDeclarativeEasingValueType; + rv = new QQmlEasingValueType; break; case QVariant::Font: - rv = new QDeclarativeFontValueType; + rv = new QQmlFontValueType; break; case QVariant::Color: - rv = new QDeclarativeColorValueType; + rv = new QQmlColorValueType; break; default: break; @@ -169,38 +169,38 @@ QDeclarativeValueType *QDeclarativeValueTypeFactory::valueType(int t) return rv; } -QDeclarativeValueType::QDeclarativeValueType(QObject *parent) +QQmlValueType::QQmlValueType(QObject *parent) : QObject(parent) { } #define QML_VALUETYPE_READWRITE(name, cpptype, var) \ - QDeclarative ## name ## ValueType::QDeclarative ## name ## ValueType(QObject *parent) \ - : QDeclarativeValueType(parent) \ + QQml ## name ## ValueType::QQml ## name ## ValueType(QObject *parent) \ + : QQmlValueType(parent) \ { \ } \ - void QDeclarative ## name ## ValueType::read(QObject *obj, int idx) \ + void QQml ## name ## ValueType::read(QObject *obj, int idx) \ { \ void *a[] = { &var, 0 }; \ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); \ onLoad(); \ } \ - void QDeclarative ## name ## ValueType::write(QObject *obj, int idx, \ - QDeclarativePropertyPrivate::WriteFlags flags) \ + void QQml ## name ## ValueType::write(QObject *obj, int idx, \ + QQmlPropertyPrivate::WriteFlags flags) \ { \ int status = -1; \ void *a[] = { &var, 0, &status, &flags }; \ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a); \ } \ - bool QDeclarative ## name ## ValueType::isEqual(const QVariant &value) const \ + bool QQml ## name ## ValueType::isEqual(const QVariant &value) const \ { \ return QVariant(var) == value; \ } \ - QVariant QDeclarative ## name ## ValueType::value() \ + QVariant QQml ## name ## ValueType::value() \ { \ return QVariant(var); \ } \ - void QDeclarative ## name ## ValueType::setValue(const QVariant &value) \ + void QQml ## name ## ValueType::setValue(const QVariant &value) \ { \ var = qvariant_cast<cpptype>(value); \ onLoad(); \ @@ -221,347 +221,347 @@ QML_VALUETYPE_READWRITE(Easing, QEasingCurve, easing); QML_VALUETYPE_READWRITE(Font, QFont, font); QML_VALUETYPE_READWRITE(Color, QColor, color); -QString QDeclarativePointFValueType::toString() const +QString QQmlPointFValueType::toString() const { return QString(QLatin1String("QPointF(%1, %2)")).arg(point.x()).arg(point.y()); } -qreal QDeclarativePointFValueType::x() const +qreal QQmlPointFValueType::x() const { return point.x(); } -qreal QDeclarativePointFValueType::y() const +qreal QQmlPointFValueType::y() const { return point.y(); } -void QDeclarativePointFValueType::setX(qreal x) +void QQmlPointFValueType::setX(qreal x) { point.setX(x); } -void QDeclarativePointFValueType::setY(qreal y) +void QQmlPointFValueType::setY(qreal y) { point.setY(y); } -QString QDeclarativePointValueType::toString() const +QString QQmlPointValueType::toString() const { return QString(QLatin1String("QPoint(%1, %2)")).arg(point.x()).arg(point.y()); } -int QDeclarativePointValueType::x() const +int QQmlPointValueType::x() const { return point.x(); } -int QDeclarativePointValueType::y() const +int QQmlPointValueType::y() const { return point.y(); } -void QDeclarativePointValueType::setX(int x) +void QQmlPointValueType::setX(int x) { point.setX(x); } -void QDeclarativePointValueType::setY(int y) +void QQmlPointValueType::setY(int y) { point.setY(y); } -QString QDeclarativeSizeFValueType::toString() const +QString QQmlSizeFValueType::toString() const { return QString(QLatin1String("QSizeF(%1, %2)")).arg(size.width()).arg(size.height()); } -qreal QDeclarativeSizeFValueType::width() const +qreal QQmlSizeFValueType::width() const { return size.width(); } -qreal QDeclarativeSizeFValueType::height() const +qreal QQmlSizeFValueType::height() const { return size.height(); } -void QDeclarativeSizeFValueType::setWidth(qreal w) +void QQmlSizeFValueType::setWidth(qreal w) { size.setWidth(w); } -void QDeclarativeSizeFValueType::setHeight(qreal h) +void QQmlSizeFValueType::setHeight(qreal h) { size.setHeight(h); } -QString QDeclarativeSizeValueType::toString() const +QString QQmlSizeValueType::toString() const { return QString(QLatin1String("QSize(%1, %2)")).arg(size.width()).arg(size.height()); } -int QDeclarativeSizeValueType::width() const +int QQmlSizeValueType::width() const { return size.width(); } -int QDeclarativeSizeValueType::height() const +int QQmlSizeValueType::height() const { return size.height(); } -void QDeclarativeSizeValueType::setWidth(int w) +void QQmlSizeValueType::setWidth(int w) { size.setWidth(w); } -void QDeclarativeSizeValueType::setHeight(int h) +void QQmlSizeValueType::setHeight(int h) { size.setHeight(h); } -QString QDeclarativeRectFValueType::toString() const +QString QQmlRectFValueType::toString() const { return QString(QLatin1String("QRectF(%1, %2, %3, %4)")).arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height()); } -qreal QDeclarativeRectFValueType::x() const +qreal QQmlRectFValueType::x() const { return rect.x(); } -qreal QDeclarativeRectFValueType::y() const +qreal QQmlRectFValueType::y() const { return rect.y(); } -void QDeclarativeRectFValueType::setX(qreal x) +void QQmlRectFValueType::setX(qreal x) { rect.moveLeft(x); } -void QDeclarativeRectFValueType::setY(qreal y) +void QQmlRectFValueType::setY(qreal y) { rect.moveTop(y); } -qreal QDeclarativeRectFValueType::width() const +qreal QQmlRectFValueType::width() const { return rect.width(); } -qreal QDeclarativeRectFValueType::height() const +qreal QQmlRectFValueType::height() const { return rect.height(); } -void QDeclarativeRectFValueType::setWidth(qreal w) +void QQmlRectFValueType::setWidth(qreal w) { rect.setWidth(w); } -void QDeclarativeRectFValueType::setHeight(qreal h) +void QQmlRectFValueType::setHeight(qreal h) { rect.setHeight(h); } -QString QDeclarativeRectValueType::toString() const +QString QQmlRectValueType::toString() const { return QString(QLatin1String("QRect(%1, %2, %3, %4)")).arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height()); } -int QDeclarativeRectValueType::x() const +int QQmlRectValueType::x() const { return rect.x(); } -int QDeclarativeRectValueType::y() const +int QQmlRectValueType::y() const { return rect.y(); } -void QDeclarativeRectValueType::setX(int x) +void QQmlRectValueType::setX(int x) { rect.moveLeft(x); } -void QDeclarativeRectValueType::setY(int y) +void QQmlRectValueType::setY(int y) { rect.moveTop(y); } -int QDeclarativeRectValueType::width() const +int QQmlRectValueType::width() const { return rect.width(); } -int QDeclarativeRectValueType::height() const +int QQmlRectValueType::height() const { return rect.height(); } -void QDeclarativeRectValueType::setWidth(int w) +void QQmlRectValueType::setWidth(int w) { rect.setWidth(w); } -void QDeclarativeRectValueType::setHeight(int h) +void QQmlRectValueType::setHeight(int h) { rect.setHeight(h); } -QString QDeclarativeVector2DValueType::toString() const +QString QQmlVector2DValueType::toString() const { return QString(QLatin1String("QVector2D(%1, %2)")).arg(vector.x()).arg(vector.y()); } -qreal QDeclarativeVector2DValueType::x() const +qreal QQmlVector2DValueType::x() const { return vector.x(); } -qreal QDeclarativeVector2DValueType::y() const +qreal QQmlVector2DValueType::y() const { return vector.y(); } -void QDeclarativeVector2DValueType::setX(qreal x) +void QQmlVector2DValueType::setX(qreal x) { vector.setX(x); } -void QDeclarativeVector2DValueType::setY(qreal y) +void QQmlVector2DValueType::setY(qreal y) { vector.setY(y); } -QString QDeclarativeVector3DValueType::toString() const +QString QQmlVector3DValueType::toString() const { return QString(QLatin1String("QVector3D(%1, %2, %3)")).arg(vector.x()).arg(vector.y()).arg(vector.z()); } -qreal QDeclarativeVector3DValueType::x() const +qreal QQmlVector3DValueType::x() const { return vector.x(); } -qreal QDeclarativeVector3DValueType::y() const +qreal QQmlVector3DValueType::y() const { return vector.y(); } -qreal QDeclarativeVector3DValueType::z() const +qreal QQmlVector3DValueType::z() const { return vector.z(); } -void QDeclarativeVector3DValueType::setX(qreal x) +void QQmlVector3DValueType::setX(qreal x) { vector.setX(x); } -void QDeclarativeVector3DValueType::setY(qreal y) +void QQmlVector3DValueType::setY(qreal y) { vector.setY(y); } -void QDeclarativeVector3DValueType::setZ(qreal z) +void QQmlVector3DValueType::setZ(qreal z) { vector.setZ(z); } -QString QDeclarativeVector4DValueType::toString() const +QString QQmlVector4DValueType::toString() const { return QString(QLatin1String("QVector4D(%1, %2, %3, %4)")).arg(vector.x()).arg(vector.y()).arg(vector.z()).arg(vector.w()); } -qreal QDeclarativeVector4DValueType::x() const +qreal QQmlVector4DValueType::x() const { return vector.x(); } -qreal QDeclarativeVector4DValueType::y() const +qreal QQmlVector4DValueType::y() const { return vector.y(); } -qreal QDeclarativeVector4DValueType::z() const +qreal QQmlVector4DValueType::z() const { return vector.z(); } -qreal QDeclarativeVector4DValueType::w() const +qreal QQmlVector4DValueType::w() const { return vector.w(); } -void QDeclarativeVector4DValueType::setX(qreal x) +void QQmlVector4DValueType::setX(qreal x) { vector.setX(x); } -void QDeclarativeVector4DValueType::setY(qreal y) +void QQmlVector4DValueType::setY(qreal y) { vector.setY(y); } -void QDeclarativeVector4DValueType::setZ(qreal z) +void QQmlVector4DValueType::setZ(qreal z) { vector.setZ(z); } -void QDeclarativeVector4DValueType::setW(qreal w) +void QQmlVector4DValueType::setW(qreal w) { vector.setW(w); } -QString QDeclarativeQuaternionValueType::toString() const +QString QQmlQuaternionValueType::toString() const { return QString(QLatin1String("QQuaternion(%1, %2, %3, %4)")).arg(quaternion.scalar()).arg(quaternion.x()).arg(quaternion.y()).arg(quaternion.z()); } -qreal QDeclarativeQuaternionValueType::scalar() const +qreal QQmlQuaternionValueType::scalar() const { return quaternion.scalar(); } -qreal QDeclarativeQuaternionValueType::x() const +qreal QQmlQuaternionValueType::x() const { return quaternion.x(); } -qreal QDeclarativeQuaternionValueType::y() const +qreal QQmlQuaternionValueType::y() const { return quaternion.y(); } -qreal QDeclarativeQuaternionValueType::z() const +qreal QQmlQuaternionValueType::z() const { return quaternion.z(); } -void QDeclarativeQuaternionValueType::setScalar(qreal scalar) +void QQmlQuaternionValueType::setScalar(qreal scalar) { quaternion.setScalar(scalar); } -void QDeclarativeQuaternionValueType::setX(qreal x) +void QQmlQuaternionValueType::setX(qreal x) { quaternion.setX(x); } -void QDeclarativeQuaternionValueType::setY(qreal y) +void QQmlQuaternionValueType::setY(qreal y) { quaternion.setY(y); } -void QDeclarativeQuaternionValueType::setZ(qreal z) +void QQmlQuaternionValueType::setZ(qreal z) { quaternion.setZ(z); } -QString QDeclarativeMatrix4x4ValueType::toString() const +QString QQmlMatrix4x4ValueType::toString() const { return QString(QLatin1String("QMatrix4x4(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16)")) .arg(matrix(0, 0)).arg(matrix(0, 1)).arg(matrix(0, 2)).arg(matrix(0, 3)) @@ -570,52 +570,52 @@ QString QDeclarativeMatrix4x4ValueType::toString() const .arg(matrix(3, 0)).arg(matrix(3, 1)).arg(matrix(3, 2)).arg(matrix(3, 3)); } -QString QDeclarativeEasingValueType::toString() const +QString QQmlEasingValueType::toString() const { return QString(QLatin1String("QEasingCurve(%1, %2, %3, %4)")).arg(easing.type()).arg(easing.amplitude()).arg(easing.overshoot()).arg(easing.period()); } -QDeclarativeEasingValueType::Type QDeclarativeEasingValueType::type() const +QQmlEasingValueType::Type QQmlEasingValueType::type() const { - return (QDeclarativeEasingValueType::Type)easing.type(); + return (QQmlEasingValueType::Type)easing.type(); } -qreal QDeclarativeEasingValueType::amplitude() const +qreal QQmlEasingValueType::amplitude() const { return easing.amplitude(); } -qreal QDeclarativeEasingValueType::overshoot() const +qreal QQmlEasingValueType::overshoot() const { return easing.overshoot(); } -qreal QDeclarativeEasingValueType::period() const +qreal QQmlEasingValueType::period() const { return easing.period(); } -void QDeclarativeEasingValueType::setType(QDeclarativeEasingValueType::Type type) +void QQmlEasingValueType::setType(QQmlEasingValueType::Type type) { easing.setType((QEasingCurve::Type)type); } -void QDeclarativeEasingValueType::setAmplitude(qreal amplitude) +void QQmlEasingValueType::setAmplitude(qreal amplitude) { easing.setAmplitude(amplitude); } -void QDeclarativeEasingValueType::setOvershoot(qreal overshoot) +void QQmlEasingValueType::setOvershoot(qreal overshoot) { easing.setOvershoot(overshoot); } -void QDeclarativeEasingValueType::setPeriod(qreal period) +void QQmlEasingValueType::setPeriod(qreal period) { easing.setPeriod(period); } -void QDeclarativeEasingValueType::setBezierCurve(const QVariantList &customCurveVariant) +void QQmlEasingValueType::setBezierCurve(const QVariantList &customCurveVariant) { if (customCurveVariant.isEmpty()) return; @@ -652,7 +652,7 @@ void QDeclarativeEasingValueType::setBezierCurve(const QVariantList &customCurve } } -QVariantList QDeclarativeEasingValueType::bezierCurve() const +QVariantList QQmlEasingValueType::bezierCurve() const { QVariantList rv; QList<QPointF> points = easing.cubicBezierSpline(); @@ -661,88 +661,88 @@ QVariantList QDeclarativeEasingValueType::bezierCurve() const return rv; } -void QDeclarativeFontValueType::onLoad() +void QQmlFontValueType::onLoad() { pixelSizeSet = false; pointSizeSet = false; } -QString QDeclarativeFontValueType::toString() const +QString QQmlFontValueType::toString() const { return QString(QLatin1String("QFont(%1)")).arg(font.toString()); } -QString QDeclarativeFontValueType::family() const +QString QQmlFontValueType::family() const { return font.family(); } -void QDeclarativeFontValueType::setFamily(const QString &family) +void QQmlFontValueType::setFamily(const QString &family) { font.setFamily(family); } -bool QDeclarativeFontValueType::bold() const +bool QQmlFontValueType::bold() const { return font.bold(); } -void QDeclarativeFontValueType::setBold(bool b) +void QQmlFontValueType::setBold(bool b) { font.setBold(b); } -QDeclarativeFontValueType::FontWeight QDeclarativeFontValueType::weight() const +QQmlFontValueType::FontWeight QQmlFontValueType::weight() const { - return (QDeclarativeFontValueType::FontWeight)font.weight(); + return (QQmlFontValueType::FontWeight)font.weight(); } -void QDeclarativeFontValueType::setWeight(QDeclarativeFontValueType::FontWeight w) +void QQmlFontValueType::setWeight(QQmlFontValueType::FontWeight w) { font.setWeight((QFont::Weight)w); } -bool QDeclarativeFontValueType::italic() const +bool QQmlFontValueType::italic() const { return font.italic(); } -void QDeclarativeFontValueType::setItalic(bool b) +void QQmlFontValueType::setItalic(bool b) { font.setItalic(b); } -bool QDeclarativeFontValueType::underline() const +bool QQmlFontValueType::underline() const { return font.underline(); } -void QDeclarativeFontValueType::setUnderline(bool b) +void QQmlFontValueType::setUnderline(bool b) { font.setUnderline(b); } -bool QDeclarativeFontValueType::overline() const +bool QQmlFontValueType::overline() const { return font.overline(); } -void QDeclarativeFontValueType::setOverline(bool b) +void QQmlFontValueType::setOverline(bool b) { font.setOverline(b); } -bool QDeclarativeFontValueType::strikeout() const +bool QQmlFontValueType::strikeout() const { return font.strikeOut(); } -void QDeclarativeFontValueType::setStrikeout(bool b) +void QQmlFontValueType::setStrikeout(bool b) { font.setStrikeOut(b); } -qreal QDeclarativeFontValueType::pointSize() const +qreal QQmlFontValueType::pointSize() const { if (font.pointSizeF() == -1) { if (dpi.isNull) @@ -752,7 +752,7 @@ qreal QDeclarativeFontValueType::pointSize() const return font.pointSizeF(); } -void QDeclarativeFontValueType::setPointSize(qreal size) +void QQmlFontValueType::setPointSize(qreal size) { if (pixelSizeSet) { qWarning() << "Both point size and pixel size set. Using pixel size."; @@ -767,7 +767,7 @@ void QDeclarativeFontValueType::setPointSize(qreal size) } } -int QDeclarativeFontValueType::pixelSize() const +int QQmlFontValueType::pixelSize() const { if (font.pixelSize() == -1) { if (dpi.isNull) @@ -777,7 +777,7 @@ int QDeclarativeFontValueType::pixelSize() const return font.pixelSize(); } -void QDeclarativeFontValueType::setPixelSize(int size) +void QQmlFontValueType::setPixelSize(int size) { if (size >0) { if (pointSizeSet) @@ -789,78 +789,78 @@ void QDeclarativeFontValueType::setPixelSize(int size) } } -QDeclarativeFontValueType::Capitalization QDeclarativeFontValueType::capitalization() const +QQmlFontValueType::Capitalization QQmlFontValueType::capitalization() const { - return (QDeclarativeFontValueType::Capitalization)font.capitalization(); + return (QQmlFontValueType::Capitalization)font.capitalization(); } -void QDeclarativeFontValueType::setCapitalization(QDeclarativeFontValueType::Capitalization c) +void QQmlFontValueType::setCapitalization(QQmlFontValueType::Capitalization c) { font.setCapitalization((QFont::Capitalization)c); } -qreal QDeclarativeFontValueType::letterSpacing() const +qreal QQmlFontValueType::letterSpacing() const { return font.letterSpacing(); } -void QDeclarativeFontValueType::setLetterSpacing(qreal size) +void QQmlFontValueType::setLetterSpacing(qreal size) { font.setLetterSpacing(QFont::AbsoluteSpacing, size); } -qreal QDeclarativeFontValueType::wordSpacing() const +qreal QQmlFontValueType::wordSpacing() const { return font.wordSpacing(); } -void QDeclarativeFontValueType::setWordSpacing(qreal size) +void QQmlFontValueType::setWordSpacing(qreal size) { font.setWordSpacing(size); } -QString QDeclarativeColorValueType::toString() const +QString QQmlColorValueType::toString() const { // special case - to maintain behaviour with QtQuick 1.0, we just output normal toString() value. return QVariant(color).toString(); } -qreal QDeclarativeColorValueType::r() const +qreal QQmlColorValueType::r() const { return color.redF(); } -qreal QDeclarativeColorValueType::g() const +qreal QQmlColorValueType::g() const { return color.greenF(); } -qreal QDeclarativeColorValueType::b() const +qreal QQmlColorValueType::b() const { return color.blueF(); } -qreal QDeclarativeColorValueType::a() const +qreal QQmlColorValueType::a() const { return color.alphaF(); } -void QDeclarativeColorValueType::setR(qreal r) +void QQmlColorValueType::setR(qreal r) { color.setRedF(r); } -void QDeclarativeColorValueType::setG(qreal g) +void QQmlColorValueType::setG(qreal g) { color.setGreenF(g); } -void QDeclarativeColorValueType::setB(qreal b) +void QQmlColorValueType::setB(qreal b) { color.setBlueF(b); } -void QDeclarativeColorValueType::setA(qreal a) +void QQmlColorValueType::setA(qreal a) { color.setAlphaF(a); } diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/qml/qml/qqmlvaluetype_p.h index be4c4c2e6d..71817c2a2d 100644 --- a/src/declarative/qml/qdeclarativevaluetype_p.h +++ b/src/qml/qml/qqmlvaluetype_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEVALUETYPE_P_H -#define QDECLARATIVEVALUETYPE_P_H +#ifndef QQMLVALUETYPE_P_H +#define QQMLVALUETYPE_P_H // // W A R N I N G @@ -53,9 +53,9 @@ // We mean it. // -#include "qdeclarativeproperty.h" -#include "qdeclarativeproperty_p.h" -#include "qdeclarativenullablevalue_p_p.h" +#include "qqmlproperty.h" +#include "qqmlproperty_p.h" +#include "qqmlnullablevalue_p_p.h" #include <QtCore/qobject.h> #include <QtCore/qrect.h> @@ -71,13 +71,13 @@ QT_BEGIN_NAMESPACE -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeValueType : public QObject +class Q_QML_PRIVATE_EXPORT QQmlValueType : public QObject { Q_OBJECT public: - QDeclarativeValueType(QObject *parent = 0); + QQmlValueType(QObject *parent = 0); virtual void read(QObject *, int) = 0; - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags flags) = 0; + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags flags) = 0; virtual QVariant value() = 0; virtual void setValue(const QVariant &) = 0; @@ -87,37 +87,37 @@ public: inline void onLoad(); }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeValueTypeFactory +class Q_QML_PRIVATE_EXPORT QQmlValueTypeFactory { public: - QDeclarativeValueTypeFactory(); - ~QDeclarativeValueTypeFactory(); + QQmlValueTypeFactory(); + ~QQmlValueTypeFactory(); static bool isValueType(int); - static QDeclarativeValueType *valueType(int); + static QQmlValueType *valueType(int); static void registerBaseTypes(const char *uri, int versionMajor, int versionMinor); static void registerValueTypes(); - QDeclarativeValueType *operator[](int idx) const { + QQmlValueType *operator[](int idx) const { if (idx >= (int)QVariant::UserType) return 0; else return valueTypes[idx]; } private: - QDeclarativeValueType *valueTypes[QVariant::UserType - 1]; + QQmlValueType *valueTypes[QVariant::UserType - 1]; }; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePointFValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlPointFValueType : public QQmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) Q_OBJECT public: - QDeclarativePointFValueType(QObject *parent = 0); + QQmlPointFValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -133,16 +133,16 @@ private: }; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePointValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlPointValueType : public QQmlValueType { Q_PROPERTY(int x READ x WRITE setX) Q_PROPERTY(int y READ y WRITE setY) Q_OBJECT public: - QDeclarativePointValueType(QObject *parent = 0); + QQmlPointValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -158,16 +158,16 @@ private: }; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeSizeFValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlSizeFValueType : public QQmlValueType { Q_PROPERTY(qreal width READ width WRITE setWidth) Q_PROPERTY(qreal height READ height WRITE setHeight) Q_OBJECT public: - QDeclarativeSizeFValueType(QObject *parent = 0); + QQmlSizeFValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -183,16 +183,16 @@ private: }; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeSizeValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlSizeValueType : public QQmlValueType { Q_PROPERTY(int width READ width WRITE setWidth) Q_PROPERTY(int height READ height WRITE setHeight) Q_OBJECT public: - QDeclarativeSizeValueType(QObject *parent = 0); + QQmlSizeValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -208,7 +208,7 @@ private: }; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeRectFValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlRectFValueType : public QQmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -216,10 +216,10 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeRectFValueType : public QDeclarat Q_PROPERTY(qreal height READ height WRITE setHeight) Q_OBJECT public: - QDeclarativeRectFValueType(QObject *parent = 0); + QQmlRectFValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -240,7 +240,7 @@ private: }; // Exported for QtQuick1 -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeRectValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlRectValueType : public QQmlValueType { Q_PROPERTY(int x READ x WRITE setX) Q_PROPERTY(int y READ y WRITE setY) @@ -248,10 +248,10 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeRectValueType : public QDeclarati Q_PROPERTY(int height READ height WRITE setHeight) Q_OBJECT public: - QDeclarativeRectValueType(QObject *parent = 0); + QQmlRectValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -271,16 +271,16 @@ private: QRect rect; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeVector2DValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlVector2DValueType : public QQmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) Q_OBJECT public: - QDeclarativeVector2DValueType(QObject *parent = 0); + QQmlVector2DValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -295,17 +295,17 @@ private: QVector2D vector; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeVector3DValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlVector3DValueType : public QQmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) Q_PROPERTY(qreal z READ z WRITE setZ) Q_OBJECT public: - QDeclarativeVector3DValueType(QObject *parent = 0); + QQmlVector3DValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -322,7 +322,7 @@ private: QVector3D vector; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeVector4DValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlVector4DValueType : public QQmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -330,10 +330,10 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeVector4DValueType : public QDecla Q_PROPERTY(qreal w READ w WRITE setW) Q_OBJECT public: - QDeclarativeVector4DValueType(QObject *parent = 0); + QQmlVector4DValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -352,7 +352,7 @@ private: QVector4D vector; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeQuaternionValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlQuaternionValueType : public QQmlValueType { Q_PROPERTY(qreal scalar READ scalar WRITE setScalar) Q_PROPERTY(qreal x READ x WRITE setX) @@ -360,10 +360,10 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeQuaternionValueType : public QDec Q_PROPERTY(qreal z READ z WRITE setZ) Q_OBJECT public: - QDeclarativeQuaternionValueType(QObject *parent = 0); + QQmlQuaternionValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -382,7 +382,7 @@ private: QQuaternion quaternion; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeMatrix4x4ValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlMatrix4x4ValueType : public QQmlValueType { Q_PROPERTY(qreal m11 READ m11 WRITE setM11) Q_PROPERTY(qreal m12 READ m12 WRITE setM12) @@ -402,10 +402,10 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeMatrix4x4ValueType : public QDecl Q_PROPERTY(qreal m44 READ m44 WRITE setM44) Q_OBJECT public: - QDeclarativeMatrix4x4ValueType(QObject *parent = 0); + QQmlMatrix4x4ValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -449,12 +449,12 @@ private: QMatrix4x4 matrix; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEasingValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlEasingValueType : public QQmlValueType { Q_OBJECT Q_ENUMS(Type) - Q_PROPERTY(QDeclarativeEasingValueType::Type type READ type WRITE setType) + Q_PROPERTY(QQmlEasingValueType::Type type READ type WRITE setType) Q_PROPERTY(qreal amplitude READ amplitude WRITE setAmplitude) Q_PROPERTY(qreal overshoot READ overshoot WRITE setOvershoot) Q_PROPERTY(qreal period READ period WRITE setPeriod) @@ -487,10 +487,10 @@ public: Bezier = QEasingCurve::BezierSpline }; - QDeclarativeEasingValueType(QObject *parent = 0); + QQmlEasingValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -512,7 +512,7 @@ private: QEasingCurve easing; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeFontValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlFontValueType : public QQmlValueType { Q_OBJECT Q_ENUMS(FontWeight) @@ -543,10 +543,10 @@ public: SmallCaps = QFont::SmallCaps, Capitalize = QFont::Capitalize }; - QDeclarativeFontValueType(QObject *parent = 0); + QQmlFontValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -593,10 +593,10 @@ private: QFont font; bool pixelSizeSet; bool pointSizeSet; - mutable QDeclarativeNullableValue<int> dpi; + mutable QQmlNullableValue<int> dpi; }; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeColorValueType : public QDeclarativeValueType +class Q_QML_PRIVATE_EXPORT QQmlColorValueType : public QQmlValueType { Q_PROPERTY(qreal r READ r WRITE setR) Q_PROPERTY(qreal g READ g WRITE setG) @@ -604,10 +604,10 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeColorValueType : public QDeclarat Q_PROPERTY(qreal a READ a WRITE setA) Q_OBJECT public: - QDeclarativeColorValueType(QObject *parent = 0); + QQmlColorValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QQmlPropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(const QVariant &value); virtual QString toString() const; @@ -626,10 +626,10 @@ private: QColor color; }; -void QDeclarativeValueType::onLoad() +void QQmlValueType::onLoad() { } QT_END_NAMESPACE -#endif // QDECLARATIVEVALUETYPE_P_H +#endif // QQMLVALUETYPE_P_H diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/qml/qml/qqmlvme.cpp index 254ae5de43..2b66e00bad 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,33 +39,33 @@ ** ****************************************************************************/ -#include "qdeclarativevme_p.h" +#include "qqmlvme_p.h" -#include "qdeclarativecompiler_p.h" -#include "qdeclarativeboundsignal_p.h" -#include "qdeclarativestringconverters_p.h" +#include "qqmlcompiler_p.h" +#include "qqmlboundsignal_p.h" +#include "qqmlstringconverters_p.h" #include <private/qmetaobjectbuilder_p.h> #include <private/qfastmetabuilder_p.h> -#include "qdeclarativedata_p.h" -#include "qdeclarative.h" -#include "qdeclarativecustomparser_p.h" -#include "qdeclarativeengine.h" -#include "qdeclarativecontext.h" -#include "qdeclarativecomponent.h" -#include "qdeclarativecomponentattached_p.h" -#include "qdeclarativebinding_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativecomponent_p.h" -#include "qdeclarativevmemetaobject_p.h" -#include "qdeclarativebinding_p_p.h" -#include "qdeclarativecontext_p.h" +#include "qqmldata_p.h" +#include "qqml.h" +#include "qqmlcustomparser_p.h" +#include "qqmlengine.h" +#include "qqmlcontext.h" +#include "qqmlcomponent.h" +#include "qqmlcomponentattached_p.h" +#include "qqmlbinding_p.h" +#include "qqmlengine_p.h" +#include "qqmlcomponent_p.h" +#include "qqmlvmemetaobject_p.h" +#include "qqmlbinding_p_p.h" +#include "qqmlcontext_p.h" #include <private/qv4bindings_p.h> #include <private/qv8bindings_p.h> -#include "qdeclarativeglobal_p.h" +#include "qqmlglobal_p.h" #include <private/qfinitestack_p.h> -#include "qdeclarativescriptstring.h" -#include "qdeclarativescriptstring_p.h" -#include "qdeclarativepropertyvalueinterceptor_p.h" +#include "qqmlscriptstring.h" +#include "qqmlscriptstring_p.h" +#include "qqmlpropertyvalueinterceptor_p.h" #include <QStack> #include <QColor> @@ -77,15 +77,15 @@ #include <QtCore/qcoreapplication.h> #include <QtCore/qdatetime.h> #include <QtCore/qvarlengtharray.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> QT_BEGIN_NAMESPACE -using namespace QDeclarativeVMETypes; +using namespace QQmlVMETypes; #define VME_EXCEPTION(desc, line) \ { \ - QDeclarativeError error; \ + QQmlError error; \ error.setDescription(desc.trimmed()); \ error.setLine(line); \ error.setUrl(COMP->url); \ @@ -93,8 +93,8 @@ using namespace QDeclarativeVMETypes; goto exceptionExit; \ } -void QDeclarativeVME::init(QDeclarativeContextData *ctxt, QDeclarativeCompiledData *comp, int start, - QDeclarativeContextData *creation) +void QQmlVME::init(QQmlContextData *ctxt, QQmlCompiledData *comp, int start, + QQmlContextData *creation) { Q_ASSERT(ctxt); Q_ASSERT(comp); @@ -111,7 +111,7 @@ void QDeclarativeVME::init(QDeclarativeContextData *ctxt, QDeclarativeCompiledDa initState.instructionStream = comp->bytecode.constData() + start; states.push(initState); - typedef QDeclarativeInstruction I; + typedef QQmlInstruction I; I *i = (I *)initState.instructionStream; Q_ASSERT(comp->instructionType(i) == I::Init); @@ -130,15 +130,15 @@ void QDeclarativeVME::init(QDeclarativeContextData *ctxt, QDeclarativeCompiledDa engine = ctxt->engine; } -bool QDeclarativeVME::initDeferred(QObject *object) +bool QQmlVME::initDeferred(QObject *object) { - QDeclarativeData *data = QDeclarativeData::get(object); + QQmlData *data = QQmlData::get(object); if (!data || !data->context || !data->deferredComponent) return false; - QDeclarativeContextData *ctxt = data->context; - QDeclarativeCompiledData *comp = data->deferredComponent; + QQmlContextData *ctxt = data->context; + QQmlCompiledData *comp = data->deferredComponent; int start = data->deferredIdx; State initState; @@ -148,7 +148,7 @@ bool QDeclarativeVME::initDeferred(QObject *object) initState.instructionStream = comp->bytecode.constData() + start; states.push(initState); - typedef QDeclarativeInstruction I; + typedef QQmlInstruction I; I *i = (I *)initState.instructionStream; Q_ASSERT(comp->instructionType(i) == I::DeferInit); @@ -174,25 +174,25 @@ bool QDeclarativeVME::initDeferred(QObject *object) namespace { struct ActiveVMERestorer { - ActiveVMERestorer(QDeclarativeVME *me, QDeclarativeEnginePrivate *ep) + ActiveVMERestorer(QQmlVME *me, QQmlEnginePrivate *ep) : ep(ep), oldVME(ep->activeVME) { ep->activeVME = me; } ~ActiveVMERestorer() { ep->activeVME = oldVME; } - QDeclarativeEnginePrivate *ep; - QDeclarativeVME *oldVME; + QQmlEnginePrivate *ep; + QQmlVME *oldVME; }; } -QObject *QDeclarativeVME::execute(QList<QDeclarativeError> *errors, const Interrupt &interrupt) +QObject *QQmlVME::execute(QList<QQmlError> *errors, const Interrupt &interrupt) { Q_ASSERT(states.count() >= 1); #ifdef QML_ENABLE_TRACE - QDeclarativeTrace trace("VME Execute"); + QQmlTrace trace("VME Execute"); trace.addDetail("URL", rootComponent->url); #endif - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(states.at(0).context->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(states.at(0).context->engine); ActiveVMERestorer restore(this, ep); @@ -203,7 +203,7 @@ QObject *QDeclarativeVME::execute(QList<QDeclarativeError> *errors, const Interr inline bool fastHasBinding(QObject *o, int index) { - QDeclarativeData *ddata = static_cast<QDeclarativeData *>(QObjectPrivate::get(o)->declarativeData); + QQmlData *ddata = static_cast<QQmlData *>(QObjectPrivate::get(o)->declarativeData); return ddata && (ddata->bindingBitsSize > index) && (ddata->bindingBits[index / 32] & (1 << (index % 32))); @@ -211,20 +211,20 @@ inline bool fastHasBinding(QObject *o, int index) static void removeBindingOnProperty(QObject *o, int index) { - QDeclarativeAbstractBinding *binding = QDeclarativePropertyPrivate::setBinding(o, index, -1, 0); + QQmlAbstractBinding *binding = QQmlPropertyPrivate::setBinding(o, index, -1, 0); if (binding) binding->destroy(); } static QVariant variantFromString(const QString &string) { - return QDeclarativeStringConverters::variantFromString(string); + return QQmlStringConverters::variantFromString(string); } // XXX we probably need some form of "work count" here to prevent us checking this // for every instruction. #define QML_BEGIN_INSTR_COMMON(I) { \ - const QDeclarativeInstructionMeta<(int)QDeclarativeInstruction::I>::DataType &instr = QDeclarativeInstructionMeta<(int)QDeclarativeInstruction::I>::data(*genericInstr); \ - INSTRUCTIONSTREAM += QDeclarativeInstructionMeta<(int)QDeclarativeInstruction::I>::Size; \ + const QQmlInstructionMeta<(int)QQmlInstruction::I>::DataType &instr = QQmlInstructionMeta<(int)QQmlInstruction::I>::data(*genericInstr); \ + INSTRUCTIONSTREAM += QQmlInstructionMeta<(int)QQmlInstruction::I>::Size; \ Q_UNUSED(instr); #ifdef QML_THREADED_VME_INTERPRETER @@ -233,19 +233,19 @@ static QVariant variantFromString(const QString &string) # define QML_NEXT_INSTR(I) { \ if (watcher.hasRecursed()) return 0; \ - genericInstr = reinterpret_cast<const QDeclarativeInstruction *>(INSTRUCTIONSTREAM); \ + genericInstr = reinterpret_cast<const QQmlInstruction *>(INSTRUCTIONSTREAM); \ goto *genericInstr->common.code; \ } # define QML_END_INSTR(I) } \ if (watcher.hasRecursed()) return 0; \ - genericInstr = reinterpret_cast<const QDeclarativeInstruction *>(INSTRUCTIONSTREAM); \ + genericInstr = reinterpret_cast<const QQmlInstruction *>(INSTRUCTIONSTREAM); \ if (interrupt.shouldInterrupt()) return 0; \ goto *genericInstr->common.code; #else # define QML_BEGIN_INSTR(I) \ - case QDeclarativeInstruction::I: \ + case QQmlInstruction::I: \ QML_BEGIN_INSTR_COMMON(I) # define QML_NEXT_INSTR(I) { \ @@ -283,7 +283,7 @@ static QVariant variantFromString(const QString &string) QObject *target = objects.top(); \ CLEAN_PROPERTY(target, instr.propertyIndex); \ QMetaObject *mo = const_cast<QMetaObject *>(target->metaObject()); \ - QDeclarativeVMEMetaObject *vmemo = static_cast<QDeclarativeVMEMetaObject *>(mo); \ + QQmlVMEMetaObject *vmemo = static_cast<QQmlVMEMetaObject *>(mo); \ vmemo->setVMEProperty(instr.propertyIndex, v8value); \ QML_END_INSTR(name) @@ -299,7 +299,7 @@ static QVariant variantFromString(const QString &string) if (fastHasBinding(o, index)) \ removeBindingOnProperty(o, index) -QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, +QObject *QQmlVME::run(QList<QQmlError> *errors, const Interrupt &interrupt #ifdef QML_THREADED_VME_INTERPRETER , void ***storeJumpTable @@ -320,18 +320,18 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, Q_ASSERT(errors->isEmpty()); Q_ASSERT(states.count() >= 1); - QDeclarativeEngine *engine = states.at(0).context->engine; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEngine *engine = states.at(0).context->engine; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); // Need a v8 handle scope and execution context for StoreVar instructions. v8::HandleScope handleScope; v8::Context::Scope contextScope(ep->v8engine()->context()); int status = -1; // needed for dbus - QDeclarativePropertyPrivate::WriteFlags flags = QDeclarativePropertyPrivate::BypassInterceptor | - QDeclarativePropertyPrivate::RemoveBindingOnAliasWrite; + QQmlPropertyPrivate::WriteFlags flags = QQmlPropertyPrivate::BypassInterceptor | + QQmlPropertyPrivate::RemoveBindingOnAliasWrite; - QRecursionWatcher<QDeclarativeVME, &QDeclarativeVME::recursion> watcher(this); + QRecursionWatcher<QQmlVME, &QQmlVME::recursion> watcher(this); #define COMP states.top().compiledData #define CTXT states.top().context @@ -347,11 +347,11 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, #define URLS COMP->urls #ifdef QML_THREADED_VME_INTERPRETER - const QDeclarativeInstruction *genericInstr = reinterpret_cast<const QDeclarativeInstruction *>(INSTRUCTIONSTREAM); + const QQmlInstruction *genericInstr = reinterpret_cast<const QQmlInstruction *>(INSTRUCTIONSTREAM); goto *genericInstr->common.code; #else for (;;) { - const QDeclarativeInstruction *genericInstr = reinterpret_cast<const QDeclarativeInstruction *>(INSTRUCTIONSTREAM); + const QQmlInstruction *genericInstr = reinterpret_cast<const QQmlInstruction *>(INSTRUCTIONSTREAM); switch (genericInstr->common.instructionType) { #endif @@ -416,8 +416,8 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, // Ensure that the compiled data has been initialized if (!COMP->isInitialized()) COMP->initialize(engine); - QDeclarativeContextData *parentCtxt = CTXT; - CTXT = new QDeclarativeContextData; + QQmlContextData *parentCtxt = CTXT; + CTXT = new QQmlContextData; CTXT->isInternal = true; CTXT->url = COMP->url; CTXT->urlString = COMP->name; @@ -468,7 +468,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_END_INSTR(Done) QML_BEGIN_INSTR(CreateQMLObject) - const QDeclarativeCompiledData::TypeReference &type = TYPES.at(instr.type); + const QQmlCompiledData::TypeReference &type = TYPES.at(instr.type); Q_ASSERT(type.component); states.push(State()); @@ -494,7 +494,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_BEGIN_INSTR(CompleteQMLObject) QObject *o = objects.top(); - QDeclarativeData *ddata = QDeclarativeData::get(o); + QQmlData *ddata = QQmlData::get(o); Q_ASSERT(ddata); if (instr.isRoot) { @@ -502,7 +502,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, Q_ASSERT(ddata->context != CTXT); Q_ASSERT(ddata->outerContext); Q_ASSERT(ddata->outerContext != CTXT); - QDeclarativeContextData *c = ddata->context; + QQmlContextData *c = ddata->context; while (c->linkedContext) c = c->linkedContext; c->linkedContext = CTXT; } else { @@ -521,13 +521,13 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_END_INSTR(CompleteQMLObject) QML_BEGIN_INSTR(CreateCppObject) - const QDeclarativeCompiledData::TypeReference &type = TYPES.at(instr.type); + const QQmlCompiledData::TypeReference &type = TYPES.at(instr.type); Q_ASSERT(type.type); QObject *o = 0; void *memory = 0; - type.type->create(&o, &memory, sizeof(QDeclarativeData)); - QDeclarativeData *ddata = new (memory) QDeclarativeData; + type.type->create(&o, &memory, sizeof(QQmlData)); + QQmlData *ddata = new (memory) QQmlData; ddata->ownMemory = false; QObjectPrivate::get(o)->declarativeData = ddata; @@ -544,7 +544,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, Q_ASSERT(ddata->context != CTXT); Q_ASSERT(ddata->outerContext); Q_ASSERT(ddata->outerContext != CTXT); - QDeclarativeContextData *c = ddata->context; + QQmlContextData *c = ddata->context; while (c->linkedContext) c = c->linkedContext; c->linkedContext = CTXT; } else { @@ -562,7 +562,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, ddata->columnNumber = instr.column; if (instr.data != -1) { - QDeclarativeCustomParser *customParser = + QQmlCustomParser *customParser = TYPES.at(instr.type).type->customParser(); customParser->setCustomData(o, DATAS.at(instr.data)); } @@ -573,18 +573,18 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, static_cast<QWidget*>(o)->setParent(static_cast<QWidget*>(parent)); else #endif - QDeclarative_setParent_noEvent(o, parent); + QQml_setParent_noEvent(o, parent); } objects.push(o); QML_END_INSTR(CreateCppObject) QML_BEGIN_INSTR(CreateSimpleObject) - QObject *o = (QObject *)operator new(instr.typeSize + sizeof(QDeclarativeData)); - ::memset(o, 0, instr.typeSize + sizeof(QDeclarativeData)); + QObject *o = (QObject *)operator new(instr.typeSize + sizeof(QQmlData)); + ::memset(o, 0, instr.typeSize + sizeof(QQmlData)); instr.create(o); - QDeclarativeData *ddata = (QDeclarativeData *)(((const char *)o) + instr.typeSize); - const QDeclarativeCompiledData::TypeReference &ref = TYPES.at(instr.type); + QQmlData *ddata = (QQmlData *)(((const char *)o) + instr.typeSize); + const QQmlCompiledData::TypeReference &ref = TYPES.at(instr.type); if (!ddata->propertyCache && ref.typePropertyCache) { ddata->propertyCache = ref.typePropertyCache; ddata->propertyCache->addref(); @@ -601,7 +601,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, CTXT->contextObjects = ddata; QObject *parent = objects.top(); - QDeclarative_setParent_noEvent(o, parent); + QQml_setParent_noEvent(o, parent); objects.push(o); QML_END_INSTR(CreateSimpleObject) @@ -616,11 +616,11 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_END_INSTR(SetDefault) QML_BEGIN_INSTR(CreateComponent) - QDeclarativeComponent *qcomp = - new QDeclarativeComponent(CTXT->engine, COMP, INSTRUCTIONSTREAM - COMP->bytecode.constData(), + QQmlComponent *qcomp = + new QQmlComponent(CTXT->engine, COMP, INSTRUCTIONSTREAM - COMP->bytecode.constData(), objects.isEmpty() ? 0 : objects.top()); - QDeclarativeData *ddata = QDeclarativeData::get(qcomp, true); + QQmlData *ddata = QQmlData::get(qcomp, true); Q_ASSERT(ddata); CTXT->addObject(qcomp); @@ -633,7 +633,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, ddata->lineNumber = instr.line; ddata->columnNumber = instr.column; - QDeclarativeComponentPrivate::get(qcomp)->creationContext = CTXT; + QQmlComponentPrivate::get(qcomp)->creationContext = CTXT; objects.push(qcomp); INSTRUCTIONSTREAM += instr.count; @@ -646,13 +646,13 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, const QByteArray &metadata = DATAS.at(instr.data); QFastMetaBuilder::fromData(&mo, 0, metadata); - const QDeclarativeVMEMetaData *data = - (const QDeclarativeVMEMetaData *)DATAS.at(instr.aliasData).constData(); + const QQmlVMEMetaData *data = + (const QQmlVMEMetaData *)DATAS.at(instr.aliasData).constData(); - (void)new QDeclarativeVMEMetaObject(target, &mo, data, COMP); + (void)new QQmlVMEMetaObject(target, &mo, data, COMP); if (instr.propertyCache != -1) { - QDeclarativeData *ddata = QDeclarativeData::get(target, true); + QQmlData *ddata = QQmlData::get(target, true); if (ddata->propertyCache) ddata->propertyCache->release(); ddata->propertyCache = PROPERTYCACHES.at(instr.propertyCache); ddata->propertyCache->addref(); @@ -665,7 +665,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, const QString &primitive = PRIMITIVES.at(instr.primitive); int type = instr.type; - QDeclarativeMetaType::StringConverter converter = QDeclarativeMetaType::customStringConverter(type); + QQmlMetaType::StringConverter converter = QQmlMetaType::customStringConverter(type); QVariant v = (*converter)(primitive); QMetaProperty prop = @@ -686,17 +686,17 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, int sigIdx = instr.signal; const QString &pr = PRIMITIVES.at(sigIdx); - QDeclarativeProperty prop(target, pr); - if (prop.type() & QDeclarativeProperty::SignalProperty) { + QQmlProperty prop(target, pr); + if (prop.type() & QQmlProperty::SignalProperty) { - QMetaMethod method = QDeclarativeMetaType::defaultMethod(assign); + QMetaMethod method = QQmlMetaType::defaultMethod(assign); if (method.signature() == 0) VME_EXCEPTION(tr("Cannot assign object type %1 with no default method").arg(QString::fromLatin1(assign->metaObject()->className())), instr.line); if (!QMetaObject::checkConnectArgs(prop.method().signature(), method.signature())) VME_EXCEPTION(tr("Cannot connect mismatched signal/slot %1 %vs. %2").arg(QString::fromLatin1(method.signature())).arg(QString::fromLatin1(prop.method().signature())), instr.line); - QDeclarativePropertyPrivate::connect(target, prop.index(), assign, method.methodIndex()); + QQmlPropertyPrivate::connect(target, prop.index(), assign, method.methodIndex()); } else { VME_EXCEPTION(tr("Cannot assign an object to signal property %1").arg(pr), instr.line); @@ -711,9 +711,9 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QMetaMethod signal = target->metaObject()->method(instr.signalIndex); - QDeclarativeBoundSignal *bs = new QDeclarativeBoundSignal(target, signal, target); - QDeclarativeExpression *expr = - new QDeclarativeExpression(CTXT, context, DATAS.at(instr.value), true, COMP->name, instr.line, instr.column, *new QDeclarativeExpressionPrivate); + QQmlBoundSignal *bs = new QQmlBoundSignal(target, signal, target); + QQmlExpression *expr = + new QQmlExpression(CTXT, context, DATAS.at(instr.value), true, COMP->name, instr.line, instr.column, *new QQmlExpressionPrivate); bs->setExpression(expr); QML_END_INSTR(StoreSignal) @@ -724,8 +724,8 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_BEGIN_INSTR(StoreScriptString) QObject *target = objects.top(); QObject *scope = objects.at(objects.count() - 1 - instr.scope); - QDeclarativeScriptString ss; - ss.setContext(CTXT->asQDeclarativeContext()); + QQmlScriptString ss; + ss.setContext(CTXT->asQQmlContext()); ss.setScopeObject(scope); ss.setScript(PRIMITIVES.at(instr.value)); ss.d.data()->bindingId = instr.bindingId; @@ -739,11 +739,11 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_BEGIN_INSTR(BeginObject) QObject *target = objects.top(); - QDeclarativeParserStatus *status = reinterpret_cast<QDeclarativeParserStatus *>(reinterpret_cast<char *>(target) + instr.castValue); + QQmlParserStatus *status = reinterpret_cast<QQmlParserStatus *>(reinterpret_cast<char *>(target) + instr.castValue); parserStatus.push(status); #ifdef QML_ENABLE_TRACE Q_ASSERT(QObjectPrivate::get(target)->declarativeData); - parserStatusData.push(static_cast<QDeclarativeData *>(QObjectPrivate::get(target)->declarativeData)); + parserStatusData.push(static_cast<QQmlData *>(QObjectPrivate::get(target)->declarativeData)); #endif status->d = &parserStatus.top(); @@ -763,14 +763,14 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, if (instr.isRoot && BINDINGSKIPLIST.testBit(instr.property.coreIndex)) QML_NEXT_INSTR(StoreBinding); - QDeclarativeBinding *bind = new QDeclarativeBinding(PRIMITIVES.at(instr.value), true, + QQmlBinding *bind = new QQmlBinding(PRIMITIVES.at(instr.value), true, context, CTXT, COMP->name, instr.line, instr.column); bindValues.push(bind); bind->m_mePtr = &bindValues.top(); bind->setTarget(target, instr.property, CTXT); - typedef QDeclarativePropertyPrivate QDPP; + typedef QQmlPropertyPrivate QDPP; Q_ASSERT(bind->propertyIndex() == QDPP::bindingIndex(instr.property)); Q_ASSERT(bind->object() == target); @@ -786,15 +786,15 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, if (instr.isRoot && BINDINGSKIPLIST.testBit(instr.property.coreIndex)) QML_NEXT_INSTR(StoreBindingOnAlias); - QDeclarativeBinding *bind = new QDeclarativeBinding(PRIMITIVES.at(instr.value), true, + QQmlBinding *bind = new QQmlBinding(PRIMITIVES.at(instr.value), true, context, CTXT, COMP->name, instr.line, instr.column); bindValues.push(bind); bind->m_mePtr = &bindValues.top(); bind->setTarget(target, instr.property, CTXT); - QDeclarativeAbstractBinding *old = - QDeclarativePropertyPrivate::setBindingNoEnable(target, instr.property.coreIndex, + QQmlAbstractBinding *old = + QQmlPropertyPrivate::setBindingNoEnable(target, instr.property.coreIndex, instr.property.getValueTypeCoreIndex(), bind); if (old) { old->destroy(); } @@ -810,7 +810,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, if (instr.isRoot && BINDINGSKIPLIST.testBit(property & 0xFFFF)) QML_NEXT_INSTR(StoreV4Binding); - QDeclarativeAbstractBinding *binding = + QQmlAbstractBinding *binding = CTXT->v4bindings->configBinding(instr.value, target, scope, property, instr.line, instr.column); bindValues.push(binding); @@ -831,13 +831,13 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, if (instr.isRoot && BINDINGSKIPLIST.testBit(instr.property.coreIndex)) QML_NEXT_INSTR(StoreV8Binding); - QDeclarativeAbstractBinding *binding = CTXT->v8bindings->configBinding(target, scope, + QQmlAbstractBinding *binding = CTXT->v8bindings->configBinding(target, scope, &instr); if (binding) { bindValues.push(binding); binding->m_mePtr = &bindValues.top(); - typedef QDeclarativePropertyPrivate QDPP; + typedef QQmlPropertyPrivate QDPP; Q_ASSERT(binding->propertyIndex() == QDPP::bindingIndex(instr.property)); Q_ASSERT(binding->object() == target); @@ -847,30 +847,30 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_BEGIN_INSTR(StoreValueSource) QObject *obj = objects.pop(); - QDeclarativePropertyValueSource *vs = reinterpret_cast<QDeclarativePropertyValueSource *>(reinterpret_cast<char *>(obj) + instr.castValue); + QQmlPropertyValueSource *vs = reinterpret_cast<QQmlPropertyValueSource *>(reinterpret_cast<char *>(obj) + instr.castValue); QObject *target = objects.at(objects.count() - 1 - instr.owner); obj->setParent(target); - vs->setTarget(QDeclarativePropertyPrivate::restore(target, instr.property, CTXT)); + vs->setTarget(QQmlPropertyPrivate::restore(target, instr.property, CTXT)); QML_END_INSTR(StoreValueSource) QML_BEGIN_INSTR(StoreValueInterceptor) QObject *obj = objects.pop(); - QDeclarativePropertyValueInterceptor *vi = reinterpret_cast<QDeclarativePropertyValueInterceptor *>(reinterpret_cast<char *>(obj) + instr.castValue); + QQmlPropertyValueInterceptor *vi = reinterpret_cast<QQmlPropertyValueInterceptor *>(reinterpret_cast<char *>(obj) + instr.castValue); QObject *target = objects.at(objects.count() - 1 - instr.owner); - QDeclarativeProperty prop = - QDeclarativePropertyPrivate::restore(target, instr.property, CTXT); + QQmlProperty prop = + QQmlPropertyPrivate::restore(target, instr.property, CTXT); obj->setParent(target); vi->setTarget(prop); - QDeclarativeVMEMetaObject *mo = static_cast<QDeclarativeVMEMetaObject *>((QMetaObject*)target->metaObject()); - mo->registerInterceptor(prop.index(), QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), vi); + QQmlVMEMetaObject *mo = static_cast<QQmlVMEMetaObject *>((QMetaObject*)target->metaObject()); + mo->registerInterceptor(prop.index(), QQmlPropertyPrivate::valueTypeCoreIndex(prop), vi); QML_END_INSTR(StoreValueInterceptor) QML_BEGIN_INSTR(StoreObjectQList) QObject *assign = objects.pop(); const List &list = lists.top(); - list.qListProperty.append((QDeclarativeListProperty<void>*)&list.qListProperty, assign); + list.qListProperty.append((QQmlListProperty<void>*)&list.qListProperty, assign); QML_END_INSTR(StoreObjectQList) QML_BEGIN_INSTR(AssignObjectList) @@ -882,14 +882,14 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, void *ptr = 0; - const char *iid = QDeclarativeMetaType::interfaceIId(type); + const char *iid = QQmlMetaType::interfaceIId(type); if (iid) ptr = assign->qt_metacast(iid); if (!ptr) VME_EXCEPTION(tr("Cannot assign object to list"), instr.line); - list.qListProperty.append((QDeclarativeListProperty<void>*)&list.qListProperty, ptr); + list.qListProperty.append((QQmlListProperty<void>*)&list.qListProperty, ptr); QML_END_INSTR(AssignObjectList) QML_BEGIN_INSTR(StoreInterface) @@ -900,7 +900,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, int coreIdx = instr.propertyIndex; QMetaProperty prop = target->metaObject()->property(coreIdx); int t = prop.userType(); - const char *iid = QDeclarativeMetaType::interfaceIId(t); + const char *iid = QQmlMetaType::interfaceIId(t); bool ok = false; if (iid) { void *ptr = assign->qt_metacast(iid); @@ -963,8 +963,8 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, QML_BEGIN_INSTR(Defer) if (instr.deferCount) { QObject *target = objects.top(); - QDeclarativeData *data = - QDeclarativeData::get(target, true); + QQmlData *data = + QQmlData::get(target, true); COMP->addref(); data->deferredComponent = COMP; data->deferredIdx = INSTRUCTIONSTREAM - COMP->bytecode.constData(); @@ -981,39 +981,39 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors, if (instr.bindingSkipList != 0) { // Possibly need to clear bindings - QDeclarativeData *targetData = QDeclarativeData::get(target); + QQmlData *targetData = QQmlData::get(target); if (targetData) { - QDeclarativeAbstractBinding *binding = - QDeclarativePropertyPrivate::binding(target, instr.property, -1); + QQmlAbstractBinding *binding = + QQmlPropertyPrivate::binding(target, instr.property, -1); - if (binding && binding->bindingType() != QDeclarativeAbstractBinding::ValueTypeProxy) { - QDeclarativePropertyPrivate::setBinding(target, instr.property, -1, 0); + if (binding && binding->bindingType() != QQmlAbstractBinding::ValueTypeProxy) { + QQmlPropertyPrivate::setBinding(target, instr.property, -1, 0); binding->destroy(); } else if (binding) { - QDeclarativeValueTypeProxyBinding *proxy = - static_cast<QDeclarativeValueTypeProxyBinding *>(binding); + QQmlValueTypeProxyBinding *proxy = + static_cast<QQmlValueTypeProxyBinding *>(binding); proxy->removeBindings(instr.bindingSkipList); } } } - QDeclarativeValueType *valueHandler = ep->valueTypes[instr.type]; + QQmlValueType *valueHandler = ep->valueTypes[instr.type]; valueHandler->read(target, instr.property); objects.push(valueHandler); QML_END_INSTR(FetchValueType) QML_BEGIN_INSTR(PopValueType) - QDeclarativeValueType *valueHandler = - static_cast<QDeclarativeValueType *>(objects.pop()); + QQmlValueType *valueHandler = + static_cast<QQmlValueType *>(objects.pop()); QObject *target = objects.top(); - valueHandler->write(target, instr.property, QDeclarativePropertyPrivate::BypassInterceptor); + valueHandler->write(target, instr.property, QQmlPropertyPrivate::BypassInterceptor); QML_END_INSTR(PopValueType) #ifdef QML_THREADED_VME_INTERPRETER // nothing to do #else default: - qFatal("QDeclarativeCompiledData: Internal error - unknown instruction %d", genericInstr->common.instructionType); + qFatal("QQmlCompiledData: Internal error - unknown instruction %d", genericInstr->common.instructionType); break; } } @@ -1039,11 +1039,11 @@ normalExit: return rv; } -void QDeclarativeVME::reset() +void QQmlVME::reset() { Q_ASSERT(!states.isEmpty() || objects.isEmpty()); - QRecursionWatcher<QDeclarativeVME, &QDeclarativeVME::recursion> watcher(this); + QRecursionWatcher<QQmlVME, &QQmlVME::recursion> watcher(this); if (!objects.isEmpty() && !(states.at(0).flags & State::Deferred)) delete objects.at(0); @@ -1051,12 +1051,12 @@ void QDeclarativeVME::reset() if (!rootContext.isNull()) rootContext->activeVMEData = 0; - // Remove the QDeclarativeParserStatus and QDeclarativeAbstractBinding back pointers + // Remove the QQmlParserStatus and QQmlAbstractBinding back pointers blank(parserStatus); blank(bindValues); while (componentAttached) { - QDeclarativeComponentAttached *a = componentAttached; + QQmlComponentAttached *a = componentAttached; a->rem(); } @@ -1075,13 +1075,13 @@ void QDeclarativeVME::reset() } // Must be called with a handle scope and context -void QDeclarativeScriptData::initialize(QDeclarativeEngine *engine) +void QQmlScriptData::initialize(QQmlEngine *engine) { Q_ASSERT(m_program.IsEmpty()); Q_ASSERT(engine); Q_ASSERT(!hasEngine()); - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); QV8Engine *v8engine = ep->v8engine(); // If compilation throws an error, a surrounding v8::TryCatch will record it. @@ -1098,23 +1098,23 @@ void QDeclarativeScriptData::initialize(QDeclarativeEngine *engine) addref(); } -v8::Persistent<v8::Object> QDeclarativeVME::run(QDeclarativeContextData *parentCtxt, QDeclarativeScriptData *script) +v8::Persistent<v8::Object> QQmlVME::run(QQmlContextData *parentCtxt, QQmlScriptData *script) { if (script->m_loaded) return qPersistentNew<v8::Object>(script->m_value); Q_ASSERT(parentCtxt && parentCtxt->engine); - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(parentCtxt->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(parentCtxt->engine); QV8Engine *v8engine = ep->v8engine(); - bool shared = script->pragmas & QDeclarativeScript::Object::ScriptBlock::Shared; + bool shared = script->pragmas & QQmlScript::Object::ScriptBlock::Shared; - QDeclarativeContextData *effectiveCtxt = parentCtxt; + QQmlContextData *effectiveCtxt = parentCtxt; if (shared) effectiveCtxt = 0; // Create the script context if required - QDeclarativeContextData *ctxt = new QDeclarativeContextData; + QQmlContextData *ctxt = new QQmlContextData; ctxt->isInternal = true; ctxt->isJSContext = true; if (shared) @@ -1170,8 +1170,8 @@ v8::Persistent<v8::Object> QDeclarativeVME::run(QDeclarativeContextData *parentC if (try_catch.HasCaught()) { v8::Local<v8::Message> message = try_catch.Message(); if (!message.IsEmpty()) { - QDeclarativeError error; - QDeclarativeExpressionPrivate::exceptionToError(message, error); + QQmlError error; + QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); } } @@ -1186,19 +1186,19 @@ v8::Persistent<v8::Object> QDeclarativeVME::run(QDeclarativeContextData *parentC } #ifdef QML_THREADED_VME_INTERPRETER -void **QDeclarativeVME::instructionJumpTable() +void **QQmlVME::instructionJumpTable() { static void **jumpTable = 0; if (!jumpTable) { - QDeclarativeVME dummy; - QDeclarativeVME::Interrupt i; + QQmlVME dummy; + QQmlVME::Interrupt i; dummy.run(0, i, &jumpTable); } return jumpTable; } #endif -QDeclarativeContextData *QDeclarativeVME::complete(const Interrupt &interrupt) +QQmlContextData *QQmlVME::complete(const Interrupt &interrupt) { Q_ASSERT(engine || (bindValues.isEmpty() && @@ -1210,24 +1210,24 @@ QDeclarativeContextData *QDeclarativeVME::complete(const Interrupt &interrupt) if (!engine) return 0; - QDeclarativeTrace trace("VME Complete"); + QQmlTrace trace("VME Complete"); #ifdef QML_ENABLE_TRACE trace.addDetail("URL", rootComponent->url); #endif - ActiveVMERestorer restore(this, QDeclarativeEnginePrivate::get(engine)); - QRecursionWatcher<QDeclarativeVME, &QDeclarativeVME::recursion> watcher(this); + ActiveVMERestorer restore(this, QQmlEnginePrivate::get(engine)); + QRecursionWatcher<QQmlVME, &QQmlVME::recursion> watcher(this); { - QDeclarativeTrace trace("VME Binding Enable"); + QQmlTrace trace("VME Binding Enable"); trace.event("begin binding eval"); while (!bindValues.isEmpty()) { - QDeclarativeAbstractBinding *b = bindValues.pop(); + QQmlAbstractBinding *b = bindValues.pop(); if(b) { b->m_mePtr = 0; - b->setEnabled(true, QDeclarativePropertyPrivate::BypassInterceptor | - QDeclarativePropertyPrivate::DontRemoveBinding); + b->setEnabled(true, QQmlPropertyPrivate::BypassInterceptor | + QQmlPropertyPrivate::DontRemoveBinding); } if (watcher.hasRecursed() || interrupt.shouldInterrupt()) @@ -1237,17 +1237,17 @@ QDeclarativeContextData *QDeclarativeVME::complete(const Interrupt &interrupt) } { - QDeclarativeTrace trace("VME Component Complete"); + QQmlTrace trace("VME Component Complete"); while (!parserStatus.isEmpty()) { - QDeclarativeParserStatus *status = parserStatus.pop(); + QQmlParserStatus *status = parserStatus.pop(); #ifdef QML_ENABLE_TRACE - QDeclarativeData *data = parserStatusData.pop(); + QQmlData *data = parserStatusData.pop(); #endif if (status && status->d) { status->d = 0; #ifdef QML_ENABLE_TRACE - QDeclarativeTrace trace("Component complete"); + QQmlTrace trace("Component complete"); trace.addDetail("URL", data->outerContext->url); trace.addDetail("Line", data->lineNumber); #endif @@ -1261,9 +1261,9 @@ QDeclarativeContextData *QDeclarativeVME::complete(const Interrupt &interrupt) } { - QDeclarativeTrace trace("VME Finalize Callbacks"); + QQmlTrace trace("VME Finalize Callbacks"); for (int ii = 0; ii < finalizeCallbacks.count(); ++ii) { - QDeclarativeEnginePrivate::FinalizeCallback callback = finalizeCallbacks.at(ii); + QQmlEnginePrivate::FinalizeCallback callback = finalizeCallbacks.at(ii); QObject *obj = callback.first; if (obj) { void *args[] = { 0 }; @@ -1276,11 +1276,11 @@ QDeclarativeContextData *QDeclarativeVME::complete(const Interrupt &interrupt) } { - QDeclarativeTrace trace("VME Component.onCompleted Callbacks"); + QQmlTrace trace("VME Component.onCompleted Callbacks"); while (componentAttached) { - QDeclarativeComponentAttached *a = componentAttached; + QQmlComponentAttached *a = componentAttached; a->rem(); - QDeclarativeData *d = QDeclarativeData::get(a->parent()); + QQmlData *d = QQmlData::get(a->parent()); Q_ASSERT(d); Q_ASSERT(d->context); a->add(&d->context->componentAttached); @@ -1291,7 +1291,7 @@ QDeclarativeContextData *QDeclarativeVME::complete(const Interrupt &interrupt) } } - QDeclarativeContextData *rv = rootContext; + QQmlContextData *rv = rootContext; reset(); @@ -1300,50 +1300,50 @@ QDeclarativeContextData *QDeclarativeVME::complete(const Interrupt &interrupt) return rv; } -void QDeclarativeVME::blank(QFiniteStack<QDeclarativeAbstractBinding *> &bs) +void QQmlVME::blank(QFiniteStack<QQmlAbstractBinding *> &bs) { for (int ii = 0; ii < bs.count(); ++ii) { - QDeclarativeAbstractBinding *b = bs.at(ii); + QQmlAbstractBinding *b = bs.at(ii); if (b) b->m_mePtr = 0; } } -void QDeclarativeVME::blank(QFiniteStack<QDeclarativeParserStatus *> &pss) +void QQmlVME::blank(QFiniteStack<QQmlParserStatus *> &pss) { for (int ii = 0; ii < pss.count(); ++ii) { - QDeclarativeParserStatus *ps = pss.at(ii); + QQmlParserStatus *ps = pss.at(ii); if(ps) ps->d = 0; } } -QDeclarativeVMEGuard::QDeclarativeVMEGuard() +QQmlVMEGuard::QQmlVMEGuard() : m_objectCount(0), m_objects(0), m_contextCount(0), m_contexts(0) { } -QDeclarativeVMEGuard::~QDeclarativeVMEGuard() +QQmlVMEGuard::~QQmlVMEGuard() { clear(); } -void QDeclarativeVMEGuard::guard(QDeclarativeVME *vme) +void QQmlVMEGuard::guard(QQmlVME *vme) { clear(); m_objectCount = vme->objects.count(); - m_objects = new QDeclarativeGuard<QObject>[m_objectCount]; + m_objects = new QQmlGuard<QObject>[m_objectCount]; for (int ii = 0; ii < m_objectCount; ++ii) m_objects[ii] = vme->objects[ii]; m_contextCount = (vme->rootContext.isNull()?0:1) + vme->states.count(); - m_contexts = new QDeclarativeGuardedContextData[m_contextCount]; + m_contexts = new QQmlGuardedContextData[m_contextCount]; for (int ii = 0; ii < vme->states.count(); ++ii) m_contexts[ii] = vme->states.at(ii).context; if (!vme->rootContext.isNull()) m_contexts[m_contextCount - 1] = vme->rootContext.contextData(); } -void QDeclarativeVMEGuard::clear() +void QQmlVMEGuard::clear() { delete [] m_objects; delete [] m_contexts; @@ -1354,7 +1354,7 @@ void QDeclarativeVMEGuard::clear() m_contexts = 0; } -bool QDeclarativeVMEGuard::isOK() const +bool QQmlVMEGuard::isOK() const { for (int ii = 0; ii < m_objectCount; ++ii) if (m_objects[ii].isNull()) diff --git a/src/declarative/qml/qdeclarativevme_p.h b/src/qml/qml/qqmlvme_p.h index d413555847..8c8d4d079e 100644 --- a/src/declarative/qml/qdeclarativevme_p.h +++ b/src/qml/qml/qqmlvme_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEVME_P_H -#define QDECLARATIVEVME_P_H +#ifndef QQMLVME_P_H +#define QQMLVME_P_H // // W A R N I N G @@ -53,9 +53,9 @@ // We mean it. // -#include "qdeclarativeerror.h" +#include "qqmlerror.h" #include <private/qbitfield_p.h> -#include "qdeclarativeinstruction_p.h" +#include "qqmlinstruction_p.h" #include <private/qrecursionwatcher_p.h> #include <QtCore/QStack> @@ -64,35 +64,35 @@ #include <QtCore/qcoreapplication.h> #include <private/qv8_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> #include <private/qfinitestack_p.h> -#include <private/qdeclarativetrace_p.h> +#include <private/qqmltrace_p.h> QT_BEGIN_NAMESPACE class QObject; class QJSValue; -class QDeclarativeScriptData; -class QDeclarativeCompiledData; -class QDeclarativeCompiledData; -class QDeclarativeContextData; +class QQmlScriptData; +class QQmlCompiledData; +class QQmlCompiledData; +class QQmlContextData; -namespace QDeclarativeVMETypes { +namespace QQmlVMETypes { struct List { List() : type(0) {} List(int t) : type(t) {} int type; - QDeclarativeListProperty<void> qListProperty; + QQmlListProperty<void> qListProperty; }; } -Q_DECLARE_TYPEINFO(QDeclarativeVMETypes::List, Q_PRIMITIVE_TYPE | Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO(QQmlVMETypes::List, Q_PRIMITIVE_TYPE | Q_MOVABLE_TYPE); -class QDeclarativeVME +class QQmlVME { - Q_DECLARE_TR_FUNCTIONS(QDeclarativeVME) + Q_DECLARE_TR_FUNCTIONS(QQmlVME) public: class Interrupt { public: @@ -114,115 +114,115 @@ public: }; }; - QDeclarativeVME() : data(0), componentAttached(0) {} - QDeclarativeVME(void *data) : data(data), componentAttached(0) {} + QQmlVME() : data(0), componentAttached(0) {} + QQmlVME(void *data) : data(data), componentAttached(0) {} void *data; - QDeclarativeComponentAttached *componentAttached; - QList<QDeclarativeEnginePrivate::FinalizeCallback> finalizeCallbacks; + QQmlComponentAttached *componentAttached; + QList<QQmlEnginePrivate::FinalizeCallback> finalizeCallbacks; - void init(QDeclarativeContextData *, QDeclarativeCompiledData *, int start, - QDeclarativeContextData * = 0); + void init(QQmlContextData *, QQmlCompiledData *, int start, + QQmlContextData * = 0); bool initDeferred(QObject *); void reset(); - QObject *execute(QList<QDeclarativeError> *errors, const Interrupt & = Interrupt()); - QDeclarativeContextData *complete(const Interrupt & = Interrupt()); + QObject *execute(QList<QQmlError> *errors, const Interrupt & = Interrupt()); + QQmlContextData *complete(const Interrupt & = Interrupt()); private: - friend class QDeclarativeVMEGuard; + friend class QQmlVMEGuard; - QObject *run(QList<QDeclarativeError> *errors, const Interrupt & + QObject *run(QList<QQmlError> *errors, const Interrupt & #ifdef QML_THREADED_VME_INTERPRETER , void ***storeJumpTable = 0 #endif ); - v8::Persistent<v8::Object> run(QDeclarativeContextData *, QDeclarativeScriptData *); + v8::Persistent<v8::Object> run(QQmlContextData *, QQmlScriptData *); #ifdef QML_THREADED_VME_INTERPRETER static void **instructionJumpTable(); - friend class QDeclarativeCompiledData; + friend class QQmlCompiledData; #endif - QDeclarativeEngine *engine; + QQmlEngine *engine; QRecursionNode recursion; #ifdef QML_ENABLE_TRACE - QDeclarativeCompiledData *rootComponent; + QQmlCompiledData *rootComponent; #endif QFiniteStack<QObject *> objects; - QFiniteStack<QDeclarativeVMETypes::List> lists; + QFiniteStack<QQmlVMETypes::List> lists; - QFiniteStack<QDeclarativeAbstractBinding *> bindValues; - QFiniteStack<QDeclarativeParserStatus *> parserStatus; + QFiniteStack<QQmlAbstractBinding *> bindValues; + QFiniteStack<QQmlParserStatus *> parserStatus; #ifdef QML_ENABLE_TRACE - QFiniteStack<QDeclarativeData *> parserStatusData; + QFiniteStack<QQmlData *> parserStatusData; #endif - QDeclarativeGuardedContextData rootContext; - QDeclarativeGuardedContextData creationContext; + QQmlGuardedContextData rootContext; + QQmlGuardedContextData creationContext; struct State { enum Flag { Deferred = 0x00000001 }; State() : flags(0), context(0), compiledData(0), instructionStream(0) {} quint32 flags; - QDeclarativeContextData *context; - QDeclarativeCompiledData *compiledData; + QQmlContextData *context; + QQmlCompiledData *compiledData; const char *instructionStream; QBitField bindingSkipList; }; QStack<State> states; - static void blank(QFiniteStack<QDeclarativeParserStatus *> &); - static void blank(QFiniteStack<QDeclarativeAbstractBinding *> &); + static void blank(QFiniteStack<QQmlParserStatus *> &); + static void blank(QFiniteStack<QQmlAbstractBinding *> &); }; -// Used to check that a QDeclarativeVME that is interrupted mid-execution +// Used to check that a QQmlVME that is interrupted mid-execution // is still valid. Checks all the objects and contexts have not been // deleted. -class QDeclarativeVMEGuard +class QQmlVMEGuard { public: - QDeclarativeVMEGuard(); - ~QDeclarativeVMEGuard(); + QQmlVMEGuard(); + ~QQmlVMEGuard(); - void guard(QDeclarativeVME *); + void guard(QQmlVME *); void clear(); bool isOK() const; private: int m_objectCount; - QDeclarativeGuard<QObject> *m_objects; + QQmlGuard<QObject> *m_objects; int m_contextCount; - QDeclarativeGuardedContextData *m_contexts; + QQmlGuardedContextData *m_contexts; }; -QDeclarativeVME::Interrupt::Interrupt() +QQmlVME::Interrupt::Interrupt() : mode(None) { } -QDeclarativeVME::Interrupt::Interrupt(bool *runWhile) +QQmlVME::Interrupt::Interrupt(bool *runWhile) : mode(Flag), runWhile(runWhile) { } -QDeclarativeVME::Interrupt::Interrupt(int nsecs) +QQmlVME::Interrupt::Interrupt(int nsecs) : mode(Time), nsecs(nsecs) { } -void QDeclarativeVME::Interrupt::reset() +void QQmlVME::Interrupt::reset() { if (mode == Time) timer.start(); } -bool QDeclarativeVME::Interrupt::shouldInterrupt() const +bool QQmlVME::Interrupt::shouldInterrupt() const { if (mode == None) { return false; @@ -237,4 +237,4 @@ bool QDeclarativeVME::Interrupt::shouldInterrupt() const QT_END_NAMESPACE -#endif // QDECLARATIVEVME_P_H +#endif // QQMLVME_P_H diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index f7361eb2ce..7ea89a4a2d 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#include "qdeclarativevmemetaobject_p.h" +#include "qqmlvmemetaobject_p.h" -#include "qdeclarative.h" -#include <private/qdeclarativerefcount_p.h> -#include "qdeclarativeexpression.h" -#include "qdeclarativeexpression_p.h" -#include "qdeclarativecontext_p.h" -#include "qdeclarativebinding_p.h" -#include "qdeclarativepropertyvalueinterceptor_p.h" +#include "qqml.h" +#include <private/qqmlrefcount_p.h> +#include "qqmlexpression.h" +#include "qqmlexpression_p.h" +#include "qqmlcontext_p.h" +#include "qqmlbinding_p.h" +#include "qqmlpropertyvalueinterceptor_p.h" #include <private/qv8variantresource_p.h> @@ -56,11 +56,11 @@ Q_DECLARE_METATYPE(QJSValue); QT_BEGIN_NAMESPACE -class QDeclarativeVMEVariant +class QQmlVMEVariant { public: - inline QDeclarativeVMEVariant(); - inline ~QDeclarativeVMEVariant(); + inline QQmlVMEVariant(); + inline ~QQmlVMEVariant(); inline const void *dataPtr() const; inline void *dataPtr(); @@ -98,28 +98,28 @@ private: inline void cleanup(); }; -class QDeclarativeVMEMetaObjectEndpoint : public QDeclarativeNotifierEndpoint +class QQmlVMEMetaObjectEndpoint : public QQmlNotifierEndpoint { public: - QDeclarativeVMEMetaObjectEndpoint(); - static void vmecallback(QDeclarativeNotifierEndpoint *); + QQmlVMEMetaObjectEndpoint(); + static void vmecallback(QQmlNotifierEndpoint *); void tryConnect(); - QFlagPointer<QDeclarativeVMEMetaObject> metaObject; + QFlagPointer<QQmlVMEMetaObject> metaObject; }; -QDeclarativeVMEVariant::QDeclarativeVMEVariant() +QQmlVMEVariant::QQmlVMEVariant() : type(QVariant::Invalid) { } -QDeclarativeVMEVariant::~QDeclarativeVMEVariant() +QQmlVMEVariant::~QQmlVMEVariant() { cleanup(); } -void QDeclarativeVMEVariant::cleanup() +void QQmlVMEVariant::cleanup() { if (type == QVariant::Invalid) { } else if (type == QMetaType::Int || @@ -127,7 +127,7 @@ void QDeclarativeVMEVariant::cleanup() type == QMetaType::Double) { type = QVariant::Invalid; } else if (type == QMetaType::QObjectStar) { - ((QDeclarativeGuard<QObject>*)dataPtr())->~QDeclarativeGuard<QObject>(); + ((QQmlGuard<QObject>*)dataPtr())->~QQmlGuard<QObject>(); type = QVariant::Invalid; } else if (type == QMetaType::QString) { ((QString *)dataPtr())->~QString(); @@ -157,30 +157,30 @@ void QDeclarativeVMEVariant::cleanup() } -int QDeclarativeVMEVariant::dataType() const +int QQmlVMEVariant::dataType() const { return type; } -const void *QDeclarativeVMEVariant::dataPtr() const +const void *QQmlVMEVariant::dataPtr() const { return &data; } -void *QDeclarativeVMEVariant::dataPtr() +void *QQmlVMEVariant::dataPtr() { return &data; } -QObject *QDeclarativeVMEVariant::asQObject() +QObject *QQmlVMEVariant::asQObject() { if (type != QMetaType::QObjectStar) setValue((QObject *)0); - return *(QDeclarativeGuard<QObject> *)(dataPtr()); + return *(QQmlGuard<QObject> *)(dataPtr()); } -const QVariant &QDeclarativeVMEVariant::asQVariant() +const QVariant &QQmlVMEVariant::asQVariant() { if (type != QMetaType::QVariant) setValue(QVariant()); @@ -188,7 +188,7 @@ const QVariant &QDeclarativeVMEVariant::asQVariant() return *(QVariant *)(dataPtr()); } -int QDeclarativeVMEVariant::asInt() +int QQmlVMEVariant::asInt() { if (type != QMetaType::Int) setValue(int(0)); @@ -196,7 +196,7 @@ int QDeclarativeVMEVariant::asInt() return *(int *)(dataPtr()); } -bool QDeclarativeVMEVariant::asBool() +bool QQmlVMEVariant::asBool() { if (type != QMetaType::Bool) setValue(bool(false)); @@ -204,7 +204,7 @@ bool QDeclarativeVMEVariant::asBool() return *(bool *)(dataPtr()); } -double QDeclarativeVMEVariant::asDouble() +double QQmlVMEVariant::asDouble() { if (type != QMetaType::Double) setValue(double(0)); @@ -212,7 +212,7 @@ double QDeclarativeVMEVariant::asDouble() return *(double *)(dataPtr()); } -const QString &QDeclarativeVMEVariant::asQString() +const QString &QQmlVMEVariant::asQString() { if (type != QMetaType::QString) setValue(QString()); @@ -220,7 +220,7 @@ const QString &QDeclarativeVMEVariant::asQString() return *(QString *)(dataPtr()); } -const QUrl &QDeclarativeVMEVariant::asQUrl() +const QUrl &QQmlVMEVariant::asQUrl() { if (type != QMetaType::QUrl) setValue(QUrl()); @@ -228,7 +228,7 @@ const QUrl &QDeclarativeVMEVariant::asQUrl() return *(QUrl *)(dataPtr()); } -const QColor &QDeclarativeVMEVariant::asQColor() +const QColor &QQmlVMEVariant::asQColor() { if (type != QMetaType::QColor) setValue(QColor()); @@ -236,7 +236,7 @@ const QColor &QDeclarativeVMEVariant::asQColor() return *(QColor *)(dataPtr()); } -const QTime &QDeclarativeVMEVariant::asQTime() +const QTime &QQmlVMEVariant::asQTime() { if (type != QMetaType::QTime) setValue(QTime()); @@ -244,7 +244,7 @@ const QTime &QDeclarativeVMEVariant::asQTime() return *(QTime *)(dataPtr()); } -const QDate &QDeclarativeVMEVariant::asQDate() +const QDate &QQmlVMEVariant::asQDate() { if (type != QMetaType::QDate) setValue(QDate()); @@ -252,7 +252,7 @@ const QDate &QDeclarativeVMEVariant::asQDate() return *(QDate *)(dataPtr()); } -const QDateTime &QDeclarativeVMEVariant::asQDateTime() +const QDateTime &QQmlVMEVariant::asQDateTime() { if (type != QMetaType::QDateTime) setValue(QDateTime()); @@ -260,7 +260,7 @@ const QDateTime &QDeclarativeVMEVariant::asQDateTime() return *(QDateTime *)(dataPtr()); } -const QJSValue &QDeclarativeVMEVariant::asQJSValue() +const QJSValue &QQmlVMEVariant::asQJSValue() { if (type != qMetaTypeId<QJSValue>()) setValue(QJSValue()); @@ -268,17 +268,17 @@ const QJSValue &QDeclarativeVMEVariant::asQJSValue() return *(QJSValue *)(dataPtr()); } -void QDeclarativeVMEVariant::setValue(QObject *v) +void QQmlVMEVariant::setValue(QObject *v) { if (type != QMetaType::QObjectStar) { cleanup(); type = QMetaType::QObjectStar; - new (dataPtr()) QDeclarativeGuard<QObject>(); + new (dataPtr()) QQmlGuard<QObject>(); } - *(QDeclarativeGuard<QObject>*)(dataPtr()) = v; + *(QQmlGuard<QObject>*)(dataPtr()) = v; } -void QDeclarativeVMEVariant::setValue(const QVariant &v) +void QQmlVMEVariant::setValue(const QVariant &v) { if (type != qMetaTypeId<QVariant>()) { cleanup(); @@ -289,7 +289,7 @@ void QDeclarativeVMEVariant::setValue(const QVariant &v) } } -void QDeclarativeVMEVariant::setValue(int v) +void QQmlVMEVariant::setValue(int v) { if (type != QMetaType::Int) { cleanup(); @@ -298,7 +298,7 @@ void QDeclarativeVMEVariant::setValue(int v) *(int *)(dataPtr()) = v; } -void QDeclarativeVMEVariant::setValue(bool v) +void QQmlVMEVariant::setValue(bool v) { if (type != QMetaType::Bool) { cleanup(); @@ -307,7 +307,7 @@ void QDeclarativeVMEVariant::setValue(bool v) *(bool *)(dataPtr()) = v; } -void QDeclarativeVMEVariant::setValue(double v) +void QQmlVMEVariant::setValue(double v) { if (type != QMetaType::Double) { cleanup(); @@ -316,7 +316,7 @@ void QDeclarativeVMEVariant::setValue(double v) *(double *)(dataPtr()) = v; } -void QDeclarativeVMEVariant::setValue(const QString &v) +void QQmlVMEVariant::setValue(const QString &v) { if (type != QMetaType::QString) { cleanup(); @@ -327,7 +327,7 @@ void QDeclarativeVMEVariant::setValue(const QString &v) } } -void QDeclarativeVMEVariant::setValue(const QUrl &v) +void QQmlVMEVariant::setValue(const QUrl &v) { if (type != QMetaType::QUrl) { cleanup(); @@ -338,7 +338,7 @@ void QDeclarativeVMEVariant::setValue(const QUrl &v) } } -void QDeclarativeVMEVariant::setValue(const QColor &v) +void QQmlVMEVariant::setValue(const QColor &v) { if (type != QMetaType::QColor) { cleanup(); @@ -349,7 +349,7 @@ void QDeclarativeVMEVariant::setValue(const QColor &v) } } -void QDeclarativeVMEVariant::setValue(const QTime &v) +void QQmlVMEVariant::setValue(const QTime &v) { if (type != QMetaType::QTime) { cleanup(); @@ -360,7 +360,7 @@ void QDeclarativeVMEVariant::setValue(const QTime &v) } } -void QDeclarativeVMEVariant::setValue(const QDate &v) +void QQmlVMEVariant::setValue(const QDate &v) { if (type != QMetaType::QDate) { cleanup(); @@ -371,7 +371,7 @@ void QDeclarativeVMEVariant::setValue(const QDate &v) } } -void QDeclarativeVMEVariant::setValue(const QDateTime &v) +void QQmlVMEVariant::setValue(const QDateTime &v) { if (type != QMetaType::QDateTime) { cleanup(); @@ -382,7 +382,7 @@ void QDeclarativeVMEVariant::setValue(const QDateTime &v) } } -void QDeclarativeVMEVariant::setValue(const QJSValue &v) +void QQmlVMEVariant::setValue(const QJSValue &v) { if (type != qMetaTypeId<QJSValue>()) { cleanup(); @@ -393,18 +393,18 @@ void QDeclarativeVMEVariant::setValue(const QJSValue &v) } } -QDeclarativeVMEMetaObjectEndpoint::QDeclarativeVMEMetaObjectEndpoint() +QQmlVMEMetaObjectEndpoint::QQmlVMEMetaObjectEndpoint() { callback = &vmecallback; } -void QDeclarativeVMEMetaObjectEndpoint::vmecallback(QDeclarativeNotifierEndpoint *e) +void QQmlVMEMetaObjectEndpoint::vmecallback(QQmlNotifierEndpoint *e) { - QDeclarativeVMEMetaObjectEndpoint *vmee = static_cast<QDeclarativeVMEMetaObjectEndpoint*>(e); + QQmlVMEMetaObjectEndpoint *vmee = static_cast<QQmlVMEMetaObjectEndpoint*>(e); vmee->tryConnect(); } -void QDeclarativeVMEMetaObjectEndpoint::tryConnect() +void QQmlVMEMetaObjectEndpoint::tryConnect() { int aliasId = this - metaObject->aliasEndpoints; @@ -413,9 +413,9 @@ void QDeclarativeVMEMetaObjectEndpoint::tryConnect() int sigIdx = metaObject->methodOffset + aliasId + metaObject->metaData->propertyCount; QMetaObject::activate(metaObject->object, sigIdx, 0); } else { - QDeclarativeVMEMetaData::AliasData *d = metaObject->metaData->aliasData() + aliasId; + QQmlVMEMetaData::AliasData *d = metaObject->metaData->aliasData() + aliasId; if (!d->isObjectAlias()) { - QDeclarativeContextData *ctxt = metaObject->ctxt; + QQmlContextData *ctxt = metaObject->ctxt; QObject *target = ctxt->idValues[d->contextIdx].data(); if (!target) return; @@ -429,12 +429,12 @@ void QDeclarativeVMEMetaObjectEndpoint::tryConnect() } } -QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj, +QQmlVMEMetaObject::QQmlVMEMetaObject(QObject *obj, const QMetaObject *other, - const QDeclarativeVMEMetaData *meta, - QDeclarativeCompiledData *cdata) + const QQmlVMEMetaData *meta, + QQmlCompiledData *cdata) : QV8GCCallback::Node(GcPrologueCallback), object(obj), compiledData(cdata), - ctxt(QDeclarativeData::get(obj, true)->outerContext), metaData(meta), data(0), + ctxt(QQmlData::get(obj, true)->outerContext), metaData(meta), data(0), aliasEndpoints(0), firstVarPropertyIndex(-1), varPropertiesInitialized(false), v8methods(0), parent(0) { @@ -451,10 +451,10 @@ QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj, propOffset = QAbstractDynamicMetaObject::propertyOffset(); methodOffset = QAbstractDynamicMetaObject::methodOffset(); - data = new QDeclarativeVMEVariant[metaData->propertyCount - metaData->varPropertyCount]; + data = new QQmlVMEVariant[metaData->propertyCount - metaData->varPropertyCount]; aConnected.resize(metaData->aliasCount); - int list_type = qMetaTypeId<QDeclarativeListProperty<QObject> >(); + int list_type = qMetaTypeId<QQmlListProperty<QObject> >(); // ### Optimize for (int ii = 0; ii < metaData->propertyCount - metaData->varPropertyCount; ++ii) { @@ -470,7 +470,7 @@ QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj, QV8GCCallback::addGcCallbackNode(this); } -QDeclarativeVMEMetaObject::~QDeclarativeVMEMetaObject() +QQmlVMEMetaObject::~QQmlVMEMetaObject() { compiledData->release(); delete parent; @@ -486,25 +486,25 @@ QDeclarativeVMEMetaObject::~QDeclarativeVMEMetaObject() qPersistentDispose(varProperties); // if not weak, will not have been cleaned up by the callback. } -int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) +int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) { int id = _id; if(c == QMetaObject::WriteProperty) { int flags = *reinterpret_cast<int*>(a[3]); - if (!(flags & QDeclarativePropertyPrivate::BypassInterceptor) + if (!(flags & QQmlPropertyPrivate::BypassInterceptor) && !aInterceptors.isEmpty() && aInterceptors.testBit(id)) { - QPair<int, QDeclarativePropertyValueInterceptor*> pair = interceptors.value(id); + QPair<int, QQmlPropertyValueInterceptor*> pair = interceptors.value(id); int valueIndex = pair.first; - QDeclarativePropertyValueInterceptor *vi = pair.second; + QQmlPropertyValueInterceptor *vi = pair.second; int type = property(id).userType(); if (type != QVariant::Invalid) { if (valueIndex != -1) { - QDeclarativeEnginePrivate *ep = ctxt?QDeclarativeEnginePrivate::get(ctxt->engine):0; - QDeclarativeValueType *valueType = 0; + QQmlEnginePrivate *ep = ctxt?QQmlEnginePrivate::get(ctxt->engine):0; + QQmlValueType *valueType = 0; if (ep) valueType = ep->valueTypes[type]; - else valueType = QDeclarativeValueTypeFactory::valueType(type); + else valueType = QQmlValueTypeFactory::valueType(type); Q_ASSERT(valueType); valueType->setValue(QVariant(type, a[0])); @@ -531,7 +531,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) if (id >= firstVarPropertyIndex) { Q_ASSERT(t == QMetaType::QVariant); // the context can be null if accessing var properties from cpp after re-parenting an item. - QDeclarativeEnginePrivate *ep = (ctxt == 0 || ctxt->engine == 0) ? 0 : QDeclarativeEnginePrivate::get(ctxt->engine); + QQmlEnginePrivate *ep = (ctxt == 0 || ctxt->engine == 0) ? 0 : QQmlEnginePrivate::get(ctxt->engine); QV8Engine *v8e = (ep == 0) ? 0 : ep->v8engine(); if (v8e) { v8::HandleScope handleScope; @@ -583,11 +583,11 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) default: break; } - if (t == qMetaTypeId<QDeclarativeListProperty<QObject> >()) { + if (t == qMetaTypeId<QQmlListProperty<QObject> >()) { int listIndex = data[id].asInt(); const List *list = &listProperties.at(listIndex); - *reinterpret_cast<QDeclarativeListProperty<QObject> *>(a[0]) = - QDeclarativeListProperty<QObject>(object, (void *)list, + *reinterpret_cast<QQmlListProperty<QObject> *>(a[0]) = + QQmlListProperty<QObject>(object, (void *)list, list_append, list_count, list_at, list_clear); } @@ -652,15 +652,15 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) if (id < metaData->aliasCount) { - QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + id; + QQmlVMEMetaData::AliasData *d = metaData->aliasData() + id; if (d->flags & QML_ALIAS_FLAG_PTR && c == QMetaObject::ReadProperty) *reinterpret_cast<void **>(a[0]) = 0; if (!ctxt) return -1; - QDeclarativeContext *context = ctxt->asQDeclarativeContext(); - QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(context); + QQmlContext *context = ctxt->asQQmlContext(); + QQmlContextPrivate *ctxtPriv = QQmlContextPrivate::get(context); QObject *target = ctxtPriv->data->idValues[d->contextIdx].data(); if (!target) @@ -676,10 +676,10 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) // Remove binding (if any) on write if(c == QMetaObject::WriteProperty) { int flags = *reinterpret_cast<int*>(a[3]); - if (flags & QDeclarativePropertyPrivate::RemoveBindingOnAliasWrite) { - QDeclarativeData *targetData = QDeclarativeData::get(target); + if (flags & QQmlPropertyPrivate::RemoveBindingOnAliasWrite) { + QQmlData *targetData = QQmlData::get(target); if (targetData && targetData->hasBindingBit(d->propertyIndex())) { - QDeclarativeAbstractBinding *binding = QDeclarativePropertyPrivate::setBinding(target, d->propertyIndex(), d->isValueTypeAlias()?d->valueTypeIndex():-1, 0); + QQmlAbstractBinding *binding = QQmlPropertyPrivate::setBinding(target, d->propertyIndex(), d->isValueTypeAlias()?d->valueTypeIndex():-1, 0); if (binding) binding->destroy(); } } @@ -687,9 +687,9 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) if (d->isValueTypeAlias()) { // Value type property - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(ctxt->engine); - QDeclarativeValueType *valueType = ep->valueTypes[d->valueType()]; + QQmlValueType *valueType = ep->valueTypes[d->valueType()]; Q_ASSERT(valueType); valueType->read(target, d->propertyIndex()); @@ -727,7 +727,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) if (!ctxt->engine) return -1; // We can't run the method - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(ctxt->engine); ep->referenceScarceResources(); // "hold" scarce resources in memory during evaluation. v8::Handle<v8::Function> function = method(id); @@ -736,14 +736,14 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) // expression rewriter does not rewrite properly (e.g., \r-terminated lines // are not rewritten correctly but this bug is deemed out-of-scope to fix for // performance reasons; see QTBUG-24064) and thus compilation will have failed. - QDeclarativeError e; + QQmlError e; e.setDescription(QString(QLatin1String("Exception occurred during compilation of function: %1")). arg(QLatin1String(QMetaObject::method(_id).signature()))); ep->warning(e); return -1; // The dynamic method with that id is not available. } - QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + id; + QQmlVMEMetaData::MethodData *data = metaData->methodData() + id; v8::HandleScope handle_scope; v8::Context::Scope scope(ep->v8engine()->context()); @@ -761,8 +761,8 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) QVariant rv; if (try_catch.HasCaught()) { - QDeclarativeError error; - QDeclarativeExpressionPrivate::exceptionToError(try_catch.Message(), error); + QQmlError error; + QQmlExpressionPrivate::exceptionToError(try_catch.Message(), error); if (error.isValid()) ep->warning(error); if (a[0]) *(QVariant *)a[0] = QVariant(); @@ -783,13 +783,13 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) return object->qt_metacall(c, _id, a); } -v8::Handle<v8::Function> QDeclarativeVMEMetaObject::method(int index) +v8::Handle<v8::Function> QQmlVMEMetaObject::method(int index) { if (!v8methods) v8methods = new v8::Persistent<v8::Function>[metaData->methodCount]; if (v8methods[index].IsEmpty()) { - QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + index; + QQmlVMEMetaData::MethodData *data = metaData->methodData() + index; const char *body = ((const char*)metaData) + data->bodyOffset; int bodyLength = data->bodyLength; @@ -797,7 +797,7 @@ v8::Handle<v8::Function> QDeclarativeVMEMetaObject::method(int index) // XXX We should evaluate all methods in a single big script block to // improve the call time between dynamic methods defined on the same // object - v8methods[index] = QDeclarativeExpressionPrivate::evalFunction(ctxt, object, body, + v8methods[index] = QQmlExpressionPrivate::evalFunction(ctxt, object, body, bodyLength, ctxt->urlString, data->lineNumber); @@ -806,7 +806,7 @@ v8::Handle<v8::Function> QDeclarativeVMEMetaObject::method(int index) return v8methods[index]; } -v8::Handle<v8::Value> QDeclarativeVMEMetaObject::readVarProperty(int id) +v8::Handle<v8::Value> QQmlVMEMetaObject::readVarProperty(int id) { Q_ASSERT(id >= firstVarPropertyIndex); @@ -814,11 +814,11 @@ v8::Handle<v8::Value> QDeclarativeVMEMetaObject::readVarProperty(int id) return varProperties->Get(id - firstVarPropertyIndex); } -QVariant QDeclarativeVMEMetaObject::readPropertyAsVariant(int id) +QVariant QQmlVMEMetaObject::readPropertyAsVariant(int id) { if (id >= firstVarPropertyIndex) { ensureVarPropertiesAllocated(); - return QDeclarativeEnginePrivate::get(ctxt->engine)->v8engine()->toVariant(varProperties->Get(id - firstVarPropertyIndex), -1); + return QQmlEnginePrivate::get(ctxt->engine)->v8engine()->toVariant(varProperties->Get(id - firstVarPropertyIndex), -1); } else { if (data[id].dataType() == QMetaType::QObjectStar) { return QVariant::fromValue(data[id].asQObject()); @@ -828,7 +828,7 @@ QVariant QDeclarativeVMEMetaObject::readPropertyAsVariant(int id) } } -void QDeclarativeVMEMetaObject::writeVarProperty(int id, v8::Handle<v8::Value> value) +void QQmlVMEMetaObject::writeVarProperty(int id, v8::Handle<v8::Value> value) { Q_ASSERT(id >= firstVarPropertyIndex); ensureVarPropertiesAllocated(); @@ -857,7 +857,7 @@ void QDeclarativeVMEMetaObject::writeVarProperty(int id, v8::Handle<v8::Value> v activate(object, methodOffset + id, 0); } -void QDeclarativeVMEMetaObject::writeProperty(int id, const QVariant &value) +void QQmlVMEMetaObject::writeProperty(int id, const QVariant &value) { if (id >= firstVarPropertyIndex) { ensureVarPropertiesAllocated(); @@ -874,7 +874,7 @@ void QDeclarativeVMEMetaObject::writeProperty(int id, const QVariant &value) // And, if the new value is a scarce resource, we need to ensure that it does not get // automatically released by the engine until no other references to it exist. - v8::Handle<v8::Value> newv = QDeclarativeEnginePrivate::get(ctxt->engine)->v8engine()->fromVariant(value); + v8::Handle<v8::Value> newv = QQmlEnginePrivate::get(ctxt->engine)->v8engine()->fromVariant(value); if (newv->IsObject()) { QV8VariantResource *r = v8_resource_cast<QV8VariantResource>(v8::Handle<v8::Object>::Cast(newv)); if (r) { @@ -905,36 +905,36 @@ void QDeclarativeVMEMetaObject::writeProperty(int id, const QVariant &value) } } -void QDeclarativeVMEMetaObject::listChanged(int id) +void QQmlVMEMetaObject::listChanged(int id) { activate(object, methodOffset + id, 0); } -void QDeclarativeVMEMetaObject::list_append(QDeclarativeListProperty<QObject> *prop, QObject *o) +void QQmlVMEMetaObject::list_append(QQmlListProperty<QObject> *prop, QObject *o) { List *list = static_cast<List *>(prop->data); list->append(o); QMetaObject::activate(prop->object, list->notifyIndex, 0); } -int QDeclarativeVMEMetaObject::list_count(QDeclarativeListProperty<QObject> *prop) +int QQmlVMEMetaObject::list_count(QQmlListProperty<QObject> *prop) { return static_cast<List *>(prop->data)->count(); } -QObject *QDeclarativeVMEMetaObject::list_at(QDeclarativeListProperty<QObject> *prop, int index) +QObject *QQmlVMEMetaObject::list_at(QQmlListProperty<QObject> *prop, int index) { return static_cast<List *>(prop->data)->at(index); } -void QDeclarativeVMEMetaObject::list_clear(QDeclarativeListProperty<QObject> *prop) +void QQmlVMEMetaObject::list_clear(QQmlListProperty<QObject> *prop) { List *list = static_cast<List *>(prop->data); list->clear(); QMetaObject::activate(prop->object, list->notifyIndex, 0); } -void QDeclarativeVMEMetaObject::registerInterceptor(int index, int valueIndex, QDeclarativePropertyValueInterceptor *interceptor) +void QQmlVMEMetaObject::registerInterceptor(int index, int valueIndex, QQmlPropertyValueInterceptor *interceptor) { if (aInterceptors.isEmpty()) aInterceptors.resize(propertyCount() + metaData->propertyCount); @@ -942,11 +942,11 @@ void QDeclarativeVMEMetaObject::registerInterceptor(int index, int valueIndex, Q interceptors.insert(index, qMakePair(valueIndex, interceptor)); } -int QDeclarativeVMEMetaObject::vmeMethodLineNumber(int index) +int QQmlVMEMetaObject::vmeMethodLineNumber(int index) { if (index < methodOffset) { Q_ASSERT(parent); - return static_cast<QDeclarativeVMEMetaObject *>(parent)->vmeMethodLineNumber(index); + return static_cast<QQmlVMEMetaObject *>(parent)->vmeMethodLineNumber(index); } int plainSignals = metaData->signalCount + metaData->propertyCount + metaData->aliasCount; @@ -954,15 +954,15 @@ int QDeclarativeVMEMetaObject::vmeMethodLineNumber(int index) int rawIndex = index - methodOffset - plainSignals; - QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + rawIndex; + QQmlVMEMetaData::MethodData *data = metaData->methodData() + rawIndex; return data->lineNumber; } -v8::Handle<v8::Function> QDeclarativeVMEMetaObject::vmeMethod(int index) +v8::Handle<v8::Function> QQmlVMEMetaObject::vmeMethod(int index) { if (index < methodOffset) { Q_ASSERT(parent); - return static_cast<QDeclarativeVMEMetaObject *>(parent)->vmeMethod(index); + return static_cast<QQmlVMEMetaObject *>(parent)->vmeMethod(index); } int plainSignals = metaData->signalCount + metaData->propertyCount + metaData->aliasCount; Q_ASSERT(index >= (methodOffset + plainSignals) && index < (methodOffset + plainSignals + metaData->methodCount)); @@ -970,11 +970,11 @@ v8::Handle<v8::Function> QDeclarativeVMEMetaObject::vmeMethod(int index) } // Used by debugger -void QDeclarativeVMEMetaObject::setVmeMethod(int index, v8::Persistent<v8::Function> value) +void QQmlVMEMetaObject::setVmeMethod(int index, v8::Persistent<v8::Function> value) { if (index < methodOffset) { Q_ASSERT(parent); - return static_cast<QDeclarativeVMEMetaObject *>(parent)->setVmeMethod(index, value); + return static_cast<QQmlVMEMetaObject *>(parent)->setVmeMethod(index, value); } int plainSignals = metaData->signalCount + metaData->propertyCount + metaData->aliasCount; Q_ASSERT(index >= (methodOffset + plainSignals) && index < (methodOffset + plainSignals + metaData->methodCount)); @@ -988,36 +988,36 @@ void QDeclarativeVMEMetaObject::setVmeMethod(int index, v8::Persistent<v8::Funct v8methods[methodIndex] = value; } -v8::Handle<v8::Value> QDeclarativeVMEMetaObject::vmeProperty(int index) +v8::Handle<v8::Value> QQmlVMEMetaObject::vmeProperty(int index) { if (index < propOffset) { Q_ASSERT(parent); - return static_cast<QDeclarativeVMEMetaObject *>(parent)->vmeProperty(index); + return static_cast<QQmlVMEMetaObject *>(parent)->vmeProperty(index); } return readVarProperty(index - propOffset); } -void QDeclarativeVMEMetaObject::setVMEProperty(int index, v8::Handle<v8::Value> v) +void QQmlVMEMetaObject::setVMEProperty(int index, v8::Handle<v8::Value> v) { if (index < propOffset) { Q_ASSERT(parent); - static_cast<QDeclarativeVMEMetaObject *>(parent)->setVMEProperty(index, v); + static_cast<QQmlVMEMetaObject *>(parent)->setVMEProperty(index, v); return; } return writeVarProperty(index - propOffset, v); } -void QDeclarativeVMEMetaObject::ensureVarPropertiesAllocated() +void QQmlVMEMetaObject::ensureVarPropertiesAllocated() { if (!varPropertiesInitialized) allocateVarPropertiesArray(); } // see also: QV8GCCallback::garbageCollectorPrologueCallback() -void QDeclarativeVMEMetaObject::allocateVarPropertiesArray() +void QQmlVMEMetaObject::allocateVarPropertiesArray() { v8::HandleScope handleScope; - v8::Context::Scope cs(QDeclarativeEnginePrivate::get(ctxt->engine)->v8engine()->context()); + v8::Context::Scope cs(QQmlEnginePrivate::get(ctxt->engine)->v8engine()->context()); varProperties = qPersistentNew(v8::Array::New(metaData->varPropertyCount)); varProperties.MakeWeak(static_cast<void*>(this), VarPropertiesWeakReferenceCallback); varPropertiesInitialized = true; @@ -1030,25 +1030,25 @@ void QDeclarativeVMEMetaObject::allocateVarPropertiesArray() is cleared as a result of all other handles to that v8object being released. See QV8GCCallback::garbageCollectorPrologueCallback() for more information. */ -void QDeclarativeVMEMetaObject::VarPropertiesWeakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter) +void QQmlVMEMetaObject::VarPropertiesWeakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter) { - QDeclarativeVMEMetaObject *vmemo = static_cast<QDeclarativeVMEMetaObject*>(parameter); + QQmlVMEMetaObject *vmemo = static_cast<QQmlVMEMetaObject*>(parameter); Q_ASSERT(vmemo); qPersistentDispose(object); vmemo->varProperties.Clear(); } -void QDeclarativeVMEMetaObject::GcPrologueCallback(QV8GCCallback::Node *node) +void QQmlVMEMetaObject::GcPrologueCallback(QV8GCCallback::Node *node) { - QDeclarativeVMEMetaObject *vmemo = static_cast<QDeclarativeVMEMetaObject*>(node); + QQmlVMEMetaObject *vmemo = static_cast<QQmlVMEMetaObject*>(node); Q_ASSERT(vmemo); if (!vmemo->varPropertiesInitialized || vmemo->varProperties.IsEmpty() || !vmemo->ctxt || !vmemo->ctxt->engine) return; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(vmemo->ctxt->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(vmemo->ctxt->engine); ep->v8engine()->addRelationshipForGC(vmemo->object, vmemo->varProperties); } -bool QDeclarativeVMEMetaObject::aliasTarget(int index, QObject **target, int *coreIndex, int *valueTypeIndex) const +bool QQmlVMEMetaObject::aliasTarget(int index, QObject **target, int *coreIndex, int *valueTypeIndex) const { Q_ASSERT(index >= propOffset + metaData->propertyCount); @@ -1059,9 +1059,9 @@ bool QDeclarativeVMEMetaObject::aliasTarget(int index, QObject **target, int *co if (!ctxt) return false; - QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + (index - propOffset - metaData->propertyCount); - QDeclarativeContext *context = ctxt->asQDeclarativeContext(); - QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(context); + QQmlVMEMetaData::AliasData *d = metaData->aliasData() + (index - propOffset - metaData->propertyCount); + QQmlContext *context = ctxt->asQQmlContext(); + QQmlContextPrivate *ctxtPriv = QQmlContextPrivate::get(context); *target = ctxtPriv->data->idValues[d->contextIdx].data(); if (!*target) @@ -1078,18 +1078,18 @@ bool QDeclarativeVMEMetaObject::aliasTarget(int index, QObject **target, int *co return true; } -void QDeclarativeVMEMetaObject::connectAlias(int aliasId) +void QQmlVMEMetaObject::connectAlias(int aliasId) { if (!aConnected.testBit(aliasId)) { if (!aliasEndpoints) - aliasEndpoints = new QDeclarativeVMEMetaObjectEndpoint[metaData->aliasCount]; + aliasEndpoints = new QQmlVMEMetaObjectEndpoint[metaData->aliasCount]; aConnected.setBit(aliasId); - QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + aliasId; + QQmlVMEMetaData::AliasData *d = metaData->aliasData() + aliasId; - QDeclarativeVMEMetaObjectEndpoint *endpoint = aliasEndpoints + aliasId; + QQmlVMEMetaObjectEndpoint *endpoint = aliasEndpoints + aliasId; endpoint->metaObject = this; endpoint->connect(&ctxt->idValues[d->contextIdx].bindings); @@ -1098,7 +1098,7 @@ void QDeclarativeVMEMetaObject::connectAlias(int aliasId) } } -void QDeclarativeVMEMetaObject::connectAliasSignal(int index) +void QQmlVMEMetaObject::connectAliasSignal(int index) { int aliasId = (index - methodOffset) - metaData->propertyCount; if (aliasId < 0 || aliasId >= metaData->aliasCount) diff --git a/src/declarative/qml/qdeclarativevmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h index a8b7c4c359..deee989383 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject_p.h +++ b/src/qml/qml/qqmlvmemetaobject_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEVMEMETAOBJECT_P_H -#define QDECLARATIVEVMEMETAOBJECT_P_H +#ifndef QQMLVMEMETAOBJECT_P_H +#define QQMLVMEMETAOBJECT_P_H // // W A R N I N G @@ -53,7 +53,7 @@ // We mean it. // -#include "qdeclarative.h" +#include "qqml.h" #include <QtCore/QMetaObject> #include <QtCore/QBitArray> @@ -65,9 +65,9 @@ #include <private/qobject_p.h> -#include "qdeclarativeguard_p.h" -#include "qdeclarativecompiler_p.h" -#include "qdeclarativecontext_p.h" +#include "qqmlguard_p.h" +#include "qqmlcompiler_p.h" +#include "qqmlcontext_p.h" #include <private/qv8engine_p.h> @@ -77,7 +77,7 @@ QT_BEGIN_NAMESPACE #define QML_ALIAS_FLAG_PTR 0x00000001 -struct QDeclarativeVMEMetaData +struct QQmlVMEMetaData { short varPropertyCount; short propertyCount; @@ -124,7 +124,7 @@ struct QDeclarativeVMEMetaData }; PropertyData *propertyData() const { - return (PropertyData *)(((const char *)this) + sizeof(QDeclarativeVMEMetaData)); + return (PropertyData *)(((const char *)this) + sizeof(QQmlVMEMetaData)); } AliasData *aliasData() const { @@ -137,19 +137,19 @@ struct QDeclarativeVMEMetaData }; class QV8QObjectWrapper; -class QDeclarativeVMEVariant; -class QDeclarativeRefCount; -class QDeclarativeVMEMetaObjectEndpoint; -class Q_AUTOTEST_EXPORT QDeclarativeVMEMetaObject : public QAbstractDynamicMetaObject, +class QQmlVMEVariant; +class QQmlRefCount; +class QQmlVMEMetaObjectEndpoint; +class Q_AUTOTEST_EXPORT QQmlVMEMetaObject : public QAbstractDynamicMetaObject, public QV8GCCallback::Node { public: - QDeclarativeVMEMetaObject(QObject *obj, const QMetaObject *other, const QDeclarativeVMEMetaData *data, - QDeclarativeCompiledData *compiledData); - ~QDeclarativeVMEMetaObject(); + QQmlVMEMetaObject(QObject *obj, const QMetaObject *other, const QQmlVMEMetaData *data, + QQmlCompiledData *compiledData); + ~QQmlVMEMetaObject(); bool aliasTarget(int index, QObject **target, int *coreIndex, int *valueTypeIndex) const; - void registerInterceptor(int index, int valueIndex, QDeclarativePropertyValueInterceptor *interceptor); + void registerInterceptor(int index, int valueIndex, QQmlPropertyValueInterceptor *interceptor); v8::Handle<v8::Function> vmeMethod(int index); int vmeMethodLineNumber(int index); void setVmeMethod(int index, v8::Persistent<v8::Function>); @@ -162,18 +162,18 @@ protected: virtual int metaCall(QMetaObject::Call _c, int _id, void **_a); private: - friend class QDeclarativeVMEMetaObjectEndpoint; + friend class QQmlVMEMetaObjectEndpoint; QObject *object; - QDeclarativeCompiledData *compiledData; - QDeclarativeGuardedContextData ctxt; + QQmlCompiledData *compiledData; + QQmlGuardedContextData ctxt; - const QDeclarativeVMEMetaData *metaData; + const QQmlVMEMetaData *metaData; int propOffset; int methodOffset; - QDeclarativeVMEVariant *data; - QDeclarativeVMEMetaObjectEndpoint *aliasEndpoints; + QQmlVMEVariant *data; + QQmlVMEMetaObjectEndpoint *aliasEndpoints; v8::Persistent<v8::Array> varProperties; int firstVarPropertyIndex; @@ -186,7 +186,7 @@ private: void connectAlias(int aliasId); QBitArray aConnected; QBitArray aInterceptors; - QHash<int, QPair<int, QDeclarativePropertyValueInterceptor*> > interceptors; + QHash<int, QPair<int, QQmlPropertyValueInterceptor*> > interceptors; v8::Persistent<v8::Function> *v8methods; v8::Handle<v8::Function> method(int); @@ -207,10 +207,10 @@ private: }; QList<List> listProperties; - static void list_append(QDeclarativeListProperty<QObject> *, QObject *); - static int list_count(QDeclarativeListProperty<QObject> *); - static QObject *list_at(QDeclarativeListProperty<QObject> *, int); - static void list_clear(QDeclarativeListProperty<QObject> *); + static void list_append(QQmlListProperty<QObject> *, QObject *); + static int list_count(QQmlListProperty<QObject> *); + static QObject *list_at(QQmlListProperty<QObject> *, int); + static void list_clear(QQmlListProperty<QObject> *); friend class QV8GCCallback; friend class QV8QObjectWrapper; @@ -218,4 +218,4 @@ private: QT_END_NAMESPACE -#endif // QDECLARATIVEVMEMETAOBJECT_P_H +#endif // QQMLVMEMETAOBJECT_P_H diff --git a/src/declarative/qml/qdeclarativewatcher.cpp b/src/qml/qml/qqmlwatcher.cpp index 1136134499..500185762f 100644 --- a/src/declarative/qml/qdeclarativewatcher.cpp +++ b/src/qml/qml/qqmlwatcher.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qdeclarativewatcher_p.h" +#include "qqmlwatcher_p.h" -#include "qdeclarativeexpression.h" -#include "qdeclarativecontext.h" -#include "qdeclarative.h" +#include "qqmlexpression.h" +#include "qqmlcontext.h" +#include "qqml.h" -#include <private/qdeclarativedebugservice_p.h> -#include "qdeclarativeproperty_p.h" -#include "qdeclarativevaluetype_p.h" +#include <private/qqmldebugservice_p.h> +#include "qqmlproperty_p.h" +#include "qqmlvaluetype_p.h" #include <QtCore/qmetaobject.h> #include <QtCore/qdebug.h> @@ -55,79 +55,79 @@ QT_BEGIN_NAMESPACE -class QDeclarativeWatchProxy : public QObject +class QQmlWatchProxy : public QObject { Q_OBJECT public: - QDeclarativeWatchProxy(int id, + QQmlWatchProxy(int id, QObject *object, int debugId, const QMetaProperty &prop, - QDeclarativeWatcher *parent = 0); + QQmlWatcher *parent = 0); - QDeclarativeWatchProxy(int id, - QDeclarativeExpression *exp, + QQmlWatchProxy(int id, + QQmlExpression *exp, int debugId, - QDeclarativeWatcher *parent = 0); + QQmlWatcher *parent = 0); public slots: void notifyValueChanged(); private: - friend class QDeclarativeWatcher; + friend class QQmlWatcher; int m_id; - QDeclarativeWatcher *m_watch; + QQmlWatcher *m_watch; QObject *m_object; int m_debugId; QMetaProperty m_property; - QDeclarativeExpression *m_expr; + QQmlExpression *m_expr; }; -QDeclarativeWatchProxy::QDeclarativeWatchProxy(int id, - QDeclarativeExpression *exp, +QQmlWatchProxy::QQmlWatchProxy(int id, + QQmlExpression *exp, int debugId, - QDeclarativeWatcher *parent) + QQmlWatcher *parent) : QObject(parent), m_id(id), m_watch(parent), m_object(0), m_debugId(debugId), m_expr(exp) { QObject::connect(m_expr, SIGNAL(valueChanged()), this, SLOT(notifyValueChanged())); } -QDeclarativeWatchProxy::QDeclarativeWatchProxy(int id, +QQmlWatchProxy::QQmlWatchProxy(int id, QObject *object, int debugId, const QMetaProperty &prop, - QDeclarativeWatcher *parent) + QQmlWatcher *parent) : QObject(parent), m_id(id), m_watch(parent), m_object(object), m_debugId(debugId), m_property(prop), m_expr(0) { static int refreshIdx = -1; if(refreshIdx == -1) - refreshIdx = QDeclarativeWatchProxy::staticMetaObject.indexOfMethod("notifyValueChanged()"); + refreshIdx = QQmlWatchProxy::staticMetaObject.indexOfMethod("notifyValueChanged()"); if (prop.hasNotifySignal()) - QDeclarativePropertyPrivate::connect(m_object, prop.notifySignalIndex(), this, refreshIdx); + QQmlPropertyPrivate::connect(m_object, prop.notifySignalIndex(), this, refreshIdx); } -void QDeclarativeWatchProxy::notifyValueChanged() +void QQmlWatchProxy::notifyValueChanged() { QVariant v; if (m_expr) v = m_expr->evaluate(); - else if (QDeclarativeValueTypeFactory::isValueType(m_property.userType())) + else if (QQmlValueTypeFactory::isValueType(m_property.userType())) v = m_property.read(m_object); emit m_watch->propertyChanged(m_id, m_debugId, m_property, v); } -QDeclarativeWatcher::QDeclarativeWatcher(QObject *parent) +QQmlWatcher::QQmlWatcher(QObject *parent) : QObject(parent) { } -bool QDeclarativeWatcher::addWatch(int id, quint32 debugId) +bool QQmlWatcher::addWatch(int id, quint32 debugId) { - QObject *object = QDeclarativeDebugService::objectForId(debugId); + QObject *object = QQmlDebugService::objectForId(debugId); if (object) { int propCount = object->metaObject()->propertyCount(); for (int ii=0; ii<propCount; ii++) @@ -137,9 +137,9 @@ bool QDeclarativeWatcher::addWatch(int id, quint32 debugId) return false; } -bool QDeclarativeWatcher::addWatch(int id, quint32 debugId, const QByteArray &property) +bool QQmlWatcher::addWatch(int id, quint32 debugId, const QByteArray &property) { - QObject *object = QDeclarativeDebugService::objectForId(debugId); + QObject *object = QQmlDebugService::objectForId(debugId); if (object) { int index = object->metaObject()->indexOfProperty(property.constData()); if (index >= 0) { @@ -150,14 +150,14 @@ bool QDeclarativeWatcher::addWatch(int id, quint32 debugId, const QByteArray &pr return false; } -bool QDeclarativeWatcher::addWatch(int id, quint32 objectId, const QString &expr) +bool QQmlWatcher::addWatch(int id, quint32 objectId, const QString &expr) { - QObject *object = QDeclarativeDebugService::objectForId(objectId); - QDeclarativeContext *context = qmlContext(object); + QObject *object = QQmlDebugService::objectForId(objectId); + QQmlContext *context = qmlContext(object); if (context) { - QDeclarativeExpression *exprObj = new QDeclarativeExpression(context, object, expr); + QQmlExpression *exprObj = new QQmlExpression(context, object, expr); exprObj->setNotifyOnValueChanged(true); - QDeclarativeWatchProxy *proxy = new QDeclarativeWatchProxy(id, exprObj, objectId, this); + QQmlWatchProxy *proxy = new QQmlWatchProxy(id, exprObj, objectId, this); exprObj->setParent(proxy); m_proxies[id].append(proxy); proxy->notifyValueChanged(); @@ -166,18 +166,18 @@ bool QDeclarativeWatcher::addWatch(int id, quint32 objectId, const QString &expr return false; } -void QDeclarativeWatcher::removeWatch(int id) +void QQmlWatcher::removeWatch(int id) { if (!m_proxies.contains(id)) return; - QList<QPointer<QDeclarativeWatchProxy> > proxies = m_proxies.take(id); + QList<QPointer<QQmlWatchProxy> > proxies = m_proxies.take(id); qDeleteAll(proxies); } -void QDeclarativeWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, const QMetaProperty &property) +void QQmlWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, const QMetaProperty &property) { - QDeclarativeWatchProxy *proxy = new QDeclarativeWatchProxy(id, object, debugId, property, this); + QQmlWatchProxy *proxy = new QQmlWatchProxy(id, object, debugId, property, this); m_proxies[id].append(proxy); proxy->notifyValueChanged(); @@ -185,4 +185,4 @@ void QDeclarativeWatcher::addPropertyWatch(int id, QObject *object, quint32 debu QT_END_NAMESPACE -#include <qdeclarativewatcher.moc> +#include <qqmlwatcher.moc> diff --git a/src/declarative/qml/qdeclarativewatcher_p.h b/src/qml/qml/qqmlwatcher_p.h index 54b348664c..70dc9d468c 100644 --- a/src/declarative/qml/qdeclarativewatcher_p.h +++ b/src/qml/qml/qqmlwatcher_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEWATCHER_P_H -#define QDECLARATIVEWATCHER_P_H +#ifndef QQMLWATCHER_P_H +#define QQMLWATCHER_P_H // // W A R N I N G @@ -62,16 +62,16 @@ QT_BEGIN_NAMESPACE -class QDeclarativeWatchProxy; -class QDeclarativeExpression; -class QDeclarativeContext; +class QQmlWatchProxy; +class QQmlExpression; +class QQmlContext; class QMetaProperty; -class QDeclarativeWatcher : public QObject +class QQmlWatcher : public QObject { Q_OBJECT public: - QDeclarativeWatcher(QObject * = 0); + QQmlWatcher(QObject * = 0); bool addWatch(int id, quint32 objectId); bool addWatch(int id, quint32 objectId, const QByteArray &property); @@ -83,12 +83,12 @@ Q_SIGNALS: void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value); private: - friend class QDeclarativeWatchProxy; + friend class QQmlWatchProxy; void addPropertyWatch(int id, QObject *object, quint32 objectId, const QMetaProperty &property); - QHash<int, QList<QPointer<QDeclarativeWatchProxy> > > m_proxies; + QHash<int, QList<QPointer<QQmlWatchProxy> > > m_proxies; }; QT_END_NAMESPACE -#endif // QDECLARATIVEWATCHER_P_H +#endif // QQMLWATCHER_P_H diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index c439948513..122693ad91 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,21 +39,21 @@ ** ****************************************************************************/ -#include "qdeclarativexmlhttprequest_p.h" +#include "qqmlxmlhttprequest_p.h" #include <private/qv8engine_p.h> -#include "qdeclarativeengine.h" -#include "qdeclarativeengine_p.h" -#include <private/qdeclarativerefcount_p.h> -#include "qdeclarativeengine_p.h" -#include "qdeclarativeexpression_p.h" -#include "qdeclarativeglobal_p.h" +#include "qqmlengine.h" +#include "qqmlengine_p.h" +#include <private/qqmlrefcount_p.h> +#include "qqmlengine_p.h" +#include "qqmlexpression_p.h" +#include "qqmlglobal_p.h" #include <private/qv8domerrors_p.h> #include <QtCore/qobject.h> -#include <QtDeclarative/qjsvalue.h> -#include <QtDeclarative/qjsengine.h> +#include <QtQml/qjsvalue.h> +#include <QtQml/qjsengine.h> #include <QtNetwork/qnetworkreply.h> #include <QtCore/qtextcodec.h> #include <QtCore/qxmlstream.h> @@ -76,9 +76,9 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(xhrDump, QML_XHR_DUMP); -struct QDeclarativeXMLHttpRequestData { - QDeclarativeXMLHttpRequestData(); - ~QDeclarativeXMLHttpRequestData(); +struct QQmlXMLHttpRequestData { + QQmlXMLHttpRequestData(); + ~QQmlXMLHttpRequestData(); v8::Persistent<v8::Function> nodeFunction; @@ -95,16 +95,16 @@ struct QDeclarativeXMLHttpRequestData { v8::Local<v8::Object> newNode(); }; -static inline QDeclarativeXMLHttpRequestData *xhrdata(QV8Engine *engine) +static inline QQmlXMLHttpRequestData *xhrdata(QV8Engine *engine) { - return (QDeclarativeXMLHttpRequestData *)engine->xmlHttpRequestData(); + return (QQmlXMLHttpRequestData *)engine->xmlHttpRequestData(); } -QDeclarativeXMLHttpRequestData::QDeclarativeXMLHttpRequestData() +QQmlXMLHttpRequestData::QQmlXMLHttpRequestData() { } -QDeclarativeXMLHttpRequestData::~QDeclarativeXMLHttpRequestData() +QQmlXMLHttpRequestData::~QQmlXMLHttpRequestData() { qPersistentDispose(nodeFunction); qPersistentDispose(namedNodeMapPrototype); @@ -118,7 +118,7 @@ QDeclarativeXMLHttpRequestData::~QDeclarativeXMLHttpRequestData() qPersistentDispose(documentPrototype); } -v8::Local<v8::Object> QDeclarativeXMLHttpRequestData::newNode() +v8::Local<v8::Object> QQmlXMLHttpRequestData::newNode() { if (nodeFunction.IsEmpty()) { v8::Local<v8::FunctionTemplate> ft = v8::FunctionTemplate::New(); @@ -175,7 +175,7 @@ public: QList<NodeImpl *> attributes; }; -class DocumentImpl : public QDeclarativeRefCount, public NodeImpl +class DocumentImpl : public QQmlRefCount, public NodeImpl { public: DocumentImpl() : root(0) { type = Document; } @@ -189,8 +189,8 @@ public: NodeImpl *root; - void addref() { QDeclarativeRefCount::addref(); } - void release() { QDeclarativeRefCount::release(); } + void addref() { QQmlRefCount::addref(); } + void release() { QQmlRefCount::release(); } }; class NamedNodeMap @@ -322,16 +322,16 @@ public: } -class QDeclarativeDOMNodeResource : public QV8ObjectResource, public Node +class QQmlDOMNodeResource : public QV8ObjectResource, public Node { V8_RESOURCE_TYPE(DOMNodeType); public: - QDeclarativeDOMNodeResource(QV8Engine *e); + QQmlDOMNodeResource(QV8Engine *e); QList<NodeImpl *> *list; // Only used in NamedNodeMap }; -QDeclarativeDOMNodeResource::QDeclarativeDOMNodeResource(QV8Engine *e) +QQmlDOMNodeResource::QQmlDOMNodeResource(QV8Engine *e) : QV8ObjectResource(e), list(0) { } @@ -356,7 +356,7 @@ void NodeImpl::release() v8::Handle<v8::Value> Node::nodeName(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -374,7 +374,7 @@ v8::Handle<v8::Value> Node::nodeName(v8::Local<v8::String>, const v8::AccessorIn v8::Handle<v8::Value> Node::nodeValue(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -392,14 +392,14 @@ v8::Handle<v8::Value> Node::nodeValue(v8::Local<v8::String>, const v8::AccessorI v8::Handle<v8::Value> Node::nodeType(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); return v8::Integer::New(r->d->type); } v8::Handle<v8::Value> Node::parentNode(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -409,7 +409,7 @@ v8::Handle<v8::Value> Node::parentNode(v8::Local<v8::String>, const v8::Accessor v8::Handle<v8::Value> Node::childNodes(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -418,7 +418,7 @@ v8::Handle<v8::Value> Node::childNodes(v8::Local<v8::String>, const v8::Accessor v8::Handle<v8::Value> Node::firstChild(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -428,7 +428,7 @@ v8::Handle<v8::Value> Node::firstChild(v8::Local<v8::String>, const v8::Accessor v8::Handle<v8::Value> Node::lastChild(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -438,7 +438,7 @@ v8::Handle<v8::Value> Node::lastChild(v8::Local<v8::String>, const v8::AccessorI v8::Handle<v8::Value> Node::previousSibling(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -456,7 +456,7 @@ v8::Handle<v8::Value> Node::previousSibling(v8::Local<v8::String>, const v8::Acc v8::Handle<v8::Value> Node::nextSibling(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -474,7 +474,7 @@ v8::Handle<v8::Value> Node::nextSibling(v8::Local<v8::String>, const v8::Accesso v8::Handle<v8::Value> Node::attributes(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -486,7 +486,7 @@ v8::Handle<v8::Value> Node::attributes(v8::Local<v8::String>, const v8::Accessor v8::Handle<v8::Object> Node::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->nodePrototype.IsEmpty()) { d->nodePrototype = qPersistentNew<v8::Object>(v8::Object::New()); d->nodePrototype->SetAccessor(v8::String::New("nodeName"), nodeName, @@ -516,7 +516,7 @@ v8::Handle<v8::Object> Node::prototype(QV8Engine *engine) v8::Handle<v8::Value> Node::create(QV8Engine *engine, NodeImpl *data) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); v8::Local<v8::Object> instance = d->newNode(); switch (data->type) { @@ -543,7 +543,7 @@ v8::Handle<v8::Value> Node::create(QV8Engine *engine, NodeImpl *data) break; } - QDeclarativeDOMNodeResource *r = new QDeclarativeDOMNodeResource(engine); + QQmlDOMNodeResource *r = new QQmlDOMNodeResource(engine); r->d = data; if (data) A(data); instance->SetExternalResource(r); @@ -553,7 +553,7 @@ v8::Handle<v8::Value> Node::create(QV8Engine *engine, NodeImpl *data) v8::Handle<v8::Object> Element::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->elementPrototype.IsEmpty()) { d->elementPrototype = qPersistentNew<v8::Object>(v8::Object::New()); d->elementPrototype->SetPrototype(Node::prototype(engine)); @@ -566,7 +566,7 @@ v8::Handle<v8::Object> Element::prototype(QV8Engine *engine) v8::Handle<v8::Object> Attr::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->attrPrototype.IsEmpty()) { d->attrPrototype = qPersistentNew<v8::Object>(v8::Object::New()); d->attrPrototype->SetPrototype(Node::prototype(engine)); @@ -583,7 +583,7 @@ v8::Handle<v8::Object> Attr::prototype(QV8Engine *engine) v8::Handle<v8::Value> Attr::name(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -592,7 +592,7 @@ v8::Handle<v8::Value> Attr::name(v8::Local<v8::String>, const v8::AccessorInfo & v8::Handle<v8::Value> Attr::value(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -601,7 +601,7 @@ v8::Handle<v8::Value> Attr::value(v8::Local<v8::String>, const v8::AccessorInfo v8::Handle<v8::Value> Attr::ownerElement(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -610,7 +610,7 @@ v8::Handle<v8::Value> Attr::ownerElement(v8::Local<v8::String>, const v8::Access v8::Handle<v8::Value> CharacterData::length(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); Q_UNUSED(engine) @@ -619,7 +619,7 @@ v8::Handle<v8::Value> CharacterData::length(v8::Local<v8::String>, const v8::Acc v8::Handle<v8::Object> CharacterData::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->characterDataPrototype.IsEmpty()) { d->characterDataPrototype = qPersistentNew<v8::Object>(v8::Object::New()); d->characterDataPrototype->SetPrototype(Node::prototype(engine)); @@ -634,7 +634,7 @@ v8::Handle<v8::Object> CharacterData::prototype(QV8Engine *engine) v8::Handle<v8::Value> Text::isElementContentWhitespace(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); Q_UNUSED(engine) @@ -643,7 +643,7 @@ v8::Handle<v8::Value> Text::isElementContentWhitespace(v8::Local<v8::String>, co v8::Handle<v8::Value> Text::wholeText(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -652,7 +652,7 @@ v8::Handle<v8::Value> Text::wholeText(v8::Local<v8::String>, const v8::AccessorI v8::Handle<v8::Object> Text::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->textPrototype.IsEmpty()) { d->textPrototype = qPersistentNew<v8::Object>(v8::Object::New()); d->textPrototype->SetPrototype(CharacterData::prototype(engine)); @@ -667,7 +667,7 @@ v8::Handle<v8::Object> Text::prototype(QV8Engine *engine) v8::Handle<v8::Object> CDATA::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->cdataPrototype.IsEmpty()) { d->cdataPrototype = qPersistentNew<v8::Object>(v8::Object::New()); d->cdataPrototype->SetPrototype(Text::prototype(engine)); @@ -678,7 +678,7 @@ v8::Handle<v8::Object> CDATA::prototype(QV8Engine *engine) v8::Handle<v8::Object> Document::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->documentPrototype.IsEmpty()) { d->documentPrototype = qPersistentNew<v8::Object>(v8::Object::New()); d->documentPrototype->SetPrototype(Node::prototype(engine)); @@ -777,7 +777,7 @@ v8::Handle<v8::Value> Document::load(QV8Engine *engine, const QByteArray &data) } v8::Local<v8::Object> instance = xhrdata(engine)->newNode(); - QDeclarativeDOMNodeResource *r = new QDeclarativeDOMNodeResource(engine); + QQmlDOMNodeResource *r = new QQmlDOMNodeResource(engine); r->d = document; instance->SetExternalResource(r); instance->SetPrototype(Document::prototype(engine)); @@ -807,7 +807,7 @@ bool Node::isNull() const v8::Handle<v8::Value> NamedNodeMap::length(v8::Local<v8::String>, const v8::AccessorInfo &args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); Q_UNUSED(engine) @@ -816,7 +816,7 @@ v8::Handle<v8::Value> NamedNodeMap::length(v8::Local<v8::String>, const v8::Acce v8::Handle<v8::Value> NamedNodeMap::indexed(uint32_t index, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r || !r->list) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -829,7 +829,7 @@ v8::Handle<v8::Value> NamedNodeMap::indexed(uint32_t index, const v8::AccessorIn v8::Handle<v8::Value> NamedNodeMap::named(v8::Local<v8::String> property, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r || !r->list) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -845,7 +845,7 @@ v8::Handle<v8::Value> NamedNodeMap::named(v8::Local<v8::String> property, const v8::Handle<v8::Object> NamedNodeMap::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->namedNodeMapPrototype.IsEmpty()) { v8::Local<v8::ObjectTemplate> ot = v8::ObjectTemplate::New(); ot->SetAccessor(v8::String::New("length"), length, 0, v8::External::Wrap(engine)); @@ -859,10 +859,10 @@ v8::Handle<v8::Object> NamedNodeMap::prototype(QV8Engine *engine) v8::Handle<v8::Value> NamedNodeMap::create(QV8Engine *engine, NodeImpl *data, QList<NodeImpl *> *list) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); v8::Local<v8::Object> instance = d->newNode(); instance->SetPrototype(NamedNodeMap::prototype(engine)); - QDeclarativeDOMNodeResource *r = new QDeclarativeDOMNodeResource(engine); + QQmlDOMNodeResource *r = new QQmlDOMNodeResource(engine); r->d = data; r->list = list; if (data) A(data); @@ -872,7 +872,7 @@ v8::Handle<v8::Value> NamedNodeMap::create(QV8Engine *engine, NodeImpl *data, QL v8::Handle<v8::Value> NodeList::indexed(uint32_t index, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -885,7 +885,7 @@ v8::Handle<v8::Value> NodeList::indexed(uint32_t index, const v8::AccessorInfo& v8::Handle<v8::Value> NodeList::length(v8::Local<v8::String>, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); Q_UNUSED(engine) @@ -894,7 +894,7 @@ v8::Handle<v8::Value> NodeList::length(v8::Local<v8::String>, const v8::Accessor v8::Handle<v8::Object> NodeList::prototype(QV8Engine *engine) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->nodeListPrototype.IsEmpty()) { v8::Local<v8::ObjectTemplate> ot = v8::ObjectTemplate::New(); ot->SetAccessor(v8::String::New("length"), length, 0, v8::External::Wrap(engine)); @@ -907,10 +907,10 @@ v8::Handle<v8::Object> NodeList::prototype(QV8Engine *engine) v8::Handle<v8::Value> NodeList::create(QV8Engine *engine, NodeImpl *data) { - QDeclarativeXMLHttpRequestData *d = xhrdata(engine); + QQmlXMLHttpRequestData *d = xhrdata(engine); v8::Local<v8::Object> instance = d->newNode(); instance->SetPrototype(NodeList::prototype(engine)); - QDeclarativeDOMNodeResource *r = new QDeclarativeDOMNodeResource(engine); + QQmlDOMNodeResource *r = new QQmlDOMNodeResource(engine); r->d = data; if (data) A(data); instance->SetExternalResource(r); @@ -919,7 +919,7 @@ v8::Handle<v8::Value> NodeList::create(QV8Engine *engine, NodeImpl *data) v8::Handle<v8::Value> Document::documentElement(v8::Local<v8::String>, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -928,7 +928,7 @@ v8::Handle<v8::Value> Document::documentElement(v8::Local<v8::String>, const v8: v8::Handle<v8::Value> Document::xmlStandalone(v8::Local<v8::String>, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); Q_UNUSED(engine) @@ -937,7 +937,7 @@ v8::Handle<v8::Value> Document::xmlStandalone(v8::Local<v8::String>, const v8::A v8::Handle<v8::Value> Document::xmlVersion(v8::Local<v8::String>, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); @@ -946,14 +946,14 @@ v8::Handle<v8::Value> Document::xmlVersion(v8::Local<v8::String>, const v8::Acce v8::Handle<v8::Value> Document::xmlEncoding(v8::Local<v8::String>, const v8::AccessorInfo& args) { - QDeclarativeDOMNodeResource *r = v8_resource_cast<QDeclarativeDOMNodeResource>(args.This()); + QQmlDOMNodeResource *r = v8_resource_cast<QQmlDOMNodeResource>(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); return engine->toString(static_cast<DocumentImpl *>(r->d)->encoding); } -class QDeclarativeXMLHttpRequest : public QObject, public QV8ObjectResource +class QQmlXMLHttpRequest : public QObject, public QV8ObjectResource { Q_OBJECT V8_RESOURCE_TYPE(XMLHttpRequestType) @@ -962,8 +962,8 @@ public: Opened = 1, HeadersReceived = 2, Loading = 3, Done = 4 }; - QDeclarativeXMLHttpRequest(QV8Engine *engine, QNetworkAccessManager *manager); - virtual ~QDeclarativeXMLHttpRequest(); + QQmlXMLHttpRequest(QV8Engine *engine, QNetworkAccessManager *manager); + virtual ~QQmlXMLHttpRequest(); bool sendFlag() const; bool errorFlag() const; @@ -1024,50 +1024,50 @@ private: int m_status; QString m_statusText; QNetworkRequest m_request; - QDeclarativeGuard<QNetworkReply> m_network; + QQmlGuard<QNetworkReply> m_network; void destroyNetwork(); QNetworkAccessManager *m_nam; QNetworkAccessManager *networkAccessManager() { return m_nam; } }; -QDeclarativeXMLHttpRequest::QDeclarativeXMLHttpRequest(QV8Engine *engine, QNetworkAccessManager *manager) +QQmlXMLHttpRequest::QQmlXMLHttpRequest(QV8Engine *engine, QNetworkAccessManager *manager) : QV8ObjectResource(engine), m_state(Unsent), m_errorFlag(false), m_sendFlag(false), m_redirectCount(0), m_gotXml(false), m_textCodec(0), m_network(0), m_nam(manager) { } -QDeclarativeXMLHttpRequest::~QDeclarativeXMLHttpRequest() +QQmlXMLHttpRequest::~QQmlXMLHttpRequest() { destroyNetwork(); } -bool QDeclarativeXMLHttpRequest::sendFlag() const +bool QQmlXMLHttpRequest::sendFlag() const { return m_sendFlag; } -bool QDeclarativeXMLHttpRequest::errorFlag() const +bool QQmlXMLHttpRequest::errorFlag() const { return m_errorFlag; } -quint32 QDeclarativeXMLHttpRequest::readyState() const +quint32 QQmlXMLHttpRequest::readyState() const { return m_state; } -int QDeclarativeXMLHttpRequest::replyStatus() const +int QQmlXMLHttpRequest::replyStatus() const { return m_status; } -QString QDeclarativeXMLHttpRequest::replyStatusText() const +QString QQmlXMLHttpRequest::replyStatusText() const { return m_statusText; } -v8::Handle<v8::Value> QDeclarativeXMLHttpRequest::open(v8::Handle<v8::Object> me, const QString &method, +v8::Handle<v8::Value> QQmlXMLHttpRequest::open(v8::Handle<v8::Object> me, const QString &method, const QUrl &url) { destroyNetwork(); @@ -1081,7 +1081,7 @@ v8::Handle<v8::Value> QDeclarativeXMLHttpRequest::open(v8::Handle<v8::Object> me return v8::Undefined(); } -void QDeclarativeXMLHttpRequest::addHeader(const QString &name, const QString &value) +void QQmlXMLHttpRequest::addHeader(const QString &name, const QString &value) { QByteArray utfname = name.toUtf8(); @@ -1092,7 +1092,7 @@ void QDeclarativeXMLHttpRequest::addHeader(const QString &name, const QString &v } } -QString QDeclarativeXMLHttpRequest::header(const QString &name) +QString QQmlXMLHttpRequest::header(const QString &name) { QByteArray utfname = name.toLower().toUtf8(); @@ -1103,7 +1103,7 @@ QString QDeclarativeXMLHttpRequest::header(const QString &name) return QString(); } -QString QDeclarativeXMLHttpRequest::headers() +QString QQmlXMLHttpRequest::headers() { QString ret; @@ -1116,7 +1116,7 @@ QString QDeclarativeXMLHttpRequest::headers() return ret; } -void QDeclarativeXMLHttpRequest::fillHeadersList() +void QQmlXMLHttpRequest::fillHeadersList() { QList<QByteArray> headerList = m_network->rawHeaderList(); @@ -1131,7 +1131,7 @@ void QDeclarativeXMLHttpRequest::fillHeadersList() } } -void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url) +void QQmlXMLHttpRequest::requestFromUrl(const QUrl &url) { QNetworkRequest request = m_request; request.setUrl(url); @@ -1191,7 +1191,7 @@ void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url) this, SLOT(finished())); } -v8::Handle<v8::Value> QDeclarativeXMLHttpRequest::send(v8::Handle<v8::Object> me, const QByteArray &data) +v8::Handle<v8::Value> QQmlXMLHttpRequest::send(v8::Handle<v8::Object> me, const QByteArray &data) { m_errorFlag = false; m_sendFlag = true; @@ -1205,7 +1205,7 @@ v8::Handle<v8::Value> QDeclarativeXMLHttpRequest::send(v8::Handle<v8::Object> me return v8::Undefined(); } -v8::Handle<v8::Value> QDeclarativeXMLHttpRequest::abort(v8::Handle<v8::Object> me) +v8::Handle<v8::Value> QQmlXMLHttpRequest::abort(v8::Handle<v8::Object> me) { destroyNetwork(); m_responseEntityBody = QByteArray(); @@ -1226,12 +1226,12 @@ v8::Handle<v8::Value> QDeclarativeXMLHttpRequest::abort(v8::Handle<v8::Object> m return v8::Undefined(); } -v8::Handle<v8::Object> QDeclarativeXMLHttpRequest::getMe() const +v8::Handle<v8::Object> QQmlXMLHttpRequest::getMe() const { return m_me; } -void QDeclarativeXMLHttpRequest::setMe(v8::Handle<v8::Object> me) +void QQmlXMLHttpRequest::setMe(v8::Handle<v8::Object> me) { qPersistentDispose(m_me); @@ -1239,7 +1239,7 @@ void QDeclarativeXMLHttpRequest::setMe(v8::Handle<v8::Object> me) m_me = qPersistentNew<v8::Object>(me); } -void QDeclarativeXMLHttpRequest::downloadProgress(qint64 bytes) +void QQmlXMLHttpRequest::downloadProgress(qint64 bytes) { v8::HandleScope handle_scope; @@ -1280,7 +1280,7 @@ static const char *errorToString(QNetworkReply::NetworkError error) else return name; } -void QDeclarativeXMLHttpRequest::error(QNetworkReply::NetworkError error) +void QQmlXMLHttpRequest::error(QNetworkReply::NetworkError error) { v8::HandleScope handle_scope; @@ -1323,7 +1323,7 @@ void QDeclarativeXMLHttpRequest::error(QNetworkReply::NetworkError error) } #define XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION 15 -void QDeclarativeXMLHttpRequest::finished() +void QQmlXMLHttpRequest::finished() { v8::HandleScope handle_scope; @@ -1380,7 +1380,7 @@ void QDeclarativeXMLHttpRequest::finished() } -void QDeclarativeXMLHttpRequest::readEncoding() +void QQmlXMLHttpRequest::readEncoding() { foreach (const HeaderPair &header, m_headersList) { if (header.first == "content-type") { @@ -1404,14 +1404,14 @@ void QDeclarativeXMLHttpRequest::readEncoding() m_gotXml = true; } -bool QDeclarativeXMLHttpRequest::receivedXml() const +bool QQmlXMLHttpRequest::receivedXml() const { return m_gotXml; } #ifndef QT_NO_TEXTCODEC -QTextCodec* QDeclarativeXMLHttpRequest::findTextCodec() const +QTextCodec* QQmlXMLHttpRequest::findTextCodec() const { QTextCodec *codec = 0; @@ -1437,7 +1437,7 @@ QTextCodec* QDeclarativeXMLHttpRequest::findTextCodec() const #endif -QString QDeclarativeXMLHttpRequest::responseBody() +QString QQmlXMLHttpRequest::responseBody() { #ifndef QT_NO_TEXTCODEC if (!m_textCodec) @@ -1449,13 +1449,13 @@ QString QDeclarativeXMLHttpRequest::responseBody() return QString::fromUtf8(m_responseEntityBody); } -const QByteArray &QDeclarativeXMLHttpRequest::rawResponseBody() const +const QByteArray &QQmlXMLHttpRequest::rawResponseBody() const { return m_responseEntityBody; } // Requires a TryCatch scope -void QDeclarativeXMLHttpRequest::dispatchCallback(v8::Handle<v8::Object> me) +void QQmlXMLHttpRequest::dispatchCallback(v8::Handle<v8::Object> me) { v8::Local<v8::Value> callback = me->Get(v8::String::New("onreadystatechange")); if (callback->IsFunction()) { @@ -1466,16 +1466,16 @@ void QDeclarativeXMLHttpRequest::dispatchCallback(v8::Handle<v8::Object> me) } // Must have a handle scope -void QDeclarativeXMLHttpRequest::printError(v8::Handle<v8::Message> message) +void QQmlXMLHttpRequest::printError(v8::Handle<v8::Message> message) { v8::Context::Scope scope(engine->context()); - QDeclarativeError error; - QDeclarativeExpressionPrivate::exceptionToError(message, error); - QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate::get(engine->engine()), error); + QQmlError error; + QQmlExpressionPrivate::exceptionToError(message, error); + QQmlEnginePrivate::warning(QQmlEnginePrivate::get(engine->engine()), error); } -void QDeclarativeXMLHttpRequest::destroyNetwork() +void QQmlXMLHttpRequest::destroyNetwork() { if (m_network) { m_network->disconnect(); @@ -1487,7 +1487,7 @@ void QDeclarativeXMLHttpRequest::destroyNetwork() // XMLHttpRequest methods static v8::Handle<v8::Value> qmlxmlhttprequest_open(const v8::Arguments &args) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(args.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(args.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); @@ -1534,14 +1534,14 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_open(const v8::Arguments &args) static v8::Handle<v8::Value> qmlxmlhttprequest_setRequestHeader(const v8::Arguments &args) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(args.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(args.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); if (args.Length() != 2) V8THROW_DOM(DOMEXCEPTION_SYNTAX_ERR, "Incorrect argument count"); - if (r->readyState() != QDeclarativeXMLHttpRequest::Opened || r->sendFlag()) + if (r->readyState() != QQmlXMLHttpRequest::Opened || r->sendFlag()) V8THROW_DOM(DOMEXCEPTION_INVALID_STATE_ERR, "Invalid state"); QV8Engine *engine = r->engine; @@ -1581,13 +1581,13 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_setRequestHeader(const v8::Argume static v8::Handle<v8::Value> qmlxmlhttprequest_send(const v8::Arguments &args) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(args.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(args.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); QV8Engine *engine = r->engine; - if (r->readyState() != QDeclarativeXMLHttpRequest::Opened || + if (r->readyState() != QQmlXMLHttpRequest::Opened || r->sendFlag()) V8THROW_DOM(DOMEXCEPTION_INVALID_STATE_ERR, "Invalid state"); @@ -1600,7 +1600,7 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_send(const v8::Arguments &args) static v8::Handle<v8::Value> qmlxmlhttprequest_abort(const v8::Arguments &args) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(args.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(args.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); @@ -1609,7 +1609,7 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_abort(const v8::Arguments &args) static v8::Handle<v8::Value> qmlxmlhttprequest_getResponseHeader(const v8::Arguments &args) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(args.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(args.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); @@ -1618,9 +1618,9 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_getResponseHeader(const v8::Argum if (args.Length() != 1) V8THROW_DOM(DOMEXCEPTION_SYNTAX_ERR, "Incorrect argument count"); - if (r->readyState() != QDeclarativeXMLHttpRequest::Loading && - r->readyState() != QDeclarativeXMLHttpRequest::Done && - r->readyState() != QDeclarativeXMLHttpRequest::HeadersReceived) + if (r->readyState() != QQmlXMLHttpRequest::Loading && + r->readyState() != QQmlXMLHttpRequest::Done && + r->readyState() != QQmlXMLHttpRequest::HeadersReceived) V8THROW_DOM(DOMEXCEPTION_INVALID_STATE_ERR, "Invalid state"); return engine->toString(r->header(engine->toString(args[0]))); @@ -1628,7 +1628,7 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_getResponseHeader(const v8::Argum static v8::Handle<v8::Value> qmlxmlhttprequest_getAllResponseHeaders(const v8::Arguments &args) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(args.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(args.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); @@ -1637,9 +1637,9 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_getAllResponseHeaders(const v8::A if (args.Length() != 0) V8THROW_DOM(DOMEXCEPTION_SYNTAX_ERR, "Incorrect argument count"); - if (r->readyState() != QDeclarativeXMLHttpRequest::Loading && - r->readyState() != QDeclarativeXMLHttpRequest::Done && - r->readyState() != QDeclarativeXMLHttpRequest::HeadersReceived) + if (r->readyState() != QQmlXMLHttpRequest::Loading && + r->readyState() != QQmlXMLHttpRequest::Done && + r->readyState() != QQmlXMLHttpRequest::HeadersReceived) V8THROW_DOM(DOMEXCEPTION_INVALID_STATE_ERR, "Invalid state"); return engine->toString(r->headers()); @@ -1649,7 +1649,7 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_getAllResponseHeaders(const v8::A static v8::Handle<v8::Value> qmlxmlhttprequest_readyState(v8::Local<v8::String> /* property */, const v8::AccessorInfo& info) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(info.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(info.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); @@ -1659,12 +1659,12 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_readyState(v8::Local<v8::String> static v8::Handle<v8::Value> qmlxmlhttprequest_status(v8::Local<v8::String> /* property */, const v8::AccessorInfo& info) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(info.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(info.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); - if (r->readyState() == QDeclarativeXMLHttpRequest::Unsent || - r->readyState() == QDeclarativeXMLHttpRequest::Opened) + if (r->readyState() == QQmlXMLHttpRequest::Unsent || + r->readyState() == QQmlXMLHttpRequest::Opened) V8THROW_DOM(DOMEXCEPTION_INVALID_STATE_ERR, "Invalid state"); if (r->errorFlag()) @@ -1676,14 +1676,14 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_status(v8::Local<v8::String> /* p static v8::Handle<v8::Value> qmlxmlhttprequest_statusText(v8::Local<v8::String> /* property */, const v8::AccessorInfo& info) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(info.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(info.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); QV8Engine *engine = r->engine; - if (r->readyState() == QDeclarativeXMLHttpRequest::Unsent || - r->readyState() == QDeclarativeXMLHttpRequest::Opened) + if (r->readyState() == QQmlXMLHttpRequest::Unsent || + r->readyState() == QQmlXMLHttpRequest::Opened) V8THROW_DOM(DOMEXCEPTION_INVALID_STATE_ERR, "Invalid state"); if (r->errorFlag()) @@ -1695,14 +1695,14 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_statusText(v8::Local<v8::String> static v8::Handle<v8::Value> qmlxmlhttprequest_responseText(v8::Local<v8::String> /* property */, const v8::AccessorInfo& info) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(info.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(info.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); QV8Engine *engine = r->engine; - if (r->readyState() != QDeclarativeXMLHttpRequest::Loading && - r->readyState() != QDeclarativeXMLHttpRequest::Done) + if (r->readyState() != QQmlXMLHttpRequest::Loading && + r->readyState() != QQmlXMLHttpRequest::Done) return engine->toString(QString()); else return engine->toString(r->responseBody()); @@ -1711,13 +1711,13 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_responseText(v8::Local<v8::String static v8::Handle<v8::Value> qmlxmlhttprequest_responseXML(v8::Local<v8::String> /* property */, const v8::AccessorInfo& info) { - QDeclarativeXMLHttpRequest *r = v8_resource_cast<QDeclarativeXMLHttpRequest>(info.This()); + QQmlXMLHttpRequest *r = v8_resource_cast<QQmlXMLHttpRequest>(info.This()); if (!r) V8THROW_REFERENCE("Not an XMLHttpRequest object"); if (!r->receivedXml() || - (r->readyState() != QDeclarativeXMLHttpRequest::Loading && - r->readyState() != QDeclarativeXMLHttpRequest::Done)) { + (r->readyState() != QQmlXMLHttpRequest::Loading && + r->readyState() != QQmlXMLHttpRequest::Done)) { return v8::Null(); } else { return Document::load(r->engine, r->rawResponseBody()); @@ -1728,9 +1728,9 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_new(const v8::Arguments &args) { if (args.IsConstructCall()) { QV8Engine *engine = V8ENGINE(); - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine->engine()); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine->engine()); Q_UNUSED(ep) - QDeclarativeXMLHttpRequest *r = new QDeclarativeXMLHttpRequest(engine, engine->networkAccessManager()); + QQmlXMLHttpRequest *r = new QQmlXMLHttpRequest(engine, engine->networkAccessManager()); args.This()->SetExternalResource(r); return args.This(); @@ -1743,7 +1743,7 @@ static v8::Handle<v8::Value> qmlxmlhttprequest_new(const v8::Arguments &args) void qt_rem_qmlxmlhttprequest(QV8Engine * /* engine */, void *d) { - QDeclarativeXMLHttpRequestData *data = (QDeclarativeXMLHttpRequestData *)d; + QQmlXMLHttpRequestData *data = (QQmlXMLHttpRequestData *)d; delete data; } @@ -1786,7 +1786,7 @@ void *qt_add_qmlxmlhttprequest(QV8Engine *engine) xmlhttprequest->Set(v8::String::New("DONE"), v8::Integer::New(4), attributes); engine->global()->Set(v8::String::New("XMLHttpRequest"), xmlhttprequest->GetFunction()); - QDeclarativeXMLHttpRequestData *data = new QDeclarativeXMLHttpRequestData; + QQmlXMLHttpRequestData *data = new QQmlXMLHttpRequestData; return data; } @@ -1794,4 +1794,4 @@ QT_END_NAMESPACE #endif // QT_NO_XMLSTREAMREADER -#include <qdeclarativexmlhttprequest.moc> +#include <qqmlxmlhttprequest.moc> diff --git a/src/declarative/qml/qdeclarativexmlhttprequest_p.h b/src/qml/qml/qqmlxmlhttprequest_p.h index 3177a7a3be..2cfdf6a140 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest_p.h +++ b/src/qml/qml/qqmlxmlhttprequest_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEXMLHTTPREQUEST_P_H -#define QDECLARATIVEXMLHTTPREQUEST_P_H +#ifndef QQMLXMLHTTPREQUEST_P_H +#define QQMLXMLHTTPREQUEST_P_H -#include <QtDeclarative/qjsengine.h> +#include <QtQml/qjsengine.h> // // W A R N I N G // ------------- @@ -69,5 +69,5 @@ QT_END_NAMESPACE #endif // QT_NO_XMLSTREAMREADER -#endif // QDECLARATIVEXMLHTTPREQUEST_P_H +#endif // QQMLXMLHTTPREQUEST_P_H diff --git a/src/declarative/qml/qdeclarativeapplication.cpp b/src/qml/qml/qquickapplication.cpp index b5ceaf2550..198a917cb8 100644 --- a/src/declarative/qml/qdeclarativeapplication.cpp +++ b/src/qml/qml/qquickapplication.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativeapplication_p.h" +#include "qquickapplication_p.h" #include <private/qobject_p.h> #include <QtGui/QGuiApplication> #include <QtGui/QInputMethod> @@ -47,11 +47,11 @@ QT_BEGIN_NAMESPACE -class QDeclarativeApplicationPrivate : public QObjectPrivate +class QQuickApplicationPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeApplication) + Q_DECLARE_PUBLIC(QQuickApplication) public: - QDeclarativeApplicationPrivate() : active(QGuiApplication::activeWindow() != 0), + QQuickApplicationPrivate() : active(QGuiApplication::activeWindow() != 0), layoutDirection(QGuiApplication::layoutDirection()) {} bool active; Qt::LayoutDirection layoutDirection; @@ -62,29 +62,29 @@ public: in qdeclarativengine.cpp */ -QDeclarativeApplication::QDeclarativeApplication(QObject *parent) : QObject(*new QDeclarativeApplicationPrivate(), parent) +QQuickApplication::QQuickApplication(QObject *parent) : QObject(*new QQuickApplicationPrivate(), parent) { if (qApp) qApp->installEventFilter(this); } -QDeclarativeApplication::~QDeclarativeApplication() +QQuickApplication::~QQuickApplication() { } -bool QDeclarativeApplication::active() const +bool QQuickApplication::active() const { - Q_D(const QDeclarativeApplication); + Q_D(const QQuickApplication); return d->active; } -Qt::LayoutDirection QDeclarativeApplication::layoutDirection() const +Qt::LayoutDirection QQuickApplication::layoutDirection() const { - Q_D(const QDeclarativeApplication); + Q_D(const QQuickApplication); return d->layoutDirection; } -QObject *QDeclarativeApplication::inputPanel() const +QObject *QQuickApplication::inputPanel() const { static bool warned = false; if (!warned) { @@ -94,10 +94,10 @@ QObject *QDeclarativeApplication::inputPanel() const return qApp ? qApp->inputMethod() : 0; } -bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event) +bool QQuickApplication::eventFilter(QObject *obj, QEvent *event) { Q_UNUSED(obj) - Q_D(QDeclarativeApplication); + Q_D(QQuickApplication); if (event->type() == QEvent::ApplicationActivate || event->type() == QEvent::ApplicationDeactivate) { bool active = d->active; diff --git a/src/declarative/qml/qdeclarativeapplication_p.h b/src/qml/qml/qquickapplication_p.h index 4a0ff52d3e..66198948ac 100644 --- a/src/declarative/qml/qdeclarativeapplication_p.h +++ b/src/qml/qml/qquickapplication_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,20 +39,20 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEAPPLICATION_P_H -#define QDECLARATIVEAPPLICATION_P_H +#ifndef QQUICKAPPLICATION_P_H +#define QQUICKAPPLICATION_P_H #include <QtCore/QObject> -#include <qdeclarative.h> -#include <private/qdeclarativeglobal_p.h> +#include <qqml.h> +#include <private/qtqmlglobal_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeApplicationPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeApplication : public QObject +class QQuickApplicationPrivate; +class Q_QML_PRIVATE_EXPORT QQuickApplication : public QObject { Q_OBJECT Q_PROPERTY(bool active READ active NOTIFY activeChanged) @@ -60,8 +60,8 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeApplication : public QObject Q_PROPERTY(QObject *inputPanel READ inputPanel CONSTANT) public: - explicit QDeclarativeApplication(QObject *parent = 0); - virtual ~QDeclarativeApplication(); + explicit QQuickApplication(QObject *parent = 0); + virtual ~QQuickApplication(); bool active() const; Qt::LayoutDirection layoutDirection() const; QT_DEPRECATED QObject *inputPanel() const; @@ -74,14 +74,14 @@ Q_SIGNALS: void layoutDirectionChanged(); private: - Q_DISABLE_COPY(QDeclarativeApplication) - Q_DECLARE_PRIVATE(QDeclarativeApplication) + Q_DISABLE_COPY(QQuickApplication) + Q_DECLARE_PRIVATE(QQuickApplication) }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeApplication) +QML_DECLARE_TYPE(QQuickApplication) QT_END_HEADER -#endif // QDECLARATIVEAPPLICATION_P_H +#endif // QQUICKAPPLICATION_P_H diff --git a/src/declarative/qml/qdeclarativelistmodel.cpp b/src/qml/qml/qquicklistmodel.cpp index ce7235e548..30c4f5d1d1 100644 --- a/src/declarative/qml/qdeclarativelistmodel.cpp +++ b/src/qml/qml/qquicklistmodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativelistmodel_p_p.h" -#include "qdeclarativelistmodelworkeragent_p.h" -#include "qdeclarativeopenmetaobject_p.h" -#include <private/qdeclarativejsast_p.h> -#include <private/qdeclarativejsengine_p.h> +#include "qquicklistmodel_p_p.h" +#include "qquicklistmodelworkeragent_p.h" +#include "qqmlopenmetaobject_p.h" +#include <private/qqmljsast_p.h> +#include <private/qqmljsengine_p.h> -#include <private/qdeclarativecustomparser_p.h> -#include <private/qdeclarativescript_p.h> -#include <private/qdeclarativeengine_p.h> -#include <qdeclarativecontext.h> -#include <qdeclarativeinfo.h> +#include <private/qqmlcustomparser_p.h> +#include <private/qqmlscript_p.h> +#include <private/qqmlengine_p.h> +#include <qqmlcontext.h> +#include <qqmlinfo.h> #include <QtCore/qdebug.h> #include <QtCore/qstack.h> @@ -119,7 +119,7 @@ const ListLayout::Role &ListLayout::getRoleOrCreate(v8::Handle<v8::String> key, const ListLayout::Role &ListLayout::createRole(const QString &key, ListLayout::Role::DataType type) { - const int dataSizes[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QDeclarativeGuard<QObject>), sizeof(QVariantMap) }; + const int dataSizes[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QQmlGuard<QObject>), sizeof(QVariantMap) }; const int dataAlignments[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QObject *), sizeof(QVariantMap) }; Role *r = new Role; @@ -247,7 +247,7 @@ const ListLayout::Role *ListLayout::getExistingRole(v8::Handle<v8::String> key) return r; } -ModelObject *ListModel::getOrCreateModelObject(QDeclarativeListModel *model, int elementIndex) +ModelObject *ListModel::getOrCreateModelObject(QQuickListModel *model, int elementIndex) { ListElement *e = elements[elementIndex]; if (e->m_objectCache == 0) { @@ -327,7 +327,7 @@ void ListModel::sync(ListModel *src, ListModel *target, QHash<int, ListModel *> } } -ListModel::ListModel(ListLayout *layout, QDeclarativeListModel *modelCache, int uid) : m_layout(layout), m_modelCache(modelCache) +ListModel::ListModel(ListLayout *layout, QQuickListModel *modelCache, int uid) : m_layout(layout), m_modelCache(modelCache) { if (uid == -1) uid = uidCounter.fetchAndAddOrdered(1); @@ -395,7 +395,7 @@ void ListModel::updateCacheIndices() } } -QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QDeclarativeListModel *owner, QV8Engine *eng) +QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQuickListModel *owner, QV8Engine *eng) { ListElement *e = elements[elementIndex]; const ListLayout::Role &r = m_layout->getExistingRole(roleIndex); @@ -636,7 +636,7 @@ QString *ListElement::getStringProperty(const ListLayout::Role &role) QObject *ListElement::getQObjectProperty(const ListLayout::Role &role) { char *mem = getPropertyMemory(role); - QDeclarativeGuard<QObject> *o = reinterpret_cast<QDeclarativeGuard<QObject> *>(mem); + QQmlGuard<QObject> *o = reinterpret_cast<QQmlGuard<QObject> *>(mem); return o->data(); } @@ -651,22 +651,22 @@ QVariantMap *ListElement::getVariantMapProperty(const ListLayout::Role &role) return map; } -QDeclarativeGuard<QObject> *ListElement::getGuardProperty(const ListLayout::Role &role) +QQmlGuard<QObject> *ListElement::getGuardProperty(const ListLayout::Role &role) { char *mem = getPropertyMemory(role); bool existingGuard = false; - for (size_t i=0 ; i < sizeof(QDeclarativeGuard<QObject>) ; ++i) { + for (size_t i=0 ; i < sizeof(QQmlGuard<QObject>) ; ++i) { if (mem[i] != 0) { existingGuard = true; break; } } - QDeclarativeGuard<QObject> *o = 0; + QQmlGuard<QObject> *o = 0; if (existingGuard) - o = reinterpret_cast<QDeclarativeGuard<QObject> *>(mem); + o = reinterpret_cast<QQmlGuard<QObject> *>(mem); return o; } @@ -678,7 +678,7 @@ ListModel *ListElement::getListProperty(const ListLayout::Role &role) return *value; } -QVariant ListElement::getProperty(const ListLayout::Role &role, const QDeclarativeListModel *owner, QV8Engine *eng) +QVariant ListElement::getProperty(const ListLayout::Role &role, const QQuickListModel *owner, QV8Engine *eng) { char *mem = getPropertyMemory(role); @@ -711,8 +711,8 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QDeclarati if (model) { if (model->m_modelCache == 0) { - model->m_modelCache = new QDeclarativeListModel(owner, model, eng); - QDeclarativeEngine::setContextForObject(model->m_modelCache, QDeclarativeEngine::contextForObject(owner)); + model->m_modelCache = new QQuickListModel(owner, model, eng); + QQmlEngine::setContextForObject(model->m_modelCache, QQmlEngine::contextForObject(owner)); } QObject *object = model->m_modelCache; @@ -722,7 +722,7 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QDeclarati break; case ListLayout::Role::QObject: { - QDeclarativeGuard<QObject> *guard = reinterpret_cast<QDeclarativeGuard<QObject> *>(mem); + QQmlGuard<QObject> *guard = reinterpret_cast<QQmlGuard<QObject> *>(mem); QObject *object = guard->data(); if (object) data = QVariant::fromValue(object); @@ -821,9 +821,9 @@ int ListElement::setQObjectProperty(const ListLayout::Role &role, QObject *o) if (role.type == ListLayout::Role::QObject) { char *mem = getPropertyMemory(role); - QDeclarativeGuard<QObject> *g = reinterpret_cast<QDeclarativeGuard<QObject> *>(mem); + QQmlGuard<QObject> *g = reinterpret_cast<QQmlGuard<QObject> *>(mem); bool existingGuard = false; - for (size_t i=0 ; i < sizeof(QDeclarativeGuard<QObject>) ; ++i) { + for (size_t i=0 ; i < sizeof(QQmlGuard<QObject>) ; ++i) { if (mem[i] != 0) { existingGuard = true; break; @@ -832,11 +832,11 @@ int ListElement::setQObjectProperty(const ListLayout::Role &role, QObject *o) bool changed; if (existingGuard) { changed = g->data() != o; - g->~QDeclarativeGuard(); + g->~QQmlGuard(); } else { changed = true; } - new (mem) QDeclarativeGuard<QObject>(o); + new (mem) QQmlGuard<QObject>(o); if (changed) roleIndex = role.index; } @@ -904,7 +904,7 @@ void ListElement::setBoolPropertyFast(const ListLayout::Role &role, bool b) void ListElement::setQObjectPropertyFast(const ListLayout::Role &role, QObject *o) { char *mem = getPropertyMemory(role); - new (mem) QDeclarativeGuard<QObject>(o); + new (mem) QQmlGuard<QObject>(o); } void ListElement::setListPropertyFast(const ListLayout::Role &role, ListModel *m) @@ -1040,9 +1040,9 @@ void ListElement::destroy(ListLayout *layout) break; case ListLayout::Role::QObject: { - QDeclarativeGuard<QObject> *guard = getGuardProperty(r); + QQmlGuard<QObject> *guard = getGuardProperty(r); if (guard) - guard->~QDeclarativeGuard(); + guard->~QQmlGuard(); } break; case ListLayout::Role::VariantMap: @@ -1135,7 +1135,7 @@ int ListElement::setJsProperty(const ListLayout::Role &role, v8::Handle<v8::Valu return roleIndex; } -ModelObject::ModelObject(QDeclarativeListModel *model, int elementIndex) +ModelObject::ModelObject(QQuickListModel *model, int elementIndex) : m_model(model), m_elementIndex(elementIndex), m_meta(new ModelNodeMetaObject(this)) { updateValues(); @@ -1166,7 +1166,7 @@ void ModelObject::updateValues(const QList<int> &roles) } ModelNodeMetaObject::ModelNodeMetaObject(ModelObject *object) -: QDeclarativeOpenMetaObject(object), m_enabled(false), m_obj(object) +: QQmlOpenMetaObject(object), m_enabled(false), m_obj(object) { } @@ -1197,12 +1197,12 @@ void ModelNodeMetaObject::propertyWritten(int index) } } -DynamicRoleModelNode::DynamicRoleModelNode(QDeclarativeListModel *owner, int uid) : m_owner(owner), m_uid(uid), m_meta(new DynamicRoleModelNodeMetaObject(this)) +DynamicRoleModelNode::DynamicRoleModelNode(QQuickListModel *owner, int uid) : m_owner(owner), m_uid(uid), m_meta(new DynamicRoleModelNodeMetaObject(this)) { setNodeUpdatesEnabled(true); } -DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QDeclarativeListModel *owner) +DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQuickListModel *owner) { DynamicRoleModelNode *object = new DynamicRoleModelNode(owner, uidCounter.fetchAndAddOrdered(1)); QList<int> roles; @@ -1210,20 +1210,20 @@ DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QDecl return object; } -void DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QDeclarativeListModel *> *targetModelHash) +void DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQuickListModel *> *targetModelHash) { for (int i=0 ; i < src->m_meta->count() ; ++i) { const QByteArray &name = src->m_meta->name(i); QVariant value = src->m_meta->value(i); - QDeclarativeListModel *srcModel = qobject_cast<QDeclarativeListModel *>(value.value<QObject *>()); - QDeclarativeListModel *targetModel = qobject_cast<QDeclarativeListModel *>(target->m_meta->value(i).value<QObject *>()); + QQuickListModel *srcModel = qobject_cast<QQuickListModel *>(value.value<QObject *>()); + QQuickListModel *targetModel = qobject_cast<QQuickListModel *>(target->m_meta->value(i).value<QObject *>()); if (srcModel) { if (targetModel == 0) - targetModel = QDeclarativeListModel::createWithOwner(target->m_owner); + targetModel = QQuickListModel::createWithOwner(target->m_owner); - QDeclarativeListModel::sync(srcModel, targetModel, targetModelHash); + QQuickListModel::sync(srcModel, targetModel, targetModelHash); QObject *targetModelObject = targetModel; value = QVariant::fromValue(targetModelObject); @@ -1254,7 +1254,7 @@ void DynamicRoleModelNode::updateValues(const QVariantMap &object, QList<int> &r QVariant value = object[key]; if (value.type() == QVariant::List) { - QDeclarativeListModel *subModel = QDeclarativeListModel::createWithOwner(m_owner); + QQuickListModel *subModel = QQuickListModel::createWithOwner(m_owner); QVariantList subArray = value.toList(); QVariantList::const_iterator subIt = subArray.begin(); @@ -1271,7 +1271,7 @@ void DynamicRoleModelNode::updateValues(const QVariantMap &object, QList<int> &r const QByteArray &keyUtf8 = key.toUtf8(); - QDeclarativeListModel *existingModel = qobject_cast<QDeclarativeListModel *>(m_meta->value(keyUtf8).value<QObject *>()); + QQuickListModel *existingModel = qobject_cast<QQuickListModel *>(m_meta->value(keyUtf8).value<QObject *>()); if (existingModel) delete existingModel; @@ -1283,14 +1283,14 @@ void DynamicRoleModelNode::updateValues(const QVariantMap &object, QList<int> &r } DynamicRoleModelNodeMetaObject::DynamicRoleModelNodeMetaObject(DynamicRoleModelNode *object) - : QDeclarativeOpenMetaObject(object), m_enabled(false), m_owner(object) + : QQmlOpenMetaObject(object), m_enabled(false), m_owner(object) { } DynamicRoleModelNodeMetaObject::~DynamicRoleModelNodeMetaObject() { for (int i=0 ; i < count() ; ++i) { - QDeclarativeListModel *subModel = qobject_cast<QDeclarativeListModel *>(value(i).value<QObject *>()); + QQuickListModel *subModel = qobject_cast<QQuickListModel *>(value(i).value<QObject *>()); if (subModel) delete subModel; } @@ -1302,7 +1302,7 @@ void DynamicRoleModelNodeMetaObject::propertyWrite(int index) return; QVariant v = value(index); - QDeclarativeListModel *model = qobject_cast<QDeclarativeListModel *>(v.value<QObject *>()); + QQuickListModel *model = qobject_cast<QQuickListModel *>(v.value<QObject *>()); if (model) delete model; } @@ -1312,11 +1312,11 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index) if (!m_enabled) return; - QDeclarativeListModel *parentModel = m_owner->m_owner; + QQuickListModel *parentModel = m_owner->m_owner; QVariant v = value(index); if (v.type() == QVariant::List) { - QDeclarativeListModel *subModel = QDeclarativeListModel::createWithOwner(parentModel); + QQuickListModel *subModel = QQuickListModel::createWithOwner(parentModel); QVariantList subArray = v.toList(); QVariantList::const_iterator subIt = subArray.begin(); @@ -1344,13 +1344,13 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index) } } -QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListModelData::instructions() const +QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::instructions() const { - return (QDeclarativeListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData)); + return (QQuickListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData)); } /*! - \qmlclass ListModel QDeclarativeListModel + \qmlclass ListModel QQuickListModel \inqmlmodule QtQuick 2 \ingroup qml-working-with-data \brief The ListModel element defines a free-form list data source. @@ -1376,7 +1376,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM \inlineimage listmodel.png \enddiv - \snippet doc/src/snippets/declarative/listmodel.qml 0 + \snippet doc/src/snippets/qml/listmodel.qml 0 \clearfloat Roles (properties) in each element must begin with a lower-case letter and @@ -1386,14 +1386,14 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM Since the example model contains an \c id property, it can be referenced by views, such as the ListView in this example: - \snippet doc/src/snippets/declarative/listmodel-simple.qml 0 + \snippet doc/src/snippets/qml/listmodel-simple.qml 0 \dots 8 - \snippet doc/src/snippets/declarative/listmodel-simple.qml 1 + \snippet doc/src/snippets/qml/listmodel-simple.qml 1 It is possible for roles to contain list data. In the following example we create a list of fruit attributes: - \snippet doc/src/snippets/declarative/listmodel-nested.qml model + \snippet doc/src/snippets/qml/listmodel-nested.qml model The delegate displays all the fruit attributes: @@ -1401,7 +1401,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM \inlineimage listmodel-nested.png \enddiv - \snippet doc/src/snippets/declarative/listmodel-nested.qml delegate + \snippet doc/src/snippets/qml/listmodel-nested.qml delegate \clearfloat \section1 Modifying List Models @@ -1409,7 +1409,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM The content of a ListModel may be created and modified using the clear(), append(), set(), insert() and setProperty() methods. For example: - \snippet doc/src/snippets/declarative/listmodel-modify.qml delegate + \snippet doc/src/snippets/qml/listmodel-modify.qml delegate Note that when creating content dynamically the set of available properties cannot be changed once set. Whatever properties are first added to the model @@ -1440,10 +1440,10 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM handler. You must call sync() or else the changes made to the list from the external thread will not be reflected in the list model in the main thread. - \sa {qmlmodels}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, QtDeclarative + \sa {qmlmodels}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, QtQml */ -QDeclarativeListModel::QDeclarativeListModel(QObject *parent) +QQuickListModel::QQuickListModel(QObject *parent) : QListModelInterface(parent) { m_mainThread = true; @@ -1458,7 +1458,7 @@ QDeclarativeListModel::QDeclarativeListModel(QObject *parent) m_engine = 0; } -QDeclarativeListModel::QDeclarativeListModel(const QDeclarativeListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent) +QQuickListModel::QQuickListModel(const QQuickListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent) : QListModelInterface(parent) { m_mainThread = owner->m_mainThread; @@ -1473,7 +1473,7 @@ QDeclarativeListModel::QDeclarativeListModel(const QDeclarativeListModel *owner, m_engine = eng; } -QDeclarativeListModel::QDeclarativeListModel(QDeclarativeListModel *orig, QDeclarativeListModelWorkerAgent *agent) +QQuickListModel::QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAgent *agent) : QListModelInterface(agent) { m_mainThread = false; @@ -1492,7 +1492,7 @@ QDeclarativeListModel::QDeclarativeListModel(QDeclarativeListModel *orig, QDecla m_engine = 0; } -QDeclarativeListModel::~QDeclarativeListModel() +QQuickListModel::~QQuickListModel() { for (int i=0 ; i < m_modelObjects.count() ; ++i) delete m_modelObjects[i]; @@ -1513,9 +1513,9 @@ QDeclarativeListModel::~QDeclarativeListModel() m_layout = 0; } -QDeclarativeListModel *QDeclarativeListModel::createWithOwner(QDeclarativeListModel *newOwner) +QQuickListModel *QQuickListModel::createWithOwner(QQuickListModel *newOwner) { - QDeclarativeListModel *model = new QDeclarativeListModel; + QQuickListModel *model = new QQuickListModel; model->m_mainThread = newOwner->m_mainThread; model->m_engine = newOwner->m_engine; @@ -1525,21 +1525,21 @@ QDeclarativeListModel *QDeclarativeListModel::createWithOwner(QDeclarativeListMo if (model->m_mainThread && model->m_agent) model->m_agent->addref(); - QDeclarativeEngine::setContextForObject(model, QDeclarativeEngine::contextForObject(newOwner)); + QQmlEngine::setContextForObject(model, QQmlEngine::contextForObject(newOwner)); return model; } -QV8Engine *QDeclarativeListModel::engine() const +QV8Engine *QQuickListModel::engine() const { if (m_engine == 0) { - m_engine = QDeclarativeEnginePrivate::getV8Engine(qmlEngine(this)); + m_engine = QQmlEnginePrivate::getV8Engine(qmlEngine(this)); } return m_engine; } -void QDeclarativeListModel::sync(QDeclarativeListModel *src, QDeclarativeListModel *target, QHash<int, QDeclarativeListModel *> *targetModelHash) +void QQuickListModel::sync(QQuickListModel *src, QQuickListModel *target, QHash<int, QQuickListModel *> *targetModelHash) { Q_ASSERT(src->m_dynamicRoles && target->m_dynamicRoles); @@ -1600,7 +1600,7 @@ void QDeclarativeListModel::sync(QDeclarativeListModel *src, QDeclarativeListMod } } -void QDeclarativeListModel::emitItemsChanged(int index, int count, const QList<int> &roles) +void QQuickListModel::emitItemsChanged(int index, int count, const QList<int> &roles) { if (m_mainThread) { emit itemsChanged(index, count, roles); @@ -1610,7 +1610,7 @@ void QDeclarativeListModel::emitItemsChanged(int index, int count, const QList<i } } -void QDeclarativeListModel::emitItemsRemoved(int index, int count) +void QQuickListModel::emitItemsRemoved(int index, int count) { if (m_mainThread) { emit itemsRemoved(index, count); @@ -1623,7 +1623,7 @@ void QDeclarativeListModel::emitItemsRemoved(int index, int count) } } -void QDeclarativeListModel::emitItemsInserted(int index, int count) +void QQuickListModel::emitItemsInserted(int index, int count) { if (m_mainThread) { emit itemsInserted(index, count); @@ -1634,7 +1634,7 @@ void QDeclarativeListModel::emitItemsInserted(int index, int count) } } -void QDeclarativeListModel::emitItemsMoved(int from, int to, int n) +void QQuickListModel::emitItemsMoved(int from, int to, int n) { if (m_mainThread) { emit itemsMoved(from, to, n); @@ -1644,16 +1644,16 @@ void QDeclarativeListModel::emitItemsMoved(int from, int to, int n) } } -QDeclarativeListModelWorkerAgent *QDeclarativeListModel::agent() +QQuickListModelWorkerAgent *QQuickListModel::agent() { if (m_agent) return m_agent; - m_agent = new QDeclarativeListModelWorkerAgent(this); + m_agent = new QQuickListModelWorkerAgent(this); return m_agent; } -QList<int> QDeclarativeListModel::roles() const +QList<int> QQuickListModel::roles() const { QList<int> rolesArray; @@ -1668,7 +1668,7 @@ QList<int> QDeclarativeListModel::roles() const return rolesArray; } -QString QDeclarativeListModel::toString(int role) const +QString QQuickListModel::toString(int role) const { QString roleName; @@ -1682,7 +1682,7 @@ QString QDeclarativeListModel::toString(int role) const return roleName; } -QVariant QDeclarativeListModel::data(int index, int role) const +QVariant QQuickListModel::data(int index, int role) const { QVariant v; @@ -1723,7 +1723,7 @@ QVariant QDeclarativeListModel::data(int index, int role) const Due to the performance cost of using dynamic roles, they are disabled by default. */ -void QDeclarativeListModel::setDynamicRoles(bool enableDynamicRoles) +void QQuickListModel::setDynamicRoles(bool enableDynamicRoles) { if (m_mainThread && m_agent == 0) { if (enableDynamicRoles) { @@ -1747,7 +1747,7 @@ void QDeclarativeListModel::setDynamicRoles(bool enableDynamicRoles) \qmlproperty int QtQuick2::ListModel::count The number of data entries in the model. */ -int QDeclarativeListModel::count() const +int QQuickListModel::count() const { int count; @@ -1767,7 +1767,7 @@ int QDeclarativeListModel::count() const \sa append() remove() */ -void QDeclarativeListModel::clear() +void QQuickListModel::clear() { int cleared = count(); @@ -1789,7 +1789,7 @@ void QDeclarativeListModel::clear() \sa clear() */ -void QDeclarativeListModel::remove(QDeclarativeV8Function *args) +void QQuickListModel::remove(QQmlV8Function *args) { int argLength = args->Length(); @@ -1832,7 +1832,7 @@ void QDeclarativeListModel::remove(QDeclarativeV8Function *args) \sa set() append() */ -void QDeclarativeListModel::insert(QDeclarativeV8Function *args) +void QQuickListModel::insert(QQmlV8Function *args) { if (args->Length() == 2) { @@ -1891,7 +1891,7 @@ void QDeclarativeListModel::insert(QDeclarativeV8Function *args) \sa append() */ -void QDeclarativeListModel::move(int from, int to, int n) +void QQuickListModel::move(int from, int to, int n) { if (n==0 || from==to) return; @@ -1942,7 +1942,7 @@ void QDeclarativeListModel::move(int from, int to, int n) \sa set() remove() */ -void QDeclarativeListModel::append(QDeclarativeV8Function *args) +void QQuickListModel::append(QQmlV8Function *args) { if (args->Length() == 1) { v8::Handle<v8::Value> arg = (*args)[0]; @@ -2015,7 +2015,7 @@ void QDeclarativeListModel::append(QDeclarativeV8Function *args) \sa append() */ -QDeclarativeV8Handle QDeclarativeListModel::get(int index) const +QQmlV8Handle QQuickListModel::get(int index) const { v8::Handle<v8::Value> result = v8::Undefined(); @@ -2026,12 +2026,12 @@ QDeclarativeV8Handle QDeclarativeListModel::get(int index) const DynamicRoleModelNode *object = m_modelObjects[index]; result = v8engine->newQObject(object); } else { - ModelObject *object = m_listModel->getOrCreateModelObject(const_cast<QDeclarativeListModel *>(this), index); + ModelObject *object = m_listModel->getOrCreateModelObject(const_cast<QQuickListModel *>(this), index); result = v8engine->newQObject(object); } } - return QDeclarativeV8Handle::fromHandle(result); + return QQmlV8Handle::fromHandle(result); } /*! @@ -2050,7 +2050,7 @@ QDeclarativeV8Handle QDeclarativeListModel::get(int index) const \sa append() */ -void QDeclarativeListModel::set(int index, const QDeclarativeV8Handle &handle) +void QQuickListModel::set(int index, const QQmlV8Handle &handle) { v8::Handle<v8::Value> valuemap = handle.toHandle(); @@ -2102,7 +2102,7 @@ void QDeclarativeListModel::set(int index, const QDeclarativeV8Handle &handle) \sa append() */ -void QDeclarativeListModel::setProperty(int index, const QString& property, const QVariant& value) +void QQuickListModel::setProperty(int index, const QString& property, const QVariant& value) { if (count() == 0 || index >= count() || index < 0) { qmlInfo(this) << tr("set: index %1 out of range").arg(index); @@ -2138,28 +2138,28 @@ void QDeclarativeListModel::setProperty(int index, const QString& property, cons Writes any unsaved changes to the list model after it has been modified from a worker script. */ -void QDeclarativeListModel::sync() +void QQuickListModel::sync() { // This is just a dummy method to make it look like sync() exists in - // ListModel (and not just QDeclarativeListModelWorkerAgent) and to let + // ListModel (and not just QQuickListModelWorkerAgent) and to let // us document sync(). qmlInfo(this) << "List sync() can only be called from a WorkerScript"; } -bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data) +bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data) { QList<QVariant> values = prop.assignedValues(); for(int ii = 0; ii < values.count(); ++ii) { const QVariant &value = values.at(ii); - if(value.userType() == qMetaTypeId<QDeclarativeCustomParserNode>()) { - QDeclarativeCustomParserNode node = - qvariant_cast<QDeclarativeCustomParserNode>(value); + if(value.userType() == qMetaTypeId<QQmlCustomParserNode>()) { + QQmlCustomParserNode node = + qvariant_cast<QQmlCustomParserNode>(value); if (node.name() != listElementTypeName) { const QMetaObject *mo = resolveType(node.name()); - if (mo != &QDeclarativeListElement::staticMetaObject) { - error(node, QDeclarativeListModel::tr("ListElement: cannot contain nested elements")); + if (mo != &QQuickListElement::staticMetaObject) { + error(node, QQuickListModel::tr("ListElement: cannot contain nested elements")); return false; } listElementTypeName = node.name(); // cache right name for next time @@ -2172,15 +2172,15 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser instr << li; } - QList<QDeclarativeCustomParserProperty> props = node.properties(); + QList<QQmlCustomParserProperty> props = node.properties(); for(int jj = 0; jj < props.count(); ++jj) { - const QDeclarativeCustomParserProperty &nodeProp = props.at(jj); + const QQmlCustomParserProperty &nodeProp = props.at(jj); if (nodeProp.name().isEmpty()) { - error(nodeProp, QDeclarativeListModel::tr("ListElement: cannot contain nested elements")); + error(nodeProp, QQuickListModel::tr("ListElement: cannot contain nested elements")); return false; } if (nodeProp.name() == QStringLiteral("id")) { - error(nodeProp, QDeclarativeListModel::tr("ListElement: cannot use reserved \"id\" property")); + error(nodeProp, QQuickListModel::tr("ListElement: cannot use reserved \"id\" property")); return false; } @@ -2209,8 +2209,8 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser } else { - QDeclarativeScript::Variant variant = - qvariant_cast<QDeclarativeScript::Variant>(value); + QQmlScript::Variant variant = + qvariant_cast<QQmlScript::Variant>(value); int ref = data.count(); @@ -2224,12 +2224,12 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser d += char(variant.asBoolean()); } else if (variant.isScript()) { if (definesEmptyList(variant.asScript())) { - d[0] = char(QDeclarativeScript::Variant::Invalid); // marks empty list + d[0] = char(QQmlScript::Variant::Invalid); // marks empty list } else { QByteArray script = variant.asScript().toUtf8(); int v = evaluateEnum(script); if (v<0) { - using namespace QDeclarativeJS; + using namespace QQmlJS; AST::Node *node = variant.asAST(); AST::StringLiteral *literal = 0; if (AST::CallExpression *callExpr = AST::cast<AST::CallExpression *>(node)) { @@ -2238,14 +2238,14 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser if (callExpr->arguments && !callExpr->arguments->next) literal = AST::cast<AST::StringLiteral *>(callExpr->arguments->expression); if (!literal) { - error(prop, QDeclarativeListModel::tr("ListElement: improperly specified %1").arg(idExpr->name.toString())); + error(prop, QQuickListModel::tr("ListElement: improperly specified %1").arg(idExpr->name.toString())); return false; } } else if (idExpr->name == QLatin1String("QT_TRANSLATE_NOOP")) { if (callExpr->arguments && callExpr->arguments->next && !callExpr->arguments->next->next) literal = AST::cast<AST::StringLiteral *>(callExpr->arguments->next->expression); if (!literal) { - error(prop, QDeclarativeListModel::tr("ListElement: improperly specified QT_TRANSLATE_NOOP")); + error(prop, QQuickListModel::tr("ListElement: improperly specified QT_TRANSLATE_NOOP")); return false; } } @@ -2253,14 +2253,14 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser } if (literal) { - d[0] = char(QDeclarativeScript::Variant::String); + d[0] = char(QQmlScript::Variant::String); d += literal->value.toUtf8(); } else { - error(prop, QDeclarativeListModel::tr("ListElement: cannot use script for property value")); + error(prop, QQuickListModel::tr("ListElement: cannot use script for property value")); return false; } } else { - d[0] = char(QDeclarativeScript::Variant::Number); + d[0] = char(QQmlScript::Variant::Number); d += QByteArray::number(v); } } @@ -2278,16 +2278,16 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser return true; } -QByteArray QDeclarativeListModelParser::compile(const QList<QDeclarativeCustomParserProperty> &customProps) +QByteArray QQuickListModelParser::compile(const QList<QQmlCustomParserProperty> &customProps) { QList<ListInstruction> instr; QByteArray data; listElementTypeName = QString(); // unknown for(int ii = 0; ii < customProps.count(); ++ii) { - const QDeclarativeCustomParserProperty &prop = customProps.at(ii); + const QQmlCustomParserProperty &prop = customProps.at(ii); if(!prop.name().isEmpty()) { // isn't default property - error(prop, QDeclarativeListModel::tr("ListModel: undefined property '%1'").arg(prop.name())); + error(prop, QQuickListModel::tr("ListModel: undefined property '%1'").arg(prop.name())); return QByteArray(); } @@ -2314,11 +2314,11 @@ QByteArray QDeclarativeListModelParser::compile(const QList<QDeclarativeCustomPa return rv; } -void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &d) +void QQuickListModelParser::setCustomData(QObject *obj, const QByteArray &d) { - QDeclarativeListModel *rv = static_cast<QDeclarativeListModel *>(obj); + QQuickListModel *rv = static_cast<QQuickListModel *>(obj); - QV8Engine *engine = QDeclarativeEnginePrivate::getV8Engine(qmlEngine(rv)); + QV8Engine *engine = QQmlEnginePrivate::getV8Engine(qmlEngine(rv)); rv->m_engine = engine; const ListModelData *lmd = (const ListModelData *)d.constData(); @@ -2373,21 +2373,21 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray & QString name = e0.name; QVariant value; - switch (QDeclarativeScript::Variant::Type(data[instr.dataIdx])) { - case QDeclarativeScript::Variant::Invalid: + switch (QQmlScript::Variant::Type(data[instr.dataIdx])) { + case QQmlScript::Variant::Invalid: { const ListLayout::Role &role = e1.model->getOrCreateListRole(e0.name); ListModel *emptyModel = new ListModel(role.subLayout, 0, -1); value = QVariant::fromValue(emptyModel); } break; - case QDeclarativeScript::Variant::Boolean: + case QQmlScript::Variant::Boolean: value = bool(data[1 + instr.dataIdx]); break; - case QDeclarativeScript::Variant::Number: + case QQmlScript::Variant::Number: value = QByteArray(data + 1 + instr.dataIdx).toDouble(); break; - case QDeclarativeScript::Variant::String: + case QQmlScript::Variant::String: value = QString::fromUtf8(data + 1 + instr.dataIdx); break; default: @@ -2409,7 +2409,7 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray & } } -bool QDeclarativeListModelParser::definesEmptyList(const QString &s) +bool QQuickListModelParser::definesEmptyList(const QString &s) { if (s.startsWith(QLatin1Char('[')) && s.endsWith(QLatin1Char(']'))) { for (int i=1; i<s.length()-1; i++) { @@ -2423,7 +2423,7 @@ bool QDeclarativeListModelParser::definesEmptyList(const QString &s) /*! - \qmlclass ListElement QDeclarativeListElement + \qmlclass ListElement QQuickListElement \inqmlmodule QtQuick 2 \ingroup qml-working-with-data \brief The ListElement element defines a data item in a ListModel. @@ -2454,12 +2454,12 @@ bool QDeclarativeListModelParser::definesEmptyList(const QString &s) The following model defines a series of list elements, each of which contain "name" and "cost" roles and their associated values. - \snippet doc/src/snippets/declarative/qml-data-models/listelements.qml model + \snippet doc/src/snippets/qml/qml-data-models/listelements.qml model The delegate obtains the name and cost for each element by simply referring to \c name and \c cost: - \snippet doc/src/snippets/declarative/qml-data-models/listelements.qml view + \snippet doc/src/snippets/qml/qml-data-models/listelements.qml view \sa ListModel */ diff --git a/src/declarative/qml/qdeclarativelistmodel_p.h b/src/qml/qml/qquicklistmodel_p.h index efc2f2fb2c..2941de9148 100644 --- a/src/declarative/qml/qdeclarativelistmodel_p.h +++ b/src/qml/qml/qquicklistmodel_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELISTMODEL_H -#define QDECLARATIVELISTMODEL_H +#ifndef QQUICKLISTMODEL_H +#define QQUICKLISTMODEL_H -#include <qdeclarative.h> -#include <private/qdeclarativecustomparser_p.h> +#include <qqml.h> +#include <private/qqmlcustomparser_p.h> #include <QtCore/QObject> #include <QtCore/QStringList> @@ -60,19 +60,19 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeListModelWorkerAgent; +class QQuickListModelWorkerAgent; class ListModel; class ListLayout; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeListModel : public QListModelInterface +class Q_QML_PRIVATE_EXPORT QQuickListModel : public QListModelInterface { Q_OBJECT Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(bool dynamicRoles READ dynamicRoles WRITE setDynamicRoles) public: - QDeclarativeListModel(QObject *parent=0); - ~QDeclarativeListModel(); + QQuickListModel(QObject *parent=0); + ~QQuickListModel(); virtual QList<int> roles() const; virtual QString toString(int role) const; @@ -80,16 +80,16 @@ public: virtual QVariant data(int index, int role) const; Q_INVOKABLE void clear(); - Q_INVOKABLE void remove(QDeclarativeV8Function *args); - Q_INVOKABLE void append(QDeclarativeV8Function *args); - Q_INVOKABLE void insert(QDeclarativeV8Function *args); - Q_INVOKABLE QDeclarativeV8Handle get(int index) const; - Q_INVOKABLE void set(int index, const QDeclarativeV8Handle &); + Q_INVOKABLE void remove(QQmlV8Function *args); + Q_INVOKABLE void append(QQmlV8Function *args); + Q_INVOKABLE void insert(QQmlV8Function *args); + Q_INVOKABLE QQmlV8Handle get(int index) const; + Q_INVOKABLE void set(int index, const QQmlV8Handle &); Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value); Q_INVOKABLE void move(int from, int to, int count); Q_INVOKABLE void sync(); - QDeclarativeListModelWorkerAgent *agent(); + QQuickListModelWorkerAgent *agent(); bool dynamicRoles() const { return m_dynamicRoles; } void setDynamicRoles(bool enableDynamicRoles); @@ -98,8 +98,8 @@ Q_SIGNALS: void countChanged(); private: - friend class QDeclarativeListModelParser; - friend class QDeclarativeListModelWorkerAgent; + friend class QQuickListModelParser; + friend class QQuickListModelWorkerAgent; friend class ModelObject; friend class ModelNodeMetaObject; friend class ListModel; @@ -108,14 +108,14 @@ private: friend class DynamicRoleModelNodeMetaObject; // Constructs a flat list model for a worker agent - QDeclarativeListModel(QDeclarativeListModel *orig, QDeclarativeListModelWorkerAgent *agent); - QDeclarativeListModel(const QDeclarativeListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent=0); + QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAgent *agent); + QQuickListModel(const QQuickListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent=0); QV8Engine *engine() const; inline bool canMove(int from, int to, int n) const { return !(from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0); } - QDeclarativeListModelWorkerAgent *m_agent; + QQuickListModelWorkerAgent *m_agent; mutable QV8Engine *m_engine; bool m_mainThread; bool m_primary; @@ -139,8 +139,8 @@ private: int getUid() const { return m_uid; } - static void sync(QDeclarativeListModel *src, QDeclarativeListModel *target, QHash<int, QDeclarativeListModel *> *targetModelHash); - static QDeclarativeListModel *createWithOwner(QDeclarativeListModel *newOwner); + static void sync(QQuickListModel *src, QQuickListModel *target, QHash<int, QQuickListModel *> *targetModelHash); + static QQuickListModel *createWithOwner(QQuickListModel *newOwner); void emitItemsChanged(int index, int count, const QList<int> &roles); void emitItemsRemoved(int index, int count); @@ -149,16 +149,16 @@ private: }; // ### FIXME -class QDeclarativeListElement : public QObject +class QQuickListElement : public QObject { Q_OBJECT }; -class QDeclarativeListModelParser : public QDeclarativeCustomParser +class QQuickListModelParser : public QQmlCustomParser { public: - QDeclarativeListModelParser() : QDeclarativeCustomParser(QDeclarativeCustomParser::AcceptsSignalHandlers) {} - QByteArray compile(const QList<QDeclarativeCustomParserProperty> &); + QQuickListModelParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {} + QByteArray compile(const QList<QQmlCustomParserProperty> &); void setCustomData(QObject *, const QByteArray &); private: @@ -173,7 +173,7 @@ private: int instrCount; ListInstruction *instructions() const; }; - bool compileProperty(const QDeclarativeCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data); + bool compileProperty(const QQmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data); bool definesEmptyList(const QString &); @@ -191,9 +191,9 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeListModel) -QML_DECLARE_TYPE(QDeclarativeListElement) +QML_DECLARE_TYPE(QQuickListModel) +QML_DECLARE_TYPE(QQuickListElement) QT_END_HEADER -#endif // QDECLARATIVELISTMODEL_H +#endif // QQUICKLISTMODEL_H diff --git a/src/declarative/qml/qdeclarativelistmodel_p_p.h b/src/qml/qml/qquicklistmodel_p_p.h index 22e19079a6..f9256c9f0a 100644 --- a/src/declarative/qml/qdeclarativelistmodel_p_p.h +++ b/src/qml/qml/qquicklistmodel_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELISTMODEL_P_P_H -#define QDECLARATIVELISTMODEL_P_P_H +#ifndef QQUICKLISTMODEL_P_P_H +#define QQUICKLISTMODEL_P_P_H // // W A R N I N G @@ -53,10 +53,10 @@ // We mean it. // -#include "qdeclarativelistmodel_p.h" -#include <private/qdeclarativeengine_p.h> -#include "qdeclarativeopenmetaobject_p.h" -#include <qdeclarative.h> +#include "qquicklistmodel_p.h" +#include <private/qqmlengine_p.h> +#include "qqmlopenmetaobject_p.h" +#include <qqml.h> QT_BEGIN_HEADER @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE class DynamicRoleModelNode; -class DynamicRoleModelNodeMetaObject : public QDeclarativeOpenMetaObject +class DynamicRoleModelNodeMetaObject : public QQmlOpenMetaObject { public: DynamicRoleModelNodeMetaObject(DynamicRoleModelNode *object); @@ -85,9 +85,9 @@ class DynamicRoleModelNode : public QObject { Q_OBJECT public: - DynamicRoleModelNode(QDeclarativeListModel *owner, int uid); + DynamicRoleModelNode(QQuickListModel *owner, int uid); - static DynamicRoleModelNode *create(const QVariantMap &obj, QDeclarativeListModel *owner); + static DynamicRoleModelNode *create(const QVariantMap &obj, QQuickListModel *owner); void updateValues(const QVariantMap &object, QList<int> &roles); @@ -111,10 +111,10 @@ public: return m_uid; } - static void sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QDeclarativeListModel *> *targetModelHash); + static void sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQuickListModel *> *targetModelHash); private: - QDeclarativeListModel *m_owner; + QQuickListModel *m_owner; int m_uid; DynamicRoleModelNodeMetaObject *m_meta; @@ -123,7 +123,7 @@ private: class ModelObject; -class ModelNodeMetaObject : public QDeclarativeOpenMetaObject +class ModelNodeMetaObject : public QQmlOpenMetaObject { public: ModelNodeMetaObject(ModelObject *object); @@ -143,7 +143,7 @@ class ModelObject : public QObject { Q_OBJECT public: - ModelObject(QDeclarativeListModel *model, int elementIndex); + ModelObject(QQuickListModel *model, int elementIndex); void setValue(const QByteArray &name, const QVariant &val, bool force) { @@ -164,7 +164,7 @@ public: void updateValues(); void updateValues(const QList<int> &roles); - QDeclarativeListModel *m_model; + QQuickListModel *m_model; int m_elementIndex; private: @@ -270,11 +270,11 @@ private: void clearProperty(const ListLayout::Role &role); - QVariant getProperty(const ListLayout::Role &role, const QDeclarativeListModel *owner, QV8Engine *eng); + QVariant getProperty(const ListLayout::Role &role, const QQuickListModel *owner, QV8Engine *eng); ListModel *getListProperty(const ListLayout::Role &role); QString *getStringProperty(const ListLayout::Role &role); QObject *getQObjectProperty(const ListLayout::Role &role); - QDeclarativeGuard<QObject> *getGuardProperty(const ListLayout::Role &role); + QQmlGuard<QObject> *getGuardProperty(const ListLayout::Role &role); QVariantMap *getVariantMapProperty(const ListLayout::Role &role); inline char *getPropertyMemory(const ListLayout::Role &role); @@ -294,7 +294,7 @@ class ListModel { public: - ListModel(ListLayout *layout, QDeclarativeListModel *modelCache, int uid); + ListModel(ListLayout *layout, QQuickListModel *modelCache, int uid); ~ListModel() {} void destroy(); @@ -302,7 +302,7 @@ public: int setOrCreateProperty(int elementIndex, const QString &key, const QVariant &data); int setExistingProperty(int uid, const QString &key, v8::Handle<v8::Value> data, QV8Engine *eng); - QVariant getProperty(int elementIndex, int roleIndex, const QDeclarativeListModel *owner, QV8Engine *eng); + QVariant getProperty(int elementIndex, int roleIndex, const QQuickListModel *owner, QV8Engine *eng); ListModel *getListProperty(int elementIndex, const ListLayout::Role &role); int roleCount() const @@ -343,14 +343,14 @@ public: static void sync(ListModel *src, ListModel *target, QHash<int, ListModel *> *srcModelHash); - ModelObject *getOrCreateModelObject(QDeclarativeListModel *model, int elementIndex); + ModelObject *getOrCreateModelObject(QQuickListModel *model, int elementIndex); private: QPODVector<ListElement *, 4> elements; ListLayout *m_layout; int m_uid; - QDeclarativeListModel *m_modelCache; + QQuickListModel *m_modelCache; struct ElementSync { @@ -365,7 +365,7 @@ private: void updateCacheIndices(); friend class ListElement; - friend class QDeclarativeListModelWorkerAgent; + friend class QQuickListModelWorkerAgent; }; QT_END_NAMESPACE @@ -374,5 +374,5 @@ Q_DECLARE_METATYPE(ListModel *); QT_END_HEADER -#endif // QDECLARATIVELISTMODEL_P_P_H +#endif // QQUICKLISTMODEL_P_P_H diff --git a/src/declarative/qml/qdeclarativelistmodelworkeragent.cpp b/src/qml/qml/qquicklistmodelworkeragent.cpp index 51ac460adf..c50b348a4a 100644 --- a/src/declarative/qml/qdeclarativelistmodelworkeragent.cpp +++ b/src/qml/qml/qquicklistmodelworkeragent.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qdeclarativelistmodelworkeragent_p.h" -#include "qdeclarativelistmodel_p_p.h" -#include <private/qdeclarativedata_p.h> -#include <private/qdeclarativeengine_p.h> -#include <qdeclarativeinfo.h> +#include "qquicklistmodelworkeragent_p.h" +#include "qquicklistmodel_p_p.h" +#include <private/qqmldata_p.h> +#include <private/qqmlengine_p.h> +#include <qqmlinfo.h> #include <QtCore/qcoreevent.h> #include <QtCore/qcoreapplication.h> @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE -void QDeclarativeListModelWorkerAgent::Data::clearChange(int uid) +void QQuickListModelWorkerAgent::Data::clearChange(int uid) { for (int i=0 ; i < changes.count() ; ++i) { if (changes[i].modelUid == uid) { @@ -63,53 +63,53 @@ void QDeclarativeListModelWorkerAgent::Data::clearChange(int uid) } } -void QDeclarativeListModelWorkerAgent::Data::insertChange(int uid, int index, int count) +void QQuickListModelWorkerAgent::Data::insertChange(int uid, int index, int count) { Change c = { uid, Change::Inserted, index, count, 0, QList<int>() }; changes << c; } -void QDeclarativeListModelWorkerAgent::Data::removeChange(int uid, int index, int count) +void QQuickListModelWorkerAgent::Data::removeChange(int uid, int index, int count) { Change c = { uid, Change::Removed, index, count, 0, QList<int>() }; changes << c; } -void QDeclarativeListModelWorkerAgent::Data::moveChange(int uid, int index, int count, int to) +void QQuickListModelWorkerAgent::Data::moveChange(int uid, int index, int count, int to) { Change c = { uid, Change::Moved, index, count, to, QList<int>() }; changes << c; } -void QDeclarativeListModelWorkerAgent::Data::changedChange(int uid, int index, int count, const QList<int> &roles) +void QQuickListModelWorkerAgent::Data::changedChange(int uid, int index, int count, const QList<int> &roles) { Change c = { uid, Change::Changed, index, count, 0, roles }; changes << c; } -QDeclarativeListModelWorkerAgent::QDeclarativeListModelWorkerAgent(QDeclarativeListModel *model) -: m_ref(1), m_orig(model), m_copy(new QDeclarativeListModel(model, this)) +QQuickListModelWorkerAgent::QQuickListModelWorkerAgent(QQuickListModel *model) +: m_ref(1), m_orig(model), m_copy(new QQuickListModel(model, this)) { } -QDeclarativeListModelWorkerAgent::~QDeclarativeListModelWorkerAgent() +QQuickListModelWorkerAgent::~QQuickListModelWorkerAgent() { mutex.lock(); syncDone.wakeAll(); mutex.unlock(); } -void QDeclarativeListModelWorkerAgent::setV8Engine(QV8Engine *eng) +void QQuickListModelWorkerAgent::setV8Engine(QV8Engine *eng) { m_copy->m_engine = eng; } -void QDeclarativeListModelWorkerAgent::addref() +void QQuickListModelWorkerAgent::addref() { m_ref.ref(); } -void QDeclarativeListModelWorkerAgent::release() +void QQuickListModelWorkerAgent::release() { bool del = !m_ref.deref(); @@ -117,57 +117,57 @@ void QDeclarativeListModelWorkerAgent::release() deleteLater(); } -void QDeclarativeListModelWorkerAgent::modelDestroyed() +void QQuickListModelWorkerAgent::modelDestroyed() { m_orig = 0; } -int QDeclarativeListModelWorkerAgent::count() const +int QQuickListModelWorkerAgent::count() const { return m_copy->count(); } -void QDeclarativeListModelWorkerAgent::clear() +void QQuickListModelWorkerAgent::clear() { m_copy->clear(); } -void QDeclarativeListModelWorkerAgent::remove(QDeclarativeV8Function *args) +void QQuickListModelWorkerAgent::remove(QQmlV8Function *args) { m_copy->remove(args); } -void QDeclarativeListModelWorkerAgent::append(QDeclarativeV8Function *args) +void QQuickListModelWorkerAgent::append(QQmlV8Function *args) { m_copy->append(args); } -void QDeclarativeListModelWorkerAgent::insert(QDeclarativeV8Function *args) +void QQuickListModelWorkerAgent::insert(QQmlV8Function *args) { m_copy->insert(args); } -QDeclarativeV8Handle QDeclarativeListModelWorkerAgent::get(int index) const +QQmlV8Handle QQuickListModelWorkerAgent::get(int index) const { return m_copy->get(index); } -void QDeclarativeListModelWorkerAgent::set(int index, const QDeclarativeV8Handle &value) +void QQuickListModelWorkerAgent::set(int index, const QQmlV8Handle &value) { m_copy->set(index, value); } -void QDeclarativeListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value) +void QQuickListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value) { m_copy->setProperty(index, property, value); } -void QDeclarativeListModelWorkerAgent::move(int from, int to, int count) +void QQuickListModelWorkerAgent::move(int from, int to, int count) { m_copy->move(from, to, count); } -void QDeclarativeListModelWorkerAgent::sync() +void QQuickListModelWorkerAgent::sync() { Sync *s = new Sync; s->data = data; @@ -180,7 +180,7 @@ void QDeclarativeListModelWorkerAgent::sync() mutex.unlock(); } -bool QDeclarativeListModelWorkerAgent::event(QEvent *e) +bool QQuickListModelWorkerAgent::event(QEvent *e) { if (e->type() == QEvent::User) { bool cc = false; @@ -191,19 +191,19 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e) cc = m_orig->count() != s->list->count(); - QHash<int, QDeclarativeListModel *> targetModelDynamicHash; + QHash<int, QQuickListModel *> targetModelDynamicHash; QHash<int, ListModel *> targetModelStaticHash; Q_ASSERT(m_orig->m_dynamicRoles == s->list->m_dynamicRoles); if (m_orig->m_dynamicRoles) - QDeclarativeListModel::sync(s->list, m_orig, &targetModelDynamicHash); + QQuickListModel::sync(s->list, m_orig, &targetModelDynamicHash); else ListModel::sync(s->list->m_listModel, m_orig->m_listModel, &targetModelStaticHash); for (int ii = 0; ii < changes.count(); ++ii) { const Change &change = changes.at(ii); - QDeclarativeListModel *model = 0; + QQuickListModel *model = 0; if (m_orig->m_dynamicRoles) { model = targetModelDynamicHash.value(change.modelUid); } else { diff --git a/src/declarative/qml/qdeclarativelistmodelworkeragent_p.h b/src/qml/qml/qquicklistmodelworkeragent_p.h index f2c971c1e1..cf2ef45c16 100644 --- a/src/declarative/qml/qdeclarativelistmodelworkeragent_p.h +++ b/src/qml/qml/qquicklistmodelworkeragent_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELISTMODELWORKERAGENT_P_H -#define QDECLARATIVELISTMODELWORKERAGENT_P_H +#ifndef QQUICKLISTMODELWORKERAGENT_P_H +#define QQUICKLISTMODELWORKERAGENT_P_H // // W A R N I N G @@ -53,7 +53,7 @@ // We mean it. // -#include <qdeclarative.h> +#include <qqml.h> #include <QtGui/qevent.h> #include <QMutex> @@ -66,16 +66,16 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeListModel; +class QQuickListModel; -class QDeclarativeListModelWorkerAgent : public QObject +class QQuickListModelWorkerAgent : public QObject { Q_OBJECT Q_PROPERTY(int count READ count) public: - QDeclarativeListModelWorkerAgent(QDeclarativeListModel *); - ~QDeclarativeListModelWorkerAgent(); + QQuickListModelWorkerAgent(QQuickListModel *); + ~QQuickListModelWorkerAgent(); void setV8Engine(QV8Engine *eng); void addref(); @@ -84,11 +84,11 @@ public: int count() const; Q_INVOKABLE void clear(); - Q_INVOKABLE void remove(QDeclarativeV8Function *args); - Q_INVOKABLE void append(QDeclarativeV8Function *args); - Q_INVOKABLE void insert(QDeclarativeV8Function *args); - Q_INVOKABLE QDeclarativeV8Handle get(int index) const; - Q_INVOKABLE void set(int index, const QDeclarativeV8Handle &); + Q_INVOKABLE void remove(QQmlV8Function *args); + Q_INVOKABLE void append(QQmlV8Function *args); + Q_INVOKABLE void insert(QQmlV8Function *args); + Q_INVOKABLE QQmlV8Handle get(int index) const; + Q_INVOKABLE void set(int index, const QQmlV8Handle &); Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value); Q_INVOKABLE void move(int from, int to, int count); Q_INVOKABLE void sync(); @@ -97,7 +97,7 @@ public: { VariantRef() : a(0) {} VariantRef(const VariantRef &r) : a(r.a) { if (a) a->addref(); } - VariantRef(QDeclarativeListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); } + VariantRef(QQuickListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); } ~VariantRef() { if (a) a->release(); } VariantRef &operator=(const VariantRef &o) { @@ -106,15 +106,15 @@ public: return *this; } - QDeclarativeListModelWorkerAgent *a; + QQuickListModelWorkerAgent *a; }; void modelDestroyed(); protected: virtual bool event(QEvent *); private: - friend class QDeclarativeWorkerScriptEnginePrivate; - friend class QDeclarativeListModel; + friend class QQuickWorkerScriptEnginePrivate; + friend class QQuickListModel; struct Change { @@ -141,21 +141,21 @@ private: struct Sync : public QEvent { Sync() : QEvent(QEvent::User) {} Data data; - QDeclarativeListModel *list; + QQuickListModel *list; }; QAtomicInt m_ref; - QDeclarativeListModel *m_orig; - QDeclarativeListModel *m_copy; + QQuickListModel *m_orig; + QQuickListModel *m_copy; QMutex mutex; QWaitCondition syncDone; }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDeclarativeListModelWorkerAgent::VariantRef) +Q_DECLARE_METATYPE(QQuickListModelWorkerAgent::VariantRef) QT_END_HEADER -#endif // QDECLARATIVEWORKERSCRIPT_P_H +#endif // QQUICKLISTMODELWORKERAGENT_P_H diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/qml/qml/qquickworkerscript.cpp index 53283113b6..f91aa28509 100644 --- a/src/declarative/qml/qdeclarativeworkerscript.cpp +++ b/src/qml/qml/qquickworkerscript.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,23 +39,23 @@ ** ****************************************************************************/ -#include "qdeclarativeworkerscript_p.h" -#include "qdeclarativelistmodel_p.h" -#include "qdeclarativelistmodelworkeragent_p.h" -#include "qdeclarativeengine_p.h" -#include "qdeclarativeexpression_p.h" +#include "qquickworkerscript_p.h" +#include "qquicklistmodel_p.h" +#include "qquicklistmodelworkeragent_p.h" +#include "qqmlengine_p.h" +#include "qqmlexpression_p.h" #include <QtCore/qcoreevent.h> #include <QtCore/qcoreapplication.h> #include <QtCore/qdebug.h> -#include <QtDeclarative/qjsengine.h> +#include <QtQml/qjsengine.h> #include <QtCore/qmutex.h> #include <QtCore/qwaitcondition.h> #include <QtCore/qfile.h> #include <QtCore/qdatetime.h> #include <QtNetwork/qnetworkaccessmanager.h> -#include <QtDeclarative/qdeclarativeinfo.h> -#include "qdeclarativenetworkaccessmanagerfactory.h" +#include <QtQml/qqmlinfo.h> +#include "qqmlnetworkaccessmanagerfactory.h" #include <private/qv8engine_p.h> #include <private/qv8worker_p.h> @@ -111,15 +111,15 @@ class WorkerErrorEvent : public QEvent public: enum Type { WorkerError = WorkerRemoveEvent::WorkerRemove + 1 }; - WorkerErrorEvent(const QDeclarativeError &error); + WorkerErrorEvent(const QQmlError &error); - QDeclarativeError error() const; + QQmlError error() const; private: - QDeclarativeError m_error; + QQmlError m_error; }; -class QDeclarativeWorkerScriptEnginePrivate : public QObject +class QQuickWorkerScriptEnginePrivate : public QObject { Q_OBJECT public: @@ -127,18 +127,18 @@ public: WorkerDestroyEvent = QEvent::User + 100 }; - QDeclarativeWorkerScriptEnginePrivate(QDeclarativeEngine *eng); + QQuickWorkerScriptEnginePrivate(QQmlEngine *eng); class WorkerEngine : public QV8Engine { public: - WorkerEngine(QDeclarativeWorkerScriptEnginePrivate *parent); + WorkerEngine(QQuickWorkerScriptEnginePrivate *parent); ~WorkerEngine(); void init(); virtual QNetworkAccessManager *networkAccessManager(); - QDeclarativeWorkerScriptEnginePrivate *p; + QQuickWorkerScriptEnginePrivate *p; v8::Local<v8::Function> sendFunction(int id); void callOnMessage(v8::Handle<v8::Object> object, v8::Handle<v8::Value> arg); @@ -149,11 +149,11 @@ public: }; WorkerEngine *workerEngine; - static QDeclarativeWorkerScriptEnginePrivate *get(QV8Engine *e) { + static QQuickWorkerScriptEnginePrivate *get(QV8Engine *e) { return static_cast<WorkerEngine *>(e)->p; } - QDeclarativeEngine *qmlengine; + QQmlEngine *qmlengine; QMutex m_lock; QWaitCondition m_wait; @@ -165,7 +165,7 @@ public: int id; QUrl source; bool initialized; - QDeclarativeWorkerScript *owner; + QQuickWorkerScript *owner; v8::Persistent<v8::Object> object; }; @@ -185,22 +185,22 @@ protected: private: void processMessage(int, const QByteArray &); void processLoad(int, const QUrl &); - void reportScriptException(WorkerScript *, const QDeclarativeError &error); + void reportScriptException(WorkerScript *, const QQmlError &error); }; -QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::WorkerEngine(QDeclarativeWorkerScriptEnginePrivate *parent) +QQuickWorkerScriptEnginePrivate::WorkerEngine::WorkerEngine(QQuickWorkerScriptEnginePrivate *parent) : QV8Engine(0), p(parent), accessManager(0) { } -QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::~WorkerEngine() +QQuickWorkerScriptEnginePrivate::WorkerEngine::~WorkerEngine() { qPersistentDispose(createsend); qPersistentDispose(onmessage); delete accessManager; } -void QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::init() +void QQuickWorkerScriptEnginePrivate::WorkerEngine::init() { initDeclarativeGlobalObject(); #define CALL_ONMESSAGE_SCRIPT \ @@ -234,7 +234,7 @@ void QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::init() v8::Local<v8::Function> createsendconstructor = v8::Local<v8::Function>::Cast(createsendscript->Run()); v8::Handle<v8::Value> args[] = { - V8FUNCTION(QDeclarativeWorkerScriptEnginePrivate::sendMessage, this) + V8FUNCTION(QQuickWorkerScriptEnginePrivate::sendMessage, this) }; v8::Local<v8::Value> createsendvalue = createsendconstructor->Call(global(), 1, args); @@ -243,21 +243,21 @@ void QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::init() } // Requires handle and context scope -v8::Local<v8::Function> QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::sendFunction(int id) +v8::Local<v8::Function> QQuickWorkerScriptEnginePrivate::WorkerEngine::sendFunction(int id) { v8::Handle<v8::Value> args[] = { v8::Integer::New(id) }; return v8::Local<v8::Function>::Cast(createsend->Call(global(), 1, args)); } // Requires handle and context scope -void QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::callOnMessage(v8::Handle<v8::Object> object, +void QQuickWorkerScriptEnginePrivate::WorkerEngine::callOnMessage(v8::Handle<v8::Object> object, v8::Handle<v8::Value> arg) { v8::Handle<v8::Value> args[] = { object, arg }; onmessage->Call(global(), 2, args); } -QNetworkAccessManager *QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::networkAccessManager() +QNetworkAccessManager *QQuickWorkerScriptEnginePrivate::WorkerEngine::networkAccessManager() { if (!accessManager) { if (p->qmlengine && p->qmlengine->networkAccessManagerFactory()) { @@ -269,12 +269,12 @@ QNetworkAccessManager *QDeclarativeWorkerScriptEnginePrivate::WorkerEngine::netw return accessManager; } -QDeclarativeWorkerScriptEnginePrivate::QDeclarativeWorkerScriptEnginePrivate(QDeclarativeEngine *engine) +QQuickWorkerScriptEnginePrivate::QQuickWorkerScriptEnginePrivate(QQmlEngine *engine) : workerEngine(0), qmlengine(engine), m_nextId(0) { } -v8::Handle<v8::Value> QDeclarativeWorkerScriptEnginePrivate::sendMessage(const v8::Arguments &args) +v8::Handle<v8::Value> QQuickWorkerScriptEnginePrivate::sendMessage(const v8::Arguments &args) { WorkerEngine *engine = (WorkerEngine*)V8ENGINE(); @@ -294,7 +294,7 @@ v8::Handle<v8::Value> QDeclarativeWorkerScriptEnginePrivate::sendMessage(const v } // Requires handle scope and context scope -v8::Handle<v8::Object> QDeclarativeWorkerScriptEnginePrivate::getWorker(WorkerScript *script) +v8::Handle<v8::Object> QQuickWorkerScriptEnginePrivate::getWorker(WorkerScript *script) { if (!script->initialized) { script->initialized = true; @@ -314,7 +314,7 @@ v8::Handle<v8::Object> QDeclarativeWorkerScriptEnginePrivate::getWorker(WorkerSc return script->object; } -bool QDeclarativeWorkerScriptEnginePrivate::event(QEvent *event) +bool QQuickWorkerScriptEnginePrivate::event(QEvent *event) { if (event->type() == (QEvent::Type)WorkerDataEvent::WorkerData) { WorkerDataEvent *workerEvent = static_cast<WorkerDataEvent *>(event); @@ -336,7 +336,7 @@ bool QDeclarativeWorkerScriptEnginePrivate::event(QEvent *event) } } -void QDeclarativeWorkerScriptEnginePrivate::processMessage(int id, const QByteArray &data) +void QQuickWorkerScriptEnginePrivate::processMessage(int id, const QByteArray &data) { WorkerScript *script = workers.value(id); if (!script) @@ -351,24 +351,24 @@ void QDeclarativeWorkerScriptEnginePrivate::processMessage(int id, const QByteAr workerEngine->callOnMessage(script->object, value); if (tc.HasCaught()) { - QDeclarativeError error; - QDeclarativeExpressionPrivate::exceptionToError(tc.Message(), error); + QQmlError error; + QQmlExpressionPrivate::exceptionToError(tc.Message(), error); reportScriptException(script, error); } } -void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url) +void QQuickWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url) { if (url.isRelative()) return; - QString fileName = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); + QString fileName = QQmlEnginePrivate::urlToLocalFileOrQrc(url); QFile f(fileName); if (f.open(QIODevice::ReadOnly)) { QByteArray data = f.readAll(); QString sourceCode = QString::fromUtf8(data); - QDeclarativeScript::Parser::extractPragmas(sourceCode); + QQmlScript::Parser::extractPragmas(sourceCode); v8::HandleScope handle_scope; v8::Context::Scope scope(workerEngine->context()); @@ -391,8 +391,8 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url) program->Run(activation); if (tc.HasCaught()) { - QDeclarativeError error; - QDeclarativeExpressionPrivate::exceptionToError(tc.Message(), error); + QQmlError error; + QQmlExpressionPrivate::exceptionToError(tc.Message(), error); reportScriptException(script, error); } } else { @@ -400,10 +400,10 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url) } } -void QDeclarativeWorkerScriptEnginePrivate::reportScriptException(WorkerScript *script, - const QDeclarativeError &error) +void QQuickWorkerScriptEnginePrivate::reportScriptException(WorkerScript *script, + const QQmlError &error) { - QDeclarativeWorkerScriptEnginePrivate *p = QDeclarativeWorkerScriptEnginePrivate::get(workerEngine); + QQuickWorkerScriptEnginePrivate *p = QQuickWorkerScriptEnginePrivate::get(workerEngine); QMutexLocker(&p->m_lock); if (script->owner) @@ -454,18 +454,18 @@ int WorkerRemoveEvent::workerId() const return m_id; } -WorkerErrorEvent::WorkerErrorEvent(const QDeclarativeError &error) +WorkerErrorEvent::WorkerErrorEvent(const QQmlError &error) : QEvent((QEvent::Type)WorkerError), m_error(error) { } -QDeclarativeError WorkerErrorEvent::error() const +QQmlError WorkerErrorEvent::error() const { return m_error; } -QDeclarativeWorkerScriptEngine::QDeclarativeWorkerScriptEngine(QDeclarativeEngine *parent) -: QThread(parent), d(new QDeclarativeWorkerScriptEnginePrivate(parent)) +QQuickWorkerScriptEngine::QQuickWorkerScriptEngine(QQmlEngine *parent) +: QThread(parent), d(new QQuickWorkerScriptEnginePrivate(parent)) { d->m_lock.lock(); connect(d, SIGNAL(stopThread()), this, SLOT(quit()), Qt::DirectConnection); @@ -475,33 +475,33 @@ QDeclarativeWorkerScriptEngine::QDeclarativeWorkerScriptEngine(QDeclarativeEngin d->m_lock.unlock(); } -QDeclarativeWorkerScriptEngine::~QDeclarativeWorkerScriptEngine() +QQuickWorkerScriptEngine::~QQuickWorkerScriptEngine() { d->m_lock.lock(); - QCoreApplication::postEvent(d, new QEvent((QEvent::Type)QDeclarativeWorkerScriptEnginePrivate::WorkerDestroyEvent)); + QCoreApplication::postEvent(d, new QEvent((QEvent::Type)QQuickWorkerScriptEnginePrivate::WorkerDestroyEvent)); d->m_lock.unlock(); //We have to force to cleanup the main thread's event queue here //to make sure the main GUI release all pending locks/wait conditions which - //some worker script/agent are waiting for (QDeclarativeListModelWorkerAgent::sync() for example). + //some worker script/agent are waiting for (QQuickListModelWorkerAgent::sync() for example). QCoreApplication::processEvents(); wait(); d->deleteLater(); } -QDeclarativeWorkerScriptEnginePrivate::WorkerScript::WorkerScript() +QQuickWorkerScriptEnginePrivate::WorkerScript::WorkerScript() : id(-1), initialized(false), owner(0) { } -QDeclarativeWorkerScriptEnginePrivate::WorkerScript::~WorkerScript() +QQuickWorkerScriptEnginePrivate::WorkerScript::~WorkerScript() { qPersistentDispose(object); } -int QDeclarativeWorkerScriptEngine::registerWorkerScript(QDeclarativeWorkerScript *owner) +int QQuickWorkerScriptEngine::registerWorkerScript(QQuickWorkerScript *owner) { - typedef QDeclarativeWorkerScriptEnginePrivate::WorkerScript WorkerScript; + typedef QQuickWorkerScriptEnginePrivate::WorkerScript WorkerScript; WorkerScript *script = new WorkerScript; script->id = d->m_nextId++; @@ -514,30 +514,30 @@ int QDeclarativeWorkerScriptEngine::registerWorkerScript(QDeclarativeWorkerScrip return script->id; } -void QDeclarativeWorkerScriptEngine::removeWorkerScript(int id) +void QQuickWorkerScriptEngine::removeWorkerScript(int id) { - QDeclarativeWorkerScriptEnginePrivate::WorkerScript* script = d->workers.value(id); + QQuickWorkerScriptEnginePrivate::WorkerScript* script = d->workers.value(id); if (script) { script->owner = 0; QCoreApplication::postEvent(d, new WorkerRemoveEvent(id)); } } -void QDeclarativeWorkerScriptEngine::executeUrl(int id, const QUrl &url) +void QQuickWorkerScriptEngine::executeUrl(int id, const QUrl &url) { QCoreApplication::postEvent(d, new WorkerLoadEvent(id, url)); } -void QDeclarativeWorkerScriptEngine::sendMessage(int id, const QByteArray &data) +void QQuickWorkerScriptEngine::sendMessage(int id, const QByteArray &data) { QCoreApplication::postEvent(d, new WorkerDataEvent(id, data)); } -void QDeclarativeWorkerScriptEngine::run() +void QQuickWorkerScriptEngine::run() { d->m_lock.lock(); - d->workerEngine = new QDeclarativeWorkerScriptEnginePrivate::WorkerEngine(d); + d->workerEngine = new QQuickWorkerScriptEnginePrivate::WorkerEngine(d); d->workerEngine->init(); d->m_wait.wakeAll(); @@ -554,7 +554,7 @@ void QDeclarativeWorkerScriptEngine::run() /*! - \qmlclass WorkerScript QDeclarativeWorkerScript + \qmlclass WorkerScript QQuickWorkerScript \ingroup qml-utility-elements \brief The WorkerScript element enables the use of threads in QML. @@ -567,12 +567,12 @@ void QDeclarativeWorkerScriptEngine::run() An example: - \snippet doc/src/snippets/declarative/workerscript.qml 0 + \snippet doc/src/snippets/qml/workerscript.qml 0 The above worker script specifies a JavaScript file, "script.js", that handles the operations to be performed in the new thread. Here is \c script.js: - \quotefile doc/src/snippets/declarative/script.js + \quotefile doc/src/snippets/qml/script.js When the user clicks anywhere within the rectangle, \c sendMessage() is called, triggering the \tt WorkerScript.onMessage() handler in @@ -587,7 +587,7 @@ void QDeclarativeWorkerScriptEngine::run() that unlike an ordinary JavaScript file that is imported into QML, the \c script.js in the above example cannot access the properties, methods or other attributes of the QML item, nor can it access any context properties set on the QML object - through QDeclarativeContext. + through QQmlContext. Additionally, there are restrictions on the types of values that can be passed to and from the worker script. See the sendMessage() documentation for details. @@ -595,12 +595,12 @@ void QDeclarativeWorkerScriptEngine::run() \sa {declarative/threading/workerscript}{WorkerScript example}, {declarative/threading/threadedlistmodel}{Threaded ListModel example} */ -QDeclarativeWorkerScript::QDeclarativeWorkerScript(QObject *parent) +QQuickWorkerScript::QQuickWorkerScript(QObject *parent) : QObject(parent), m_engine(0), m_scriptId(-1), m_componentComplete(true) { } -QDeclarativeWorkerScript::~QDeclarativeWorkerScript() +QQuickWorkerScript::~QQuickWorkerScript() { if (m_scriptId != -1) m_engine->removeWorkerScript(m_scriptId); } @@ -611,12 +611,12 @@ QDeclarativeWorkerScript::~QDeclarativeWorkerScript() This holds the url of the JavaScript file that implements the \tt WorkerScript.onMessage() handler for threaded operations. */ -QUrl QDeclarativeWorkerScript::source() const +QUrl QQuickWorkerScript::source() const { return m_source; } -void QDeclarativeWorkerScript::setSource(const QUrl &source) +void QQuickWorkerScript::setSource(const QUrl &source) { if (m_source == source) return; @@ -649,10 +649,10 @@ void QDeclarativeWorkerScript::setSource(const QUrl &source) of ListModel objects, any modifications by the other thread to an object passed in \c message will not be reflected in the original object. */ -void QDeclarativeWorkerScript::sendMessage(QDeclarativeV8Function *args) +void QQuickWorkerScript::sendMessage(QQmlV8Function *args) { if (!engine()) { - qWarning("QDeclarativeWorkerScript: Attempt to send message before WorkerScript establishment"); + qWarning("QQuickWorkerScript: Attempt to send message before WorkerScript establishment"); return; } @@ -663,22 +663,22 @@ void QDeclarativeWorkerScript::sendMessage(QDeclarativeV8Function *args) m_engine->sendMessage(m_scriptId, QV8Worker::serialize(argument, args->engine())); } -void QDeclarativeWorkerScript::classBegin() +void QQuickWorkerScript::classBegin() { m_componentComplete = false; } -QDeclarativeWorkerScriptEngine *QDeclarativeWorkerScript::engine() +QQuickWorkerScriptEngine *QQuickWorkerScript::engine() { if (m_engine) return m_engine; if (m_componentComplete) { - QDeclarativeEngine *engine = qmlEngine(this); + QQmlEngine *engine = qmlEngine(this); if (!engine) { - qWarning("QDeclarativeWorkerScript: engine() called without qmlEngine() set"); + qWarning("QQuickWorkerScript: engine() called without qmlEngine() set"); return 0; } - m_engine = QDeclarativeEnginePrivate::get(engine)->getWorkerScriptEngine(); + m_engine = QQmlEnginePrivate::get(engine)->getWorkerScriptEngine(); m_scriptId = m_engine->registerWorkerScript(this); if (m_source.isValid()) @@ -689,7 +689,7 @@ QDeclarativeWorkerScriptEngine *QDeclarativeWorkerScript::engine() return 0; } -void QDeclarativeWorkerScript::componentComplete() +void QQuickWorkerScript::componentComplete() { m_componentComplete = true; engine(); // Get it started now. @@ -702,22 +702,22 @@ void QDeclarativeWorkerScript::componentComplete() script in another thread through a call to sendMessage(). */ -bool QDeclarativeWorkerScript::event(QEvent *event) +bool QQuickWorkerScript::event(QEvent *event) { if (event->type() == (QEvent::Type)WorkerDataEvent::WorkerData) { - QDeclarativeEngine *engine = qmlEngine(this); + QQmlEngine *engine = qmlEngine(this); if (engine) { WorkerDataEvent *workerEvent = static_cast<WorkerDataEvent *>(event); - QV8Engine *v8engine = QDeclarativeEnginePrivate::get(engine)->v8engine(); + QV8Engine *v8engine = QQmlEnginePrivate::get(engine)->v8engine(); v8::HandleScope handle_scope; v8::Context::Scope scope(v8engine->context()); v8::Handle<v8::Value> value = QV8Worker::deserialize(workerEvent->data(), v8engine); - emit message(QDeclarativeV8Handle::fromHandle(value)); + emit message(QQmlV8Handle::fromHandle(value)); } return true; } else if (event->type() == (QEvent::Type)WorkerErrorEvent::WorkerError) { WorkerErrorEvent *workerEvent = static_cast<WorkerErrorEvent *>(event); - QDeclarativeEnginePrivate::warning(qmlEngine(this), workerEvent->error()); + QQmlEnginePrivate::warning(qmlEngine(this), workerEvent->error()); return true; } else { return QObject::event(event); @@ -726,5 +726,5 @@ bool QDeclarativeWorkerScript::event(QEvent *event) QT_END_NAMESPACE -#include <qdeclarativeworkerscript.moc> +#include <qquickworkerscript.moc> diff --git a/src/declarative/qml/qdeclarativeworkerscript_p.h b/src/qml/qml/qquickworkerscript_p.h index 192251f8ac..fd1c3ed690 100644 --- a/src/declarative/qml/qdeclarativeworkerscript_p.h +++ b/src/qml/qml/qquickworkerscript_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEWORKERSCRIPT_P_H -#define QDECLARATIVEWORKERSCRIPT_P_H +#ifndef QQUICKWORKERSCRIPT_P_H +#define QQUICKWORKERSCRIPT_P_H // // W A R N I N G @@ -53,11 +53,11 @@ // We mean it. // -#include "qdeclarative.h" -#include "qdeclarativeparserstatus.h" +#include "qqml.h" +#include "qqmlparserstatus.h" #include <QtCore/qthread.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> #include <QtCore/qurl.h> QT_BEGIN_HEADER @@ -65,16 +65,16 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeWorkerScript; -class QDeclarativeWorkerScriptEnginePrivate; -class QDeclarativeWorkerScriptEngine : public QThread +class QQuickWorkerScript; +class QQuickWorkerScriptEnginePrivate; +class QQuickWorkerScriptEngine : public QThread { Q_OBJECT public: - QDeclarativeWorkerScriptEngine(QDeclarativeEngine *parent = 0); - virtual ~QDeclarativeWorkerScriptEngine(); + QQuickWorkerScriptEngine(QQmlEngine *parent = 0); + virtual ~QQuickWorkerScriptEngine(); - int registerWorkerScript(QDeclarativeWorkerScript *); + int registerWorkerScript(QQuickWorkerScript *); void removeWorkerScript(int); void executeUrl(int, const QUrl &); void sendMessage(int, const QByteArray &); @@ -83,30 +83,30 @@ protected: virtual void run(); private: - QDeclarativeWorkerScriptEnginePrivate *d; + QQuickWorkerScriptEnginePrivate *d; }; -class QDeclarativeV8Function; -class QDeclarativeV8Handle; -class Q_AUTOTEST_EXPORT QDeclarativeWorkerScript : public QObject, public QDeclarativeParserStatus +class QQmlV8Function; +class QQmlV8Handle; +class Q_AUTOTEST_EXPORT QQuickWorkerScript : public QObject, public QQmlParserStatus { Q_OBJECT Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: - QDeclarativeWorkerScript(QObject *parent = 0); - virtual ~QDeclarativeWorkerScript(); + QQuickWorkerScript(QObject *parent = 0); + virtual ~QQuickWorkerScript(); QUrl source() const; void setSource(const QUrl &); public slots: - void sendMessage(QDeclarativeV8Function*); + void sendMessage(QQmlV8Function*); signals: void sourceChanged(); - void message(const QDeclarativeV8Handle &messageObject); + void message(const QQmlV8Handle &messageObject); protected: virtual void classBegin(); @@ -114,8 +114,8 @@ protected: virtual bool event(QEvent *); private: - QDeclarativeWorkerScriptEngine *engine(); - QDeclarativeWorkerScriptEngine *m_engine; + QQuickWorkerScriptEngine *engine(); + QQuickWorkerScriptEngine *m_engine; int m_scriptId; QUrl m_source; bool m_componentComplete; @@ -123,8 +123,8 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeWorkerScript) +QML_DECLARE_TYPE(QQuickWorkerScript) QT_END_HEADER -#endif // QDECLARATIVEWORKERSCRIPT_P_H +#endif // QQUICKWORKERSCRIPT_P_H diff --git a/src/declarative/qml/rewriter/rewriter.pri b/src/qml/qml/rewriter/rewriter.pri index e51ee5ba4e..e51ee5ba4e 100644 --- a/src/declarative/qml/rewriter/rewriter.pri +++ b/src/qml/qml/rewriter/rewriter.pri diff --git a/src/declarative/qml/rewriter/textwriter.cpp b/src/qml/qml/rewriter/textwriter.cpp index 5cf5c0388e..f14c4af521 100644 --- a/src/declarative/qml/rewriter/textwriter.cpp +++ b/src/qml/qml/rewriter/textwriter.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,7 +43,7 @@ QT_QML_BEGIN_NAMESPACE -using namespace QDeclarativeJS; +using namespace QQmlJS; TextWriter::TextWriter() :string(0), cursor(0) diff --git a/src/declarative/qml/rewriter/textwriter_p.h b/src/qml/qml/rewriter/textwriter_p.h index aae9271c1a..94e2d08730 100644 --- a/src/declarative/qml/rewriter/textwriter_p.h +++ b/src/qml/qml/rewriter/textwriter_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,7 +42,7 @@ #ifndef TEXTWRITER_H #define TEXTWRITER_H -#include <private/qdeclarativejsglobal_p.h> +#include <private/qqmljsglobal_p.h> #include <QtCore/QString> #include <QtCore/QList> @@ -51,7 +51,7 @@ QT_BEGIN_HEADER QT_QML_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { class TextWriter { @@ -93,7 +93,7 @@ public: }; -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS QT_QML_END_NAMESPACE QT_END_HEADER diff --git a/src/declarative/qml/v4/qv4bindings.cpp b/src/qml/qml/v4/qv4bindings.cpp index 2c26fff3d8..c03292d74d 100644 --- a/src/declarative/qml/v4/qv4bindings.cpp +++ b/src/qml/qml/v4/qv4bindings.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -46,23 +46,23 @@ #include "qv4compiler_p.h" #include "qv4compiler_p_p.h" -#include <private/qdeclarativeaccessors_p.h> -#include <private/qdeclarativeprofilerservice_p.h> -#include <private/qdeclarativemetatype_p.h> -#include <private/qdeclarativetrace_p.h> +#include <private/qqmlaccessors_p.h> +#include <private/qqmlprofilerservice_p.h> +#include <private/qqmlmetatype_p.h> +#include <private/qqmltrace_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtCore/qnumeric.h> #include <QtCore/qmath.h> #include <math.h> // ::fmod QT_BEGIN_NAMESPACE -using namespace QDeclarativeJS; +using namespace QQmlJS; namespace { struct Register { - typedef QDeclarativeRegisterType Type; + typedef QQmlRegisterType Type; void setUndefined() { dataType = UndefinedType; } void setNaN() { setqreal(qSNaN()); } @@ -189,8 +189,8 @@ void Register::init(Type type) } // end of anonymous namespace QV4Bindings::QV4Bindings(const char *programData, - QDeclarativeContextData *context, - QDeclarativeRefCount *ref) + QQmlContextData *context, + QQmlRefCount *ref) : subscriptions(0), program(0), dataRef(0), bindings(0) { program = (QV4Program *)programData; @@ -201,7 +201,7 @@ QV4Bindings::QV4Bindings(const char *programData, subscriptions = new Subscription[program->subscriptions]; bindings = new Binding[program->bindings]; - QDeclarativeAbstractExpression::setContext(context); + QQmlAbstractExpression::setContext(context); } } @@ -212,7 +212,7 @@ QV4Bindings::~QV4Bindings() if (dataRef) dataRef->release(); } -QDeclarativeAbstractBinding *QV4Bindings::configBinding(int index, QObject *target, +QQmlAbstractBinding *QV4Bindings::configBinding(int index, QObject *target, QObject *scope, int property, int line, int column) { @@ -231,7 +231,7 @@ QDeclarativeAbstractBinding *QV4Bindings::configBinding(int index, QObject *targ return rv; } -void QV4Bindings::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) +void QV4Bindings::Binding::setEnabled(bool e, QQmlPropertyPrivate::WriteFlags flags) { if (enabled != e) { enabled = e; @@ -240,7 +240,7 @@ void QV4Bindings::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::Write } } -void QV4Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags) +void QV4Bindings::Binding::update(QQmlPropertyPrivate::WriteFlags flags) { parent->run(this, flags); } @@ -264,7 +264,7 @@ QObject *QV4Bindings::Binding::object() const return target; } -void QV4Bindings::Subscription::subscriptionCallback(QDeclarativeNotifierEndpoint *e) +void QV4Bindings::Subscription::subscriptionCallback(QQmlNotifierEndpoint *e) { Subscription *s = static_cast<Subscription *>(e); s->bindings->subscriptionNotify(s->method); @@ -280,33 +280,33 @@ void QV4Bindings::subscriptionNotify(int id) Binding *binding = bindings + bindingRef->binding; if (binding->executedBlocks & bindingRef->blockMask) { - run(binding, QDeclarativePropertyPrivate::DontRemoveBinding); + run(binding, QQmlPropertyPrivate::DontRemoveBinding); } } } -void QV4Bindings::run(Binding *binding, QDeclarativePropertyPrivate::WriteFlags flags) +void QV4Bindings::run(Binding *binding, QQmlPropertyPrivate::WriteFlags flags) { if (!binding->enabled) return; - QDeclarativeContextData *context = QDeclarativeAbstractExpression::context(); + QQmlContextData *context = QQmlAbstractExpression::context(); if (!context || !context->isValid()) return; - QDeclarativeTrace trace("V4 Binding Update"); + QQmlTrace trace("V4 Binding Update"); trace.addDetail("URL", context->url); trace.addDetail("Line", binding->line); trace.addDetail("Column", binding->column); - QDeclarativeBindingProfiler prof(context->urlString, binding->line, binding->column); + QQmlBindingProfiler prof(context->urlString, binding->line, binding->column); if (binding->updating) { QString name; if (binding->property & 0xFFFF0000) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context->engine); - QDeclarativeValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF]; + QQmlValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF]; Q_ASSERT(vt); name = QLatin1String(binding->target->metaObject()->property(binding->property & 0xFFFF).name()); @@ -321,9 +321,9 @@ void QV4Bindings::run(Binding *binding, QDeclarativePropertyPrivate::WriteFlags binding->updating = true; if (binding->property & 0xFFFF0000) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context->engine); - QDeclarativeValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF]; + QQmlValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF]; Q_ASSERT(vt); vt->read(binding->target, binding->property & 0xFFFF); @@ -344,7 +344,7 @@ void QV4Bindings::unsubscribe(int subIndex) sub->disconnect(); } -void QV4Bindings::subscribeId(QDeclarativeContextData *p, int idIndex, int subIndex) +void QV4Bindings::subscribeId(QQmlContextData *p, int idIndex, int subIndex) { unsubscribe(subIndex); @@ -416,7 +416,7 @@ inline static bool toBool(Register *reg, int type, bool *ok = 0) } } -inline static QUrl toUrl(Register *reg, int type, QDeclarativeContextData *context, bool *ok = 0) +inline static QUrl toUrl(Register *reg, int type, QQmlContextData *context, bool *ok = 0) { if (ok) *ok = true; @@ -463,8 +463,8 @@ static bool testCompareVariants(const QVariant &qtscriptRaw, const QVariant &v4) int type = qtscript.userType(); - if (type == QDeclarativeMetaType::QQuickAnchorLineMetaTypeId()) { - return QDeclarativeMetaType::QQuickAnchorLineCompare(qtscript.constData(), v4.constData()); + if (type == QQmlMetaType::QQuickAnchorLineMetaTypeId()) { + return QQmlMetaType::QQuickAnchorLineCompare(qtscript.constData(), v4.constData()); } else if (type == QMetaType::Double) { double la = qvariant_cast<double>(qtscript); @@ -497,10 +497,10 @@ QByteArray testResultToString(const QVariant &result, bool undefined) } static void testBindingResult(const QString &binding, int line, int column, - QDeclarativeContextData *context, QObject *scope, + QQmlContextData *context, QObject *scope, const Register &result, int resultType) { - QDeclarativeExpression expression(context->asQDeclarativeContext(), scope, binding); + QQmlExpression expression(context->asQQmlContext(), scope, binding); bool isUndefined = false; QVariant value = expression.evaluate(&isUndefined); @@ -543,8 +543,8 @@ static void testBindingResult(const QString &binding, int line, int column, v4value = result.getqreal(); break; default: - if (resultType == QDeclarativeMetaType::QQuickAnchorLineMetaTypeId()) { - v4value = QVariant(QDeclarativeMetaType::QQuickAnchorLineMetaTypeId(), result.typeDataPtr()); + if (resultType == QQmlMetaType::QQuickAnchorLineMetaTypeId()) { + v4value = QVariant(QQmlMetaType::QQuickAnchorLineMetaTypeId(), result.typeDataPtr()); } else { iserror = true; v4Result = "Unknown V4 type"; @@ -567,9 +567,9 @@ static void testBindingResult(const QString &binding, int line, int column, } static void testBindingException(const QString &binding, int line, int column, - QDeclarativeContextData *context, QObject *scope) + QQmlContextData *context, QObject *scope) { - QDeclarativeExpression expression(context->asQDeclarativeContext(), scope, binding); + QQmlExpression expression(context->asQQmlContext(), scope, binding); bool isUndefined = false; QVariant value = expression.evaluate(&isUndefined); @@ -582,8 +582,8 @@ static void testBindingException(const QString &binding, int line, int column, } } -static void throwException(int id, QDeclarativeDelayedError *error, - QV4Program *program, QDeclarativeContextData *context, +static void throwException(int id, QQmlDelayedError *error, + QV4Program *program, QQmlContextData *context, const QString &description = QString()) { error->error.setUrl(context->url); @@ -599,8 +599,8 @@ static void throwException(int id, QDeclarativeDelayedError *error, error->error.setLine(-1); error->error.setColumn(-1); } - if (!context->engine || !error->addError(QDeclarativeEnginePrivate::get(context->engine))) - QDeclarativeEnginePrivate::warning(context->engine, error->error); + if (!context->engine || !error->addError(QQmlEnginePrivate::get(context->engine))) + QQmlEnginePrivate::warning(context->engine, error->error); } const qreal QV4Bindings::D32 = 4294967296.0; @@ -675,7 +675,7 @@ void **QV4Bindings::getDecodeInstrTable() QV4Bindings *dummy = new QV4Bindings(0, 0, 0); quint32 executedBlocks = 0; dummy->run(0, executedBlocks, 0, 0, 0, 0, - QDeclarativePropertyPrivate::BypassInterceptor, + QQmlPropertyPrivate::BypassInterceptor, &decode_instr); dummy->release(); } @@ -684,9 +684,9 @@ void **QV4Bindings::getDecodeInstrTable() #endif void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, - QDeclarativeContextData *context, QDeclarativeDelayedError *error, + QQmlContextData *context, QQmlDelayedError *error, QObject *scope, QObject *output, - QDeclarativePropertyPrivate::WriteFlags storeFlags + QQmlPropertyPrivate::WriteFlags storeFlags #ifdef QML_THREADED_INTERPRETER ,void ***table #endif @@ -771,12 +771,12 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, reg.init((Register::Type)instr->fetchAndSubscribe.valueType); if (instr->fetchAndSubscribe.valueType >= FirstCleanupType) MARK_REGISTER(instr->fetchAndSubscribe.reg); - QDeclarativeAccessors *accessors = instr->fetchAndSubscribe.property.accessors; + QQmlAccessors *accessors = instr->fetchAndSubscribe.property.accessors; accessors->read(object, instr->fetchAndSubscribe.property.accessorData, reg.typeDataPtr()); if (accessors->notifier) { - QDeclarativeNotifier *notifier = 0; + QQmlNotifier *notifier = 0; accessors->notifier(object, instr->fetchAndSubscribe.property.accessorData, ¬ifier); if (notifier) sub->connect(notifier); } else if (instr->fetchAndSubscribe.property.notifyIndex != -1) { diff --git a/src/declarative/qml/v4/qv4bindings_p.h b/src/qml/qml/v4/qv4bindings_p.h index 58dd4328af..61d29a6f57 100644 --- a/src/declarative/qml/v4/qv4bindings_p.h +++ b/src/qml/qml/v4/qv4bindings_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,8 +53,8 @@ // We mean it. // -#include "private/qdeclarativeexpression_p.h" -#include "private/qdeclarativebinding_p.h" +#include "private/qqmlexpression_p.h" +#include "private/qqmlbinding_p.h" #include "private/qv4instruction_p.h" QT_BEGIN_HEADER @@ -62,16 +62,16 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE struct QV4Program; -class QV4Bindings : public QDeclarativeAbstractExpression, - public QDeclarativeRefCount +class QV4Bindings : public QQmlAbstractExpression, + public QQmlRefCount { Q_DECLARE_TR_FUNCTIONS(QV4Bindings) public: - QV4Bindings(const char *program, QDeclarativeContextData *context, - QDeclarativeRefCount *); + QV4Bindings(const char *program, QQmlContextData *context, + QQmlRefCount *); virtual ~QV4Bindings(); - QDeclarativeAbstractBinding *configBinding(int index, QObject *target, + QQmlAbstractBinding *configBinding(int index, QObject *target, QObject *scope, int property, int line, int column); @@ -82,13 +82,13 @@ public: private: Q_DISABLE_COPY(QV4Bindings) - struct Binding : public QDeclarativeAbstractBinding, public QDeclarativeDelayedError { + struct Binding : public QQmlAbstractBinding, public QQmlDelayedError { Binding() : enabled(false), updating(0), property(0), scope(0), target(0), executedBlocks(0), parent(0) {} - // Inherited from QDeclarativeAbstractBinding - virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags); - virtual void update(QDeclarativePropertyPrivate::WriteFlags flags); + // Inherited from QQmlAbstractBinding + virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags flags); + virtual void update(QQmlPropertyPrivate::WriteFlags flags); virtual void destroy(); virtual int propertyIndex() const; virtual QObject *object() const; @@ -106,11 +106,11 @@ private: QV4Bindings *parent; }; - class Subscription : public QDeclarativeNotifierEndpoint + class Subscription : public QQmlNotifierEndpoint { public: Subscription() : bindings(0), method(-1) { callback = &subscriptionCallback; } - static void subscriptionCallback(QDeclarativeNotifierEndpoint *e); + static void subscriptionCallback(QQmlNotifierEndpoint *e); QV4Bindings *bindings; int method; }; @@ -119,16 +119,16 @@ private: Subscription *subscriptions; void subscriptionNotify(int); - void run(Binding *, QDeclarativePropertyPrivate::WriteFlags flags); + void run(Binding *, QQmlPropertyPrivate::WriteFlags flags); QV4Program *program; - QDeclarativeRefCount *dataRef; + QQmlRefCount *dataRef; Binding *bindings; void init(); - void run(int instr, quint32 &executedBlocks, QDeclarativeContextData *context, - QDeclarativeDelayedError *error, QObject *scope, QObject *output, - QDeclarativePropertyPrivate::WriteFlags storeFlags + void run(int instr, quint32 &executedBlocks, QQmlContextData *context, + QQmlDelayedError *error, QObject *scope, QObject *output, + QQmlPropertyPrivate::WriteFlags storeFlags #ifdef QML_THREADED_INTERPRETER , void ***decode_instr = 0 #endif @@ -136,7 +136,7 @@ private: inline void unsubscribe(int subIndex); - inline void subscribeId(QDeclarativeContextData *p, int idIndex, int subIndex); + inline void subscribeId(QQmlContextData *p, int idIndex, int subIndex); inline void subscribe(QObject *o, int notifyIndex, int subIndex); inline static qint32 toInt32(qreal n); diff --git a/src/declarative/qml/v4/qv4compiler.cpp b/src/qml/qml/v4/qv4compiler.cpp index 42e56d12c9..d61fd580c7 100644 --- a/src/declarative/qml/v4/qv4compiler.cpp +++ b/src/qml/qml/v4/qv4compiler.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,9 +45,10 @@ #include "qv4ir_p.h" #include "qv4irbuilder_p.h" -#include <private/qdeclarativejsast_p.h> -#include <private/qdeclarativeaccessors_p.h> -#include <private/qdeclarativejsengine_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmljsast_p.h> +#include <private/qqmlaccessors_p.h> +#include <private/qqmljsengine_p.h> QT_BEGIN_NAMESPACE @@ -60,7 +61,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlBindingsTestEnv, QML_BINDINGS_TEST) static bool qmlBindingsTest = false; static bool qmlEnableV4 = true; -using namespace QDeclarativeJS; +using namespace QQmlJS; QV4CompilerPrivate::QV4CompilerPrivate() : _function(0) , _block(0) , _discarded(false) { @@ -321,11 +322,11 @@ void QV4CompilerPrivate::visitName(IR::Name *e) if (e->property->coreIndex == -1) { QMetaProperty prop; - e->property->load(prop, QDeclarativeEnginePrivate::get(engine)); + e->property->load(prop, QQmlEnginePrivate::get(engine)); } const int propTy = e->property->propType; - QDeclarativeRegisterType regType; + QQmlRegisterType regType; switch (propTy) { case QMetaType::QReal: @@ -345,9 +346,9 @@ void QV4CompilerPrivate::visitName(IR::Name *e) break; default: - if (propTy == QDeclarativeMetaType::QQuickAnchorLineMetaTypeId()) { + if (propTy == QQmlMetaType::QQuickAnchorLineMetaTypeId()) { regType = PODValueType; - } else if (QDeclarativeMetaType::isQObject(propTy)) { + } else if (QQmlMetaType::isQObject(propTy)) { regType = QObjectStarType; } else { if (qmlVerboseCompiler()) @@ -989,7 +990,7 @@ void QV4CompilerPrivate::visitRet(IR::Ret *s) test.regType = QMetaType::QUrl; break; case IR::SGAnchorLineType: - test.regType = QDeclarativeMetaType::QQuickAnchorLineMetaTypeId(); + test.regType = QQmlMetaType::QQuickAnchorLineMetaTypeId(); break; case IR::ObjectType: test.regType = QMetaType::QObjectStar; @@ -1070,7 +1071,7 @@ int QV4CompilerPrivate::commitCompile() return rv; } -bool QV4CompilerPrivate::compile(QDeclarativeJS::AST::Node *node) +bool QV4CompilerPrivate::compile(QQmlJS::AST::Node *node) { resetInstanceState(); @@ -1229,11 +1230,11 @@ quint8 QV4CompilerPrivate::exceptionId(quint32 line, quint32 column) return rv; } -quint8 QV4CompilerPrivate::exceptionId(QDeclarativeJS::AST::ExpressionNode *n) +quint8 QV4CompilerPrivate::exceptionId(QQmlJS::AST::ExpressionNode *n) { quint8 rv = 0xFF; if (n && exceptions.count() < 0xFF) { - QDeclarativeJS::AST::SourceLocation l = n->firstSourceLocation(); + QQmlJS::AST::SourceLocation l = n->firstSourceLocation(); rv = exceptionId(l.startLine, l.startColumn); } return rv; @@ -1261,7 +1262,7 @@ bool QV4Compiler::isValid() const /* -1 on failure, otherwise the binding index to use. */ -int QV4Compiler::compile(const Expression &expression, QDeclarativeEnginePrivate *engine) +int QV4Compiler::compile(const Expression &expression, QQmlEnginePrivate *engine) { if (!expression.expression.asAST()) return false; @@ -1286,8 +1287,8 @@ QByteArray QV4CompilerPrivate::buildSignalTable() const QHash<int, QList<QPair<int, quint32> > > table; for (int ii = 0; ii < committed.count(); ++ii) { - const QDeclarativeAssociationList<int, quint32> &deps = committed.dependencies.at(ii); - for (QDeclarativeAssociationList<int, quint32>::const_iterator iter = deps.begin(); iter != deps.end(); ++iter) + const QQmlAssociationList<int, quint32> &deps = committed.dependencies.at(ii); + for (QQmlAssociationList<int, quint32>::const_iterator iter = deps.begin(); iter != deps.end(); ++iter) table[iter->first].append(qMakePair(ii, iter->second)); } @@ -1370,7 +1371,7 @@ QByteArray QV4Compiler::program() const if (bindingsDump()) { qWarning().nospace() << "Subscription slots:"; - for (QDeclarativeAssociationList<QString, int>::ConstIterator iter = d->committed.subscriptionIds.begin(); + for (QQmlAssociationList<QString, int>::ConstIterator iter = d->committed.subscriptionIds.begin(); iter != d->committed.subscriptionIds.end(); ++iter) { qWarning().nospace() << " " << iter->first << "\t-> " << iter->second; diff --git a/src/declarative/qml/v4/qv4compiler_p.h b/src/qml/qml/v4/qv4compiler_p.h index 99d5569b6a..a93248ad14 100644 --- a/src/declarative/qml/v4/qv4compiler_p.h +++ b/src/qml/qml/v4/qv4compiler_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,15 +53,15 @@ // We mean it. // -#include <private/qdeclarativeexpression_p.h> -#include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativecompiler_p.h> +#include <private/qqmlexpression_p.h> +#include <private/qqmlbinding_p.h> +#include <private/qqmlcompiler_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeTypeNameCache; +class QQmlTypeNameCache; class QV4CompilerPrivate; class Q_AUTOTEST_EXPORT QV4Compiler { @@ -74,18 +74,18 @@ public: struct Expression { - Expression(const QDeclarativeImports &imp) : imports(imp) {} - QDeclarativeScript::Object *component; - QDeclarativeScript::Object *context; - QDeclarativeScript::Property *property; - QDeclarativeScript::Variant expression; - QDeclarativeCompilerTypes::IdList *ids; - QDeclarativeTypeNameCache *importCache; - QDeclarativeImports imports; + Expression(const QQmlImports &imp) : imports(imp) {} + QQmlScript::Object *component; + QQmlScript::Object *context; + QQmlScript::Property *property; + QQmlScript::Variant expression; + QQmlCompilerTypes::IdList *ids; + QQmlTypeNameCache *importCache; + QQmlImports imports; }; // -1 on failure, otherwise the binding index to use - int compile(const Expression &, QDeclarativeEnginePrivate *); + int compile(const Expression &, QQmlEnginePrivate *); // Returns the compiled program QByteArray program() const; diff --git a/src/declarative/qml/v4/qv4compiler_p_p.h b/src/qml/qml/v4/qv4compiler_p_p.h index 85a7c36f87..4b74a1d1c5 100644 --- a/src/declarative/qml/v4/qv4compiler_p_p.h +++ b/src/qml/qml/v4/qv4compiler_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -55,16 +55,16 @@ #include "qv4instruction_p.h" #include "qv4ir_p.h" -#include <private/qdeclarativescript_p.h> -#include <private/qdeclarativeimport_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlscript_p.h> +#include <private/qqmlimport_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE template <typename _Key, typename _Value> -class QDeclarativeAssociationList +class QQmlAssociationList { public: typedef QVarLengthArray<QPair<_Key, _Value>, 8> Container; @@ -111,8 +111,8 @@ private: Container _container; }; -class QV4CompilerPrivate: protected QDeclarativeJS::IR::ExprVisitor, - protected QDeclarativeJS::IR::StmtVisitor +class QV4CompilerPrivate: protected QQmlJS::IR::ExprVisitor, + protected QQmlJS::IR::StmtVisitor { public: QV4CompilerPrivate(); @@ -121,15 +121,15 @@ public: int commitCompile(); const QV4Compiler::Expression *expression; - QDeclarativeEnginePrivate *engine; + QQmlEnginePrivate *engine; QString contextName() const { return QLatin1String("$$$SCOPE_") + QString::number((quintptr)expression->context, 16); } - bool compile(QDeclarativeJS::AST::Node *); + bool compile(QQmlJS::AST::Node *); int registerLiteralString(quint8 reg, const QStringRef &); int registerString(const QString &); - QDeclarativeAssociationList<QString, QPair<int, int> > registeredStrings; + QQmlAssociationList<QString, QPair<int, int> > registeredStrings; QByteArray data; bool blockNeedsSubscription(const QStringList &); @@ -137,36 +137,36 @@ public: quint32 subscriptionBlockMask(const QStringList &); quint8 exceptionId(quint32 line, quint32 column); - quint8 exceptionId(QDeclarativeJS::AST::ExpressionNode *); + quint8 exceptionId(QQmlJS::AST::ExpressionNode *); QVector<quint64> exceptions; - QDeclarativeAssociationList<int, quint32> usedSubscriptionIds; + QQmlAssociationList<int, quint32> usedSubscriptionIds; - QDeclarativeAssociationList<QString, int> subscriptionIds; - QDeclarativeJS::Bytecode bytecode; + QQmlAssociationList<QString, int> subscriptionIds; + QQmlJS::Bytecode bytecode; // back patching struct Patch { - QDeclarativeJS::IR::BasicBlock *block; // the basic block + QQmlJS::IR::BasicBlock *block; // the basic block int offset; // the index of the instruction to patch - Patch(QDeclarativeJS::IR::BasicBlock *block = 0, int index = -1) + Patch(QQmlJS::IR::BasicBlock *block = 0, int index = -1) : block(block), offset(index) {} }; QVector<Patch> patches; - QDeclarativePool pool; + QQmlPool pool; // Committed binding data struct { QList<int> offsets; - QList<QDeclarativeAssociationList<int, quint32> > dependencies; + QList<QQmlAssociationList<int, quint32> > dependencies; - //QDeclarativeJS::Bytecode bytecode; + //QQmlJS::Bytecode bytecode; QByteArray bytecode; QByteArray data; - QDeclarativeAssociationList<QString, int> subscriptionIds; + QQmlAssociationList<QString, int> subscriptionIds; QVector<quint64> exceptions; - QDeclarativeAssociationList<QString, QPair<int, int> > registeredStrings; + QQmlAssociationList<QString, QPair<int, int> > registeredStrings; int count() const { return offsets.count(); } } committed; @@ -174,13 +174,13 @@ public: QByteArray buildSignalTable() const; QByteArray buildExceptionData() const; - void convertToReal(QDeclarativeJS::IR::Expr *expr, int reg); - void convertToInt(QDeclarativeJS::IR::Expr *expr, int reg); - void convertToBool(QDeclarativeJS::IR::Expr *expr, int reg); - quint8 instructionOpcode(QDeclarativeJS::IR::Binop *e); + void convertToReal(QQmlJS::IR::Expr *expr, int reg); + void convertToInt(QQmlJS::IR::Expr *expr, int reg); + void convertToBool(QQmlJS::IR::Expr *expr, int reg); + quint8 instructionOpcode(QQmlJS::IR::Binop *e); struct Instr { -#define QML_V4_INSTR_DATA_TYPEDEF(I, FMT) typedef QDeclarativeJS::V4InstrData<QDeclarativeJS::V4Instr::I> I; +#define QML_V4_INSTR_DATA_TYPEDEF(I, FMT) typedef QQmlJS::V4InstrData<QQmlJS::V4Instr::I> I; FOR_EACH_V4_INSTR(QML_V4_INSTR_DATA_TYPEDEF) #undef QML_v4_INSTR_DATA_TYPEDEF private: @@ -192,42 +192,42 @@ protected: // tracing // void trace(int line, int column); - void trace(QVector<QDeclarativeJS::IR::BasicBlock *> *blocks); - void traceExpression(QDeclarativeJS::IR::Expr *e, quint8 r); + void trace(QVector<QQmlJS::IR::BasicBlock *> *blocks); + void traceExpression(QQmlJS::IR::Expr *e, quint8 r); template <int Instr> - inline void gen(const QDeclarativeJS::V4InstrData<Instr> &i) + inline void gen(const QQmlJS::V4InstrData<Instr> &i) { bytecode.append(i); } - inline void gen(QDeclarativeJS::V4Instr::Type type, QDeclarativeJS::V4Instr &instr) + inline void gen(QQmlJS::V4Instr::Type type, QQmlJS::V4Instr &instr) { bytecode.append(type, instr); } - inline QDeclarativeJS::V4Instr::Type instructionType(const QDeclarativeJS::V4Instr *i) const + inline QQmlJS::V4Instr::Type instructionType(const QQmlJS::V4Instr *i) const { return bytecode.instructionType(i); } // // expressions // - virtual void visitConst(QDeclarativeJS::IR::Const *e); - virtual void visitString(QDeclarativeJS::IR::String *e); - virtual void visitName(QDeclarativeJS::IR::Name *e); - virtual void visitTemp(QDeclarativeJS::IR::Temp *e); - virtual void visitUnop(QDeclarativeJS::IR::Unop *e); - virtual void visitBinop(QDeclarativeJS::IR::Binop *e); - virtual void visitCall(QDeclarativeJS::IR::Call *e); + virtual void visitConst(QQmlJS::IR::Const *e); + virtual void visitString(QQmlJS::IR::String *e); + virtual void visitName(QQmlJS::IR::Name *e); + virtual void visitTemp(QQmlJS::IR::Temp *e); + virtual void visitUnop(QQmlJS::IR::Unop *e); + virtual void visitBinop(QQmlJS::IR::Binop *e); + virtual void visitCall(QQmlJS::IR::Call *e); // // statements // - virtual void visitExp(QDeclarativeJS::IR::Exp *s); - virtual void visitMove(QDeclarativeJS::IR::Move *s); - virtual void visitJump(QDeclarativeJS::IR::Jump *s); - virtual void visitCJump(QDeclarativeJS::IR::CJump *s); - virtual void visitRet(QDeclarativeJS::IR::Ret *s); + virtual void visitExp(QQmlJS::IR::Exp *s); + virtual void visitMove(QQmlJS::IR::Move *s); + virtual void visitJump(QQmlJS::IR::Jump *s); + virtual void visitCJump(QQmlJS::IR::CJump *s); + virtual void visitRet(QQmlJS::IR::Ret *s); private: QStringList _subscribeName; - QDeclarativeJS::IR::Function *_function; - QDeclarativeJS::IR::BasicBlock *_block; + QQmlJS::IR::Function *_function; + QQmlJS::IR::BasicBlock *_block; void discard() { _discarded = true; } bool _discarded; quint8 currentReg; diff --git a/src/declarative/qml/v4/qv4instruction.cpp b/src/qml/qml/v4/qv4instruction.cpp index d470b5b841..08b2570747 100644 --- a/src/declarative/qml/v4/qv4instruction.cpp +++ b/src/qml/qml/v4/qv4instruction.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,7 +43,7 @@ #include "qv4bindings_p.h" #include <QtCore/qdebug.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlglobal_p.h> // Define this to do a test dump of all the instructions at startup. This is // helpful to test that each instruction's Instr::dump() case uses the correct @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { #ifdef DEBUG_INSTR_DUMP static struct DumpInstrAtStartup { diff --git a/src/declarative/qml/v4/qv4instruction_p.h b/src/qml/qml/v4/qv4instruction_p.h index 477a085dd7..8150eedf54 100644 --- a/src/declarative/qml/v4/qv4instruction_p.h +++ b/src/qml/qml/v4/qv4instruction_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -58,7 +58,7 @@ #include <QtCore/qvector.h> #include <QtCore/qvarlengtharray.h> -#include <private/qdeclarativepropertycache_p.h> +#include <private/qqmlpropertycache_p.h> QT_BEGIN_HEADER @@ -173,9 +173,9 @@ QT_BEGIN_NAMESPACE #endif class QObject; -class QDeclarativeNotifier; +class QQmlNotifier; -namespace QDeclarativeJS { +namespace QQmlJS { union V4Instr { enum Type { @@ -241,7 +241,7 @@ union V4Instr { quint8 exceptionId; quint8 valueType; quint16 subscription; - QDeclarativePropertyRawData property; + QQmlPropertyRawData property; }; struct instr_fetch{ diff --git a/src/declarative/qml/v4/qv4ir.cpp b/src/qml/qml/v4/qv4ir.cpp index 149479d757..be822145a4 100644 --- a/src/declarative/qml/v4/qv4ir.cpp +++ b/src/qml/qml/v4/qv4ir.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE -namespace QDeclarativeJS { +namespace QQmlJS { namespace IR { inline const char *typeName(Type t) @@ -480,7 +480,7 @@ Name *BasicBlock::NAME(Name *base, const QString &id, quint32 line, quint32 colu return e; } -Name *BasicBlock::SYMBOL(Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage, +Name *BasicBlock::SYMBOL(Type type, const QString &id, const QMetaObject *meta, QQmlPropertyData *property, Name::Storage storage, quint32 line, quint32 column) { Name *name = SYMBOL(/*base = */ 0, type, id, meta, property, line, column); @@ -488,7 +488,7 @@ Name *BasicBlock::SYMBOL(Type type, const QString &id, const QMetaObject *meta, return name; } -Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage, +Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QQmlPropertyData *property, Name::Storage storage, quint32 line, quint32 column) { Name *name = function->pool->New<Name>(); @@ -500,7 +500,7 @@ Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaOb return name; } -Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, +Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QQmlPropertyData *property, quint32 line, quint32 column) { Name *name = function->pool->New<Name>(); @@ -511,7 +511,7 @@ Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaOb return name; } -Name *BasicBlock::ID_OBJECT(const QString &id, const QDeclarativeScript::Object *object, quint32 line, quint32 column) +Name *BasicBlock::ID_OBJECT(const QString &id, const QQmlScript::Object *object, quint32 line, quint32 column) { Name *name = function->pool->New<Name>(); name->init(/*base = */ 0, IR::ObjectType, @@ -523,7 +523,7 @@ Name *BasicBlock::ID_OBJECT(const QString &id, const QDeclarativeScript::Object return name; } -Name *BasicBlock::ATTACH_TYPE(const QString &id, const QDeclarativeType *attachType, Name::Storage storage, +Name *BasicBlock::ATTACH_TYPE(const QString &id, const QQmlType *attachType, Name::Storage storage, quint32 line, quint32 column) { Name *name = function->pool->New<Name>(); @@ -713,7 +713,7 @@ void IRDump::dec() void IRDump::dec(); -void IRDump::expression(QDeclarativeJS::IR::Expr *e) +void IRDump::expression(QQmlJS::IR::Expr *e) { inc(); @@ -722,7 +722,7 @@ void IRDump::expression(QDeclarativeJS::IR::Expr *e) dec(); } -void IRDump::basicblock(QDeclarativeJS::IR::BasicBlock *b) +void IRDump::basicblock(QQmlJS::IR::BasicBlock *b) { inc(); @@ -737,7 +737,7 @@ void IRDump::basicblock(QDeclarativeJS::IR::BasicBlock *b) dec(); } -void IRDump::statement(QDeclarativeJS::IR::Stmt *s) +void IRDump::statement(QQmlJS::IR::Stmt *s) { inc(); @@ -746,7 +746,7 @@ void IRDump::statement(QDeclarativeJS::IR::Stmt *s) dec(); } -void IRDump::function(QDeclarativeJS::IR::Function *f) +void IRDump::function(QQmlJS::IR::Function *f) { inc(); @@ -764,35 +764,35 @@ const char *IRDump::indent() return indentData.constData(); } -void IRDump::visitConst(QDeclarativeJS::IR::Const *e) +void IRDump::visitConst(QQmlJS::IR::Const *e) { qWarning().nospace() << indent() << "Const:Expr { type: " << typeName(e->type) << ", value: " << e->value << "}"; } -void IRDump::visitString(QDeclarativeJS::IR::String *e) +void IRDump::visitString(QQmlJS::IR::String *e) { qWarning().nospace() << indent() << "String:Expr { type: " << typeName(e->type) << ", value: " << e->value << "}"; } -static void namedumprecur(QDeclarativeJS::IR::Name *e, const char *indent) +static void namedumprecur(QQmlJS::IR::Name *e, const char *indent) { if (e->base) namedumprecur(e->base, indent); qWarning().nospace() << indent << " { type: " << typeName(e->type) << ", symbol: " << symbolname(e->symbol) << ", storage: " << storagename(e->storage) << ", id: " << e->id << "}"; } -void IRDump::visitName(QDeclarativeJS::IR::Name *e) +void IRDump::visitName(QQmlJS::IR::Name *e) { qWarning().nospace() << indent() << "Name:Expr {"; namedumprecur(e, indent()); qWarning().nospace() << indent() << "}"; } -void IRDump::visitTemp(QDeclarativeJS::IR::Temp *e) +void IRDump::visitTemp(QQmlJS::IR::Temp *e) { qWarning().nospace() << indent() << "Temp:Expr { type: " << typeName(e->type) << ", index: " << e->index << " }"; } -void IRDump::visitUnop(QDeclarativeJS::IR::Unop *e) +void IRDump::visitUnop(QQmlJS::IR::Unop *e) { qWarning().nospace() << indent() << "Unop:Expr { "; qWarning().nospace() << indent() << " type: " << typeName(e->type) << ", op: " << opname(e->op); @@ -802,7 +802,7 @@ void IRDump::visitUnop(QDeclarativeJS::IR::Unop *e) qWarning().nospace() << indent() << "}"; } -void IRDump::visitBinop(QDeclarativeJS::IR::Binop *e) +void IRDump::visitBinop(QQmlJS::IR::Binop *e) { qWarning().nospace() << indent() << "Binop:Expr { "; qWarning().nospace() << indent() << " type: " << typeName(e->type) << ", op: " << opname(e->op); @@ -819,20 +819,20 @@ void IRDump::visitBinop(QDeclarativeJS::IR::Binop *e) qWarning().nospace() << indent() << "}"; } -void IRDump::visitCall(QDeclarativeJS::IR::Call *e) +void IRDump::visitCall(QQmlJS::IR::Call *e) { Q_UNUSED(e); qWarning().nospace() << indent() << "Exp::Call { }"; } -void IRDump::visitExp(QDeclarativeJS::IR::Exp *s) +void IRDump::visitExp(QQmlJS::IR::Exp *s) { qWarning().nospace() << indent() << "Exp:Stmt {"; expression(s->expr); qWarning().nospace() << indent() << "}"; } -void IRDump::visitMove(QDeclarativeJS::IR::Move *s) +void IRDump::visitMove(QQmlJS::IR::Move *s) { qWarning().nospace() << indent() << "Move:Stmt {"; qWarning().nospace() << indent() << " isMoveForReturn: " << s->isMoveForReturn; @@ -849,12 +849,12 @@ void IRDump::visitMove(QDeclarativeJS::IR::Move *s) qWarning().nospace() << indent() << "}"; } -void IRDump::visitJump(QDeclarativeJS::IR::Jump *s) +void IRDump::visitJump(QQmlJS::IR::Jump *s) { qWarning().nospace() << indent() << "Jump:Stmt { BasicBlock(" << s->target << ") }"; } -void IRDump::visitCJump(QDeclarativeJS::IR::CJump *s) +void IRDump::visitCJump(QQmlJS::IR::CJump *s) { qWarning().nospace() << indent() << "CJump:Stmt {"; qWarning().nospace() << indent() << " cond: {"; @@ -867,7 +867,7 @@ void IRDump::visitCJump(QDeclarativeJS::IR::CJump *s) qWarning().nospace() << indent() << "}"; } -void IRDump::visitRet(QDeclarativeJS::IR::Ret *s) +void IRDump::visitRet(QQmlJS::IR::Ret *s) { qWarning().nospace() << indent() << "Ret:Stmt {"; qWarning().nospace() << indent() << " type: " << typeName(s->type); @@ -877,6 +877,6 @@ void IRDump::visitRet(QDeclarativeJS::IR::Ret *s) #endif } // end of namespace IR -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS QT_END_NAMESPACE diff --git a/src/declarative/qml/v4/qv4ir_p.h b/src/qml/qml/v4/qv4ir_p.h index 746995e5be..48a08adf9f 100644 --- a/src/declarative/qml/v4/qv4ir_p.h +++ b/src/qml/qml/v4/qv4ir_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,14 +53,14 @@ // We mean it. // -#include <private/qdeclarativejsast_p.h> -#include <private/qdeclarativejsengine_p.h> -#include <private/qdeclarativescript_p.h> -#include <private/qdeclarativeimport_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmljsast_p.h> +#include <private/qqmljsengine_p.h> +#include <private/qqmlscript_p.h> +#include <private/qqmlimport_p.h> +#include <private/qqmlengine_p.h> #include <private/qv4compiler_p.h> -#include <private/qdeclarativepool_p.h> +#include <private/qqmlpool_p.h> #include <QtCore/qvarlengtharray.h> // #define DEBUG_IR_STRUCTURE @@ -70,9 +70,9 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QTextStream; -class QDeclarativeType; +class QQmlType; -namespace QDeclarativeJS { +namespace QQmlJS { namespace IR { @@ -174,7 +174,7 @@ struct StmtVisitor { virtual void visitRet(Ret *) {} }; -struct Expr: QDeclarativePool::POD { +struct Expr: QQmlPool::POD { Type type; Expr(): type(InvalidType) {} @@ -190,7 +190,7 @@ struct Expr: QDeclarativePool::POD { virtual void dump(QTextStream &out) = 0; }; -struct ExprList: QDeclarativePool::POD { +struct ExprList: QQmlPool::POD { Expr *expr; ExprList *next; @@ -265,10 +265,10 @@ struct Name: Expr { union { void *ptr; const QMetaObject *meta; - const QDeclarativeType *declarativeType; - const QDeclarativeScript::Object *idObject; + const QQmlType *declarativeType; + const QQmlScript::Object *idObject; }; - QDeclarativePropertyData *property; + QQmlPropertyData *property; Storage storage; BuiltinSymbol builtin; quint32 line; @@ -368,7 +368,7 @@ private: static Type typeForFunction(Expr *base); }; -struct Stmt: QDeclarativePool::POD { +struct Stmt: QQmlPool::POD { enum Mode { HIR, MIR @@ -477,11 +477,11 @@ struct Ret: Stmt { }; struct Function { - QDeclarativePool *pool; + QQmlPool *pool; QVarLengthArray<BasicBlock *, 8> basicBlocks; int tempCount; - Function(QDeclarativePool *pool) + Function(QQmlPool *pool) : pool(pool), tempCount(0) {} ~Function(); @@ -530,11 +530,11 @@ struct BasicBlock { Name *NAME(const QString &id, quint32 line, quint32 column); Name *NAME(Name *base, const QString &id, quint32 line, quint32 column); - Name *SYMBOL(Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage, quint32 line, quint32 column); - Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, quint32 line, quint32 column); - Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage, quint32 line, quint32 column); - Name *ID_OBJECT(const QString &id, const QDeclarativeScript::Object *object, quint32 line, quint32 column); - Name *ATTACH_TYPE(const QString &id, const QDeclarativeType *attachType, Name::Storage storage, quint32 line, quint32 column); + Name *SYMBOL(Type type, const QString &id, const QMetaObject *meta, QQmlPropertyData *property, Name::Storage storage, quint32 line, quint32 column); + Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QQmlPropertyData *property, quint32 line, quint32 column); + Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QQmlPropertyData *property, Name::Storage storage, quint32 line, quint32 column); + Name *ID_OBJECT(const QString &id, const QQmlScript::Object *object, quint32 line, quint32 column); + Name *ATTACH_TYPE(const QString &id, const QQmlType *attachType, Name::Storage storage, quint32 line, quint32 column); Expr *UNOP(AluOp op, Expr *expr); Expr *BINOP(AluOp op, Expr *left, Expr *right); @@ -557,10 +557,10 @@ struct IRDump : public ExprVisitor, public: IRDump(); - void expression(QDeclarativeJS::IR::Expr *); - void basicblock(QDeclarativeJS::IR::BasicBlock *); - void statement(QDeclarativeJS::IR::Stmt *); - void function(QDeclarativeJS::IR::Function *); + void expression(QQmlJS::IR::Expr *); + void basicblock(QQmlJS::IR::BasicBlock *); + void statement(QQmlJS::IR::Stmt *); + void function(QQmlJS::IR::Function *); protected: const char *indent(); @@ -568,22 +568,22 @@ protected: // // expressions // - virtual void visitConst(QDeclarativeJS::IR::Const *e); - virtual void visitString(QDeclarativeJS::IR::String *e); - virtual void visitName(QDeclarativeJS::IR::Name *e); - virtual void visitTemp(QDeclarativeJS::IR::Temp *e); - virtual void visitUnop(QDeclarativeJS::IR::Unop *e); - virtual void visitBinop(QDeclarativeJS::IR::Binop *e); - virtual void visitCall(QDeclarativeJS::IR::Call *e); + virtual void visitConst(QQmlJS::IR::Const *e); + virtual void visitString(QQmlJS::IR::String *e); + virtual void visitName(QQmlJS::IR::Name *e); + virtual void visitTemp(QQmlJS::IR::Temp *e); + virtual void visitUnop(QQmlJS::IR::Unop *e); + virtual void visitBinop(QQmlJS::IR::Binop *e); + virtual void visitCall(QQmlJS::IR::Call *e); // // statements // - virtual void visitExp(QDeclarativeJS::IR::Exp *s); - virtual void visitMove(QDeclarativeJS::IR::Move *s); - virtual void visitJump(QDeclarativeJS::IR::Jump *s); - virtual void visitCJump(QDeclarativeJS::IR::CJump *s); - virtual void visitRet(QDeclarativeJS::IR::Ret *s); + virtual void visitExp(QQmlJS::IR::Exp *s); + virtual void visitMove(QQmlJS::IR::Move *s); + virtual void visitJump(QQmlJS::IR::Jump *s); + virtual void visitCJump(QQmlJS::IR::CJump *s); + virtual void visitRet(QQmlJS::IR::Ret *s); private: int indentSize; @@ -595,7 +595,7 @@ private: } // end of namespace IR -} // end of namespace QDeclarativeJS +} // end of namespace QQmlJS QT_END_NAMESPACE diff --git a/src/declarative/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp index 604eeaa713..1956be8e72 100644 --- a/src/declarative/qml/v4/qv4irbuilder.cpp +++ b/src/qml/qml/v4/qv4irbuilder.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,16 +42,17 @@ #include "qv4irbuilder_p.h" #include "qv4compiler_p_p.h" -#include <private/qdeclarativemetatype_p.h> -#include <private/qdeclarativetypenamecache_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlmetatype_p.h> +#include <private/qqmltypenamecache_p.h> DEFINE_BOOL_CONFIG_OPTION(qmlVerboseCompiler, QML_VERBOSE_COMPILER) QT_BEGIN_NAMESPACE -using namespace QDeclarativeJS; +using namespace QQmlJS; -static IR::Type irTypeFromVariantType(int t, QDeclarativeEnginePrivate *engine, const QMetaObject * /* meta */) +static IR::Type irTypeFromVariantType(int t, QQmlEnginePrivate *engine, const QMetaObject * /* meta */) { switch (t) { case QMetaType::Bool: @@ -70,7 +71,7 @@ static IR::Type irTypeFromVariantType(int t, QDeclarativeEnginePrivate *engine, return IR::UrlType; default: - if (t == QDeclarativeMetaType::QQuickAnchorLineMetaTypeId()) { + if (t == QQmlMetaType::QQuickAnchorLineMetaTypeId()) { return IR::SGAnchorLineType; } else if (engine->metaObjectForType(t)) { return IR::ObjectType; @@ -81,13 +82,13 @@ static IR::Type irTypeFromVariantType(int t, QDeclarativeEnginePrivate *engine, } QV4IRBuilder::QV4IRBuilder(const QV4Compiler::Expression *expr, - QDeclarativeEnginePrivate *engine) + QQmlEnginePrivate *engine) : m_expression(expr), m_engine(engine), _function(0), _block(0), _discard(false) { } -bool QV4IRBuilder::operator()(QDeclarativeJS::IR::Function *function, - QDeclarativeJS::AST::Node *ast) +bool QV4IRBuilder::operator()(QQmlJS::IR::Function *function, + QQmlJS::AST::Node *ast) { bool discarded = false; @@ -413,14 +414,14 @@ bool QV4IRBuilder::visit(AST::IdentifierExpression *ast) } else if (m_engine->v8engine()->illegalNames().contains(name) ) { if (qmlVerboseCompiler()) qWarning() << "*** illegal symbol:" << name; return false; - } else if (const QDeclarativeScript::Object *obj = m_expression->ids->value(name)) { + } else if (const QQmlScript::Object *obj = m_expression->ids->value(name)) { IR::Name *code = _block->ID_OBJECT(name, obj, line, column); if (obj == m_expression->component) code->storage = IR::Name::RootStorage; _expr.code = code; } else { - QDeclarativeTypeNameCache::Result r = m_expression->importCache->query(name); + QQmlTypeNameCache::Result r = m_expression->importCache->query(name); if (r.isValid()) { if (r.type) { _expr.code = _block->ATTACH_TYPE(name, r.type, IR::Name::ScopeStorage, line, column); @@ -431,11 +432,11 @@ bool QV4IRBuilder::visit(AST::IdentifierExpression *ast) if (m_expression->context != m_expression->component) { // RootStorage is more efficient than ScopeStorage, so prefer that if they are the same - QDeclarativePropertyCache *cache = m_expression->context->synthCache; + QQmlPropertyCache *cache = m_expression->context->synthCache; const QMetaObject *metaObject = m_expression->context->metaObject(); if (!cache) cache = m_engine->cache(metaObject); - QDeclarativePropertyData *data = cache->property(name); + QQmlPropertyData *data = cache->property(name); if (data && data->revision != 0) { if (qmlVerboseCompiler()) @@ -452,11 +453,11 @@ bool QV4IRBuilder::visit(AST::IdentifierExpression *ast) } if (!found) { - QDeclarativePropertyCache *cache = m_expression->component->synthCache; + QQmlPropertyCache *cache = m_expression->component->synthCache; const QMetaObject *metaObject = m_expression->component->metaObject(); if (!cache) cache = m_engine->cache(metaObject); - QDeclarativePropertyData *data = cache->property(name); + QQmlPropertyData *data = cache->property(name); if (data && data->revision != 0) { if (qmlVerboseCompiler()) @@ -581,8 +582,8 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast) qWarning() << "*** unresolved enum:" << (*baseName->id + QLatin1String(".") + ast->name.toString()); } else if(const QMetaObject *attachedMeta = baseName->declarativeType->attachedPropertiesType()) { - QDeclarativePropertyCache *cache = m_engine->cache(attachedMeta); - QDeclarativePropertyData *data = cache->property(name); + QQmlPropertyCache *cache = m_engine->cache(attachedMeta); + QQmlPropertyData *data = cache->property(name); if (!data || data->isFunction()) return false; // Don't support methods (or non-existing properties ;) @@ -600,11 +601,11 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast) break; case IR::Name::IdObject: { - const QDeclarativeScript::Object *idObject = baseName->idObject; - QDeclarativePropertyCache *cache = + const QQmlScript::Object *idObject = baseName->idObject; + QQmlPropertyCache *cache = idObject->synthCache?idObject->synthCache:m_engine->cache(idObject->metaObject()); - QDeclarativePropertyData *data = cache->property(name); + QQmlPropertyData *data = cache->property(name); if (!data || data->isFunction()) return false; // Don't support methods (or non-existing properties ;) @@ -624,11 +625,11 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast) case IR::Name::Property: if (baseName->type == IR::ObjectType && baseName->meta && baseName->property->isFinal()) { - QDeclarativePropertyCache *cache = m_engine->cache(baseName->meta); + QQmlPropertyCache *cache = m_engine->cache(baseName->meta); if (!cache) return false; - if (QDeclarativePropertyData *data = cache->property(name)) { + if (QQmlPropertyData *data = cache->property(name)) { if (!data->isFinal()) { if (qmlVerboseCompiler()) qWarning() << "*** non-final property access:" diff --git a/src/qml/qml/v4/qv4irbuilder_p.h b/src/qml/qml/v4/qv4irbuilder_p.h new file mode 100644 index 0000000000..2b338c0778 --- /dev/null +++ b/src/qml/qml/v4/qv4irbuilder_p.h @@ -0,0 +1,240 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QV4IRBUILDER_P_H +#define QV4IRBUILDER_P_H + +#include <QtCore/qglobal.h> + +#include "qv4ir_p.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QV4IRBuilder : public QQmlJS::AST::Visitor +{ +public: + QV4IRBuilder(const QV4Compiler::Expression *, QQmlEnginePrivate *); + + bool operator()(QQmlJS::IR::Function *, QQmlJS::AST::Node *); + +protected: + struct ExprResult { + enum Format { + ex, // expression + cx // condition + }; + + QQmlJS::IR::Expr *code; + QQmlJS::IR::BasicBlock *iftrue; + QQmlJS::IR::BasicBlock *iffalse; + Format hint; // requested format + Format format; // instruction format + + ExprResult(QQmlJS::IR::Expr *expr = 0) + : code(expr), iftrue(0), iffalse(0), hint(ex), format(ex) {} + + ExprResult(QQmlJS::IR::BasicBlock *iftrue, QQmlJS::IR::BasicBlock *iffalse) + : code(0), iftrue(iftrue), iffalse(iffalse), hint(cx), format(ex) {} + + inline QQmlJS::IR::Type type() const { return code ? code->type : QQmlJS::IR::InvalidType; } + + inline QQmlJS::IR::Expr *get() const { return code; } + inline operator QQmlJS::IR::Expr *() const { return get(); } + inline QQmlJS::IR::Expr *operator->() const { return get(); } + inline bool isValid() const { return code ? code->type != QQmlJS::IR::InvalidType : false; } + inline bool is(QQmlJS::IR::Type t) const { return type() == t; } + inline bool isNot(QQmlJS::IR::Type t) const { return type() != t; } + + bool isPrimitive() const { + switch (type()) { + case QQmlJS::IR::UndefinedType: // ### TODO + case QQmlJS::IR::NullType: // ### TODO + case QQmlJS::IR::UrlType: // ### TODO + return false; + + case QQmlJS::IR::StringType: + case QQmlJS::IR::BoolType: + case QQmlJS::IR::IntType: + case QQmlJS::IR::RealType: + case QQmlJS::IR::RealNaNType: + return true; + + default: + return false; + } // switch + } + }; + + inline void accept(QQmlJS::AST::Node *ast) { QQmlJS::AST::Node::accept(ast, this); } + + ExprResult expression(QQmlJS::AST::ExpressionNode *ast); + ExprResult statement(QQmlJS::AST::Statement *ast); + void sourceElement(QQmlJS::AST::SourceElement *ast); + void condition(QQmlJS::AST::ExpressionNode *ast, QQmlJS::IR::BasicBlock *iftrue, QQmlJS::IR::BasicBlock *iffalse); + void binop(QQmlJS::AST::BinaryExpression *ast, ExprResult left, ExprResult right); + + void implicitCvt(ExprResult &expr, QQmlJS::IR::Type type); + + virtual bool preVisit(QQmlJS::AST::Node *ast); + + // QML + virtual bool visit(QQmlJS::AST::UiProgram *ast); + virtual bool visit(QQmlJS::AST::UiImportList *ast); + virtual bool visit(QQmlJS::AST::UiImport *ast); + virtual bool visit(QQmlJS::AST::UiPublicMember *ast); + virtual bool visit(QQmlJS::AST::UiSourceElement *ast); + virtual bool visit(QQmlJS::AST::UiObjectDefinition *ast); + virtual bool visit(QQmlJS::AST::UiObjectInitializer *ast); + virtual bool visit(QQmlJS::AST::UiObjectBinding *ast); + virtual bool visit(QQmlJS::AST::UiScriptBinding *ast); + virtual bool visit(QQmlJS::AST::UiArrayBinding *ast); + virtual bool visit(QQmlJS::AST::UiObjectMemberList *ast); + virtual bool visit(QQmlJS::AST::UiArrayMemberList *ast); + virtual bool visit(QQmlJS::AST::UiQualifiedId *ast); + + // JS + virtual bool visit(QQmlJS::AST::Program *ast); + virtual bool visit(QQmlJS::AST::SourceElements *ast); + virtual bool visit(QQmlJS::AST::FunctionSourceElement *ast); + virtual bool visit(QQmlJS::AST::StatementSourceElement *ast); + + // object literals + virtual bool visit(QQmlJS::AST::PropertyNameAndValueList *ast); + virtual bool visit(QQmlJS::AST::IdentifierPropertyName *ast); + virtual bool visit(QQmlJS::AST::StringLiteralPropertyName *ast); + virtual bool visit(QQmlJS::AST::NumericLiteralPropertyName *ast); + + // array literals + virtual bool visit(QQmlJS::AST::ElementList *ast); + virtual bool visit(QQmlJS::AST::Elision *ast); + + // function calls + virtual bool visit(QQmlJS::AST::ArgumentList *ast); + + // expressions + virtual bool visit(QQmlJS::AST::ObjectLiteral *ast); + virtual bool visit(QQmlJS::AST::ArrayLiteral *ast); + virtual bool visit(QQmlJS::AST::ThisExpression *ast); + virtual bool visit(QQmlJS::AST::IdentifierExpression *ast); + virtual bool visit(QQmlJS::AST::NullExpression *ast); + virtual bool visit(QQmlJS::AST::TrueLiteral *ast); + virtual bool visit(QQmlJS::AST::FalseLiteral *ast); + virtual bool visit(QQmlJS::AST::StringLiteral *ast); + virtual bool visit(QQmlJS::AST::NumericLiteral *ast); + virtual bool visit(QQmlJS::AST::RegExpLiteral *ast); + virtual bool visit(QQmlJS::AST::NestedExpression *ast); + virtual bool visit(QQmlJS::AST::ArrayMemberExpression *ast); + virtual bool visit(QQmlJS::AST::FieldMemberExpression *ast); + virtual bool visit(QQmlJS::AST::NewMemberExpression *ast); + virtual bool visit(QQmlJS::AST::NewExpression *ast); + virtual bool visit(QQmlJS::AST::CallExpression *ast); + virtual bool visit(QQmlJS::AST::PostIncrementExpression *ast); + virtual bool visit(QQmlJS::AST::PostDecrementExpression *ast); + virtual bool visit(QQmlJS::AST::DeleteExpression *ast); + virtual bool visit(QQmlJS::AST::VoidExpression *ast); + virtual bool visit(QQmlJS::AST::TypeOfExpression *ast); + virtual bool visit(QQmlJS::AST::PreIncrementExpression *ast); + virtual bool visit(QQmlJS::AST::PreDecrementExpression *ast); + virtual bool visit(QQmlJS::AST::UnaryPlusExpression *ast); + virtual bool visit(QQmlJS::AST::UnaryMinusExpression *ast); + virtual bool visit(QQmlJS::AST::TildeExpression *ast); + virtual bool visit(QQmlJS::AST::NotExpression *ast); + virtual bool visit(QQmlJS::AST::BinaryExpression *ast); + virtual bool visit(QQmlJS::AST::ConditionalExpression *ast); + virtual bool visit(QQmlJS::AST::Expression *ast); + + // statements + virtual bool visit(QQmlJS::AST::Block *ast); + virtual bool visit(QQmlJS::AST::StatementList *ast); + virtual bool visit(QQmlJS::AST::VariableStatement *ast); + virtual bool visit(QQmlJS::AST::VariableDeclarationList *ast); + virtual bool visit(QQmlJS::AST::VariableDeclaration *ast); + virtual bool visit(QQmlJS::AST::EmptyStatement *ast); + virtual bool visit(QQmlJS::AST::ExpressionStatement *ast); + virtual bool visit(QQmlJS::AST::IfStatement *ast); + virtual bool visit(QQmlJS::AST::DoWhileStatement *ast); + virtual bool visit(QQmlJS::AST::WhileStatement *ast); + virtual bool visit(QQmlJS::AST::ForStatement *ast); + virtual bool visit(QQmlJS::AST::LocalForStatement *ast); + virtual bool visit(QQmlJS::AST::ForEachStatement *ast); + virtual bool visit(QQmlJS::AST::LocalForEachStatement *ast); + virtual bool visit(QQmlJS::AST::ContinueStatement *ast); + virtual bool visit(QQmlJS::AST::BreakStatement *ast); + virtual bool visit(QQmlJS::AST::ReturnStatement *ast); + virtual bool visit(QQmlJS::AST::WithStatement *ast); + virtual bool visit(QQmlJS::AST::SwitchStatement *ast); + virtual bool visit(QQmlJS::AST::CaseBlock *ast); + virtual bool visit(QQmlJS::AST::CaseClauses *ast); + virtual bool visit(QQmlJS::AST::CaseClause *ast); + virtual bool visit(QQmlJS::AST::DefaultClause *ast); + virtual bool visit(QQmlJS::AST::LabelledStatement *ast); + virtual bool visit(QQmlJS::AST::ThrowStatement *ast); + virtual bool visit(QQmlJS::AST::TryStatement *ast); + virtual bool visit(QQmlJS::AST::Catch *ast); + virtual bool visit(QQmlJS::AST::Finally *ast); + virtual bool visit(QQmlJS::AST::FunctionDeclaration *ast); + virtual bool visit(QQmlJS::AST::FunctionExpression *ast); + virtual bool visit(QQmlJS::AST::FormalParameterList *ast); + virtual bool visit(QQmlJS::AST::FunctionBody *ast); + virtual bool visit(QQmlJS::AST::DebuggerStatement *ast); + +private: + bool buildName(QList<QStringRef> &name, QQmlJS::AST::Node *node, + QList<QQmlJS::AST::ExpressionNode *> *nodes); + void discard(); + + const QV4Compiler::Expression *m_expression; + QQmlEnginePrivate *m_engine; + + QQmlJS::IR::Function *_function; + QQmlJS::IR::BasicBlock *_block; + bool _discard; + + ExprResult _expr; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QV4IRBUILDER_P_H diff --git a/src/declarative/qml/v4/qv4program_p.h b/src/qml/qml/v4/qv4program_p.h index 1f37786307..b6b03e438b 100644 --- a/src/declarative/qml/v4/qv4program_p.h +++ b/src/qml/qml/v4/qv4program_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -83,7 +83,7 @@ struct QV4Program { inline BindingReferenceList *signalTable(int signalIndex) const; }; -enum QDeclarativeRegisterType { +enum QQmlRegisterType { UndefinedType, QObjectStarType, QRealType, diff --git a/src/declarative/qml/v4/v4.pri b/src/qml/qml/v4/v4.pri index b6784851d8..b6784851d8 100644 --- a/src/declarative/qml/v4/v4.pri +++ b/src/qml/qml/v4/v4.pri diff --git a/src/declarative/qml/v8/notes.txt b/src/qml/qml/v8/notes.txt index ff5a289b7c..a4006b93c6 100644 --- a/src/declarative/qml/v8/notes.txt +++ b/src/qml/qml/v8/notes.txt @@ -1,4 +1,4 @@ Removed backwards compatible imports - QTBUG-17518 autotest print() taking objects that don't ToString() -autotest QDeclarativeV8Function +autotest QQmlV8Function diff --git a/src/declarative/qml/v8/qjsconverter_impl_p.h b/src/qml/qml/v8/qjsconverter_impl_p.h index 018c0441a2..10b8ab5fae 100644 --- a/src/declarative/qml/v8/qjsconverter_impl_p.h +++ b/src/qml/qml/v8/qjsconverter_impl_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qjsconverter_p.h b/src/qml/qml/v8/qjsconverter_p.h index 29fef3c700..29fef3c700 100644 --- a/src/declarative/qml/v8/qjsconverter_p.h +++ b/src/qml/qml/v8/qjsconverter_p.h diff --git a/src/declarative/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp index 3121d1b361..3121d1b361 100644 --- a/src/declarative/qml/v8/qjsengine.cpp +++ b/src/qml/qml/v8/qjsengine.cpp diff --git a/src/declarative/qml/v8/qjsengine.h b/src/qml/qml/v8/qjsengine.h index 94c4dffde4..1521c752d4 100644 --- a/src/declarative/qml/v8/qjsengine.h +++ b/src/qml/qml/v8/qjsengine.h @@ -29,7 +29,7 @@ #include <QtCore/qvariant.h> #include <QtCore/qsharedpointer.h> #include <QtCore/qobject.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> QT_BEGIN_HEADER @@ -42,7 +42,7 @@ template <typename T> inline T qjsvalue_cast(const QJSValue &); class QJSEnginePrivate; -class Q_DECLARATIVE_EXPORT QJSEngine +class Q_QML_EXPORT QJSEngine : public QObject { Q_OBJECT diff --git a/src/declarative/qml/v8/qjsengine_p.h b/src/qml/qml/v8/qjsengine_p.h index ecd5f7cc86..ecd5f7cc86 100644 --- a/src/declarative/qml/v8/qjsengine_p.h +++ b/src/qml/qml/v8/qjsengine_p.h diff --git a/src/declarative/qml/v8/qjsvalue.cpp b/src/qml/qml/v8/qjsvalue.cpp index e0a925c3bb..e0a925c3bb 100644 --- a/src/declarative/qml/v8/qjsvalue.cpp +++ b/src/qml/qml/v8/qjsvalue.cpp diff --git a/src/declarative/qml/v8/qjsvalue.h b/src/qml/qml/v8/qjsvalue.h index bfe0ec0951..30ea2e7345 100644 --- a/src/declarative/qml/v8/qjsvalue.h +++ b/src/qml/qml/v8/qjsvalue.h @@ -24,8 +24,9 @@ #ifndef QJSVALUE_H #define QJSVALUE_H -#include <QtCore/qstring.h> +#include <QtQml/qtqmlglobal.h> +#include <QtCore/qstring.h> #include <QtCore/qlist.h> #include <QtCore/qsharedpointer.h> #include <QtCore/qshareddata.h> @@ -48,7 +49,7 @@ class QJSValuePrivate; struct QScriptValuePrivatePointerDeleter; template <class T> class QScriptPassPointer; -class Q_DECLARATIVE_EXPORT QJSValue +class Q_QML_EXPORT QJSValue { public: enum SpecialValue { diff --git a/src/declarative/qml/v8/qjsvalue_impl_p.h b/src/qml/qml/v8/qjsvalue_impl_p.h index cd33859c50..cd33859c50 100644 --- a/src/declarative/qml/v8/qjsvalue_impl_p.h +++ b/src/qml/qml/v8/qjsvalue_impl_p.h diff --git a/src/declarative/qml/v8/qjsvalue_p.h b/src/qml/qml/v8/qjsvalue_p.h index 3eccba64bd..3eccba64bd 100644 --- a/src/declarative/qml/v8/qjsvalue_p.h +++ b/src/qml/qml/v8/qjsvalue_p.h diff --git a/src/declarative/qml/v8/qjsvalueiterator.cpp b/src/qml/qml/v8/qjsvalueiterator.cpp index 4c3fa15fd3..4c3fa15fd3 100644 --- a/src/declarative/qml/v8/qjsvalueiterator.cpp +++ b/src/qml/qml/v8/qjsvalueiterator.cpp diff --git a/src/declarative/qml/v8/qjsvalueiterator.h b/src/qml/qml/v8/qjsvalueiterator.h index 5f5446430e..c47f07d43b 100644 --- a/src/declarative/qml/v8/qjsvalueiterator.h +++ b/src/qml/qml/v8/qjsvalueiterator.h @@ -24,7 +24,7 @@ #ifndef QSCRIPTVALUEITERATOR_H #define QSCRIPTVALUEITERATOR_H -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> #include <QtCore/qscopedpointer.h> QT_BEGIN_HEADER @@ -35,7 +35,7 @@ QT_BEGIN_NAMESPACE class QString; class QJSValueIteratorPrivate; -class Q_DECLARATIVE_EXPORT QJSValueIterator +class Q_QML_EXPORT QJSValueIterator { public: QJSValueIterator(const QJSValue &value); diff --git a/src/declarative/qml/v8/qjsvalueiterator_impl_p.h b/src/qml/qml/v8/qjsvalueiterator_impl_p.h index 40814b1969..131296ecac 100644 --- a/src/declarative/qml/v8/qjsvalueiterator_impl_p.h +++ b/src/qml/qml/v8/qjsvalueiterator_impl_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL-ONLY$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qjsvalueiterator_p.h b/src/qml/qml/v8/qjsvalueiterator_p.h index d1869506e9..2a5bcdec22 100644 --- a/src/declarative/qml/v8/qjsvalueiterator_p.h +++ b/src/qml/qml/v8/qjsvalueiterator_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL-ONLY$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index 12f06e6b76..5284832ae1 100644 --- a/src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,18 +39,18 @@ ** ****************************************************************************/ -#include "qdeclarativebuiltinfunctions_p.h" +#include "qqmlbuiltinfunctions_p.h" -#include <QtDeclarative/qdeclarativecomponent.h> -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativecomponent_p.h> -#include <private/qdeclarativestringconverters_p.h> -#include <private/qdeclarativelocale_p.h> +#include <QtQml/qqmlcomponent.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlcomponent_p.h> +#include <private/qqmlstringconverters_p.h> +#include <private/qqmllocale_p.h> #include <private/qv8engine_p.h> #include <private/qjsconverter_impl_p.h> #include <private/qv8profilerservice_p.h> -#include <private/qdeclarativeprofilerservice_p.h> +#include <private/qqmlprofilerservice_p.h> #include <QtCore/qstring.h> #include <QtCore/qdatetime.h> @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE -namespace QDeclarativeBuiltinFunctions { +namespace QQmlBuiltinFunctions { enum ConsoleLogTypes { Log, @@ -206,7 +206,7 @@ v8::Handle<v8::Value> consoleProfile(const v8::Arguments &args) int line; jsContext(&file, &line, &function); - if (QDeclarativeProfilerService::startProfiling()) { + if (QQmlProfilerService::startProfiling()) { QV8ProfilerService::instance()->startProfiling(title); QMessageLogger(*v8::String::AsciiValue(file), line, @@ -233,10 +233,10 @@ v8::Handle<v8::Value> consoleProfileEnd(const v8::Arguments &args) int line; jsContext(&file, &line, &function); - if (QDeclarativeProfilerService::stopProfiling()) { + if (QQmlProfilerService::stopProfiling()) { QV8ProfilerService *profiler = QV8ProfilerService::instance(); profiler->stopProfiling(title); - QDeclarativeProfilerService::sendProfilingData(); + QQmlProfilerService::sendProfilingData(); profiler->sendProfilingData(); QMessageLogger(*v8::String::AsciiValue(file), line, @@ -557,7 +557,7 @@ v8::Handle<v8::Value> lighter(const v8::Arguments &args) color = v.value<QColor>(); } else if (v.userType() == QVariant::String) { bool ok = false; - color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok); + color = QQmlStringConverters::colorFromString(v.toString(), &ok); if (!ok) { return v8::Null(); } @@ -599,7 +599,7 @@ v8::Handle<v8::Value> darker(const v8::Arguments &args) color = v.value<QColor>(); } else if (v.userType() == QVariant::String) { bool ok = false; - color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok); + color = QQmlStringConverters::colorFromString(v.toString(), &ok); if (!ok) { return v8::Null(); } @@ -651,7 +651,7 @@ v8::Handle<v8::Value> tint(const v8::Arguments &args) color = v.value<QColor>(); } else if (v.userType() == QVariant::String) { bool ok = false; - color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok); + color = QQmlStringConverters::colorFromString(v.toString(), &ok); if (!ok) { return v8::Null(); } @@ -666,7 +666,7 @@ v8::Handle<v8::Value> tint(const v8::Arguments &args) tintColor = v.value<QColor>(); } else if (v.userType() == QVariant::String) { bool ok = false; - tintColor = QDeclarativeStringConverters::colorFromString(v.toString(), &ok); + tintColor = QQmlStringConverters::colorFromString(v.toString(), &ok); if (!ok) { return v8::Null(); } @@ -922,11 +922,11 @@ v8::Handle<v8::Value> openUrlExternally(const v8::Arguments &args) v8::Handle<v8::Value> resolvedUrl(const v8::Arguments &args) { QUrl url = V8ENGINE()->toVariant(args[0], -1).toUrl(); - QDeclarativeEngine *e = V8ENGINE()->engine(); - QDeclarativeEnginePrivate *p = 0; - if (e) p = QDeclarativeEnginePrivate::get(e); + QQmlEngine *e = V8ENGINE()->engine(); + QQmlEnginePrivate *p = 0; + if (e) p = QQmlEnginePrivate::get(e); if (p) { - QDeclarativeContextData *ctxt = V8ENGINE()->callingContext(); + QQmlContextData *ctxt = V8ENGINE()->callingContext(); if (ctxt) return V8ENGINE()->toString(ctxt->resolvedUrl(url).toString()); else @@ -993,14 +993,14 @@ v8::Handle<v8::Value> atob(const v8::Arguments &args) /*! \qmlmethod Qt::quit() -This function causes the QDeclarativeEngine::quit() signal to be emitted. +This function causes the QQmlEngine::quit() signal to be emitted. Within the \l {QML Viewer}, this causes the launcher application to exit; to quit a C++ application when this method is called, connect the -QDeclarativeEngine::quit() signal to the QCoreApplication::quit() slot. +QQmlEngine::quit() signal to the QCoreApplication::quit() slot. */ v8::Handle<v8::Value> quit(const v8::Arguments &args) { - QDeclarativeEnginePrivate::get(V8ENGINE()->engine())->sendQuit(); + QQmlEnginePrivate::get(V8ENGINE()->engine())->sendQuit(); return v8::Undefined(); } @@ -1014,7 +1014,7 @@ If \a filepath is specified, it will be used for error reporting for the created Example (where \c parentItem is the id of an existing QML item): -\snippet doc/src/snippets/declarative/createQmlObject.qml 0 +\snippet doc/src/snippets/qml/createQmlObject.qml 0 In the case of an error, a QtScript Error object is thrown. This object has an additional property, \c qmlErrors, which is an array of the errors encountered. @@ -1034,12 +1034,12 @@ v8::Handle<v8::Value> createQmlObject(const v8::Arguments &args) V8THROW_ERROR("Qt.createQmlObject(): Invalid arguments"); struct Error { - static v8::Local<v8::Value> create(QV8Engine *engine, const QList<QDeclarativeError> &errors) { + static v8::Local<v8::Value> create(QV8Engine *engine, const QList<QQmlError> &errors) { QString errorstr = QLatin1String("Qt.createQmlObject(): failed to create object: "); v8::Local<v8::Array> qmlerrors = v8::Array::New(errors.count()); for (int ii = 0; ii < errors.count(); ++ii) { - const QDeclarativeError &error = errors.at(ii); + const QQmlError &error = errors.at(ii); errorstr += QLatin1String("\n ") + error.toString(); v8::Local<v8::Object> qmlerror = v8::Object::New(); qmlerror->Set(v8::String::New("lineNumber"), v8::Integer::New(error.line())); @@ -1057,14 +1057,14 @@ v8::Handle<v8::Value> createQmlObject(const v8::Arguments &args) }; QV8Engine *v8engine = V8ENGINE(); - QDeclarativeEngine *engine = v8engine->engine(); + QQmlEngine *engine = v8engine->engine(); - QDeclarativeContextData *context = v8engine->callingContext(); - QDeclarativeContext *effectiveContext = 0; + QQmlContextData *context = v8engine->callingContext(); + QQmlContext *effectiveContext = 0; if (context->isPragmaLibraryContext) effectiveContext = engine->rootContext(); else - effectiveContext = context->asQDeclarativeContext(); + effectiveContext = context->asQQmlContext(); Q_ASSERT(context && effectiveContext); QString qml = v8engine->toString(args[0]->ToString()); @@ -1084,7 +1084,7 @@ v8::Handle<v8::Value> createQmlObject(const v8::Arguments &args) if (!parentArg) V8THROW_ERROR("Qt.createQmlObject(): Missing parent object"); - QDeclarativeComponent component(engine); + QQmlComponent component(engine); component.setData(qml.toUtf8(), url); if (component.isError()) { @@ -1097,7 +1097,7 @@ v8::Handle<v8::Value> createQmlObject(const v8::Arguments &args) QObject *obj = component.beginCreate(effectiveContext); if (obj) - QDeclarativeData::get(obj, true)->setImplicitDestructible(); + QQmlData::get(obj, true)->setImplicitDestructible(); component.completeCreate(); if (component.isError()) { @@ -1109,9 +1109,9 @@ v8::Handle<v8::Value> createQmlObject(const v8::Arguments &args) obj->setParent(parentArg); - QList<QDeclarativePrivate::AutoParentFunction> functions = QDeclarativeMetaType::parentFunctions(); + QList<QQmlPrivate::AutoParentFunction> functions = QQmlMetaType::parentFunctions(); for (int ii = 0; ii < functions.count(); ++ii) { - if (QDeclarativePrivate::Parented == functions.at(ii)(obj, parentArg)) + if (QQmlPrivate::Parented == functions.at(ii)(obj, parentArg)) break; } @@ -1133,7 +1133,7 @@ component to create an object instance of the component. For example: -\snippet doc/src/snippets/declarative/createComponent-simple.qml 0 +\snippet doc/src/snippets/qml/createComponent-simple.qml 0 See \l {Dynamic Object Management in QML} for more information on using this function. @@ -1146,10 +1146,10 @@ v8::Handle<v8::Value> createComponent(const v8::Arguments &args) V8THROW_ERROR("Qt.createComponent(): Invalid arguments"); QV8Engine *v8engine = V8ENGINE(); - QDeclarativeEngine *engine = v8engine->engine(); + QQmlEngine *engine = v8engine->engine(); - QDeclarativeContextData *context = v8engine->callingContext(); - QDeclarativeContextData *effectiveContext = context; + QQmlContextData *context = v8engine->callingContext(); + QQmlContextData *effectiveContext = context; if (context->isPragmaLibraryContext) effectiveContext = 0; Q_ASSERT(context); @@ -1159,9 +1159,9 @@ v8::Handle<v8::Value> createComponent(const v8::Arguments &args) return v8::Null(); QUrl url = context->resolvedUrl(QUrl(arg)); - QDeclarativeComponent *c = new QDeclarativeComponent(engine, url, engine); - QDeclarativeComponentPrivate::get(c)->creationContext = effectiveContext; - QDeclarativeData::get(c, true)->setImplicitDestructible(); + QQmlComponent *c = new QQmlComponent(engine, url, engine); + QQmlComponentPrivate::get(c)->creationContext = effectiveContext; + QQmlData::get(c, true)->setImplicitDestructible(); return v8engine->newQObject(c); } @@ -1228,7 +1228,7 @@ v8::Handle<v8::Value> qsTr(const v8::Arguments &args) V8THROW_ERROR("qsTr(): third argument (n) must be a number"); QV8Engine *v8engine = V8ENGINE(); - QDeclarativeContextData *ctxt = v8engine->callingContext(); + QQmlContextData *ctxt = v8engine->callingContext(); QString path = ctxt->url.toString(); int lastSlash = path.lastIndexOf(QLatin1Char('/')); @@ -1312,9 +1312,9 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args) if (args.Length() == 1) code = v8engine->toString(args[0]); - return QDeclarativeLocale::locale(v8engine, code); + return QQmlLocale::locale(v8engine, code); } -} // namespace QDeclarativeBuiltinFunctions +} // namespace QQmlBuiltinFunctions QT_END_NAMESPACE diff --git a/src/declarative/qml/v8/qdeclarativebuiltinfunctions_p.h b/src/qml/qml/v8/qqmlbuiltinfunctions_p.h index d5780dc70d..ddb1c64243 100644 --- a/src/declarative/qml/v8/qdeclarativebuiltinfunctions_p.h +++ b/src/qml/qml/v8/qqmlbuiltinfunctions_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEBUILTINFUNCTIONS_P_H -#define QDECLARATIVEBUILTINFUNCTIONS_P_H +#ifndef QQMLBUILTINFUNCTIONS_P_H +#define QQMLBUILTINFUNCTIONS_P_H // // W A R N I N G @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE -namespace QDeclarativeBuiltinFunctions +namespace QQmlBuiltinFunctions { v8::Handle<v8::Value> gc(const v8::Arguments &args); v8::Handle<v8::Value> consoleError(const v8::Arguments &args); @@ -107,4 +107,4 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args); QT_END_NAMESPACE -#endif // QDECLARATIVEBUILTINFUNCTIONS_P_H +#endif // QQMLBUILTINFUNCTIONS_P_H diff --git a/src/declarative/qml/v8/qscript_impl_p.h b/src/qml/qml/v8/qscript_impl_p.h index fdbf2f0097..fdbf2f0097 100644 --- a/src/declarative/qml/v8/qscript_impl_p.h +++ b/src/qml/qml/v8/qscript_impl_p.h diff --git a/src/declarative/qml/v8/qscriptisolate_p.h b/src/qml/qml/v8/qscriptisolate_p.h index 4afa74756f..4afa74756f 100644 --- a/src/declarative/qml/v8/qscriptisolate_p.h +++ b/src/qml/qml/v8/qscriptisolate_p.h diff --git a/src/declarative/qml/v8/qscriptoriginalglobalobject_p.h b/src/qml/qml/v8/qscriptoriginalglobalobject_p.h index 12321cc71a..12321cc71a 100644 --- a/src/declarative/qml/v8/qscriptoriginalglobalobject_p.h +++ b/src/qml/qml/v8/qscriptoriginalglobalobject_p.h diff --git a/src/declarative/qml/v8/qscriptshareddata_p.h b/src/qml/qml/v8/qscriptshareddata_p.h index df95b26206..df95b26206 100644 --- a/src/declarative/qml/v8/qscriptshareddata_p.h +++ b/src/qml/qml/v8/qscriptshareddata_p.h diff --git a/src/declarative/qml/v8/qscripttools_p.h b/src/qml/qml/v8/qscripttools_p.h index fcea205f61..fcea205f61 100644 --- a/src/declarative/qml/v8/qscripttools_p.h +++ b/src/qml/qml/v8/qscripttools_p.h diff --git a/src/declarative/qml/v8/qv8_p.h b/src/qml/qml/v8/qv8_p.h index 13867bdfc8..d6a06593f5 100644 --- a/src/declarative/qml/v8/qv8_p.h +++ b/src/qml/qml/v8/qv8_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8bindings.cpp b/src/qml/qml/v8/qv8bindings.cpp index 439ba1e1a4..76fbea137e 100644 --- a/src/declarative/qml/v8/qv8bindings.cpp +++ b/src/qml/qml/v8/qv8bindings.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,28 +42,28 @@ #include "qv8bindings_p.h" #include <private/qv8_p.h> -#include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativecompiler_p.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativebinding_p_p.h> -#include <private/qdeclarativeexpression_p.h> +#include <private/qqmlbinding_p.h> +#include <private/qqmlcompiler_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlbinding_p_p.h> +#include <private/qqmlexpression_p.h> #include <private/qobject_p.h> -#include <private/qdeclarativetrace_p.h> -#include <private/qdeclarativeprofilerservice_p.h> +#include <private/qqmltrace_p.h> +#include <private/qqmlprofilerservice_p.h> QT_BEGIN_NAMESPACE -static QDeclarativeJavaScriptExpression::VTable QV8Bindings_Binding_jsvtable = { +static QQmlJavaScriptExpression::VTable QV8Bindings_Binding_jsvtable = { QV8Bindings::Binding::expressionIdentifier, QV8Bindings::Binding::expressionChanged }; QV8Bindings::Binding::Binding() -: QDeclarativeJavaScriptExpression(&QV8Bindings_Binding_jsvtable), target(0), parent(0) +: QQmlJavaScriptExpression(&QV8Bindings_Binding_jsvtable), target(0), parent(0) { } -void QV8Bindings::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) +void QV8Bindings::Binding::setEnabled(bool e, QQmlPropertyPrivate::WriteFlags flags) { if (enabledFlag() != e) { setEnabledFlag(e); @@ -94,25 +94,25 @@ QObject *QV8Bindings::Binding::object() const return target; } -void QV8Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags) +void QV8Bindings::Binding::update(QQmlPropertyPrivate::WriteFlags flags) { if (!enabledFlag()) return; - QDeclarativeTrace trace("V8 Binding Update"); + QQmlTrace trace("V8 Binding Update"); trace.addDetail("URL", parent->url()); trace.addDetail("Line", instruction->line); trace.addDetail("Column", instruction->column); - QDeclarativeBindingProfiler prof(parent->urlString(), instruction->line, instruction->column); + QQmlBindingProfiler prof(parent->urlString(), instruction->line, instruction->column); - QDeclarativeContextData *context = parent->context(); + QQmlContextData *context = parent->context(); if (!context || !context->isValid()) return; if (!updatingFlag()) { setUpdatingFlag(true); - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context->engine); bool isUndefined = false; @@ -129,7 +129,7 @@ void QV8Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags) trace.event("writing V8 result"); bool needsErrorData = false; if (!watcher.wasDeleted() && !hasError()) { - typedef QDeclarativePropertyPrivate PP; + typedef QQmlPropertyPrivate PP; needsErrorData = !PP::writeBinding(target, instruction->property, context, this, result, isUndefined, flags); } @@ -157,23 +157,23 @@ void QV8Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags) ep->dereferenceScarceResources(); } else { - QDeclarativeProperty p = QDeclarativePropertyPrivate::restore(target, instruction->property, + QQmlProperty p = QQmlPropertyPrivate::restore(target, instruction->property, context); - QDeclarativeBindingPrivate::printBindingLoopError(p); + QQmlBindingPrivate::printBindingLoopError(p); } } -QString QV8Bindings::Binding::expressionIdentifier(QDeclarativeJavaScriptExpression *e) +QString QV8Bindings::Binding::expressionIdentifier(QQmlJavaScriptExpression *e) { Binding *This = static_cast<Binding *>(e); return This->parent->urlString() + QLatin1String(":") + QString::number(This->instruction->line); } -void QV8Bindings::Binding::expressionChanged(QDeclarativeJavaScriptExpression *e) +void QV8Bindings::Binding::expressionChanged(QQmlJavaScriptExpression *e) { Binding *This = static_cast<Binding *>(e); - This->update(QDeclarativePropertyPrivate::DontRemoveBinding); + This->update(QQmlPropertyPrivate::DontRemoveBinding); } void QV8Bindings::Binding::destroy() @@ -185,14 +185,14 @@ void QV8Bindings::Binding::destroy() parent->release(); } -QV8Bindings::QV8Bindings(QDeclarativeCompiledData::V8Program *program, +QV8Bindings::QV8Bindings(QQmlCompiledData::V8Program *program, int line, - QDeclarativeContextData *context) + QQmlContextData *context) : program(program), bindings(0), refCount(1) { program->cdata->addref(); - QV8Engine *engine = QDeclarativeEnginePrivate::getV8Engine(context->engine); + QV8Engine *engine = QQmlEnginePrivate::getV8Engine(context->engine); if (program->bindings.IsEmpty()) { v8::HandleScope handle_scope; @@ -211,12 +211,12 @@ QV8Bindings::QV8Bindings(QDeclarativeCompiledData::V8Program *program, // are not rewritten correctly but this bug is demed out-of-scope to fix for // performance reasons; see QTBUG-24064). compileFailed = true; - QDeclarativeError error; + QQmlError error; error.setDescription(QString(QLatin1String("Exception occurred during compilation of binding at line: %1")).arg(line)); v8::Local<v8::Message> message = try_catch.Message(); if (!message.IsEmpty()) - QDeclarativeExpressionPrivate::exceptionToError(message, error); - QDeclarativeEnginePrivate::get(engine->engine())->warning(error); + QQmlExpressionPrivate::exceptionToError(message, error); + QQmlEnginePrivate::get(engine->engine())->warning(error); program->bindings = qPersistentNew(v8::Array::New()); } } @@ -245,9 +245,9 @@ QV8Bindings::~QV8Bindings() bindings = 0; } -QDeclarativeAbstractBinding * +QQmlAbstractBinding * QV8Bindings::configBinding(QObject *target, QObject *scope, - const QDeclarativeInstruction::instr_assignBinding *i) + const QQmlInstruction::instr_assignBinding *i) { if (!bindings) // initialization failed. return 0; diff --git a/src/declarative/qml/v8/qv8bindings_p.h b/src/qml/qml/v8/qv8bindings_p.h index 14de2d1705..ad5b2cb8b0 100644 --- a/src/declarative/qml/v8/qv8bindings_p.h +++ b/src/qml/qml/v8/qv8bindings_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,48 +53,48 @@ // We mean it. // -#include <private/qdeclarativepropertycache_p.h> -#include <private/qdeclarativeinstruction_p.h> -#include <private/qdeclarativeexpression_p.h> -#include <private/qdeclarativecompiler_p.h> -#include <private/qdeclarativebinding_p.h> +#include <private/qqmlpropertycache_p.h> +#include <private/qqmlinstruction_p.h> +#include <private/qqmlexpression_p.h> +#include <private/qqmlcompiler_p.h> +#include <private/qqmlbinding_p.h> #include <private/qflagpointer_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeCompiledData; +class QQmlCompiledData; class QV8BindingsPrivate; -class QV8Bindings : public QDeclarativeAbstractExpression +class QV8Bindings : public QQmlAbstractExpression { public: - QV8Bindings(QDeclarativeCompiledData::V8Program *, + QV8Bindings(QQmlCompiledData::V8Program *, int line, - QDeclarativeContextData *context); + QQmlContextData *context); virtual ~QV8Bindings(); - QDeclarativeAbstractBinding *configBinding(QObject *target, QObject *scope, - const QDeclarativeInstruction::instr_assignBinding *); + QQmlAbstractBinding *configBinding(QObject *target, QObject *scope, + const QQmlInstruction::instr_assignBinding *); - // Inherited from QDeclarativeAbstractExpression + // Inherited from QQmlAbstractExpression virtual void refresh(); - struct Binding : public QDeclarativeJavaScriptExpression, - public QDeclarativeAbstractBinding { + struct Binding : public QQmlJavaScriptExpression, + public QQmlAbstractBinding { Binding(); - void update() { QDeclarativeAbstractBinding::update(); } + void update() { QQmlAbstractBinding::update(); } void refresh(); - // "Inherited" from QDeclarativeJavaScriptExpression - static QString expressionIdentifier(QDeclarativeJavaScriptExpression *); - static void expressionChanged(QDeclarativeJavaScriptExpression *); + // "Inherited" from QQmlJavaScriptExpression + static QString expressionIdentifier(QQmlJavaScriptExpression *); + static void expressionChanged(QQmlJavaScriptExpression *); - // Inherited from QDeclarativeAbstractBinding - virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags); - virtual void update(QDeclarativePropertyPrivate::WriteFlags flags); + // Inherited from QQmlAbstractBinding + virtual void setEnabled(bool, QQmlPropertyPrivate::WriteFlags flags); + virtual void update(QQmlPropertyPrivate::WriteFlags flags); virtual void destroy(); virtual int propertyIndex() const; virtual QObject *object() const; @@ -105,7 +105,7 @@ public: // To save memory, we store flags inside the instruction pointer. // flag1: enabled // flag2: updating - QFlagPointer<const QDeclarativeInstruction::instr_assignBinding> instruction; + QFlagPointer<const QQmlInstruction::instr_assignBinding> instruction; inline bool enabledFlag() const { return instruction.flag(); } inline void setEnabledFlag(bool v) { instruction.setFlagValue(v); } @@ -123,7 +123,7 @@ private: const QString &urlString() const; v8::Persistent<v8::Array> &functions() const; - QDeclarativeCompiledData::V8Program *program; + QQmlCompiledData::V8Program *program; Binding *bindings; int refCount; }; diff --git a/src/declarative/qml/v8/qv8contextwrapper.cpp b/src/qml/qml/v8/qv8contextwrapper.cpp index 8b7fbe8941..246b716aa0 100644 --- a/src/declarative/qml/v8/qv8contextwrapper.cpp +++ b/src/qml/qml/v8/qv8contextwrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,8 +42,8 @@ #include "qv8contextwrapper_p.h" #include "qv8engine_p.h" -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativecontext_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlcontext_p.h> QT_BEGIN_NAMESPACE @@ -55,10 +55,10 @@ class QV8ContextResource : public QV8ObjectResource V8_RESOURCE_TYPE(ContextType); public: - QV8ContextResource(QV8Engine *engine, QDeclarativeContextData *context, QObject *scopeObject); + QV8ContextResource(QV8Engine *engine, QQmlContextData *context, QObject *scopeObject); ~QV8ContextResource(); - inline QDeclarativeContextData *getContext() const; + inline QQmlContextData *getContext() const; inline QObject *getScopeObject() const; quint32 isSharedContext:1; @@ -75,20 +75,20 @@ public: // v8::Script::Data() later on to resolve names and URLs against the sub-context instead // of the main outer context. struct SubContext : public v8::String::ExternalStringResource { - SubContext(QDeclarativeContextData *context) : context(context) {} - QDeclarativeGuardedContextData context; + SubContext(QQmlContextData *context) : context(context) {} + QQmlGuardedContextData context; virtual const uint16_t* data() const { return (const uint16_t *)internal.constData(); } virtual size_t length() const { return internal.length(); } }; private: - QDeclarativeGuardedContextData context; - QDeclarativeGuard<QObject> scopeObject; + QQmlGuardedContextData context; + QQmlGuard<QObject> scopeObject; }; -QV8ContextResource::QV8ContextResource(QV8Engine *engine, QDeclarativeContextData *context, QObject *scopeObject) +QV8ContextResource::QV8ContextResource(QV8Engine *engine, QQmlContextData *context, QObject *scopeObject) : QV8ObjectResource(engine), isSharedContext(false), hasSubContexts(false), readOnly(true), secondaryScope(0), context(context), scopeObject(scopeObject) { @@ -104,16 +104,16 @@ QV8ContextResource::~QV8ContextResource() QObject *QV8ContextResource::getScopeObject() const { if (isSharedContext) - return QDeclarativeEnginePrivate::get(engine->engine())->sharedScope; + return QQmlEnginePrivate::get(engine->engine())->sharedScope; else return scopeObject; } // Returns the context, including resolving a subcontext -QDeclarativeContextData *QV8ContextResource::getContext() const +QQmlContextData *QV8ContextResource::getContext() const { if (isSharedContext) - return QDeclarativeEnginePrivate::get(engine->engine())->sharedContext; + return QQmlEnginePrivate::get(engine->engine())->sharedContext; if (!hasSubContexts) return context; @@ -170,7 +170,7 @@ void QV8ContextWrapper::init(QV8Engine *engine) } } -v8::Local<v8::Object> QV8ContextWrapper::qmlScope(QDeclarativeContextData *ctxt, QObject *scope) +v8::Local<v8::Object> QV8ContextWrapper::qmlScope(QQmlContextData *ctxt, QObject *scope) { // XXX NewInstance() should be optimized v8::Local<v8::Object> rv = m_constructor->NewInstance(); @@ -181,7 +181,7 @@ v8::Local<v8::Object> QV8ContextWrapper::qmlScope(QDeclarativeContextData *ctxt, v8::Local<v8::Object> QV8ContextWrapper::urlScope(const QUrl &url) { - QDeclarativeContextData *context = new QDeclarativeContextData; + QQmlContextData *context = new QQmlContextData; context->url = url; context->isInternal = true; context->isJSContext = true; @@ -201,7 +201,7 @@ void QV8ContextWrapper::setReadOnly(v8::Handle<v8::Object> qmlglobal, bool readO } void QV8ContextWrapper::addSubContext(v8::Handle<v8::Object> qmlglobal, v8::Handle<v8::Script> script, - QDeclarativeContextData *ctxt) + QQmlContextData *ctxt) { QV8ContextResource *resource = v8_resource_cast<QV8ContextResource>(qmlglobal); Q_ASSERT(resource); @@ -219,7 +219,7 @@ QObject *QV8ContextWrapper::setSecondaryScope(v8::Handle<v8::Object> ctxt, QObje return rv; } -QDeclarativeContextData *QV8ContextWrapper::callingContext() +QQmlContextData *QV8ContextWrapper::callingContext() { v8::Local<v8::Object> qmlglobal = v8::Context::GetCallingQmlGlobal(); if (qmlglobal.IsEmpty()) return 0; @@ -228,7 +228,7 @@ QDeclarativeContextData *QV8ContextWrapper::callingContext() return r?r->getContext():0; } -QDeclarativeContextData *QV8ContextWrapper::context(v8::Handle<v8::Value> value) +QQmlContextData *QV8ContextWrapper::context(v8::Handle<v8::Value> value) { if (!value->IsObject()) return 0; @@ -257,8 +257,8 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property, // Its possible we could delay the calculation of the "actual" context (in the case // of sub contexts) until it is definately needed. - QDeclarativeContextData *context = resource->getContext(); - QDeclarativeContextData *expressionContext = context; + QQmlContextData *context = resource->getContext(); + QQmlContextData *expressionContext = context; if (!context) return v8::Undefined(); @@ -283,7 +283,7 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property, if (context->imports && QV8Engine::startsWithUpper(property)) { // Search for attached properties, enums and imported scripts - QDeclarativeTypeNameCache::Result r = context->imports->query(propertystring); + QQmlTypeNameCache::Result r = context->imports->query(propertystring); if (r.isValid()) { if (r.scriptIndex != -1) { @@ -303,7 +303,7 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property, // Fall through } - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine->engine()); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine->engine()); QV8QObjectWrapper *qobjectWrapper = engine->qobjectWrapper(); if (resource->secondaryScope) { @@ -325,18 +325,18 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property, return engine->newQObject(context->idValues[propertyIdx]); } else { - QDeclarativeContextPrivate *cp = context->asQDeclarativeContextPrivate(); + QQmlContextPrivate *cp = context->asQQmlContextPrivate(); - ep->captureProperty(context->asQDeclarativeContext(), -1, + ep->captureProperty(context->asQQmlContext(), -1, propertyIdx + cp->notifyIndex); const QVariant &value = cp->propertyValues.at(propertyIdx); if (value.userType() == qMetaTypeId<QList<QObject*> >()) { - QDeclarativeListProperty<QObject> prop(context->asQDeclarativeContext(), (void*)propertyIdx, + QQmlListProperty<QObject> prop(context->asQQmlContext(), (void*)propertyIdx, 0, - QDeclarativeContextPrivate::context_count, - QDeclarativeContextPrivate::context_at); - return engine->listWrapper()->newList(prop, qMetaTypeId<QDeclarativeListProperty<QObject> >()); + QQmlContextPrivate::context_count, + QQmlContextPrivate::context_at); + return engine->listWrapper()->newList(prop, qMetaTypeId<QQmlListProperty<QObject> >()); } else { return engine->fromVariant(cp->propertyValues.at(propertyIdx)); } @@ -396,8 +396,8 @@ v8::Handle<v8::Value> QV8ContextWrapper::Setter(v8::Local<v8::String> property, // Its possible we could delay the calculation of the "actual" context (in the case // of sub contexts) until it is definately needed. - QDeclarativeContextData *context = resource->getContext(); - QDeclarativeContextData *expressionContext = context; + QQmlContextData *context = resource->getContext(); + QQmlContextData *expressionContext = context; if (!context) return v8::Undefined(); diff --git a/src/declarative/qml/v8/qv8contextwrapper_p.h b/src/qml/qml/v8/qv8contextwrapper_p.h index eabbc15f15..117f16ab39 100644 --- a/src/declarative/qml/v8/qv8contextwrapper_p.h +++ b/src/qml/qml/v8/qv8contextwrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE class QUrl; class QObject; class QV8Engine; -class QDeclarativeContextData; +class QQmlContextData; class QV8ContextWrapper { public: @@ -71,13 +71,13 @@ public: void init(QV8Engine *); void destroy(); - v8::Local<v8::Object> qmlScope(QDeclarativeContextData *ctxt, QObject *scope); + v8::Local<v8::Object> qmlScope(QQmlContextData *ctxt, QObject *scope); v8::Local<v8::Object> urlScope(const QUrl &); void setReadOnly(v8::Handle<v8::Object>, bool); void addSubContext(v8::Handle<v8::Object> qmlglobal, v8::Handle<v8::Script>, - QDeclarativeContextData *ctxt); + QQmlContextData *ctxt); // XXX We only use the secondary scope to pass the "arguments" of the signal to // on<SignalName> properties. Instead of doing this we should rewrite the @@ -86,8 +86,8 @@ public: // not members of the QV8Engine::illegalNames() set. QObject *setSecondaryScope(v8::Handle<v8::Object>, QObject *); - QDeclarativeContextData *callingContext(); - QDeclarativeContextData *context(v8::Handle<v8::Value>); + QQmlContextData *callingContext(); + QQmlContextData *context(v8::Handle<v8::Value>); inline v8::Handle<v8::Object> sharedContext() const; diff --git a/src/declarative/qml/v8/qv8debug_p.h b/src/qml/qml/v8/qv8debug_p.h index cf1d945712..4e1ec3e2ca 100644 --- a/src/declarative/qml/v8/qv8debug_p.h +++ b/src/qml/qml/v8/qv8debug_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8domerrors.cpp b/src/qml/qml/v8/qv8domerrors.cpp index 2f340e736f..7b8f10a27e 100644 --- a/src/declarative/qml/v8/qv8domerrors.cpp +++ b/src/qml/qml/v8/qv8domerrors.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8domerrors_p.h b/src/qml/qml/v8/qv8domerrors_p.h index 5131f960f1..5d5f277d55 100644 --- a/src/declarative/qml/v8/qv8domerrors_p.h +++ b/src/qml/qml/v8/qv8domerrors_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 04589fe244..4c2cce1525 100644 --- a/src/declarative/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -50,12 +50,12 @@ #include "qjsengine_p.h" #include "../../../3rdparty/javascriptcore/DateMath.h" -#include <private/qdeclarativebuiltinfunctions_p.h> -#include <private/qdeclarativelist_p.h> -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativeapplication_p.h> -#include <private/qdeclarativexmlhttprequest_p.h> -#include <private/qdeclarativelocale_p.h> +#include <private/qqmlbuiltinfunctions_p.h> +#include <private/qqmllist_p.h> +#include <private/qqmlengine_p.h> +#include <private/qquickapplication_p.h> +#include <private/qqmlxmlhttprequest_p.h> +#include <private/qqmllocale_p.h> #include "qscript_impl_p.h" #include "qv8domerrors_p.h" @@ -67,7 +67,7 @@ Q_DECLARE_METATYPE(QList<int>) // XXX TODO: Need to check all the global functions will also work in a worker script where the -// QDeclarativeEngine is not available +// QQmlEngine is not available QT_BEGIN_NAMESPACE static bool ObjectComparisonCallback(v8::Local<v8::Object> lhs, v8::Local<v8::Object> rhs) @@ -369,14 +369,14 @@ v8::Handle<v8::Value> QV8Engine::fromVariant(const QVariant &variant) } if (m_engine) { - if (QDeclarativeValueType *vt = QDeclarativeEnginePrivate::get(m_engine)->valueTypes[type]) + if (QQmlValueType *vt = QQmlEnginePrivate::get(m_engine)->valueTypes[type]) return m_valueTypeWrapper.newValueType(variant, vt); } } else { - if (type == qMetaTypeId<QDeclarativeListReference>()) { - typedef QDeclarativeListReferencePrivate QDLRP; - QDLRP *p = QDLRP::get((QDeclarativeListReference*)ptr); + if (type == qMetaTypeId<QQmlListReference>()) { + typedef QQmlListReferencePrivate QDLRP; + QDLRP *p = QDLRP::get((QQmlListReference*)ptr); if (p->object) { return m_listWrapper.newList(p->property, p->propertyType); } else { @@ -398,7 +398,7 @@ v8::Handle<v8::Value> QV8Engine::fromVariant(const QVariant &variant) } bool objOk; - QObject *obj = QDeclarativeMetaType::toQObject(variant, &objOk); + QObject *obj = QQmlMetaType::toQObject(variant, &objOk); if (objOk) return newQObject(obj); @@ -453,7 +453,7 @@ v8::Local<v8::Script> QV8Engine::qmlModeCompile(const char *source, int sourceLe QNetworkAccessManager *QV8Engine::networkAccessManager() { - return QDeclarativeEnginePrivate::get(m_engine)->getNetworkAccessManager(); + return QQmlEnginePrivate::get(m_engine)->getNetworkAccessManager(); } const QStringHash<bool> &QV8Engine::illegalNames() const @@ -474,7 +474,7 @@ v8::Local<v8::Array> QV8Engine::getOwnPropertyNames(v8::Handle<v8::Object> o) return v8::Local<v8::Array>::Cast(r); } -QDeclarativeContextData *QV8Engine::callingContext() +QQmlContextData *QV8Engine::callingContext() { return m_contextWrapper.callingContext(); } @@ -542,7 +542,7 @@ struct StaticQtMetaObject : public QObject void QV8Engine::initializeGlobal(v8::Handle<v8::Object> global) { - using namespace QDeclarativeBuiltinFunctions; + using namespace QQmlBuiltinFunctions; v8::Local<v8::Object> console = v8::Object::New(); v8::Local<v8::Function> consoleLogFn = V8FUNCTION(consoleLog, this); @@ -598,7 +598,7 @@ void QV8Engine::initializeGlobal(v8::Handle<v8::Object> global) qt->Set(v8::String::New("locale"), V8FUNCTION(locale, this)); if (m_engine) { - qt->Set(v8::String::New("application"), newQObject(new QDeclarativeApplication(m_engine))); + qt->Set(v8::String::New("application"), newQObject(new QQuickApplication(m_engine))); qt->Set(v8::String::New("inputMethod"), newQObject(qGuiApp->inputMethod(), CppOwnership)); qt->Set(v8::String::New("lighter"), V8FUNCTION(lighter, this)); qt->Set(v8::String::New("darker"), V8FUNCTION(darker, this)); @@ -618,7 +618,7 @@ void QV8Engine::initializeGlobal(v8::Handle<v8::Object> global) global->Set(v8::String::New("print"), consoleLogFn); global->Set(v8::String::New("console"), console); global->Set(v8::String::New("Qt"), qt); - global->Set(v8::String::New("gc"), V8FUNCTION(QDeclarativeBuiltinFunctions::gc, this)); + global->Set(v8::String::New("gc"), V8FUNCTION(QQmlBuiltinFunctions::gc, this)); { #define STRING_ARG "(function(stringArg) { "\ @@ -636,9 +636,9 @@ void QV8Engine::initializeGlobal(v8::Handle<v8::Object> global) #undef STRING_ARG } - QDeclarativeLocale::registerStringLocaleCompare(this); - QDeclarativeDateExtension::registerExtension(this); - QDeclarativeNumberExtension::registerExtension(this); + QQmlLocale::registerStringLocaleCompare(this); + QQmlDateExtension::registerExtension(this); + QQmlNumberExtension::registerExtension(this); qt_add_domexceptions(this); m_xmlHttpRequestData = qt_add_qmlxmlhttprequest(this); @@ -785,9 +785,9 @@ v8::Persistent<v8::Object> *QV8Engine::findOwnerAndStrength(QObject *object, boo QObject *parent = object->parent(); if (!parent) { // if the object has JS ownership, the object's v8object owns the lifetime of the persistent value. - if (QDeclarativeEngine::objectOwnership(object) == QDeclarativeEngine::JavaScriptOwnership) { + if (QQmlEngine::objectOwnership(object) == QQmlEngine::JavaScriptOwnership) { *shouldBeStrong = false; - return &(QDeclarativeData::get(object)->v8object); + return &(QQmlData::get(object)->v8object); } // no parent, and has CPP ownership - doesn't have an implicit parent. @@ -800,10 +800,10 @@ v8::Persistent<v8::Object> *QV8Engine::findOwnerAndStrength(QObject *object, boo while (parent->parent()) parent = parent->parent(); - if (QDeclarativeEngine::objectOwnership(parent) == QDeclarativeEngine::JavaScriptOwnership) { + if (QQmlEngine::objectOwnership(parent) == QQmlEngine::JavaScriptOwnership) { // root parent is owned by JS. It's v8object owns the persistent value in question. *shouldBeStrong = false; - return &(QDeclarativeData::get(parent)->v8object); + return &(QQmlData::get(parent)->v8object); } else { // root parent has CPP ownership. The persistent value should not be made weak. *shouldBeStrong = true; @@ -847,7 +847,7 @@ void QV8Engine::addRelationshipForGC(QObject *object, QObject *other) { bool handleShouldBeStrong = false; v8::Persistent<v8::Object> *implicitOwner = findOwnerAndStrength(object, &handleShouldBeStrong); - v8::Persistent<v8::Value> handle = QDeclarativeData::get(other, true)->v8object; + v8::Persistent<v8::Value> handle = QQmlData::get(other, true)->v8object; if (handleShouldBeStrong) { v8::V8::AddImplicitReferences(m_strongReferencer, &handle, 1); } else if (!implicitOwner->IsEmpty()) { @@ -882,7 +882,7 @@ void QV8Engine::initDeclarativeGlobalObject() freezeObject(m_context->Global()); } -void QV8Engine::setEngine(QDeclarativeEngine *engine) +void QV8Engine::setEngine(QQmlEngine *engine) { m_engine = engine; initDeclarativeGlobalObject(); diff --git a/src/declarative/qml/v8/qv8engine_impl_p.h b/src/qml/qml/v8/qv8engine_impl_p.h index 349589680a..ebb21f851c 100644 --- a/src/declarative/qml/v8/qv8engine_impl_p.h +++ b/src/qml/qml/v8/qv8engine_impl_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL-ONLY$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h index 4bfb991eae..22a8d7599f 100644 --- a/src/declarative/qml/v8/qv8engine_p.h +++ b/src/qml/qml/v8/qv8engine_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEV8ENGINE_P_H -#define QDECLARATIVEV8ENGINE_P_H +#ifndef QQMLV8ENGINE_P_H +#define QQMLV8ENGINE_P_H // // W A R N I N G @@ -70,7 +70,7 @@ #include "qscriptoriginalglobalobject_p.h" #include "qscripttools_p.h" -#include <private/qdeclarativepropertycache_p.h> +#include <private/qqmlpropertycache_p.h> #include "qv8contextwrapper_p.h" #include "qv8qobjectwrapper_p.h" @@ -165,63 +165,63 @@ inline T *v8_resource_check(v8::Handle<v8::Object> object) { // class MyClass : public QObject { // Q_OBJECT // ... -// Q_INVOKABLE void myMethod(QDeclarativeV8Function*); +// Q_INVOKABLE void myMethod(QQmlV8Function*); // }; -// The QDeclarativeV8Function - and consequently the arguments and return value - only remains +// The QQmlV8Function - and consequently the arguments and return value - only remains // valid during the call. If the return value isn't set within myMethod(), the will return // undefined. class QV8Engine; -class QDeclarativeV8Function +class QQmlV8Function { public: int Length() const { return _ac; } v8::Local<v8::Value> operator[](int idx) { return (*_a)->Get(idx); } - QDeclarativeContextData *context() { return _c; } + QQmlContextData *context() { return _c; } v8::Handle<v8::Object> qmlGlobal() { return *_g; } void returnValue(v8::Handle<v8::Value> rv) { *_r = rv; } QV8Engine *engine() const { return _e; } private: friend class QV8QObjectWrapper; - QDeclarativeV8Function(); - QDeclarativeV8Function(const QDeclarativeV8Function &); - QDeclarativeV8Function &operator=(const QDeclarativeV8Function &); + QQmlV8Function(); + QQmlV8Function(const QQmlV8Function &); + QQmlV8Function &operator=(const QQmlV8Function &); - QDeclarativeV8Function(int length, v8::Handle<v8::Object> &args, + QQmlV8Function(int length, v8::Handle<v8::Object> &args, v8::Handle<v8::Value> &rv, v8::Handle<v8::Object> &global, - QDeclarativeContextData *c, QV8Engine *e) + QQmlContextData *c, QV8Engine *e) : _ac(length), _a(&args), _r(&rv), _g(&global), _c(c), _e(e) {} int _ac; v8::Handle<v8::Object> *_a; v8::Handle<v8::Value> *_r; v8::Handle<v8::Object> *_g; - QDeclarativeContextData *_c; + QQmlContextData *_c; QV8Engine *_e; }; -class QDeclarativeV8Handle +class QQmlV8Handle { public: - QDeclarativeV8Handle() : d(0) {} - QDeclarativeV8Handle(const QDeclarativeV8Handle &other) : d(other.d) {} - QDeclarativeV8Handle &operator=(const QDeclarativeV8Handle &other) { d = other.d; return *this; } + QQmlV8Handle() : d(0) {} + QQmlV8Handle(const QQmlV8Handle &other) : d(other.d) {} + QQmlV8Handle &operator=(const QQmlV8Handle &other) { d = other.d; return *this; } - static QDeclarativeV8Handle fromHandle(v8::Handle<v8::Value> h) { - return QDeclarativeV8Handle(*h); + static QQmlV8Handle fromHandle(v8::Handle<v8::Value> h) { + return QQmlV8Handle(*h); } v8::Handle<v8::Value> toHandle() const { return v8::Handle<v8::Value>((v8::Value *)d); } private: - QDeclarativeV8Handle(void *d) : d(d) {} + QQmlV8Handle(void *d) : d(d) {} void *d; }; class QObject; -class QDeclarativeEngine; -class QDeclarativeValueType; +class QQmlEngine; +class QQmlValueType; class QNetworkAccessManager; -class QDeclarativeContextData; +class QQmlContextData; class Q_AUTOTEST_EXPORT QV8GCCallback { @@ -244,7 +244,7 @@ public: static void addGcCallbackNode(Node *node); }; -class Q_DECLARATIVE_EXPORT QV8Engine +class Q_QML_EXPORT QV8Engine { public: static QV8Engine* get(QJSEngine* q) { Q_ASSERT(q); return q->handle(); } @@ -253,7 +253,7 @@ public: QV8Engine(QJSEngine* qq,QJSEngine::ContextOwnership ownership = QJSEngine::CreateNewContext); virtual ~QV8Engine(); - // This enum should be in sync with QDeclarativeEngine::ObjectOwnership + // This enum should be in sync with QQmlEngine::ObjectOwnership enum ObjectOwnership { CppOwnership, JavaScriptOwnership }; struct Deletable { @@ -284,8 +284,8 @@ public: }; void initDeclarativeGlobalObject(); - void setEngine(QDeclarativeEngine *engine); - QDeclarativeEngine *engine() { return m_engine; } + void setEngine(QQmlEngine *engine); + QQmlEngine *engine() { return m_engine; } v8::Local<v8::Object> global() { return m_context->Global(); } v8::Handle<v8::Context> context() const { return m_context; } @@ -310,7 +310,7 @@ public: Deletable *listModelData() { return m_listModelData; } void setListModelData(Deletable *d) { if (m_listModelData) delete m_listModelData; m_listModelData = d; } - QDeclarativeContextData *callingContext(); + QQmlContextData *callingContext(); v8::Local<v8::Array> getOwnPropertyNames(v8::Handle<v8::Object>); inline QJSValuePrivate::PropertyFlags getPropertyFlags(v8::Handle<v8::Object> object, v8::Handle<v8::Value> property); @@ -335,7 +335,7 @@ public: int lineNumber = 1); // Return the QML global "scope" object for the \a ctxt context and \a scope object. - inline v8::Local<v8::Object> qmlScope(QDeclarativeContextData *ctxt, QObject *scope); + inline v8::Local<v8::Object> qmlScope(QQmlContextData *ctxt, QObject *scope); // Return a JS wrapper for the given QObject \a object inline v8::Handle<v8::Value> newQObject(QObject *object); @@ -347,8 +347,8 @@ public: inline v8::Local<v8::String> toString(const QString &string); // Create a new value type object - inline v8::Handle<v8::Value> newValueType(QObject *, int coreIndex, QDeclarativeValueType *); - inline v8::Handle<v8::Value> newValueType(const QVariant &, QDeclarativeValueType *); + inline v8::Handle<v8::Value> newValueType(QObject *, int coreIndex, QQmlValueType *); + inline v8::Handle<v8::Value> newValueType(const QVariant &, QQmlValueType *); // Create a new sequence type object inline v8::Handle<v8::Value> newSequence(int sequenceType, QObject *, int coreIndex, bool *succeeded); @@ -358,7 +358,7 @@ public: inline v8::Handle<v8::Value> newQVariant(const QVariant &); // Return the network access manager for this engine. By default this returns the network - // access manager of the QDeclarativeEngine. It is overridden in the case of a threaded v8 + // access manager of the QQmlEngine. It is overridden in the case of a threaded v8 // instance (like in WorkerScript). virtual QNetworkAccessManager *networkAccessManager(); @@ -456,7 +456,7 @@ public: protected: QJSEngine* q; - QDeclarativeEngine *m_engine; + QQmlEngine *m_engine; bool m_ownsV8Context; v8::Persistent<v8::Context> m_context; QScriptOriginalGlobalObject m_originalGlobalObject; @@ -555,7 +555,7 @@ bool QV8Engine::isVariant(v8::Handle<v8::Value> value) return m_variantWrapper.isVariant(value); } -v8::Local<v8::Object> QV8Engine::qmlScope(QDeclarativeContextData *ctxt, QObject *scope) +v8::Local<v8::Object> QV8Engine::qmlScope(QQmlContextData *ctxt, QObject *scope) { return m_contextWrapper.qmlScope(ctxt, scope); } @@ -581,7 +581,7 @@ v8::Handle<v8::Value> QV8Engine::newQObject(QObject *object, const ObjectOwnersh return v8::Null(); v8::Handle<v8::Value> result = newQObject(object); - QDeclarativeData *ddata = QDeclarativeData::get(object, true); + QQmlData *ddata = QQmlData::get(object, true); if (ownership == JavaScriptOwnership && ddata) { ddata->indestructible = false; ddata->explicitIndestructibleSet = true; @@ -594,12 +594,12 @@ v8::Local<v8::String> QV8Engine::toString(const QString &string) return m_stringWrapper.toString(string); } -v8::Handle<v8::Value> QV8Engine::newValueType(QObject *object, int property, QDeclarativeValueType *type) +v8::Handle<v8::Value> QV8Engine::newValueType(QObject *object, int property, QQmlValueType *type) { return m_valueTypeWrapper.newValueType(object, property, type); } -v8::Handle<v8::Value> QV8Engine::newValueType(const QVariant &value, QDeclarativeValueType *type) +v8::Handle<v8::Value> QV8Engine::newValueType(const QVariant &value, QQmlValueType *type) { return m_valueTypeWrapper.newValueType(value, type); } @@ -628,4 +628,4 @@ QV8Engine::Deletable *QV8Engine::extensionData(int index) const QT_END_NAMESPACE -#endif // QDECLARATIVEV8ENGINE_P_H +#endif // QQMLV8ENGINE_P_H diff --git a/src/declarative/qml/v8/qv8include.cpp b/src/qml/qml/v8/qv8include.cpp index 116baee0e2..89f60f256e 100644 --- a/src/declarative/qml/v8/qv8include.cpp +++ b/src/qml/qml/v8/qv8include.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -41,16 +41,16 @@ #include "qv8include_p.h" -#include <QtDeclarative/qjsengine.h> +#include <QtQml/qjsengine.h> #include <QtNetwork/qnetworkrequest.h> #include <QtNetwork/qnetworkreply.h> #include <QtCore/qfile.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE -QV8Include::QV8Include(const QUrl &url, QV8Engine *engine, QDeclarativeContextData *context, +QV8Include::QV8Include(const QUrl &url, QV8Engine *engine, QQmlContextData *context, v8::Handle<v8::Object> qmlglobal, v8::Handle<v8::Function> callback) : m_engine(engine), m_network(0), m_reply(0), m_url(url), m_redirectCount(0), m_context(context) { @@ -130,9 +130,9 @@ void QV8Include::finished() QByteArray data = m_reply->readAll(); QString code = QString::fromUtf8(data); - QDeclarativeScript::Parser::extractPragmas(code); + QQmlScript::Parser::extractPragmas(code); - QDeclarativeContextData *importContext = new QDeclarativeContextData; + QQmlContextData *importContext = new QQmlContextData; importContext->isInternal = true; importContext->isJSContext = true; importContext->url = m_url; @@ -174,7 +174,7 @@ v8::Handle<v8::Value> QV8Include::include(const v8::Arguments &args) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); - QDeclarativeContextData *context = engine->callingContext(); + QQmlContextData *context = engine->callingContext(); if (!context || !context->isJSContext) V8THROW_ERROR("Qt.include(): Can only be called from JavaScript files"); @@ -185,7 +185,7 @@ v8::Handle<v8::Value> QV8Include::include(const v8::Arguments &args) if (args.Length() >= 2 && args[1]->IsFunction()) callbackFunction = v8::Local<v8::Function>::Cast(args[1]); - QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); + QString localFile = QQmlEnginePrivate::urlToLocalFileOrQrc(url); v8::Local<v8::Object> result; @@ -203,9 +203,9 @@ v8::Handle<v8::Value> QV8Include::include(const v8::Arguments &args) if (f.open(QIODevice::ReadOnly)) { QByteArray data = f.readAll(); QString code = QString::fromUtf8(data); - QDeclarativeScript::Parser::extractPragmas(code); + QQmlScript::Parser::extractPragmas(code); - QDeclarativeContextData *importContext = new QDeclarativeContextData; + QQmlContextData *importContext = new QQmlContextData; importContext->isInternal = true; importContext->isJSContext = true; importContext->url = url; diff --git a/src/declarative/qml/v8/qv8include_p.h b/src/qml/qml/v8/qv8include_p.h index 89ff2967ed..f1e57b3eee 100644 --- a/src/declarative/qml/v8/qv8include_p.h +++ b/src/qml/qml/v8/qv8include_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,14 +56,14 @@ #include <QtCore/qobject.h> #include <QtCore/qurl.h> -#include <private/qdeclarativecontext_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlcontext_p.h> +#include <private/qqmlguard_p.h> #include <private/qv8_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; class QNetworkAccessManager; class QNetworkReply; class QV8Engine; @@ -84,7 +84,7 @@ private slots: void finished(); private: - QV8Include(const QUrl &, QV8Engine *, QDeclarativeContextData *, + QV8Include(const QUrl &, QV8Engine *, QQmlContextData *, v8::Handle<v8::Object>, v8::Handle<v8::Function>); ~QV8Include(); @@ -95,7 +95,7 @@ private: QV8Engine *m_engine; QNetworkAccessManager *m_network; - QDeclarativeGuard<QNetworkReply> m_reply; + QQmlGuard<QNetworkReply> m_reply; QUrl m_url; int m_redirectCount; @@ -103,7 +103,7 @@ private: v8::Persistent<v8::Function> m_callbackFunction; v8::Persistent<v8::Object> m_resultObject; - QDeclarativeGuardedContextData m_context; + QQmlGuardedContextData m_context; v8::Persistent<v8::Object> m_qmlglobal; }; diff --git a/src/declarative/qml/v8/qv8listwrapper.cpp b/src/qml/qml/v8/qv8listwrapper.cpp index 08b548aa08..d6eab7af34 100644 --- a/src/declarative/qml/v8/qv8listwrapper.cpp +++ b/src/qml/qml/v8/qv8listwrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -41,7 +41,7 @@ #include "qv8listwrapper_p.h" #include "qv8engine_p.h" -#include <private/qdeclarativelist_p.h> +#include <private/qqmllist_p.h> QT_BEGIN_NAMESPACE @@ -51,8 +51,8 @@ class QV8ListResource : public QV8ObjectResource public: QV8ListResource(QV8Engine *engine) : QV8ObjectResource(engine) {} - QDeclarativeGuard<QObject> object; - QDeclarativeListProperty<QObject> property; + QQmlGuard<QObject> object; + QQmlListProperty<QObject> property; int propertyType; }; @@ -99,7 +99,7 @@ v8::Handle<v8::Value> QV8ListWrapper::newList(QObject *object, int propId, int p return rv; } -v8::Handle<v8::Value> QV8ListWrapper::newList(const QDeclarativeListProperty<QObject> &prop, int propType) +v8::Handle<v8::Value> QV8ListWrapper::newList(const QQmlListProperty<QObject> &prop, int propType) { // XXX NewInstance() should be optimized v8::Local<v8::Object> rv = m_constructor->NewInstance(); @@ -126,7 +126,7 @@ QVariant QV8ListWrapper::toVariant(QV8ObjectResource *r) if (!resource->object) return QVariant(); - return QVariant::fromValue(QDeclarativeListReferencePrivate::init(resource->property, resource->propertyType, + return QVariant::fromValue(QQmlListReferencePrivate::init(resource->property, resource->propertyType, m_engine->engine())); } diff --git a/src/declarative/qml/v8/qv8listwrapper_p.h b/src/qml/qml/v8/qv8listwrapper_p.h index 891e84de65..1e4bab06d5 100644 --- a/src/declarative/qml/v8/qv8listwrapper_p.h +++ b/src/qml/qml/v8/qv8listwrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -54,7 +54,7 @@ // #include <QtCore/qglobal.h> -#include <QtDeclarative/qdeclarativelist.h> +#include <QtQml/qqmllist.h> #include <private/qv8_p.h> QT_BEGIN_NAMESPACE @@ -71,7 +71,7 @@ public: void destroy(); v8::Handle<v8::Value> newList(QObject *, int, int); - v8::Handle<v8::Value> newList(const QDeclarativeListProperty<QObject> &, int); + v8::Handle<v8::Value> newList(const QQmlListProperty<QObject> &, int); QVariant toVariant(v8::Handle<v8::Object>); QVariant toVariant(QV8ObjectResource *); diff --git a/src/declarative/qml/v8/qv8profiler_p.h b/src/qml/qml/v8/qv8profiler_p.h index 4aba9ecdb5..45df5a17c4 100644 --- a/src/declarative/qml/v8/qv8profiler_p.h +++ b/src/qml/qml/v8/qv8profiler_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/qml/qml/v8/qv8qobjectwrapper.cpp index 11733be5fd..b84ae339be 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp +++ b/src/qml/qml/v8/qv8qobjectwrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,23 +43,23 @@ #include "qv8contextwrapper_p.h" #include "qv8engine_p.h" -#include <private/qdeclarativeguard_p.h> -#include <private/qdeclarativepropertycache_p.h> -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativevmemetaobject_p.h> -#include <private/qdeclarativebinding_p.h> +#include <private/qqmlguard_p.h> +#include <private/qqmlpropertycache_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlvmemetaobject_p.h> +#include <private/qqmlbinding_p.h> #include <private/qjsvalue_p.h> #include <private/qscript_impl_p.h> -#include <private/qdeclarativeaccessors_p.h> -#include <private/qdeclarativeexpression_p.h> +#include <private/qqmlaccessors_p.h> +#include <private/qqmlexpression_p.h> -#include <QtDeclarative/qjsvalue.h> +#include <QtQml/qjsvalue.h> #include <QtCore/qvarlengtharray.h> #include <QtCore/qtimer.h> #include <QtCore/qatomic.h> Q_DECLARE_METATYPE(QJSValue); -Q_DECLARE_METATYPE(QDeclarativeV8Handle); +Q_DECLARE_METATYPE(QQmlV8Handle); QT_BEGIN_NAMESPACE @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE #define QOBJECT_TOSTRING_INDEX -2 #define QOBJECT_DESTROY_INDEX -3 -// XXX TODO: Need to review all calls to QDeclarativeEngine *engine() to confirm QObjects work +// XXX TODO: Need to review all calls to QQmlEngine *engine() to confirm QObjects work // correctly in a worker thread class QV8QObjectResource : public QV8ObjectResource @@ -84,14 +84,14 @@ class QV8QObjectResource : public QV8ObjectResource public: QV8QObjectResource(QV8Engine *engine, QObject *object); - QDeclarativeGuard<QObject> object; + QQmlGuard<QObject> object; }; -class QV8QObjectInstance : public QDeclarativeGuard<QObject> +class QV8QObjectInstance : public QQmlGuard<QObject> { public: QV8QObjectInstance(QObject *o, QV8QObjectWrapper *w) - : QDeclarativeGuard<QObject>(o), wrapper(w) + : QQmlGuard<QObject>(o), wrapper(w) { } @@ -117,7 +117,7 @@ class QV8SignalHandlerResource : public QV8ObjectResource public: QV8SignalHandlerResource(QV8Engine *engine, QObject *object, int index); - QDeclarativeGuard<QObject> object; + QQmlGuard<QObject> object; int index; }; @@ -158,7 +158,7 @@ private: QString, QList<QObject *>, QJSValue, - QDeclarativeV8Handle>::Size]; + QQmlV8Handle>::Size]; qint64 q_for_alignment; }; @@ -168,7 +168,7 @@ private: QVariant *qvariantPtr; QList<QObject *> *qlistPtr; QJSValue *qjsValuePtr; - QDeclarativeV8Handle *handlePtr; + QQmlV8Handle *handlePtr; }; int type; @@ -216,8 +216,8 @@ void QV8QObjectWrapper::destroy() } struct ReadAccessor { - static inline void Indirect(QObject *object, const QDeclarativePropertyData &property, - void *output, QDeclarativeNotifier **n) + static inline void Indirect(QObject *object, const QQmlPropertyData &property, + void *output, QQmlNotifier **n) { Q_ASSERT(n == 0); Q_UNUSED(n); @@ -226,8 +226,8 @@ struct ReadAccessor { QMetaObject::metacall(object, QMetaObject::ReadProperty, property.coreIndex, args); } - static inline void Direct(QObject *object, const QDeclarativePropertyData &property, - void *output, QDeclarativeNotifier **n) + static inline void Direct(QObject *object, const QQmlPropertyData &property, + void *output, QQmlNotifier **n) { Q_ASSERT(n == 0); Q_UNUSED(n); @@ -236,8 +236,8 @@ struct ReadAccessor { object->qt_metacall(QMetaObject::ReadProperty, property.coreIndex, args); } - static inline void Accessor(QObject *object, const QDeclarativePropertyData &property, - void *output, QDeclarativeNotifier **n) + static inline void Accessor(QObject *object, const QQmlPropertyData &property, + void *output, QQmlNotifier **n) { Q_ASSERT(property.accessors); @@ -261,8 +261,8 @@ static inline v8::Handle<v8::Value> valueToHandle(QV8Engine *, double v) static inline v8::Handle<v8::Value> valueToHandle(QV8Engine *e, QObject *v) { return e->newQObject(v); } -template<typename T, void (*ReadFunction)(QObject *, const QDeclarativePropertyData &, - void *, QDeclarativeNotifier **)> +template<typename T, void (*ReadFunction)(QObject *, const QQmlPropertyData &, + void *, QQmlNotifier **)> static v8::Handle<v8::Value> GenericValueGetter(v8::Local<v8::String>, const v8::AccessorInfo &info) { v8::Handle<v8::Object> This = info.This(); @@ -271,17 +271,17 @@ static v8::Handle<v8::Value> GenericValueGetter(v8::Local<v8::String>, const v8: QObject *object = resource->object; if (!object) return v8::Undefined(); - QDeclarativePropertyData *property = - (QDeclarativePropertyData *)v8::External::Unwrap(info.Data()); + QQmlPropertyData *property = + (QQmlPropertyData *)v8::External::Unwrap(info.Data()); - QDeclarativeEngine *engine = resource->engine->engine(); - QDeclarativeEnginePrivate *ep = engine?QDeclarativeEnginePrivate::get(engine):0; + QQmlEngine *engine = resource->engine->engine(); + QQmlEnginePrivate *ep = engine?QQmlEnginePrivate::get(engine):0; T value = T(); if (ep && ep->propertyCapture) { if (ReadFunction == ReadAccessor::Accessor && property->accessors->notifier) { - QDeclarativeNotifier *notifier = 0; + QQmlNotifier *notifier = 0; ReadFunction(object, *property, &value, ¬ifier); if (notifier) ep->captureProperty(notifier); } else if (!property->isConstant()) { @@ -380,11 +380,11 @@ QObject *QV8QObjectWrapper::toQObject(QV8ObjectResource *r) } // Load value properties -template<void (*ReadFunction)(QObject *, const QDeclarativePropertyData &, - void *, QDeclarativeNotifier **)> +template<void (*ReadFunction)(QObject *, const QQmlPropertyData &, + void *, QQmlNotifier **)> static v8::Handle<v8::Value> LoadProperty(QV8Engine *engine, QObject *object, - const QDeclarativePropertyData &property, - QDeclarativeNotifier **notifier) + const QQmlPropertyData &property, + QQmlNotifier **notifier) { Q_ASSERT(!property.isFunction()); @@ -423,19 +423,19 @@ static v8::Handle<v8::Value> LoadProperty(QV8Engine *engine, QObject *object, ReadFunction(object, property, &v, notifier); return valueToHandle(engine, v); } else if (property.isV8Handle()) { - QDeclarativeV8Handle handle; + QQmlV8Handle handle; ReadFunction(object, property, &handle, notifier); return handle.toHandle(); } else if (property.isQVariant()) { QVariant v; ReadFunction(object, property, &v, notifier); return engine->fromVariant(v); - } else if (QDeclarativeValueTypeFactory::isValueType((uint)property.propType) + } else if (QQmlValueTypeFactory::isValueType((uint)property.propType) && engine->engine()) { Q_ASSERT(notifier == 0); - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine->engine()); - QDeclarativeValueType *valueType = ep->valueTypes[property.propType]; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine->engine()); + QQmlValueType *valueType = ep->valueTypes[property.propType]; if (valueType) return engine->newValueType(object, property.coreIndex, valueType); } else { @@ -500,28 +500,28 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject } } - QDeclarativePropertyData local; - QDeclarativePropertyData *result = 0; + QQmlPropertyData local; + QQmlPropertyData *result = 0; { - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); if (ddata && ddata->propertyCache) result = ddata->propertyCache->property(property); else - result = QDeclarativePropertyCache::property(engine->engine(), object, property, local); + result = QQmlPropertyCache::property(engine->engine(), object, property, local); } if (!result) return v8::Handle<v8::Value>(); if (revisionMode == QV8QObjectWrapper::CheckRevision && result->revision != 0) { - QDeclarativeData *ddata = QDeclarativeData::get(object); + QQmlData *ddata = QQmlData::get(object); if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(result)) return v8::Handle<v8::Value>(); } if (result->isFunction()) { if (result->isVMEFunction()) { - return ((QDeclarativeVMEMetaObject *)(object->metaObject()))->vmeMethod(result->coreIndex); + return ((QQmlVMEMetaObject *)(object->metaObject()))->vmeMethod(result->coreIndex); } else if (result->isV8Function()) { return MethodClosure::createWithGlobal(engine, object, objectHandle, result->coreIndex); } else if (result->isSignalHandler()) { @@ -534,12 +534,12 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject } } - QDeclarativeEnginePrivate *ep = - engine->engine()?QDeclarativeEnginePrivate::get(engine->engine()):0; + QQmlEnginePrivate *ep = + engine->engine()?QQmlEnginePrivate::get(engine->engine()):0; if (result->hasAccessors()) { - QDeclarativeNotifier *n = 0; - QDeclarativeNotifier **nptr = 0; + QQmlNotifier *n = 0; + QQmlNotifier **nptr = 0; if (ep && ep->propertyCapture && result->accessors->notifier) nptr = &n; @@ -558,13 +558,13 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject if (ep && !result->isConstant()) { if (result->coreIndex == 0) - ep->captureProperty(QDeclarativeData::get(object, true)->objectNameNotifier()); + ep->captureProperty(QQmlData::get(object, true)->objectNameNotifier()); else ep->captureProperty(object, result->coreIndex, result->notifyIndex); } if (result->isVMEProperty()) { - typedef QDeclarativeVMEMetaObject VMEMO; + typedef QQmlVMEMetaObject VMEMO; VMEMO *vmemo = const_cast<VMEMO *>(static_cast<const VMEMO *>(object->metaObject())); return vmemo->vmeProperty(result->coreIndex); } else if (result->isDirect()) { @@ -575,13 +575,13 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject } // Setter for writable properties. Shared between the interceptor and fast property accessor -static inline void StoreProperty(QV8Engine *engine, QObject *object, QDeclarativePropertyData *property, +static inline void StoreProperty(QV8Engine *engine, QObject *object, QQmlPropertyData *property, v8::Handle<v8::Value> value) { - QDeclarativeBinding *newBinding = 0; + QQmlBinding *newBinding = 0; if (value->IsFunction()) { - QDeclarativeContextData *context = engine->callingContext(); + QQmlContextData *context = engine->callingContext(); v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(value); v8::Local<v8::StackTrace> trace = @@ -592,15 +592,15 @@ static inline void StoreProperty(QV8Engine *engine, QObject *object, QDeclarativ int columNumber = frame->GetColumn(); QString url = engine->toString(frame->GetScriptName()); - newBinding = new QDeclarativeBinding(&function, object, context); + newBinding = new QQmlBinding(&function, object, context); newBinding->setSourceLocation(url, lineNumber, columNumber); newBinding->setTarget(object, *property, context); newBinding->setEvaluateFlags(newBinding->evaluateFlags() | - QDeclarativeBinding::RequiresThisObject); + QQmlBinding::RequiresThisObject); } - QDeclarativeAbstractBinding *oldBinding = - QDeclarativePropertyPrivate::setBinding(object, property->coreIndex, -1, newBinding); + QQmlAbstractBinding *oldBinding = + QQmlPropertyPrivate::setBinding(object, property->coreIndex, -1, newBinding); if (oldBinding) oldBinding->destroy(); @@ -636,7 +636,7 @@ static inline void StoreProperty(QV8Engine *engine, QObject *object, QDeclarativ } else if (property->propType == QMetaType::QString && value->IsString()) { PROPERTY_STORE(QString, engine->toString(value->ToString())); } else if (property->isVMEProperty()) { - static_cast<QDeclarativeVMEMetaObject *>(const_cast<QMetaObject *>(object->metaObject()))->setVMEProperty(property->coreIndex, value); + static_cast<QQmlVMEMetaObject *>(const_cast<QMetaObject *>(object->metaObject()))->setVMEProperty(property->coreIndex, value); } else { QVariant v; if (property->isQList()) @@ -644,8 +644,8 @@ static inline void StoreProperty(QV8Engine *engine, QObject *object, QDeclarativ else v = engine->toVariant(value, property->propType); - QDeclarativeContextData *context = engine->callingContext(); - if (!QDeclarativePropertyPrivate::write(object, *property, v, context)) { + QQmlContextData *context = engine->callingContext(); + if (!QQmlPropertyPrivate::write(object, *property, v, context)) { const char *valueType = 0; if (v.userType() == QVariant::Invalid) valueType = "null"; else valueType = QMetaType::typeName(v.userType()); @@ -666,15 +666,15 @@ bool QV8QObjectWrapper::SetProperty(QV8Engine *engine, QObject *object, const QH engine->qobjectWrapper()->m_destroyString == property) return true; - QDeclarativePropertyData local; - QDeclarativePropertyData *result = 0; - result = QDeclarativePropertyCache::property(engine->engine(), object, property, local); + QQmlPropertyData local; + QQmlPropertyData *result = 0; + result = QQmlPropertyCache::property(engine->engine(), object, property, local); if (!result) return false; if (revisionMode == QV8QObjectWrapper::CheckRevision && result->revision != 0) { - QDeclarativeData *ddata = QDeclarativeData::get(object); + QQmlData *ddata = QQmlData::get(object); if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(result)) return false; } @@ -712,10 +712,10 @@ v8::Handle<v8::Value> QV8QObjectWrapper::Getter(v8::Local<v8::String> property, if (QV8Engine::startsWithUpper(property)) { // Check for attached properties - QDeclarativeContextData *context = v8engine->callingContext(); + QQmlContextData *context = v8engine->callingContext(); if (context && context->imports) { - QDeclarativeTypeNameCache::Result r = context->imports->query(propertystring); + QQmlTypeNameCache::Result r = context->imports->query(propertystring); if (r.isValid()) { if (r.scriptIndex != -1) { @@ -773,9 +773,9 @@ v8::Handle<v8::Integer> QV8QObjectWrapper::Query(v8::Local<v8::String> property, QHashedV8String propertystring(property); - QDeclarativePropertyData local; - QDeclarativePropertyData *result = 0; - result = QDeclarativePropertyCache::property(engine->engine(), object, propertystring, local); + QQmlPropertyData local; + QQmlPropertyData *result = 0; + result = QQmlPropertyCache::property(engine->engine(), object, propertystring, local); if (!result) return v8::Handle<v8::Integer>(); @@ -796,12 +796,12 @@ v8::Handle<v8::Array> QV8QObjectWrapper::Enumerator(const v8::AccessorInfo &info QStringList result; - QDeclarativeEnginePrivate *ep = resource->engine->engine() - ? QDeclarativeEnginePrivate::get(resource->engine->engine()) + QQmlEnginePrivate *ep = resource->engine->engine() + ? QQmlEnginePrivate::get(resource->engine->engine()) : 0; - QDeclarativePropertyCache *cache = 0; - QDeclarativeData *ddata = QDeclarativeData::get(object); + QQmlPropertyCache *cache = 0; + QQmlData *ddata = QQmlData::get(object); if (ddata) cache = ddata->propertyCache; @@ -839,16 +839,16 @@ static void FastValueSetter(v8::Local<v8::String>, v8::Local<v8::Value> value, QObject *object = resource->object; - QDeclarativePropertyData *property = - (QDeclarativePropertyData *)v8::External::Unwrap(info.Data()); + QQmlPropertyData *property = + (QQmlPropertyData *)v8::External::Unwrap(info.Data()); int index = property->coreIndex; - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); Q_ASSERT(ddata); Q_ASSERT(ddata->propertyCache); - QDeclarativePropertyData *pdata = ddata->propertyCache->property(index); + QQmlPropertyData *pdata = ddata->propertyCache->property(index); Q_ASSERT(pdata); Q_ASSERT(pdata->isWritable() || pdata->isQList()); @@ -881,7 +881,7 @@ static void WeakQObjectReferenceCallback(v8::Persistent<v8::Value> handle, void QObject *object = resource->object; if (object) { - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); if (ddata) { ddata->v8object.Clear(); if (!object->parent() && !ddata->indestructible) @@ -899,13 +899,13 @@ static void WeakQObjectInstanceCallback(v8::Persistent<v8::Value> handle, void * qPersistentDispose(handle); } -v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8Engine *engine) +v8::Local<v8::Object> QQmlPropertyCache::newQObject(QObject *object, QV8Engine *engine) { Q_ASSERT(object); Q_ASSERT(this->engine); - Q_ASSERT(QDeclarativeData::get(object, false)); - Q_ASSERT(QDeclarativeData::get(object, false)->propertyCache == this); + Q_ASSERT(QQmlData::get(object, false)); + Q_ASSERT(QQmlData::get(object, false)->propertyCache == this); // Setup constructor if (constructor.IsEmpty()) { @@ -930,7 +930,7 @@ v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8 uniqueHash.insert(iter); } - QDeclarativePropertyData *property = *iter; + QQmlPropertyData *property = *iter; if (property->notFullyResolved()) resolve(property); if (property->isFunction()) @@ -971,7 +971,7 @@ v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8 ft->InstanceTemplate()->SetHasExternalResource(true); } - // We wrap the raw QDeclarativePropertyData pointer here. This is safe as the + // We wrap the raw QQmlPropertyData pointer here. This is safe as the // pointer will remain valid at least as long as the lifetime of any QObject's of // this type and the property accessor checks if the object is 0 (deleted) before // dereferencing the pointer. @@ -992,7 +992,7 @@ v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8 constructor = qPersistentNew<v8::Function>(ft->GetFunction()); } - QDeclarativeCleanup::addToEngine(this->engine); + QQmlCleanup::addToEngine(this->engine); } v8::Local<v8::Object> result = constructor->NewInstance(); @@ -1001,12 +1001,12 @@ v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8 return result; } -v8::Local<v8::Object> QV8QObjectWrapper::newQObject(QObject *object, QDeclarativeData *ddata, QV8Engine *engine) +v8::Local<v8::Object> QV8QObjectWrapper::newQObject(QObject *object, QQmlData *ddata, QV8Engine *engine) { v8::Local<v8::Object> rv; if (!ddata->propertyCache && engine->engine()) { - ddata->propertyCache = QDeclarativeEnginePrivate::get(engine->engine())->cache(object); + ddata->propertyCache = QQmlEnginePrivate::get(engine->engine())->cache(object); if (ddata->propertyCache) ddata->propertyCache->addref(); } @@ -1027,14 +1027,14 @@ As V8 doesn't support an equality callback, for QObject's we have to return exac V8 handle for subsequent calls to newQObject for the same QObject. To do this we have a two pronged strategy: 1. If there is no current outstanding V8 handle to the QObject, we create one and store a - persistent handle in QDeclarativeData::v8object. We mark the QV8QObjectWrapper that - "owns" this handle by setting the QDeclarativeData::v8objectid to the id of this + persistent handle in QQmlData::v8object. We mark the QV8QObjectWrapper that + "owns" this handle by setting the QQmlData::v8objectid to the id of this QV8QObjectWrapper. - 2. If another QV8QObjectWrapper has create the handle in QDeclarativeData::v8object we create + 2. If another QV8QObjectWrapper has create the handle in QQmlData::v8object we create an entry in the m_taintedObject hash where we store the handle and mark the object as - "tainted" in the QDeclarativeData::hasTaintedV8Object flag. + "tainted" in the QQmlData::hasTaintedV8Object flag. We have to mark the object as tainted to ensure that we search our m_taintedObject hash even -in the case that the original QV8QObjectWrapper owner of QDeclarativeData::v8object has +in the case that the original QV8QObjectWrapper owner of QQmlData::v8object has released the handle. */ v8::Handle<v8::Value> QV8QObjectWrapper::newQObject(QObject *object) @@ -1045,7 +1045,7 @@ v8::Handle<v8::Value> QV8QObjectWrapper::newQObject(QObject *object) if (QObjectPrivate::get(object)->wasDeleted) return v8::Undefined(); - QDeclarativeData *ddata = QDeclarativeData::get(object, true); + QQmlData *ddata = QQmlData::get(object, true); if (!ddata) return v8::Undefined(); @@ -1132,7 +1132,7 @@ QPair<QObject *, int> QV8QObjectWrapper::ExtractQtMethod(QV8Engine *engine, v8:: return qMakePair((QObject *)0, -1); } -class QV8QObjectConnectionList : public QObject, public QDeclarativeGuard<QObject> +class QV8QObjectConnectionList : public QObject, public QQmlGuard<QObject> { public: QV8QObjectConnectionList(QObject *object, QV8Engine *engine); @@ -1179,7 +1179,7 @@ public: }; QV8QObjectConnectionList::QV8QObjectConnectionList(QObject *object, QV8Engine *engine) -: QDeclarativeGuard<QObject>(object), engine(engine), needsDestroy(false), inUse(0) +: QQmlGuard<QObject>(object), engine(engine), needsDestroy(false), inUse(0) { } @@ -1222,7 +1222,7 @@ int QV8QObjectConnectionList::qt_metacall(QMetaObject::Call method, int index, v QList<Connection> connections = connectionList; QVarLengthArray<int, 9> dummy; - int *argsTypes = QDeclarativePropertyCache::methodParameterTypes(data(), index, dummy, 0); + int *argsTypes = QQmlPropertyCache::methodParameterTypes(data(), index, dummy, 0); v8::HandleScope handle_scope; v8::Context::Scope scope(engine->context()); @@ -1252,12 +1252,12 @@ int QV8QObjectConnectionList::qt_metacall(QMetaObject::Call method, int index, v } if (try_catch.HasCaught()) { - QDeclarativeError error; + QQmlError error; error.setDescription(QString(QLatin1String("Unknown exception occurred during evaluation of connected function: %1")).arg(engine->toString(connection.function->GetName()))); v8::Local<v8::Message> message = try_catch.Message(); if (!message.IsEmpty()) - QDeclarativeExpressionPrivate::exceptionToError(message, error); - QDeclarativeEnginePrivate::get(engine->engine())->warning(error); + QQmlExpressionPrivate::exceptionToError(message, error); + QQmlEnginePrivate::get(engine->engine())->warning(error); } } @@ -1649,11 +1649,11 @@ static QByteArray QMetaMethod_name(const QMetaMethod &m) /*! Returns the next related method, if one, or 0. */ -static const QDeclarativePropertyData * RelatedMethod(QObject *object, - const QDeclarativePropertyData *current, - QDeclarativePropertyData &dummy) +static const QQmlPropertyData * RelatedMethod(QObject *object, + const QQmlPropertyData *current, + QQmlPropertyData &dummy) { - QDeclarativePropertyCache *cache = QDeclarativeData::get(object)->propertyCache; + QQmlPropertyCache *cache = QQmlData::get(object)->propertyCache; if (!current->isOverload()) return 0; @@ -1677,7 +1677,7 @@ static const QDeclarativePropertyData * RelatedMethod(QObject *object, QByteArray methodName = QMetaMethod_name(method); for (int ii = current->overrideIndex - 1; ii >= methodOffset; --ii) { if (methodName == QMetaMethod_name(mo->method(ii))) { - dummy.setFlags(dummy.getFlags() | QDeclarativePropertyData::IsOverload); + dummy.setFlags(dummy.getFlags() | QQmlPropertyData::IsOverload); dummy.overrideIndexIsProperty = 0; dummy.overrideIndex = ii; return &dummy; @@ -1688,7 +1688,7 @@ static const QDeclarativePropertyData * RelatedMethod(QObject *object, } } -static v8::Handle<v8::Value> CallPrecise(QObject *object, const QDeclarativePropertyData &data, +static v8::Handle<v8::Value> CallPrecise(QObject *object, const QQmlPropertyData &data, QV8Engine *engine, CallArgs &callArgs) { if (data.hasArguments()) { @@ -1697,7 +1697,7 @@ static v8::Handle<v8::Value> CallPrecise(QObject *object, const QDeclarativeProp QVarLengthArray<int, 9> dummy; QByteArray unknownTypeError; - args = QDeclarativePropertyCache::methodParameterTypes(object, data.coreIndex, dummy, + args = QQmlPropertyCache::methodParameterTypes(object, data.coreIndex, dummy, &unknownTypeError); if (!args) { @@ -1735,24 +1735,24 @@ Resolve the overloaded method to call. The algorithm works conceptually like th If two or more overloads have the same match score, call the last one. The match score is constructed by adding the matchScore() result for each of the parameters. */ -static v8::Handle<v8::Value> CallOverloaded(QObject *object, const QDeclarativePropertyData &data, +static v8::Handle<v8::Value> CallOverloaded(QObject *object, const QQmlPropertyData &data, QV8Engine *engine, CallArgs &callArgs) { int argumentCount = callArgs.Length(); - const QDeclarativePropertyData *best = 0; + const QQmlPropertyData *best = 0; int bestParameterScore = INT_MAX; int bestMatchScore = INT_MAX; - QDeclarativePropertyData dummy; - const QDeclarativePropertyData *attempt = &data; + QQmlPropertyData dummy; + const QQmlPropertyData *attempt = &data; do { QVarLengthArray<int, 9> dummy; int methodArgumentCount = 0; int *methodArgTypes = 0; if (attempt->hasArguments()) { - typedef QDeclarativePropertyCache PC; + typedef QQmlPropertyCache PC; int *args = PC::methodParameterTypes(object, attempt->coreIndex, dummy, 0); if (!args) // Must be an unknown argument continue; @@ -1787,7 +1787,7 @@ static v8::Handle<v8::Value> CallOverloaded(QObject *object, const QDeclarativeP return CallPrecise(object, *best, engine, callArgs); } else { QString error = QLatin1String("Unable to determine callable overload. Candidates are:"); - const QDeclarativePropertyData *candidate = &data; + const QQmlPropertyData *candidate = &data; while (candidate) { error += QLatin1String("\n ") + QString::fromUtf8(object->metaObject()->method(candidate->coreIndex).signature()); @@ -1825,7 +1825,7 @@ static v8::Handle<v8::Value> ToString(QV8Engine *engine, QObject *object, int, v static v8::Handle<v8::Value> Destroy(QV8Engine *, QObject *object, int argCount, v8::Handle<v8::Object> args) { - QDeclarativeData *ddata = QDeclarativeData::get(object, false); + QQmlData *ddata = QQmlData::get(object, false); if (!ddata || ddata->indestructible) { const char *error = "Invalid attempt to destroy() an indestructible object"; v8::ThrowException(v8::Exception::Error(v8::String::New(error))); @@ -1883,11 +1883,11 @@ v8::Handle<v8::Value> QV8QObjectWrapper::Invoke(const v8::Arguments &args) } } - QDeclarativePropertyData method; + QQmlPropertyData method; - if (QDeclarativeData *ddata = static_cast<QDeclarativeData *>(QObjectPrivate::get(object)->declarativeData)) { + if (QQmlData *ddata = static_cast<QQmlData *>(QObjectPrivate::get(object)->declarativeData)) { if (ddata->propertyCache) { - QDeclarativePropertyData *d = ddata->propertyCache->method(index); + QQmlPropertyData *d = ddata->propertyCache->method(index); if (!d) return v8::Undefined(); method = *d; @@ -1905,10 +1905,10 @@ v8::Handle<v8::Value> QV8QObjectWrapper::Invoke(const v8::Arguments &args) v8::Handle<v8::Value> rv; v8::Handle<v8::Object> qmlglobal = args[2]->ToObject(); - QDeclarativeV8Function func(argCount, arguments, rv, qmlglobal, + QQmlV8Function func(argCount, arguments, rv, qmlglobal, resource->engine->contextWrapper()->context(qmlglobal), resource->engine); - QDeclarativeV8Function *funcptr = &func; + QQmlV8Function *funcptr = &func; void *args[] = { 0, &funcptr }; QMetaObject::metacall(object, QMetaObject::InvokeMetaMethod, method.coreIndex, args); @@ -1982,9 +1982,9 @@ void CallArgument::initAsType(int callType) } else if (callType == qMetaTypeId<QList<QObject *> >()) { type = callType; qlistPtr = new (&allocData) QList<QObject *>(); - } else if (callType == qMetaTypeId<QDeclarativeV8Handle>()) { + } else if (callType == qMetaTypeId<QQmlV8Handle>()) { type = callType; - handlePtr = new (&allocData) QDeclarativeV8Handle; + handlePtr = new (&allocData) QQmlV8Handle; } else { type = -1; qvariantPtr = new (&allocData) QVariant(callType, (void *)0); @@ -2036,14 +2036,14 @@ void CallArgument::fromValue(int callType, QV8Engine *engine, v8::Handle<v8::Val qlistPtr->append(engine->toQObject(value)); } type = callType; - } else if (callType == qMetaTypeId<QDeclarativeV8Handle>()) { - handlePtr = new (&allocData) QDeclarativeV8Handle(QDeclarativeV8Handle::fromHandle(value)); + } else if (callType == qMetaTypeId<QQmlV8Handle>()) { + handlePtr = new (&allocData) QQmlV8Handle(QQmlV8Handle::fromHandle(value)); type = callType; } else { qvariantPtr = new (&allocData) QVariant(); type = -1; - QDeclarativeEnginePrivate *ep = engine->engine() ? QDeclarativeEnginePrivate::get(engine->engine()) : 0; + QQmlEnginePrivate *ep = engine->engine() ? QQmlEnginePrivate::get(engine->engine()) : 0; QVariant v = engine->toVariant(value, -1); if (v.userType() == callType) { @@ -2086,7 +2086,7 @@ v8::Handle<v8::Value> CallArgument::toValue(QV8Engine *engine) } else if (type == QMetaType::QObjectStar) { QObject *object = qobjectPtr; if (object) - QDeclarativeData::get(object, true)->setImplicitDestructible(); + QQmlData::get(object, true)->setImplicitDestructible(); return engine->newQObject(object); } else if (type == qMetaTypeId<QList<QObject *> >()) { // XXX Can this be made more by using Array as a prototype and implementing @@ -2096,13 +2096,13 @@ v8::Handle<v8::Value> CallArgument::toValue(QV8Engine *engine) for (int ii = 0; ii < list.count(); ++ii) array->Set(ii, engine->newQObject(list.at(ii))); return array; - } else if (type == qMetaTypeId<QDeclarativeV8Handle>()) { + } else if (type == qMetaTypeId<QQmlV8Handle>()) { return handlePtr->toHandle(); } else if (type == -1 || type == qMetaTypeId<QVariant>()) { QVariant value = *qvariantPtr; v8::Handle<v8::Value> rv = engine->fromVariant(value); if (QObject *object = engine->toQObject(rv)) - QDeclarativeData::get(object, true)->setImplicitDestructible(); + QQmlData::get(object, true)->setImplicitDestructible(); return rv; } else { return v8::Undefined(); diff --git a/src/declarative/qml/v8/qv8qobjectwrapper_p.h b/src/qml/qml/v8/qv8qobjectwrapper_p.h index c029285d08..f7b965690b 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper_p.h +++ b/src/qml/qml/v8/qv8qobjectwrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -59,19 +59,19 @@ #include <QtCore/qhash.h> #include <private/qv8_p.h> #include <private/qhashedstring_p.h> -#include <private/qdeclarativedata_p.h> -#include <private/qdeclarativepropertycache_p.h> +#include <private/qqmldata_p.h> +#include <private/qqmlpropertycache_p.h> QT_BEGIN_NAMESPACE class QObject; class QV8Engine; -class QDeclarativeData; +class QQmlData; class QV8ObjectResource; class QV8QObjectInstance; class QV8QObjectConnectionList; -class QDeclarativePropertyCache; -class Q_DECLARATIVE_EXPORT QV8QObjectWrapper +class QQmlPropertyCache; +class Q_QML_EXPORT QV8QObjectWrapper { public: QV8QObjectWrapper(); @@ -90,11 +90,11 @@ public: inline bool setProperty(QObject *, const QHashedV8String &, v8::Handle<v8::Value>, RevisionMode); private: - friend class QDeclarativePropertyCache; + friend class QQmlPropertyCache; friend class QV8QObjectConnectionList; friend class QV8QObjectInstance; - v8::Local<v8::Object> newQObject(QObject *, QDeclarativeData *, QV8Engine *); + v8::Local<v8::Object> newQObject(QObject *, QQmlData *, QV8Engine *); static v8::Handle<v8::Value> GetProperty(QV8Engine *, QObject *, v8::Handle<v8::Value> *, const QHashedV8String &, QV8QObjectWrapper::RevisionMode); static bool SetProperty(QV8Engine *, QObject *, const QHashedV8String &, @@ -131,7 +131,7 @@ private: v8::Handle<v8::Value> QV8QObjectWrapper::getProperty(QObject *object, const QHashedV8String &string, RevisionMode mode) { - QDeclarativeData *dd = QDeclarativeData::get(object, false); + QQmlData *dd = QQmlData::get(object, false); if (!dd || !dd->propertyCache || m_toStringString == string || m_destroyString == string || dd->propertyCache->property(string)) { return GetProperty(m_engine, object, 0, string, mode); @@ -143,7 +143,7 @@ v8::Handle<v8::Value> QV8QObjectWrapper::getProperty(QObject *object, const QHas bool QV8QObjectWrapper::setProperty(QObject *object, const QHashedV8String &string, v8::Handle<v8::Value> value, RevisionMode mode) { - QDeclarativeData *dd = QDeclarativeData::get(object, false); + QQmlData *dd = QQmlData::get(object, false); if (!dd || !dd->propertyCache || m_toStringString == string || m_destroyString == string || dd->propertyCache->property(string)) { return SetProperty(m_engine, object, string, value, mode); diff --git a/src/declarative/qml/v8/qv8sequencewrapper.cpp b/src/qml/qml/v8/qv8sequencewrapper.cpp index 7d7184e83d..883ed1b60c 100644 --- a/src/declarative/qml/v8/qv8sequencewrapper.cpp +++ b/src/qml/qml/v8/qv8sequencewrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include "qv8sequencewrapper_p.h" #include "qv8sequencewrapper_p_p.h" diff --git a/src/declarative/qml/v8/qv8sequencewrapper_p.h b/src/qml/qml/v8/qv8sequencewrapper_p.h index fae21d0b88..104135ff76 100644 --- a/src/declarative/qml/v8/qv8sequencewrapper_p.h +++ b/src/qml/qml/v8/qv8sequencewrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8sequencewrapper_p_p.h b/src/qml/qml/v8/qv8sequencewrapper_p_p.h index 41cdcaa8b7..9d519809fa 100644 --- a/src/declarative/qml/v8/qv8sequencewrapper_p_p.h +++ b/src/qml/qml/v8/qv8sequencewrapper_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,8 +53,8 @@ // We mean it. // -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativemetatype_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlmetatype_p.h> QT_BEGIN_NAMESPACE @@ -113,11 +113,11 @@ static void generateWarning(QV8Engine *engine, const QString& description) if (currFrame.IsEmpty()) return; - QDeclarativeError retn; + QQmlError retn; retn.setDescription(description); retn.setLine(currFrame->GetLineNumber()); retn.setUrl(QUrl(engine->toString(currFrame->GetScriptName()))); - QDeclarativeEnginePrivate::warning(engine->engine(), retn); + QQmlEnginePrivate::warning(engine->engine(), retn); } @@ -480,13 +480,13 @@ static QString convertUrlToString(QV8Engine *, const QUrl &v) Q_ASSERT(object); \ Q_ASSERT(objectType == QV8SequenceResource::Reference); \ int status = -1; \ - QDeclarativePropertyPrivate::WriteFlags flags = \ - QDeclarativePropertyPrivate::DontRemoveBinding; \ + QQmlPropertyPrivate::WriteFlags flags = \ + QQmlPropertyPrivate::DontRemoveBinding; \ void *a[] = { &c, 0, &status, &flags }; \ QMetaObject::metacall(object, QMetaObject::WriteProperty, propertyIndex, a); \ } \ private: \ - QDeclarativeGuard<QObject> object; \ + QQmlGuard<QObject> object; \ int propertyIndex; \ SequenceType c; \ }; diff --git a/src/declarative/qml/v8/qv8sqlerrors.cpp b/src/qml/qml/v8/qv8sqlerrors.cpp index f5e868650e..8c5856ea18 100644 --- a/src/declarative/qml/v8/qv8sqlerrors.cpp +++ b/src/qml/qml/v8/qv8sqlerrors.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8sqlerrors_p.h b/src/qml/qml/v8/qv8sqlerrors_p.h index 8f4668cedd..c799be6e7c 100644 --- a/src/declarative/qml/v8/qv8sqlerrors_p.h +++ b/src/qml/qml/v8/qv8sqlerrors_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8stringwrapper.cpp b/src/qml/qml/v8/qv8stringwrapper.cpp index bff932150d..d4abbdc60b 100644 --- a/src/declarative/qml/v8/qv8stringwrapper.cpp +++ b/src/qml/qml/v8/qv8stringwrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/qv8stringwrapper_p.h b/src/qml/qml/v8/qv8stringwrapper_p.h index 89fd5448d7..1609720298 100644 --- a/src/declarative/qml/v8/qv8stringwrapper_p.h +++ b/src/qml/qml/v8/qv8stringwrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEV8STRINGWRAPPER_P_H -#define QDECLARATIVEV8STRINGWRAPPER_P_H +#ifndef QQMLV8STRINGWRAPPER_P_H +#define QQMLV8STRINGWRAPPER_P_H // // W A R N I N G @@ -53,12 +53,14 @@ // We mean it. // +#include <QtQml/qtqmlglobal.h> + #include <QtCore/qstring.h> #include <private/qv8_p.h> QT_BEGIN_NAMESPACE -class Q_DECLARATIVE_EXPORT QV8StringWrapper +class Q_QML_EXPORT QV8StringWrapper { public: QV8StringWrapper(); @@ -73,4 +75,4 @@ public: QT_END_NAMESPACE -#endif // QDECLARATIVEV8STRINGWRAPPER_P_H +#endif // QQMLV8STRINGWRAPPER_P_H diff --git a/src/declarative/qml/v8/qv8typewrapper.cpp b/src/qml/qml/v8/qv8typewrapper.cpp index d9060be309..dbf369e678 100644 --- a/src/declarative/qml/v8/qv8typewrapper.cpp +++ b/src/qml/qml/v8/qv8typewrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,8 +42,8 @@ #include "qv8contextwrapper_p.h" #include "qv8engine_p.h" -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativecontext_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlcontext_p.h> #include <private/qjsvalue_p.h> #include <private/qscript_impl_p.h> @@ -60,10 +60,10 @@ public: QV8TypeWrapper::TypeNameMode mode; - QDeclarativeGuard<QObject> object; + QQmlGuard<QObject> object; - QDeclarativeType *type; - QDeclarativeTypeNameCache *typeNamespace; + QQmlType *type; + QQmlTypeNameCache *typeNamespace; const void *importNamespace; }; @@ -101,7 +101,7 @@ void QV8TypeWrapper::init(QV8Engine *engine) } // Returns a type wrapper for type t on o. This allows access of enums, and attached properties. -v8::Local<v8::Object> QV8TypeWrapper::newObject(QObject *o, QDeclarativeType *t, TypeNameMode mode) +v8::Local<v8::Object> QV8TypeWrapper::newObject(QObject *o, QQmlType *t, TypeNameMode mode) { Q_ASSERT(t); // XXX NewInstance() should be optimized @@ -114,7 +114,7 @@ v8::Local<v8::Object> QV8TypeWrapper::newObject(QObject *o, QDeclarativeType *t, // Returns a type wrapper for importNamespace (of t) on o. This allows nested resolution of a type in a // namespace. -v8::Local<v8::Object> QV8TypeWrapper::newObject(QObject *o, QDeclarativeTypeNameCache *t, +v8::Local<v8::Object> QV8TypeWrapper::newObject(QObject *o, QQmlTypeNameCache *t, const void *importNamespace, TypeNameMode mode) { Q_ASSERT(t); @@ -135,7 +135,7 @@ QVariant QV8TypeWrapper::toVariant(QV8ObjectResource *r) QV8Engine *v8engine = resource->engine; if (resource->typeNamespace) { - if (QDeclarativeMetaType::ModuleApiInstance *moduleApi = resource->typeNamespace->moduleApi(resource->importNamespace)) { + if (QQmlMetaType::ModuleApiInstance *moduleApi = resource->typeNamespace->moduleApi(resource->importNamespace)) { if (moduleApi->scriptCallback) { moduleApi->scriptApi = moduleApi->scriptCallback(v8engine->engine(), v8engine->engine()); moduleApi->scriptCallback = 0; @@ -170,7 +170,7 @@ v8::Handle<v8::Value> QV8TypeWrapper::Getter(v8::Local<v8::String> property, QHashedV8String propertystring(property); if (resource->type) { - QDeclarativeType *type = resource->type; + QQmlType *type = resource->type; if (QV8Engine::startsWithUpper(property)) { int value = type->enumValue(propertystring); @@ -192,7 +192,7 @@ v8::Handle<v8::Value> QV8TypeWrapper::Getter(v8::Local<v8::String> property, } else if (resource->typeNamespace) { Q_ASSERT(resource->importNamespace); - QDeclarativeTypeNameCache::Result r = resource->typeNamespace->query(propertystring, + QQmlTypeNameCache::Result r = resource->typeNamespace->query(propertystring, resource->importNamespace); if (r.isValid()) { @@ -200,13 +200,13 @@ v8::Handle<v8::Value> QV8TypeWrapper::Getter(v8::Local<v8::String> property, return v8engine->typeWrapper()->newObject(object, r.type, resource->mode); } else if (r.scriptIndex != -1) { int index = r.scriptIndex; - QDeclarativeContextData *context = v8engine->callingContext(); + QQmlContextData *context = v8engine->callingContext(); if (index < context->importedScripts.count()) return context->importedScripts.at(index); } return v8::Undefined(); - } else if (QDeclarativeMetaType::ModuleApiInstance *moduleApi = resource->typeNamespace->moduleApi(resource->importNamespace)) { + } else if (QQmlMetaType::ModuleApiInstance *moduleApi = resource->typeNamespace->moduleApi(resource->importNamespace)) { if (moduleApi->scriptCallback) { moduleApi->scriptApi = moduleApi->scriptCallback(v8engine->engine(), v8engine->engine()); @@ -273,14 +273,14 @@ v8::Handle<v8::Value> QV8TypeWrapper::Setter(v8::Local<v8::String> property, QHashedV8String propertystring(property); if (resource->type && resource->object) { - QDeclarativeType *type = resource->type; + QQmlType *type = resource->type; QObject *object = resource->object; QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(), object); if (ao) v8engine->qobjectWrapper()->setProperty(ao, propertystring, value, QV8QObjectWrapper::IgnoreRevision); } else if (resource->typeNamespace) { - if (QDeclarativeMetaType::ModuleApiInstance *moduleApi = resource->typeNamespace->moduleApi(resource->importNamespace)) { + if (QQmlMetaType::ModuleApiInstance *moduleApi = resource->typeNamespace->moduleApi(resource->importNamespace)) { if (moduleApi->scriptCallback) { moduleApi->scriptApi = moduleApi->scriptCallback(v8engine->engine(), v8engine->engine()); moduleApi->scriptCallback = 0; diff --git a/src/declarative/qml/v8/qv8typewrapper_p.h b/src/qml/qml/v8/qv8typewrapper_p.h index d30dbfbc24..8b658da6fb 100644 --- a/src/declarative/qml/v8/qv8typewrapper_p.h +++ b/src/qml/qml/v8/qv8typewrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE class QObject; class QV8Engine; -class QDeclarativeType; -class QDeclarativeTypeNameCache; +class QQmlType; +class QQmlTypeNameCache; class QV8TypeWrapper { public: @@ -72,8 +72,8 @@ public: void destroy(); enum TypeNameMode { IncludeEnums, ExcludeEnums }; - v8::Local<v8::Object> newObject(QObject *, QDeclarativeType *, TypeNameMode = IncludeEnums); - v8::Local<v8::Object> newObject(QObject *, QDeclarativeTypeNameCache *, const void *, + v8::Local<v8::Object> newObject(QObject *, QQmlType *, TypeNameMode = IncludeEnums); + v8::Local<v8::Object> newObject(QObject *, QQmlTypeNameCache *, const void *, TypeNameMode = IncludeEnums); QVariant toVariant(QV8ObjectResource *); diff --git a/src/declarative/qml/v8/qv8valuetypewrapper.cpp b/src/qml/qml/v8/qv8valuetypewrapper.cpp index 7da3d8a2dc..54d871d5f0 100644 --- a/src/declarative/qml/v8/qv8valuetypewrapper.cpp +++ b/src/qml/qml/v8/qv8valuetypewrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,8 +42,8 @@ #include "qv8valuetypewrapper_p.h" #include "qv8engine_p.h" -#include <private/qdeclarativevaluetype_p.h> -#include <private/qdeclarativebinding_p.h> +#include <private/qqmlvaluetype_p.h> +#include <private/qqmlbinding_p.h> QT_BEGIN_NAMESPACE @@ -57,7 +57,7 @@ public: QV8ValueTypeResource(QV8Engine *engine, ObjectType objectType); ObjectType objectType; - QDeclarativeValueType *type; + QQmlValueType *type; }; class QV8ValueTypeReferenceResource : public QV8ValueTypeResource @@ -65,7 +65,7 @@ class QV8ValueTypeReferenceResource : public QV8ValueTypeResource public: QV8ValueTypeReferenceResource(QV8Engine *engine); - QDeclarativeGuard<QObject> object; + QQmlGuard<QObject> object; int property; }; @@ -128,7 +128,7 @@ void QV8ValueTypeWrapper::init(QV8Engine *engine) toStringHash = m_toStringString.hash(); } -v8::Local<v8::Object> QV8ValueTypeWrapper::newValueType(QObject *object, int property, QDeclarativeValueType *type) +v8::Local<v8::Object> QV8ValueTypeWrapper::newValueType(QObject *object, int property, QQmlValueType *type) { // XXX NewInstance() should be optimized v8::Local<v8::Object> rv = m_constructor->NewInstance(); @@ -138,7 +138,7 @@ v8::Local<v8::Object> QV8ValueTypeWrapper::newValueType(QObject *object, int pro return rv; } -v8::Local<v8::Object> QV8ValueTypeWrapper::newValueType(const QVariant &value, QDeclarativeValueType *type) +v8::Local<v8::Object> QV8ValueTypeWrapper::newValueType(const QVariant &value, QQmlValueType *type) { // XXX NewInstance() should be optimized v8::Local<v8::Object> rv = m_constructor->NewInstance(); @@ -249,14 +249,14 @@ v8::Handle<v8::Value> QV8ValueTypeWrapper::Getter(v8::Local<v8::String> property } } - QDeclarativePropertyData local; - QDeclarativePropertyData *result = 0; + QQmlPropertyData local; + QQmlPropertyData *result = 0; { - QDeclarativeData *ddata = QDeclarativeData::get(r->type, false); + QQmlData *ddata = QQmlData::get(r->type, false); if (ddata && ddata->propertyCache) result = ddata->propertyCache->property(propertystring); else - result = QDeclarativePropertyCache::property(r->engine->engine(), r->type, + result = QQmlPropertyCache::property(r->engine->engine(), r->type, propertystring, local); } @@ -321,15 +321,15 @@ v8::Handle<v8::Value> QV8ValueTypeWrapper::Setter(v8::Local<v8::String> property r->type->read(reference->object, reference->property); QMetaProperty p = r->type->metaObject()->property(index); - QDeclarativeBinding *newBinding = 0; + QQmlBinding *newBinding = 0; if (value->IsFunction()) { - QDeclarativeContextData *context = r->engine->callingContext(); + QQmlContextData *context = r->engine->callingContext(); v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(value); - QDeclarativePropertyData cacheData; - cacheData.setFlags(QDeclarativePropertyData::IsWritable | - QDeclarativePropertyData::IsValueTypeVirtual); + QQmlPropertyData cacheData; + cacheData.setFlags(QQmlPropertyData::IsWritable | + QQmlPropertyData::IsValueTypeVirtual); cacheData.propType = reference->object->metaObject()->property(reference->property).userType(); cacheData.coreIndex = reference->property; cacheData.valueTypeFlags = 0; @@ -345,15 +345,15 @@ v8::Handle<v8::Value> QV8ValueTypeWrapper::Setter(v8::Local<v8::String> property int columnNumber = frame->GetColumn(); QString url = r->engine->toString(frame->GetScriptName()); - newBinding = new QDeclarativeBinding(&function, reference->object, context); + newBinding = new QQmlBinding(&function, reference->object, context); newBinding->setSourceLocation(url, lineNumber, columnNumber); newBinding->setTarget(reference->object, cacheData, context); newBinding->setEvaluateFlags(newBinding->evaluateFlags() | - QDeclarativeBinding::RequiresThisObject); + QQmlBinding::RequiresThisObject); } - QDeclarativeAbstractBinding *oldBinding = - QDeclarativePropertyPrivate::setBinding(reference->object, reference->property, index, newBinding); + QQmlAbstractBinding *oldBinding = + QQmlPropertyPrivate::setBinding(reference->object, reference->property, index, newBinding); if (oldBinding) oldBinding->destroy(); diff --git a/src/declarative/qml/v8/qv8valuetypewrapper_p.h b/src/qml/qml/v8/qv8valuetypewrapper_p.h index 09f6e7def3..b80d3cbbba 100644 --- a/src/declarative/qml/v8/qv8valuetypewrapper_p.h +++ b/src/qml/qml/v8/qv8valuetypewrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -54,7 +54,7 @@ // #include <QtCore/qglobal.h> -#include <QtDeclarative/qdeclarativelist.h> +#include <QtQml/qqmllist.h> #include <private/qv8_p.h> #include <private/qhashedstring_p.h> @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE class QV8Engine; class QV8ObjectResource; -class QDeclarativeValueType; +class QQmlValueType; class QV8ValueTypeWrapper { public: @@ -72,8 +72,8 @@ public: void init(QV8Engine *); void destroy(); - v8::Local<v8::Object> newValueType(QObject *, int, QDeclarativeValueType *); - v8::Local<v8::Object> newValueType(const QVariant &, QDeclarativeValueType *); + v8::Local<v8::Object> newValueType(QObject *, int, QQmlValueType *); + v8::Local<v8::Object> newValueType(const QVariant &, QQmlValueType *); QVariant toVariant(v8::Handle<v8::Object>); QVariant toVariant(QV8ObjectResource *); diff --git a/src/declarative/qml/v8/qv8variantresource_p.h b/src/qml/qml/v8/qv8variantresource_p.h index dd8664ff15..0b6328cb54 100644 --- a/src/declarative/qml/v8/qv8variantresource_p.h +++ b/src/qml/qml/v8/qv8variantresource_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,12 +56,12 @@ #include <QtCore/qglobal.h> #include <private/qv8_p.h> #include <private/qv8engine_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE class QV8VariantResource : public QV8ObjectResource, - public QDeclarativeEnginePrivate::ScarceResourceData + public QQmlEnginePrivate::ScarceResourceData { V8_RESOURCE_TYPE(VariantType) diff --git a/src/declarative/qml/v8/qv8variantwrapper.cpp b/src/qml/qml/v8/qv8variantwrapper.cpp index cd9d09e451..4b1fc643f6 100644 --- a/src/declarative/qml/v8/qv8variantwrapper.cpp +++ b/src/qml/qml/v8/qv8variantwrapper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,12 +42,12 @@ #include "qv8variantwrapper_p.h" #include "qv8variantresource_p.h" #include "qv8engine_p.h" -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE QV8VariantResource::QV8VariantResource(QV8Engine *engine, const QVariant &data) -: QV8ObjectResource(engine), QDeclarativeEnginePrivate::ScarceResourceData(data), m_isScarceResource(false), m_vmePropertyReferenceCount(0) +: QV8ObjectResource(engine), QQmlEnginePrivate::ScarceResourceData(data), m_isScarceResource(false), m_vmePropertyReferenceCount(0) { } @@ -67,7 +67,7 @@ void QV8VariantResource::removeVmePropertyReference() // and add to the ep->scarceResources list // since it is now eligible to be released // automatically by the engine. - QDeclarativeEnginePrivate::get(engine->engine())->scarceResources.insert(this); + QQmlEnginePrivate::get(engine->engine())->scarceResources.insert(this); } } @@ -143,7 +143,7 @@ v8::Local<v8::Object> QV8VariantWrapper::newVariant(const QVariant &value) QV8VariantResource *r = new QV8VariantResource(m_engine, value); if (scarceResource) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(m_engine->engine()); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(m_engine->engine()); Q_ASSERT(ep->scarceResourcesRefCount); rv = m_scarceConstructor->NewInstance(); r->m_isScarceResource = true; diff --git a/src/declarative/qml/v8/qv8variantwrapper_p.h b/src/qml/qml/v8/qv8variantwrapper_p.h index 578acf01c8..877155c8ca 100644 --- a/src/declarative/qml/v8/qv8variantwrapper_p.h +++ b/src/qml/qml/v8/qv8variantwrapper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -54,7 +54,7 @@ // #include <QtCore/qglobal.h> -#include <QtDeclarative/qdeclarativelist.h> +#include <QtQml/qqmllist.h> #include <private/qv8_p.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/v8/qv8worker.cpp b/src/qml/qml/v8/qv8worker.cpp index 90c8b8441d..6ea527166c 100644 --- a/src/declarative/qml/v8/qv8worker.cpp +++ b/src/qml/qml/v8/qv8worker.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -41,8 +41,8 @@ #include "qv8worker_p.h" -#include <private/qdeclarativelistmodel_p.h> -#include <private/qdeclarativelistmodelworkeragent_p.h> +#include <private/qquicklistmodel_p.h> +#include <private/qquicklistmodelworkeragent_p.h> QT_BEGIN_NAMESPACE @@ -242,9 +242,9 @@ void QV8Worker::serialize(QByteArray &data, v8::Handle<v8::Value> v, QV8Engine * } else if (engine->isQObject(v)) { // XXX TODO: Generalize passing objects between the main thread and worker scripts so // that others can trivially plug in their elements. - QDeclarativeListModel *lm = qobject_cast<QDeclarativeListModel *>(engine->toQObject(v)); + QQuickListModel *lm = qobject_cast<QQuickListModel *>(engine->toQObject(v)); if (lm && lm->agent()) { - QDeclarativeListModelWorkerAgent *agent = lm->agent(); + QQuickListModelWorkerAgent *agent = lm->agent(); agent->addref(); push(data, valueheader(WorkerListModel)); push(data, (void *)agent); @@ -347,10 +347,10 @@ v8::Handle<v8::Value> QV8Worker::deserialize(const char *&data, QV8Engine *engin case WorkerListModel: { void *ptr = popPtr(data); - QDeclarativeListModelWorkerAgent *agent = (QDeclarativeListModelWorkerAgent *)ptr; + QQuickListModelWorkerAgent *agent = (QQuickListModelWorkerAgent *)ptr; v8::Handle<v8::Value> rv = engine->newQObject(agent); if (rv->IsObject()) { - QDeclarativeListModelWorkerAgent::VariantRef ref(agent); + QQuickListModelWorkerAgent::VariantRef ref(agent); QVariant var = qVariantFromValue(ref); rv->ToObject()->SetHiddenValue(v8::String::New("qml::ref"), engine->fromVariant(var)); } diff --git a/src/declarative/qml/v8/qv8worker_p.h b/src/qml/qml/v8/qv8worker_p.h index f920446b27..d398d21f60 100644 --- a/src/declarative/qml/v8/qv8worker_p.h +++ b/src/qml/qml/v8/qv8worker_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/declarative/qml/v8/script.pri b/src/qml/qml/v8/script.pri index 3439413f5e..3439413f5e 100644 --- a/src/declarative/qml/v8/script.pri +++ b/src/qml/qml/v8/script.pri diff --git a/src/declarative/qml/v8/v8.pri b/src/qml/qml/v8/v8.pri index 72416c4dbb..de492a8ce5 100644 --- a/src/declarative/qml/v8/v8.pri +++ b/src/qml/qml/v8/v8.pri @@ -24,7 +24,7 @@ HEADERS += \ $$PWD/qv8engine_impl_p.h \ $$PWD/qv8domerrors_p.h \ $$PWD/qv8sqlerrors_p.h \ - $$PWD/qdeclarativebuiltinfunctions_p.h + $$PWD/qqmlbuiltinfunctions_p.h SOURCES += \ $$PWD/qv8stringwrapper.cpp \ @@ -42,4 +42,4 @@ SOURCES += \ $$PWD/../../../3rdparty/javascriptcore/DateMath.cpp \ $$PWD/qv8domerrors.cpp \ $$PWD/qv8sqlerrors.cpp \ - $$PWD/qdeclarativebuiltinfunctions.cpp
\ No newline at end of file + $$PWD/qqmlbuiltinfunctions.cpp
\ No newline at end of file diff --git a/src/qml/qtqmlglobal.h b/src/qml/qtqmlglobal.h new file mode 100644 index 0000000000..65277e60a9 --- /dev/null +++ b/src/qml/qtqmlglobal.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QTQMLGLOBAL_H +#define QTQMLGLOBAL_H + +#include <QtCore/qglobal.h> + +#if defined(Q_OS_WIN) +# if defined(QT_MAKEDLL) /* create a Qt DLL library */ +# if defined(QT_BUILD_QML_LIB) +# define Q_QML_EXPORT Q_DECL_EXPORT +# else +# define Q_QML_EXPORT Q_DECL_IMPORT +# endif +# elif defined(QT_DLL) /* use a Qt DLL library */ +# define Q_QML_EXPORT Q_DECL_IMPORT +# endif +#endif + +#if !defined(Q_QML_EXPORT) +# if defined(QT_SHARED) +# define Q_QML_EXPORT Q_DECL_EXPORT +# else +# define Q_QML_EXPORT +# endif +#endif + +#endif // QTQMLGLOBAL_H diff --git a/src/qml/qtqmlglobal_p.h b/src/qml/qtqmlglobal_p.h new file mode 100644 index 0000000000..36926228c7 --- /dev/null +++ b/src/qml/qtqmlglobal_p.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QTQMLGLOBAL_P_H +#define QTQMLGLOBAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qtqmlglobal.h" + +#define Q_QML_PRIVATE_EXPORT Q_QML_EXPORT + +#endif // QTQMLGLOBAL_P_H diff --git a/src/declarative/util/qdeclarativepropertymap.cpp b/src/qml/util/qqmlpropertymap.cpp index 8ec1517017..5010af17c8 100644 --- a/src/declarative/util/qdeclarativepropertymap.cpp +++ b/src/qml/util/qqmlpropertymap.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,42 +39,42 @@ ** ****************************************************************************/ -#include "qdeclarativepropertymap.h" +#include "qqmlpropertymap.h" #include <private/qmetaobjectbuilder_p.h> -#include <private/qdeclarativeopenmetaobject_p.h> +#include <private/qqmlopenmetaobject_p.h> #include <QDebug> QT_BEGIN_NAMESPACE -//QDeclarativePropertyMapMetaObject lets us listen for changes coming from QML +//QQmlPropertyMapMetaObject lets us listen for changes coming from QML //so we can emit the changed signal. -class QDeclarativePropertyMapMetaObject : public QDeclarativeOpenMetaObject +class QQmlPropertyMapMetaObject : public QQmlOpenMetaObject { public: - QDeclarativePropertyMapMetaObject(QDeclarativePropertyMap *obj, QDeclarativePropertyMapPrivate *objPriv); + QQmlPropertyMapMetaObject(QQmlPropertyMap *obj, QQmlPropertyMapPrivate *objPriv); protected: virtual void propertyWritten(int index); virtual void propertyCreated(int, QMetaPropertyBuilder &); virtual int createProperty(const char *, const char *); private: - QDeclarativePropertyMap *map; - QDeclarativePropertyMapPrivate *priv; + QQmlPropertyMap *map; + QQmlPropertyMapPrivate *priv; }; -class QDeclarativePropertyMapPrivate : public QObjectPrivate +class QQmlPropertyMapPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativePropertyMap) + Q_DECLARE_PUBLIC(QQmlPropertyMap) public: - QDeclarativePropertyMapMetaObject *mo; + QQmlPropertyMapMetaObject *mo; QStringList keys; void emitChanged(const QString &key, const QVariant &value); bool validKeyName(const QString& name); }; -bool QDeclarativePropertyMapPrivate::validKeyName(const QString& name) +bool QQmlPropertyMapPrivate::validKeyName(const QString& name) { //The following strings shouldn't be used as property names return name != QLatin1String("keys") @@ -84,53 +84,53 @@ bool QDeclarativePropertyMapPrivate::validKeyName(const QString& name) && name != QLatin1String("deleteLater"); } -void QDeclarativePropertyMapPrivate::emitChanged(const QString &key, const QVariant &value) +void QQmlPropertyMapPrivate::emitChanged(const QString &key, const QVariant &value) { - Q_Q(QDeclarativePropertyMap); + Q_Q(QQmlPropertyMap); emit q->valueChanged(key, value); } -QDeclarativePropertyMapMetaObject::QDeclarativePropertyMapMetaObject(QDeclarativePropertyMap *obj, QDeclarativePropertyMapPrivate *objPriv) : QDeclarativeOpenMetaObject(obj) +QQmlPropertyMapMetaObject::QQmlPropertyMapMetaObject(QQmlPropertyMap *obj, QQmlPropertyMapPrivate *objPriv) : QQmlOpenMetaObject(obj) { map = obj; priv = objPriv; } -void QDeclarativePropertyMapMetaObject::propertyWritten(int index) +void QQmlPropertyMapMetaObject::propertyWritten(int index) { priv->emitChanged(QString::fromUtf8(name(index)), operator[](index)); } -void QDeclarativePropertyMapMetaObject::propertyCreated(int, QMetaPropertyBuilder &b) +void QQmlPropertyMapMetaObject::propertyCreated(int, QMetaPropertyBuilder &b) { priv->keys.append(QString::fromUtf8(b.name())); } -int QDeclarativePropertyMapMetaObject::createProperty(const char *name, const char *value) +int QQmlPropertyMapMetaObject::createProperty(const char *name, const char *value) { if (!priv->validKeyName(QString::fromUtf8(name))) return -1; - return QDeclarativeOpenMetaObject::createProperty(name, value); + return QQmlOpenMetaObject::createProperty(name, value); } /*! - \class QDeclarativePropertyMap - \brief The QDeclarativePropertyMap class allows you to set key-value pairs that can be used in QML bindings. + \class QQmlPropertyMap + \brief The QQmlPropertyMap class allows you to set key-value pairs that can be used in QML bindings. - QDeclarativePropertyMap provides a convenient way to expose domain data to the UI layer. + QQmlPropertyMap provides a convenient way to expose domain data to the UI layer. The following example shows how you might declare data in C++ and then access it in QML. In the C++ file: \code // create our data - QDeclarativePropertyMap ownerData; + QQmlPropertyMap ownerData; ownerData.insert("name", QVariant(QString("John Smith"))); ownerData.insert("phone", QVariant(QString("555-5555"))); // expose it to the UI layer - QDeclarativeView view; - QDeclarativeContext *ctxt = view.rootContext(); + QQuickView view; + QQmlContext *ctxt = view.rootContext(); ctxt->setContextProperty("owner", &ownerData); view.setSource(QUrl::fromLocalFile("main.qml")); @@ -156,26 +156,26 @@ int QDeclarativePropertyMapMetaObject::createProperty(const char *name, const ch /*! Constructs a bindable map with parent object \a parent. */ -QDeclarativePropertyMap::QDeclarativePropertyMap(QObject *parent) -: QObject(*(new QDeclarativePropertyMapPrivate), parent) +QQmlPropertyMap::QQmlPropertyMap(QObject *parent) +: QObject(*(new QQmlPropertyMapPrivate), parent) { - Q_D(QDeclarativePropertyMap); - d->mo = new QDeclarativePropertyMapMetaObject(this, d); + Q_D(QQmlPropertyMap); + d->mo = new QQmlPropertyMapMetaObject(this, d); } /*! Destroys the bindable map. */ -QDeclarativePropertyMap::~QDeclarativePropertyMap() +QQmlPropertyMap::~QQmlPropertyMap() { } /*! Clears the value (if any) associated with \a key. */ -void QDeclarativePropertyMap::clear(const QString &key) +void QQmlPropertyMap::clear(const QString &key) { - Q_D(QDeclarativePropertyMap); + Q_D(QQmlPropertyMap); d->mo->setValue(key.toUtf8(), QVariant()); } @@ -185,9 +185,9 @@ void QDeclarativePropertyMap::clear(const QString &key) If no value has been set for this key (or if the value has been cleared), an invalid QVariant is returned. */ -QVariant QDeclarativePropertyMap::value(const QString &key) const +QVariant QQmlPropertyMap::value(const QString &key) const { - Q_D(const QDeclarativePropertyMap); + Q_D(const QQmlPropertyMap); return d->mo->value(key.toUtf8()); } @@ -196,9 +196,9 @@ QVariant QDeclarativePropertyMap::value(const QString &key) const If the key doesn't exist, it is automatically created. */ -void QDeclarativePropertyMap::insert(const QString &key, const QVariant &value) +void QQmlPropertyMap::insert(const QString &key, const QVariant &value) { - Q_D(QDeclarativePropertyMap); + Q_D(QQmlPropertyMap); if (d->validKeyName(key)) { d->mo->setValue(key.toUtf8(), value); @@ -215,9 +215,9 @@ void QDeclarativePropertyMap::insert(const QString &key, const QVariant &value) Keys that have been cleared will still appear in this list, even though their associated values are invalid QVariants. */ -QStringList QDeclarativePropertyMap::keys() const +QStringList QQmlPropertyMap::keys() const { - Q_D(const QDeclarativePropertyMap); + Q_D(const QQmlPropertyMap); return d->keys; } @@ -226,9 +226,9 @@ QStringList QDeclarativePropertyMap::keys() const Same as size(). */ -int QDeclarativePropertyMap::count() const +int QQmlPropertyMap::count() const { - Q_D(const QDeclarativePropertyMap); + Q_D(const QQmlPropertyMap); return d->keys.count(); } @@ -237,9 +237,9 @@ int QDeclarativePropertyMap::count() const \sa isEmpty(), count() */ -int QDeclarativePropertyMap::size() const +int QQmlPropertyMap::size() const { - Q_D(const QDeclarativePropertyMap); + Q_D(const QQmlPropertyMap); return d->keys.size(); } @@ -249,9 +249,9 @@ int QDeclarativePropertyMap::size() const \sa size() */ -bool QDeclarativePropertyMap::isEmpty() const +bool QQmlPropertyMap::isEmpty() const { - Q_D(const QDeclarativePropertyMap); + Q_D(const QQmlPropertyMap); return d->keys.isEmpty(); } @@ -260,9 +260,9 @@ bool QDeclarativePropertyMap::isEmpty() const \sa size() */ -bool QDeclarativePropertyMap::contains(const QString &key) const +bool QQmlPropertyMap::contains(const QString &key) const { - Q_D(const QDeclarativePropertyMap); + Q_D(const QQmlPropertyMap); return d->keys.contains(key); } @@ -276,10 +276,10 @@ bool QDeclarativePropertyMap::contains(const QString &key) const \sa insert(), value() */ -QVariant &QDeclarativePropertyMap::operator[](const QString &key) +QVariant &QQmlPropertyMap::operator[](const QString &key) { //### optimize - Q_D(QDeclarativePropertyMap); + Q_D(QQmlPropertyMap); QByteArray utf8key = key.toUtf8(); if (!d->keys.contains(key)) insert(key, QVariant());//force creation -- needed below @@ -292,13 +292,13 @@ QVariant &QDeclarativePropertyMap::operator[](const QString &key) Same as value(). */ -QVariant QDeclarativePropertyMap::operator[](const QString &key) const +QVariant QQmlPropertyMap::operator[](const QString &key) const { return value(key); } /*! - \fn void QDeclarativePropertyMap::valueChanged(const QString &key, const QVariant &value) + \fn void QQmlPropertyMap::valueChanged(const QString &key, const QVariant &value) This signal is emitted whenever one of the values in the map is changed. \a key is the key corresponding to the \a value that was changed. diff --git a/src/declarative/util/qdeclarativepropertymap.h b/src/qml/util/qqmlpropertymap.h index 3a2ce7b33d..53254ab672 100644 --- a/src/declarative/util/qdeclarativepropertymap.h +++ b/src/qml/util/qqmlpropertymap.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROPERTYMAP_H -#define QDECLARATIVEPROPERTYMAP_H +#ifndef QQMLPROPERTYMAP_H +#define QQMLPROPERTYMAP_H + +#include <QtQml/qtqmlglobal.h> #include <QtCore/QObject> #include <QtCore/QHash> @@ -52,13 +54,13 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativePropertyMapPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativePropertyMap : public QObject +class QQmlPropertyMapPrivate; +class Q_QML_EXPORT QQmlPropertyMap : public QObject { Q_OBJECT public: - QDeclarativePropertyMap(QObject *parent = 0); - virtual ~QDeclarativePropertyMap(); + QQmlPropertyMap(QObject *parent = 0); + virtual ~QQmlPropertyMap(); QVariant value(const QString &key) const; void insert(const QString &key, const QVariant &value); @@ -78,8 +80,8 @@ Q_SIGNALS: void valueChanged(const QString &key, const QVariant &value); private: - Q_DECLARE_PRIVATE(QDeclarativePropertyMap) - Q_DISABLE_COPY(QDeclarativePropertyMap) + Q_DECLARE_PRIVATE(QQmlPropertyMap) + Q_DISABLE_COPY(QQmlPropertyMap) }; QT_END_NAMESPACE diff --git a/src/qml/util/util.pri b/src/qml/util/util.pri new file mode 100644 index 0000000000..3b121ba3cb --- /dev/null +++ b/src/qml/util/util.pri @@ -0,0 +1,5 @@ +SOURCES += \ + $$PWD/qqmlpropertymap.cpp + +HEADERS += \ + $$PWD/qqmlpropertymap.h diff --git a/src/qmldevtools/qmldevtools.pro b/src/qmldevtools/qmldevtools.pro index 3aac5e5a9c..97b3788dcd 100644 --- a/src/qmldevtools/qmldevtools.pro +++ b/src/qmldevtools/qmldevtools.pro @@ -17,4 +17,4 @@ HEADERS += qtqmldevtoolsversion.h unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include($$QT.declarative.sources/qml/parser/parser.pri) +include($$QT.qml.sources/qml/parser/parser.pri) diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro index 39b7dc8a3f..d2e90c2b5d 100644 --- a/src/qmltest/qmltest.pro +++ b/src/qmltest/qmltest.pro @@ -7,7 +7,7 @@ CONFIG += module CONFIG += dll warn_on declarative_debug MODULE_PRI += ../../modules/qt_qmltest.pri -QT += testlib-private declarative testlib quick widgets widgets-private gui +QT += testlib-private qml testlib quick widgets widgets-private gui DEFINES += QT_BUILD_QUICK_TEST_LIB QT_NO_URL_CAST_FROM_STRING load(qt_module_config) diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index 19acfaf6f0..e6c27eec00 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -44,15 +44,15 @@ #include <QtTest/qtestsystem.h> #include "qtestoptions_p.h" #include <QApplication> -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecontext.h> +#include <QtQml/qqml.h> +#include <QtQml/qqmlengine.h> +#include <QtQml/qqmlcontext.h> #if defined(QML_VERSION) && QML_VERSION >= 0x020000 #include <QtQuick/qquickview.h> #define QUICK_TEST_SCENEGRAPH 1 #endif -#include <QtDeclarative/qjsvalue.h> -#include <QtDeclarative/qjsengine.h> +#include <QtQml/qjsvalue.h> +#include <QtQml/qjsengine.h> #include <QtGui/qopengl.h> #include <QtCore/qurl.h> #include <QtCore/qfileinfo.h> @@ -107,7 +107,7 @@ static inline QString stripQuotes(const QString &s) template <class View> void handleCompileErrors(const QFileInfo &fi, const View &view) { // Error compiling the test - flag failure in the log and continue. - const QList<QDeclarativeError> errors = view.errors(); + const QList<QQmlError> errors = view.errors(); QuickTestResult results; results.setTestCaseName(fi.baseName()); results.startLogging(); @@ -117,7 +117,7 @@ template <class View> void handleCompileErrors(const QFileInfo &fi, const View & QTextStream str(&message); str << "\n " << QDir::toNativeSeparators(fi.absoluteFilePath()) << " produced " << errors.size() << " error(s):\n"; - foreach (const QDeclarativeError &e, errors) { + foreach (const QQmlError &e, errors) { str << " "; if (e.url().isLocalFile()) { str << e.url().toLocalFile(); @@ -129,7 +129,7 @@ template <class View> void handleCompileErrors(const QFileInfo &fi, const View & str << ": " << e.description() << '\n'; } str << " Working directory: " << QDir::toNativeSeparators(QDir::current().absolutePath()) << '\n'; - if (QDeclarativeEngine *engine = view.engine()) { + if (QQmlEngine *engine = view.engine()) { str << " View: " << view.metaObject()->className() << ", import paths:\n"; foreach (const QString &i, engine->importPathList()) str << " '" << QDir::toNativeSeparators(i) << "'\n"; @@ -254,7 +254,7 @@ int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport } // Scan through all of the "tst_*.qml" files and run each of them - // in turn with a QDeclarativeView. + // in turn with a QQuickView. #ifdef QUICK_TEST_SCENEGRAPH if (qtQuick2) { QQuickView view; diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp index 4dee9bee77..f996adbeca 100644 --- a/src/qmltest/quicktestevent.cpp +++ b/src/qmltest/quicktestevent.cpp @@ -41,7 +41,7 @@ #include "quicktestevent_p.h" #include <QtTest/qtestkeyboard.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #if defined(QML_VERSION) && QML_VERSION >= 0x020000 #include <QtQuick/qquickitem.h> #include <QtQuick/qquickcanvas.h> @@ -279,7 +279,7 @@ QWindow *QuickTestEvent::eventWindow() #endif return 0; /* - QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(parent()); + QQuickItem *item = qobject_cast<QQuickItem *>(parent()); if (!item) return 0; QGraphicsScene *s = item->scene(); diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp index d500e0a1ee..d389190642 100644 --- a/src/quick/designer/designersupport.cpp +++ b/src/quick/designer/designersupport.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,9 +44,9 @@ #include <QtQuick/private/qquickshadereffectsource_p.h> #include <QtQuick/private/qquickrectangle_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> #include <private/qquickview_p.h> -#include <QtQuick/private/qdeclarativestategroup_p.h> +#include <QtQuick/private/qquickstategroup_p.h> #include <QtGui/QImage> QT_BEGIN_NAMESPACE @@ -309,7 +309,7 @@ QQuickItem *DesignerSupport::anchorCenterInTargetItem(QQuickItem *item) -QPair<QString, QObject*> DesignerSupport::anchorLineTarget(QQuickItem *item, const QString &name, QDeclarativeContext *context) +QPair<QString, QObject*> DesignerSupport::anchorLineTarget(QQuickItem *item, const QString &name, QQmlContext *context) { QObject *targetObject = 0; QString targetName; @@ -319,7 +319,7 @@ QPair<QString, QObject*> DesignerSupport::anchorLineTarget(QQuickItem *item, con } else if (name == QLatin1String("anchors.centerIn")) { targetObject = anchors(item)->centerIn(); } else { - QDeclarativeProperty metaProperty(item, name, context); + QQmlProperty metaProperty(item, name, context); if (!metaProperty.isValid()) return QPair<QString, QObject*>(); @@ -360,7 +360,7 @@ void DesignerSupport::resetAnchor(QQuickItem *item, const QString &name) QList<QObject*> DesignerSupport::statesForItem(QQuickItem *item) { QList<QObject*> objectList; - QList<QDeclarativeState *> stateList = QQuickItemPrivate::get(item)->_states()->states(); + QList<QQuickState *> stateList = QQuickItemPrivate::get(item)->_states()->states(); qCopy(stateList.begin(), stateList.end(), objectList.begin()); return objectList; @@ -380,9 +380,9 @@ int DesignerSupport::borderWidth(QQuickItem *item) return 0; } -void DesignerSupport::refreshExpressions(QDeclarativeContext *context) +void DesignerSupport::refreshExpressions(QQmlContext *context) { - QDeclarativeContextPrivate::get(context)->data->refreshExpressions(); + QQmlContextPrivate::get(context)->data->refreshExpressions(); } void DesignerSupport::setRootItem(QQuickView *view, QQuickItem *item) diff --git a/src/quick/designer/designersupport.h b/src/quick/designer/designersupport.h index e80a537859..a31c8c3d46 100644 --- a/src/quick/designer/designersupport.h +++ b/src/quick/designer/designersupport.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -67,7 +67,7 @@ class QQuickItem; class QQuickShaderEffectTexture; class QImage; class QTransform; -class QDeclarativeContext; +class QQmlContext; class QQuickView; @@ -122,7 +122,7 @@ public: static bool hasAnchor(QQuickItem *item, const QString &name); static QQuickItem *anchorFillTargetItem(QQuickItem *item); static QQuickItem *anchorCenterInTargetItem(QQuickItem *item); - static QPair<QString, QObject*> anchorLineTarget(QQuickItem *item, const QString &name, QDeclarativeContext *context); + static QPair<QString, QObject*> anchorLineTarget(QQuickItem *item, const QString &name, QQmlContext *context); static void resetAnchor(QQuickItem *item, const QString &name); @@ -132,7 +132,7 @@ public: static int borderWidth(QQuickItem *item); - static void refreshExpressions(QDeclarativeContext *context); + static void refreshExpressions(QQmlContext *context); static void setRootItem(QQuickView *view, QQuickItem *item); diff --git a/src/quick/items/context2d/qquickcanvascontext.cpp b/src/quick/items/context2d/qquickcanvascontext.cpp index 3e6e51c89d..bb1065bd6a 100644 --- a/src/quick/items/context2d/qquickcanvascontext.cpp +++ b/src/quick/items/context2d/qquickcanvascontext.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/context2d/qquickcanvascontext_p.h b/src/quick/items/context2d/qquickcanvascontext_p.h index 6a2edef7a8..37b5fa33fa 100644 --- a/src/quick/items/context2d/qquickcanvascontext_p.h +++ b/src/quick/items/context2d/qquickcanvascontext_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 7031294ecc..550ab20403 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,10 +45,10 @@ #include <private/qquickcanvascontext_p.h> #include <private/qquickcontext2d_p.h> #include <private/qquickcanvasitemnode_p.h> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> -#include <qdeclarativeinfo.h> -#include <private/qdeclarativeengine_p.h> +#include <qqmlinfo.h> +#include <private/qqmlengine_p.h> #include <QtCore/QBuffer> QT_BEGIN_NAMESPACE @@ -71,7 +71,7 @@ public: QQuickCanvasItem::RenderTarget renderTarget; QQuickCanvasItem::RenderStrategy renderStrategy; QString contextType; - QHash<QUrl, QDeclarativePixmap*> images; + QHash<QUrl, QQuickPixmap*> images; QUrl baseUrl; QMap<int, v8::Persistent<v8::Function> > animationCallbacks; }; @@ -254,13 +254,13 @@ void QQuickCanvasItem::setContextType(const QString &contextType) this property will contain the current drawing context, otherwise null. */ -QDeclarativeV8Handle QQuickCanvasItem::context() const +QQmlV8Handle QQuickCanvasItem::context() const { Q_D(const QQuickCanvasItem); if (d->contextInitialized) - return QDeclarativeV8Handle::fromHandle(d->context->v8value()); + return QQmlV8Handle::fromHandle(d->context->v8value()); - return QDeclarativeV8Handle::fromHandle(v8::Null()); + return QQmlV8Handle::fromHandle(v8::Null()); } /*! @@ -532,7 +532,7 @@ void QQuickCanvasItem::updatePolish() foreach (int key, animationCallbacks.keys()) { v8::HandleScope handle_scope; - v8::Handle<v8::Object> self = QDeclarativeEnginePrivate::getV8Engine(qmlEngine(this))->newQObject(this).As<v8::Object>(); + v8::Handle<v8::Object> self = QQmlEnginePrivate::getV8Engine(qmlEngine(this))->newQObject(this).As<v8::Object>(); v8::Handle<v8::Value> args[] = { v8::Uint32::New(QDateTime::currentDateTimeUtc().toTime_t()) }; v8::Persistent<v8::Function> f = animationCallbacks.value(key); f->Call(self, 1, args); @@ -591,7 +591,7 @@ QSGNode *QQuickCanvasItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData Canvas only supports a 2d context. */ -void QQuickCanvasItem::getContext(QDeclarativeV8Function *args) +void QQuickCanvasItem::getContext(QQmlV8Function *args) { Q_D(QQuickCanvasItem); @@ -633,7 +633,7 @@ void QQuickCanvasItem::getContext(QDeclarativeV8Function *args) scene. */ -void QQuickCanvasItem::requestAnimationFrame(QDeclarativeV8Function *args) +void QQuickCanvasItem::requestAnimationFrame(QQmlV8Function *args) { if (args->Length() < 1 || !(*args)[0]->IsFunction()) { qmlInfo(this) << "requestAnimationFrame should be called with an animation callback function"; @@ -659,7 +659,7 @@ void QQuickCanvasItem::requestAnimationFrame(QDeclarativeV8Function *args) This function will cancel the animation callback referenced by \a handle. */ -void QQuickCanvasItem::cancelRequestAnimationFrame(QDeclarativeV8Function *args) +void QQuickCanvasItem::cancelRequestAnimationFrame(QQmlV8Function *args) { if (args->Length() < 1 || !(*args)[0]->IsInt32()) { qmlInfo(this) << "cancelRequestAnimationFrame should be called with an animation callback id"; @@ -737,7 +737,7 @@ QImage QQuickCanvasItem::loadedImage(const QUrl& url) if (!d->images.contains(fullPathUrl)) { loadImage(url); } - QDeclarativePixmap* pix = d->images.value(fullPathUrl); + QQuickPixmap* pix = d->images.value(fullPathUrl); if (pix->isLoading() || pix->isError()) { return QImage(); } @@ -760,12 +760,12 @@ void QQuickCanvasItem::loadImage(const QUrl& url) Q_D(QQuickCanvasItem); QUrl fullPathUrl = d->baseUrl.resolved(url); if (!d->images.contains(fullPathUrl)) { - QDeclarativePixmap* pix = new QDeclarativePixmap(); + QQuickPixmap* pix = new QQuickPixmap(); d->images.insert(fullPathUrl, pix); pix->load(qmlEngine(this) , fullPathUrl - , QDeclarativePixmap::Cache | QDeclarativePixmap::Asynchronous); + , QQuickPixmap::Cache | QQuickPixmap::Asynchronous); if (pix->isLoading()) pix->connectFinished(this, SIGNAL(imageLoaded())); } @@ -918,7 +918,7 @@ void QQuickCanvasItem::initializeContext(QQuickCanvasContext *context, const QVa d->context = context; d->context->init(this, args); - d->context->setV8Engine(QDeclarativeEnginePrivate::getV8Engine(qmlEngine(this))); + d->context->setV8Engine(QQmlEnginePrivate::getV8Engine(qmlEngine(this))); d->contextInitialized = true; connect(d->context, SIGNAL(textureChanged()), SLOT(update())); connect(d->context, SIGNAL(textureChanged()), SIGNAL(painted())); diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h index 0dad629eea..9a57733d4c 100644 --- a/src/quick/items/context2d/qquickcanvasitem_p.h +++ b/src/quick/items/context2d/qquickcanvasitem_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -60,7 +60,7 @@ class Q_QUICK_EXPORT QQuickCanvasItem : public QQuickItem Q_PROPERTY(bool available READ isAvailable NOTIFY availableChanged); Q_PROPERTY(QString contextType READ contextType WRITE setContextType NOTIFY contextTypeChanged) - Q_PROPERTY(QDeclarativeV8Handle context READ context NOTIFY contextChanged); + Q_PROPERTY(QQmlV8Handle context READ context NOTIFY contextChanged); Q_PROPERTY(QSizeF canvasSize READ canvasSize WRITE setCanvasSize NOTIFY canvasSizeChanged) Q_PROPERTY(QSize tileSize READ tileSize WRITE setTileSize NOTIFY tileSizeChanged) Q_PROPERTY(QRectF canvasWindow READ canvasWindow WRITE setCanvasWindow NOTIFY canvasWindowChanged) @@ -87,7 +87,7 @@ public: QString contextType() const; void setContextType(const QString &contextType); - QDeclarativeV8Handle context() const; + QQmlV8Handle context() const; QSizeF canvasSize() const; void setCanvasSize(const QSizeF &); @@ -108,10 +108,10 @@ public: QImage toImage(const QRectF& rect = QRectF()) const; - Q_INVOKABLE void getContext(QDeclarativeV8Function *args); + Q_INVOKABLE void getContext(QQmlV8Function *args); - Q_INVOKABLE void requestAnimationFrame(QDeclarativeV8Function *args); - Q_INVOKABLE void cancelRequestAnimationFrame(QDeclarativeV8Function *args); + Q_INVOKABLE void requestAnimationFrame(QQmlV8Function *args); + Q_INVOKABLE void cancelRequestAnimationFrame(QQmlV8Function *args); Q_INVOKABLE void requestPaint(); Q_INVOKABLE void markDirty(const QRectF& dirtyRect = QRectF()); diff --git a/src/quick/items/context2d/qquickcanvasitemnode.cpp b/src/quick/items/context2d/qquickcanvasitemnode.cpp index b9347dd33c..5a2dd80ff1 100644 --- a/src/quick/items/context2d/qquickcanvasitemnode.cpp +++ b/src/quick/items/context2d/qquickcanvasitemnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/context2d/qquickcanvasitemnode_p.h b/src/quick/items/context2d/qquickcanvasitemnode_p.h index 77181c64e6..7eb7d2aec5 100644 --- a/src/quick/items/context2d/qquickcanvasitemnode_p.h +++ b/src/quick/items/context2d/qquickcanvasitemnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index ba709b7f66..fc2ada2867 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -49,17 +49,17 @@ #include <QtCore/qdebug.h> #include <QtQuick/private/qsgcontext_p.h> -#include <private/qdeclarativesvgparser_p.h> -#include <private/qdeclarativepath_p.h> +#include <private/qquicksvgparser_p.h> +#include <private/qquickpath_p.h> #include <private/qquickimage_p_p.h> #include <QtGui/qguiapplication.h> -#include <qdeclarativeinfo.h> +#include <qqmlinfo.h> #include <QtCore/qmath.h> #include <private/qv8engine_p.h> -#include <qdeclarativeengine.h> +#include <qqmlengine.h> #include <private/qv8domerrors_p.h> #include <QtCore/qnumeric.h> @@ -1586,12 +1586,12 @@ static void ctx2d_path_set(v8::Local<v8::String>, v8::Local<v8::Value> value, co r->context->beginPath(); if (value->IsObject()) { - QDeclarativePath* path = qobject_cast<QDeclarativePath*>(engine->toQObject(value)); + QQuickPath* path = qobject_cast<QQuickPath*>(engine->toQObject(value)); if (path) r->context->m_path = path->path(); } else { QString path = engine->toString(value->ToString()); - QDeclarativeSvgParser::parsePathDataFast(path, r->context->m_path); + QQuickSvgParser::parsePathDataFast(path, r->context->m_path); } r->context->m_v8path = value; } diff --git a/src/quick/items/context2d/qquickcontext2d_p.h b/src/quick/items/context2d/qquickcontext2d_p.h index 3cabb6b198..239a244739 100644 --- a/src/quick/items/context2d/qquickcontext2d_p.h +++ b/src/quick/items/context2d/qquickcontext2d_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,8 +43,8 @@ #define QQUICKCONTEXT2D_P_H #include <QtQuick/qtquickglobal.h> -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQml/qqml.h> +#include <QtQml/qqmlcomponent.h> #include <private/qquickcanvascontext_p.h> #include <private/qquickcanvasitem_p.h> #include <QtGui/qpainter.h> @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE class QQuickContext2DCommandBuffer; class QQuickContext2DTexture; -class QDeclarativePixmap; +class QQuickPixmap; class QSGTexture; class QLockedCommandBuffer { diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp index 7342999864..591fc216a4 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -41,7 +41,7 @@ #include "qquickcontext2dcommandbuffer_p.h" #include "qquickcanvasitem_p.h" -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/QMutex> #define HAS_SHADOW(offsetX, offsetY, blur, color) (color.isValid() && color.alpha() && (blur || offsetX || offsetY)) diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h index fc4c1a3a9c..f33c43a936 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include <QtCore/qmutex.h> #include "qquickcontext2d_p.h" -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> QT_BEGIN_HEADER diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp index 5d0c0ab63e..28460e2164 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture.cpp +++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h index bd4d4ff72c..9e00ece16c 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture_p.h +++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/context2d/qquickcontext2dtile.cpp b/src/quick/items/context2d/qquickcontext2dtile.cpp index 284cdcef83..dd416e15af 100644 --- a/src/quick/items/context2d/qquickcontext2dtile.cpp +++ b/src/quick/items/context2d/qquickcontext2dtile.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h index e05030cb88..2e6d61c8f2 100644 --- a/src/quick/items/context2d/qquickcontext2dtile_p.h +++ b/src/quick/items/context2d/qquickcontext2dtile_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/items.pri b/src/quick/items/items.pri index f02c769c3a..9a3b24c328 100644 --- a/src/quick/items/items.pri +++ b/src/quick/items/items.pri @@ -58,8 +58,8 @@ HEADERS += \ $$PWD/qquickclipnode_p.h \ $$PWD/qquickview.h \ $$PWD/qquickview_p.h \ - $$PWD/qquickanimation_p.h \ - $$PWD/qquickanimation_p_p.h \ + $$PWD/qquickitemanimation_p.h \ + $$PWD/qquickitemanimation_p_p.h \ $$PWD/qquickstateoperations_p.h \ $$PWD/qquickimplicitsizeitem_p.h \ $$PWD/qquickimplicitsizeitem_p_p.h \ @@ -111,7 +111,7 @@ SOURCES += \ $$PWD/qquicktranslate.cpp \ $$PWD/qquickclipnode.cpp \ $$PWD/qquickview.cpp \ - $$PWD/qquickanimation.cpp \ + $$PWD/qquickitemanimation.cpp \ $$PWD/qquickstateoperations.cpp \ $$PWD/qquickimplicitsizeitem.cpp \ $$PWD/qquickspriteengine.cpp \ diff --git a/src/quick/items/qquickaccessibleattached.cpp b/src/quick/items/qquickaccessibleattached.cpp index b28c28ba29..177454eedc 100644 --- a/src/quick/items/qquickaccessibleattached.cpp +++ b/src/quick/items/qquickaccessibleattached.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickaccessibleattached_p.h b/src/quick/items/qquickaccessibleattached_p.h index 02b427337e..5eea44b6e4 100644 --- a/src/quick/items/qquickaccessibleattached_p.h +++ b/src/quick/items/qquickaccessibleattached_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickanchors.cpp b/src/quick/items/qquickanchors.cpp index 2df304e15d..b7071b9598 100644 --- a/src/quick/items/qquickanchors.cpp +++ b/src/quick/items/qquickanchors.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include "qquickitem.h" #include "qquickitem_p.h" -#include <qdeclarativeinfo.h> +#include <qqmlinfo.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/items/qquickanchors_p.h b/src/quick/items/qquickanchors_p.h index 52248db3b8..9076fbe697 100644 --- a/src/quick/items/qquickanchors_p.h +++ b/src/quick/items/qquickanchors_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,7 +42,7 @@ #ifndef QQUICKANCHORS_P_H #define QQUICKANCHORS_P_H -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/QObject> diff --git a/src/quick/items/qquickanchors_p_p.h b/src/quick/items/qquickanchors_p_p.h index b2b587932b..1814185980 100644 --- a/src/quick/items/qquickanchors_p_p.h +++ b/src/quick/items/qquickanchors_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickanimatedimage.cpp b/src/quick/items/qquickanimatedimage.cpp index 7bea56cc53..eef20db361 100644 --- a/src/quick/items/qquickanimatedimage.cpp +++ b/src/quick/items/qquickanimatedimage.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,12 +44,12 @@ #ifndef QT_NO_MOVIE -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtGui/qmovie.h> #include <QtNetwork/qnetworkrequest.h> #include <QtNetwork/qnetworkreply.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE /*! @@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE \bold Note: Unlike images, animated images are not cached or shared internally. \clearfloat - \snippet doc/src/snippets/declarative/animatedimage.qml document + \snippet doc/src/snippets/qml/animatedimage.qml document \sa BorderImage, Image */ @@ -95,7 +95,7 @@ QT_BEGIN_NAMESPACE AnimatedImage can handle any image format supported by Qt, loaded from any URL scheme supported by Qt. - \sa QDeclarativeImageProvider + \sa QQmlImageProvider */ /*! @@ -264,7 +264,7 @@ void QQuickAnimatedImage::load() if (d->progress != oldProgress) emit progressChanged(d->progress); } else { - QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url); + QString lf = QQmlEnginePrivate::urlToLocalFileOrQrc(d->url); if (!lf.isEmpty()) { //### should be unified with movieRequestFinished d->_movie = new QMovie(lf); diff --git a/src/quick/items/qquickanimatedimage_p.h b/src/quick/items/qquickanimatedimage_p.h index 3c1f77d674..86910199ac 100644 --- a/src/quick/items/qquickanimatedimage_p.h +++ b/src/quick/items/qquickanimatedimage_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickanimatedimage_p_p.h b/src/quick/items/qquickanimatedimage_p_p.h index b1288d78a1..95142f5f1f 100644 --- a/src/quick/items/qquickanimatedimage_p_p.h +++ b/src/quick/items/qquickanimatedimage_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp index 67b5cdf737..5beb345afc 100644 --- a/src/quick/items/qquickborderimage.cpp +++ b/src/quick/items/qquickborderimage.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,10 +43,11 @@ #include "qquickborderimage_p_p.h" #include "qquickninepatchnode_p.h" -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtCore/qfile.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE @@ -97,7 +98,7 @@ QT_BEGIN_NAMESPACE used to determine the parts of the image that will lie inside the unscaled corner areas and the parts that will be stretched horizontally and vertically. - \snippet doc/src/snippets/declarative/borderimage/normal-image.qml normal image + \snippet doc/src/snippets/qml/borderimage/normal-image.qml normal image \clearfloat \beginfloatleft @@ -111,7 +112,7 @@ QT_BEGIN_NAMESPACE is set to \l{BorderImage::verticalTileMode}{BorderImage.Stretch}, the parts of image in regions 4 and 6 are stretched vertically. - \snippet doc/src/snippets/declarative/borderimage/borderimage-scaled.qml scaled border image + \snippet doc/src/snippets/qml/borderimage/borderimage-scaled.qml scaled border image \clearfloat \beginfloatleft @@ -125,7 +126,7 @@ QT_BEGIN_NAMESPACE \l{BorderImage::verticalTileMode}{BorderImage.Repeat}, the parts of image in regions 4 and 6 are tiled so that they fill the space at the left and right of the element. - \snippet doc/src/snippets/declarative/borderimage/borderimage-tiled.qml tiled border image + \snippet doc/src/snippets/qml/borderimage/borderimage-tiled.qml tiled border image \clearfloat In some situations, the width of regions 2 and 8 may not be an exact multiple of the width @@ -256,7 +257,7 @@ QQuickBorderImage::~QQuickBorderImage() The URL may be absolute, or relative to the URL of the component. - \sa QDeclarativeImageProvider + \sa QQmlImageProvider */ /*! @@ -305,7 +306,7 @@ void QQuickBorderImage::load() } else { d->status = Loading; if (d->url.path().endsWith(QLatin1String("sci"))) { - QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url); + QString lf = QQmlEnginePrivate::urlToLocalFileOrQrc(d->url); if (!lf.isEmpty()) { QFile file(lf); file.open(QIODevice::ReadOnly); @@ -317,11 +318,11 @@ void QQuickBorderImage::load() } } else { - QDeclarativePixmap::Options options; + QQuickPixmap::Options options; if (d->async) - options |= QDeclarativePixmap::Asynchronous; + options |= QQuickPixmap::Asynchronous; if (d->cache) - options |= QDeclarativePixmap::Cache; + options |= QQuickPixmap::Cache; d->pix.clear(this); d->pix.load(qmlEngine(this), d->url, options); @@ -448,11 +449,11 @@ void QQuickBorderImage::setGridScaledImage(const QQuickGridScaledImage& sci) d->sciurl = d->url.resolved(QUrl(sci.pixmapUrl())); - QDeclarativePixmap::Options options; + QQuickPixmap::Options options; if (d->async) - options |= QDeclarativePixmap::Asynchronous; + options |= QQuickPixmap::Asynchronous; if (d->cache) - options |= QDeclarativePixmap::Cache; + options |= QQuickPixmap::Cache; d->pix.clear(this); d->pix.load(qmlEngine(this), d->sciurl, options); diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h index 93dc452e87..80532b7082 100644 --- a/src/quick/items/qquickborderimage_p.h +++ b/src/quick/items/qquickborderimage_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickborderimage_p_p.h b/src/quick/items/qquickborderimage_p_p.h index b9b5723a06..07a62b4d29 100644 --- a/src/quick/items/qquickborderimage_p_p.h +++ b/src/quick/items/qquickborderimage_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,6 +56,8 @@ #include "qquickimagebase_p_p.h" #include "qquickscalegrid_p_p.h" +#include <private/qqmlglobal_p.h> + QT_BEGIN_NAMESPACE class QNetworkReply; diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp index a9df484a98..1e1db18723 100644 --- a/src/quick/items/qquickcanvas.cpp +++ b/src/quick/items/qquickcanvas.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -65,11 +65,11 @@ #include <QtGui/qstylehints.h> #include <QtCore/qvarlengtharray.h> #include <QtCore/qabstractanimation.h> -#include <QtDeclarative/qdeclarativeincubator.h> +#include <QtQml/qqmlincubator.h> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> -#include <private/qdeclarativeprofilerservice_p.h> +#include <private/qqmlprofilerservice_p.h> QT_BEGIN_NAMESPACE @@ -83,7 +83,7 @@ void QQuickCanvasPrivate::updateFocusItemTransform() qApp->inputMethod()->setInputItemTransform(QQuickItemPrivate::get(focus)->itemToCanvasTransform()); } -class QQuickCanvasIncubationController : public QObject, public QDeclarativeIncubationController +class QQuickCanvasIncubationController : public QObject, public QQmlIncubationController { public: QQuickCanvasIncubationController(QQuickCanvasPrivate *canvas) @@ -340,7 +340,7 @@ void QQuickCanvasPrivate::init(QQuickCanvas *c) engine->setCanvas(q); } -QDeclarativeListProperty<QObject> QQuickCanvasPrivate::data() +QQmlListProperty<QObject> QQuickCanvasPrivate::data() { initRootItem(); return QQuickItemPrivate::get(rootItem)->data(); @@ -663,7 +663,7 @@ void QQuickCanvasPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, void QQuickCanvasPrivate::notifyFocusChangesRecur(QQuickItem **items, int remaining) { - QDeclarativeGuard<QQuickItem> item(*items); + QQmlGuard<QQuickItem> item(*items); if (remaining) notifyFocusChangesRecur(items + 1, remaining - 1); @@ -761,7 +761,7 @@ void QQuickCanvas::releaseResources() { Q_D(QQuickCanvas); d->windowManager->releaseResources(); - QDeclarativePixmap::purgeCache(); + QQuickPixmap::purgeCache(); } @@ -2044,12 +2044,12 @@ QImage QQuickCanvas::grabFrameBuffer() /*! Returns an incubation controller that splices incubation between frames for this canvas. QQuickView automatically installs this controller for you, - otherwise you will need to install it yourself using \l{QDeclarativeEngine::setIncubationController} + otherwise you will need to install it yourself using \l{QQmlEngine::setIncubationController} The controller is owned by the canvas and will be destroyed when the canvas is deleted. */ -QDeclarativeIncubationController *QQuickCanvas::incubationController() const +QQmlIncubationController *QQuickCanvas::incubationController() const { Q_D(const QQuickCanvas); diff --git a/src/quick/items/qquickcanvas.h b/src/quick/items/qquickcanvas.h index 3246d53a42..0b6b01b05a 100644 --- a/src/quick/items/qquickcanvas.h +++ b/src/quick/items/qquickcanvas.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -58,13 +58,13 @@ class QSGTexture; class QInputMethodEvent; class QQuickCanvasPrivate; class QOpenGLFramebufferObject; -class QDeclarativeIncubationController; +class QQmlIncubationController; class QInputMethodEvent; class Q_QUICK_EXPORT QQuickCanvas : public QWindow { Q_OBJECT - Q_PRIVATE_PROPERTY(QQuickCanvas::d_func(), QDeclarativeListProperty<QObject> data READ data DESIGNABLE false) + Q_PRIVATE_PROPERTY(QQuickCanvas::d_func(), QQmlListProperty<QObject> data READ data DESIGNABLE false) Q_PROPERTY(QColor color READ clearColor WRITE setClearColor NOTIFY clearColorChanged) Q_CLASSINFO("DefaultProperty", "data") Q_DECLARE_PRIVATE(QQuickCanvas) @@ -100,7 +100,7 @@ public: uint renderTargetId() const; QSize renderTargetSize() const; - QDeclarativeIncubationController *incubationController() const; + QQmlIncubationController *incubationController() const; virtual QAccessibleInterface *accessibleRoot() const; diff --git a/src/quick/items/qquickcanvas_p.h b/src/quick/items/qquickcanvas_p.h index d4d6a01f75..147526466e 100644 --- a/src/quick/items/qquickcanvas_p.h +++ b/src/quick/items/qquickcanvas_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -55,7 +55,7 @@ #include "qquickitem.h" #include "qquickcanvas.h" -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> #include <QtQuick/private/qsgcontext_p.h> #include <private/qquickdrag_p.h> @@ -108,7 +108,7 @@ public: QQuickRootItem *rootItem; QSet<QQuickItem *> parentlessItems; - QDeclarativeListProperty<QObject> data(); + QQmlListProperty<QObject> data(); QQuickItem *activeFocusItem; QQuickItem *mouseGrabberItem; diff --git a/src/quick/items/qquickclipnode.cpp b/src/quick/items/qquickclipnode.cpp index 168e973927..f9894edb48 100644 --- a/src/quick/items/qquickclipnode.cpp +++ b/src/quick/items/qquickclipnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickclipnode_p.h b/src/quick/items/qquickclipnode_p.h index a48972532c..02902a758e 100644 --- a/src/quick/items/qquickclipnode_p.h +++ b/src/quick/items/qquickclipnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index c44e1acd4b..f8c1281af5 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,7 +45,7 @@ #include <QtQuick/private/qquickevents_p_p.h> #include <private/qquickitemchangelistener_p.h> #include <private/qv8engine_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtGui/qevent.h> QT_BEGIN_NAMESPACE @@ -76,8 +76,8 @@ public: QQuickDragGrabber dragGrabber; - QDeclarativeGuard<QObject> source; - QDeclarativeGuard<QObject> target; + QQmlGuard<QObject> source; + QQmlGuard<QObject> target; QQuickItem *attachedItem; QQuickDragMimeData *mimeData; Qt::DropAction proposedAction; @@ -106,7 +106,7 @@ public: However, dragging is not limited to mouse drags, anything that can move an item can generate drag events, this can include touch events, animations and bindings. - \snippet doc/src/snippets/declarative/drag.qml 0 + \snippet doc/src/snippets/qml/drag.qml 0 A drag can be terminated either by canceling it with Drag.cancel() or setting Drag.active to false, or it can be terminated with a drop event by calling @@ -377,7 +377,7 @@ void QQuickDragAttachedPrivate::start(Qt::DropActions supportedActions) property for the started sequence. */ -void QQuickDragAttached::start(QDeclarativeV8Function *args) +void QQuickDragAttached::start(QQmlV8Function *args) { Q_D(QQuickDragAttached); if (d->inEvent) { diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h index eca3927624..ac19c021e0 100644 --- a/src/quick/items/qquickdrag_p.h +++ b/src/quick/items/qquickdrag_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -60,10 +60,10 @@ class QQuickDragPrivate; class QQuickDragGrabber { - class Item : public QDeclarativeGuard<QQuickItem> + class Item : public QQmlGuard<QQuickItem> { public: - Item(QQuickItem *item) : QDeclarativeGuard<QQuickItem>(item) {} + Item(QQuickItem *item) : QQmlGuard<QQuickItem>(item) {} QIntrusiveListNode node; protected: @@ -142,7 +142,7 @@ private: friend class QQuickDragAttachedPrivate; }; -class QDeclarativeV8Function; +class QQmlV8Function; class QQuickDragAttachedPrivate; class QQuickDragAttached : public QObject @@ -183,7 +183,7 @@ public: Q_INVOKABLE int drop(); public Q_SLOTS: - void start(QDeclarativeV8Function *); + void start(QQmlV8Function *); void cancel(); Q_SIGNALS: diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp index 0534fb5bb0..ed5fb23658 100644 --- a/src/quick/items/qquickdroparea.cpp +++ b/src/quick/items/qquickdroparea.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include "qquickitem_p.h" #include "qquickcanvas.h" -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE @@ -74,8 +74,8 @@ public: QRegExp keyRegExp; QPointF dragPosition; QQuickDropAreaDrag *drag; - QDeclarativeGuard<QObject> source; - QDeclarativeGuard<QMimeData> mimeData; + QQmlGuard<QObject> source; + QQmlGuard<QMimeData> mimeData; }; QQuickDropAreaPrivate::QQuickDropAreaPrivate() @@ -409,7 +409,7 @@ QStringList QQuickDropEvent::keys() const If an \a action is specified it will overwrite the value of the \l action property. */ -void QQuickDropEvent::accept(QDeclarativeV8Function *args) +void QQuickDropEvent::accept(QQmlV8Function *args) { Qt::DropAction action = event->dropAction(); diff --git a/src/quick/items/qquickdroparea_p.h b/src/quick/items/qquickdroparea_p.h index 6fdfc4b03b..e207787198 100644 --- a/src/quick/items/qquickdroparea_p.h +++ b/src/quick/items/qquickdroparea_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include "qquickitem.h" -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> #include <private/qv8engine_p.h> #include <QtGui/qevent.h> @@ -82,7 +82,7 @@ public: bool accepted() const { return event->isAccepted(); } void setAccepted(bool accepted) { event->setAccepted(accepted); } - Q_INVOKABLE void accept(QDeclarativeV8Function *); + Q_INVOKABLE void accept(QQmlV8Function *); private: QQuickDropAreaPrivate *d; diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 6e7769f1d3..597e64eb18 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 1d13a19fed..e69d44303b 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -54,7 +54,7 @@ // #include <QtQuick/qtquickglobal.h> -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/qobject.h> #include <QtGui/qvector2d.h> diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 43aaf92b1a..ef67549780 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,7 +45,9 @@ #include "qquickcanvas_p.h" #include "qquickevents_p_p.h" -#include <QtDeclarative/qdeclarativeinfo.h> +#include <private/qqmlglobal_p.h> + +#include <QtQml/qqmlinfo.h> #include <QtGui/qevent.h> #include <QtGui/qguiapplication.h> #include <QtGui/qstylehints.h> @@ -204,7 +206,7 @@ QQuickFlickablePrivate::QQuickFlickablePrivate() void QQuickFlickablePrivate::init() { Q_Q(QQuickFlickable); - QDeclarative_setParent_noEvent(contentItem, q); + QQml_setParent_noEvent(contentItem, q); contentItem->setParentItem(q); FAST_CONNECT(&timeline, SIGNAL(completed()), q, SLOT(movementEnding())) q->setAcceptedMouseButtons(Qt::LeftButton); @@ -277,7 +279,7 @@ void QQuickFlickablePrivate::flickY(qreal velocity) } void QQuickFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal, - QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity) + QQuickTimeLineCallback::Callback fixupCallback, qreal velocity) { Q_Q(QQuickFlickable); qreal maxDistance = -1; @@ -303,7 +305,7 @@ void QQuickFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExt timeline.accel(data.move, v, deceleration); else timeline.accel(data.move, v, deceleration, maxDistance); - timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this)); + timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this)); if (!hData.flicking && q->xflick() && (&data == &hData)) { hData.flicking = true; emit q->flickingChanged(); @@ -507,7 +509,7 @@ is finished. The following example shows a small view onto a large image in which the user can drag or flick the image in order to view different parts of it. - \snippet doc/src/snippets/declarative/flickable.qml document + \snippet doc/src/snippets/qml/flickable.qml document \clearfloat @@ -569,9 +571,9 @@ is finished. These properties are typically used to draw a scrollbar. For example: - \snippet doc/src/snippets/declarative/flickableScrollbar.qml 0 + \snippet doc/src/snippets/qml/flickableScrollbar.qml 0 \dots 8 - \snippet doc/src/snippets/declarative/flickableScrollbar.qml 1 + \snippet doc/src/snippets/qml/flickableScrollbar.qml 1 \sa {declarative/ui-components/scrollbar}{scrollbar example} */ @@ -1302,7 +1304,7 @@ void QQuickFlickable::viewportMoved() qreal maxDistance = d->overShootDistance(height()); d->timeline.reset(d->vData.move); d->timeline.accel(d->vData.move, -d->vData.smoothVelocity.value(), d->deceleration*QML_FLICK_OVERSHOOTFRICTION, maxDistance); - d->timeline.callback(QDeclarativeTimeLineCallback(&d->vData.move, d->fixupY_callback, d)); + d->timeline.callback(QQuickTimeLineCallback(&d->vData.move, d->fixupY_callback, d)); } if (!d->hData.inOvershoot && !d->hData.fixingUp && d->hData.flicking && (d->hData.move.value() > minXExtent() || d->hData.move.value() < maxXExtent()) @@ -1312,7 +1314,7 @@ void QQuickFlickable::viewportMoved() qreal maxDistance = d->overShootDistance(width()); d->timeline.reset(d->hData.move); d->timeline.accel(d->hData.move, -d->hData.smoothVelocity.value(), d->deceleration*QML_FLICK_OVERSHOOTFRICTION, maxDistance); - d->timeline.callback(QDeclarativeTimeLineCallback(&d->hData.move, d->fixupX_callback, d)); + d->timeline.callback(QQuickTimeLineCallback(&d->hData.move, d->fixupX_callback, d)); } d->lastFlickablePosition = QPointF(d->hData.move.value(), d->vData.move.value()); @@ -1386,7 +1388,7 @@ void QQuickFlickable::cancelFlick() movementEnding(); } -void QQuickFlickablePrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o) +void QQuickFlickablePrivate::data_append(QQmlListProperty<QObject> *prop, QObject *o) { QQuickItem *i = qobject_cast<QQuickItem *>(o); if (i) { @@ -1396,33 +1398,33 @@ void QQuickFlickablePrivate::data_append(QDeclarativeListProperty<QObject> *prop } } -int QQuickFlickablePrivate::data_count(QDeclarativeListProperty<QObject> *) +int QQuickFlickablePrivate::data_count(QQmlListProperty<QObject> *) { // XXX todo return 0; } -QObject *QQuickFlickablePrivate::data_at(QDeclarativeListProperty<QObject> *, int) +QObject *QQuickFlickablePrivate::data_at(QQmlListProperty<QObject> *, int) { // XXX todo return 0; } -void QQuickFlickablePrivate::data_clear(QDeclarativeListProperty<QObject> *) +void QQuickFlickablePrivate::data_clear(QQmlListProperty<QObject> *) { // XXX todo } -QDeclarativeListProperty<QObject> QQuickFlickable::flickableData() +QQmlListProperty<QObject> QQuickFlickable::flickableData() { Q_D(QQuickFlickable); - return QDeclarativeListProperty<QObject>(this, (void *)d, QQuickFlickablePrivate::data_append, + return QQmlListProperty<QObject>(this, (void *)d, QQuickFlickablePrivate::data_append, QQuickFlickablePrivate::data_count, QQuickFlickablePrivate::data_at, QQuickFlickablePrivate::data_clear); } -QDeclarativeListProperty<QQuickItem> QQuickFlickable::flickableChildren() +QQmlListProperty<QQuickItem> QQuickFlickable::flickableChildren() { Q_D(QQuickFlickable); return QQuickItemPrivate::get(d->contentItem)->children(); @@ -1475,7 +1477,7 @@ void QQuickFlickable::setBoundsBehavior(BoundsBehavior b) The following snippet shows how these properties are used to display an image that is larger than the Flickable item itself: - \snippet doc/src/snippets/declarative/flickable.qml document + \snippet doc/src/snippets/qml/flickable.qml document In some cases, the the content dimensions can be automatically set using the \l {Item::childrenRect.width}{childrenRect.width} diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h index 9d6ca94770..7a19b0c05a 100644 --- a/src/quick/items/qquickflickable_p.h +++ b/src/quick/items/qquickflickable_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -97,8 +97,8 @@ class Q_QUICK_EXPORT QQuickFlickable : public QQuickItem Q_PROPERTY(bool pixelAligned READ pixelAligned WRITE setPixelAligned NOTIFY pixelAlignedChanged) - Q_PROPERTY(QDeclarativeListProperty<QObject> flickableData READ flickableData) - Q_PROPERTY(QDeclarativeListProperty<QQuickItem> flickableChildren READ flickableChildren) + Q_PROPERTY(QQmlListProperty<QObject> flickableData READ flickableData) + Q_PROPERTY(QQmlListProperty<QQuickItem> flickableChildren READ flickableChildren) Q_CLASSINFO("DefaultProperty", "flickableData") Q_ENUMS(FlickableDirection) @@ -108,8 +108,8 @@ public: QQuickFlickable(QQuickItem *parent=0); ~QQuickFlickable(); - QDeclarativeListProperty<QObject> flickableData(); - QDeclarativeListProperty<QQuickItem> flickableChildren(); + QQmlListProperty<QObject> flickableData(); + QQmlListProperty<QQuickItem> flickableChildren(); enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds }; BoundsBehavior boundsBehavior() const; diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h index 7b16f1ac52..ac6f2fffed 100644 --- a/src/quick/items/qquickflickable_p_p.h +++ b/src/quick/items/qquickflickable_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -57,12 +57,12 @@ #include "qquickitem_p.h" #include "qquickitemchangelistener_p.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include <QtCore/qdatetime.h> #include "qplatformdefs.h" -#include <private/qdeclarativetimeline_p_p.h> -#include <private/qdeclarativeanimation_p_p.h> +#include <private/qquicktimeline_p_p.h> +#include <private/qquickanimation_p_p.h> QT_BEGIN_NAMESPACE @@ -80,13 +80,13 @@ public: QQuickFlickablePrivate(); void init(); - struct Velocity : public QDeclarativeTimeLineValue + struct Velocity : public QQuickTimeLineValue { Velocity(QQuickFlickablePrivate *p) : parent(p) {} virtual void setValue(qreal v) { if (v != value()) { - QDeclarativeTimeLineValue::setValue(v); + QQuickTimeLineValue::setValue(v); parent->updateVelocity(); } } @@ -119,7 +119,7 @@ public: void addVelocitySample(qreal v, qreal maxVelocity); void updateVelocity(); - QDeclarativeTimeLineValueProxy<QQuickFlickablePrivate> move; + QQuickTimeLineValueProxy<QQuickFlickablePrivate> move; qreal viewSize; qreal pressPos; qreal dragStartOffset; @@ -148,7 +148,7 @@ public: void flickX(qreal velocity); void flickY(qreal velocity); virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, - QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity); + QQuickTimeLineCallback::Callback fixupCallback, qreal velocity); void fixupX(); void fixupY(); @@ -176,7 +176,7 @@ public: AxisData hData; AxisData vData; - QDeclarativeTimeLine timeline; + QQuickTimeLine timeline; bool hMoved : 1; bool vMoved : 1; bool stealMouse : 1; @@ -209,7 +209,7 @@ public: void updateVelocity(); int vTime; - QDeclarativeTimeLine velocityTimeline; + QQuickTimeLine velocityTimeline; QQuickFlickableVisibleArea *visibleArea; QQuickFlickable::FlickableDirection flickableDirection; QQuickFlickable::BoundsBehavior boundsBehavior; @@ -221,10 +221,10 @@ public: qint64 computeCurrentTime(QInputEvent *event); // flickableData property - static void data_append(QDeclarativeListProperty<QObject> *, QObject *); - static int data_count(QDeclarativeListProperty<QObject> *); - static QObject *data_at(QDeclarativeListProperty<QObject> *, int); - static void data_clear(QDeclarativeListProperty<QObject> *); + static void data_append(QQmlListProperty<QObject> *, QObject *); + static int data_count(QQmlListProperty<QObject> *); + static QObject *data_at(QQmlListProperty<QObject> *, int); + static void data_clear(QQmlListProperty<QObject> *); }; class QQuickFlickableVisibleArea : public QObject diff --git a/src/quick/items/qquickflipable.cpp b/src/quick/items/qquickflipable.cpp index a29c6f0d83..f454ce54d5 100644 --- a/src/quick/items/qquickflipable.cpp +++ b/src/quick/items/qquickflipable.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,9 +42,9 @@ #include "qquickflipable_p.h" #include "qquickitem_p.h" -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> QT_BEGIN_NAMESPACE @@ -78,9 +78,9 @@ public: void setBackTransform(); QQuickFlipable::Side current; - QDeclarativeGuard<QQuickLocalTransform> backTransform; - QDeclarativeGuard<QQuickItem> front; - QDeclarativeGuard<QQuickItem> back; + QQmlGuard<QQuickLocalTransform> backTransform; + QQmlGuard<QQuickItem> front; + QQmlGuard<QQuickItem> back; bool sideDirty; bool wantBackXFlipped; @@ -113,7 +113,7 @@ public: degrees to produce the flipping effect. When \c flipped is false, the item reverts to the default state, in which the \c angle value is 0. - \snippet doc/src/snippets/declarative/flipable/flipable.qml 0 + \snippet doc/src/snippets/qml/flipable/flipable.qml 0 \image flipable.gif diff --git a/src/quick/items/qquickflipable_p.h b/src/quick/items/qquickflipable_p.h index cf17bce314..dd53ec3d49 100644 --- a/src/quick/items/qquickflipable_p.h +++ b/src/quick/items/qquickflipable_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickfocusscope.cpp b/src/quick/items/qquickfocusscope.cpp index b1d3516d3b..7ef2476b30 100644 --- a/src/quick/items/qquickfocusscope.cpp +++ b/src/quick/items/qquickfocusscope.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickfocusscope_p.h b/src/quick/items/qquickfocusscope_p.h index 889b45ca1c..6d43dbb619 100644 --- a/src/quick/items/qquickfocusscope_p.h +++ b/src/quick/items/qquickfocusscope_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp index d7f4b808f2..a57d0ee778 100644 --- a/src/quick/items/qquickgridview.cpp +++ b/src/quick/items/qquickgridview.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include "qquickflickable_p_p.h" #include "qquickitemview_p_p.h" -#include <private/qdeclarativesmoothedanimation_p_p.h> +#include <private/qquicksmoothedanimation_p_p.h> #include <private/qlistmodelinterface_p.h> #include <QtGui/qevent.h> @@ -193,7 +193,7 @@ public: virtual void setPosition(qreal pos); virtual void layoutVisibleItems(int fromModelIndex = 0); - virtual bool applyInsertionChange(const QDeclarativeChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView); + virtual bool applyInsertionChange(const QQuickChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView); virtual void translateAndTransitionItemsAfter(int afterModelIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult); virtual bool needsRefillForAddedOrRemovedIndex(int index) const; @@ -211,7 +211,7 @@ public: virtual void fixupPosition(); virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent); virtual void flick(QQuickItemViewPrivate::AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, - QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity); + QQuickTimeLineCallback::Callback fixupCallback, qreal velocity); QQuickGridView::Flow flow; qreal cellWidth; @@ -692,10 +692,10 @@ void QQuickGridViewPrivate::createHighlight() if (autoHighlight) resetHighlightPosition(); highlightXAnimator = new QSmoothedAnimation; - highlightXAnimator->target = QDeclarativeProperty(item, QLatin1String("x")); + highlightXAnimator->target = QQmlProperty(item, QLatin1String("x")); highlightXAnimator->userDuration = highlightMoveDuration; highlightYAnimator = new QSmoothedAnimation; - highlightYAnimator->target = QDeclarativeProperty(item, QLatin1String("y")); + highlightYAnimator->target = QQmlProperty(item, QLatin1String("y")); highlightYAnimator->userDuration = highlightMoveDuration; highlight = newHighlight; @@ -960,7 +960,7 @@ void QQuickGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte } void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, - QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity) + QQuickTimeLineCallback::Callback fixupCallback, qreal velocity) { Q_Q(QQuickGridView); data.fixingUp = false; @@ -1060,7 +1060,7 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte } timeline.reset(data.move); timeline.accel(data.move, v, accel, maxDistance + overshootDist); - timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this)); + timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this)); if (!hData.flicking && q->xflick()) { hData.flicking = true; emit q->flickingChanged(); @@ -1103,7 +1103,7 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte The following example shows the definition of a simple list model defined in a file called \c ContactModel.qml: - \snippet doc/src/snippets/declarative/gridview/ContactModel.qml 0 + \snippet doc/src/snippets/qml/gridview/ContactModel.qml 0 \div {class="float-right"} \inlineimage gridview-simple.png @@ -1117,9 +1117,9 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte (containing \l Image and \l Text elements) for its delegate. \clearfloat - \snippet doc/src/snippets/declarative/gridview/gridview.qml import + \snippet doc/src/snippets/qml/gridview/gridview.qml import \codeline - \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs simple + \snippet doc/src/snippets/qml/gridview/gridview.qml classdocs simple \div {class="float-right"} \inlineimage gridview-highlight.png @@ -1132,7 +1132,7 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte into a separate \c contactDelegate component. \clearfloat - \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs advanced + \snippet doc/src/snippets/qml/gridview/gridview.qml classdocs advanced The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property, and \c focus is set to \c true to enable keyboard navigation for the grid view. @@ -1146,7 +1146,7 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte this attached property directly as \c GridView.isCurrentItem, while the child \c contactInfo object must refer to this property as \c wrapper.GridView.isCurrentItem. - \snippet doc/src/snippets/declarative/gridview/gridview.qml isCurrentItem + \snippet doc/src/snippets/qml/gridview/gridview.qml isCurrentItem \note Views do not set the \l{Item::}{clip} property automatically. If the view is not clipped by another item or the screen, it will be necessary @@ -1190,7 +1190,7 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight) It is attached to each instance of the delegate. - \snippet doc/src/snippets/declarative/gridview/gridview.qml isCurrentItem + \snippet doc/src/snippets/qml/gridview/gridview.qml isCurrentItem */ /*! @@ -1202,7 +1202,7 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight) until an animation completes. The example delegate below ensures that the animation completes before the item is removed from the list. - \snippet doc/src/snippets/declarative/gridview/gridview.qml delayRemove + \snippet doc/src/snippets/qml/gridview/gridview.qml delayRemove If a \l remove transition has been specified, it will not be applied until delayRemove is returned to \c false. @@ -1310,7 +1310,7 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight) Here is a highlight with its motion defined by a \l {SpringAnimation} item: - \snippet doc/src/snippets/declarative/gridview/gridview.qml highlightFollowsCurrentItem + \snippet doc/src/snippets/qml/gridview/gridview.qml highlightFollowsCurrentItem */ @@ -2051,7 +2051,7 @@ void QQuickGridView::moveCurrentIndexRight() } } -bool QQuickGridViewPrivate::applyInsertionChange(const QDeclarativeChangeSet::Insert &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView) +bool QQuickGridViewPrivate::applyInsertionChange(const QQuickChangeSet::Insert &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView) { Q_Q(QQuickGridView); diff --git a/src/quick/items/qquickgridview_p.h b/src/quick/items/qquickgridview_p.h index b8f44ed0e1..ac3c8f097d 100644 --- a/src/quick/items/qquickgridview_p.h +++ b/src/quick/items/qquickgridview_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include "qquickitemview_p.h" -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> QT_BEGIN_HEADER @@ -131,7 +131,7 @@ Q_SIGNALS: void viewChanged(); public: - QDeclarativeGuard<QQuickGridView> m_view; + QQmlGuard<QQuickGridView> m_view; }; diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index a71c666977..a939365e98 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -120,7 +120,7 @@ QQuickImagePrivate::QQuickImagePrivate() The following example shows the simplest usage of the Image element. - \snippet doc/src/snippets/declarative/image.qml document + \snippet doc/src/snippets/qml/image.qml document \beginfloatleft \image declarative-qtlogo.png @@ -147,7 +147,7 @@ QQuickImagePrivate::QQuickImagePrivate() size bounded via the \l sourceSize property. This is especially important for content that is loaded from external sources or provided by the user. - \sa {declarative/imageelements/image}{Image example}, QDeclarativeImageProvider + \sa {declarative/imageelements/image}{Image example}, QQmlImageProvider */ QQuickImage::QQuickImage(QQuickItem *parent) @@ -431,7 +431,7 @@ qreal QQuickImage::paintedHeight() const The URL may be absolute, or relative to the URL of the component. - \sa QDeclarativeImageProvider + \sa QQmlImageProvider */ /*! diff --git a/src/quick/items/qquickimage_p.h b/src/quick/items/qquickimage_p.h index 35337dfd09..a9e37b47e1 100644 --- a/src/quick/items/qquickimage_p.h +++ b/src/quick/items/qquickimage_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickimage_p_p.h b/src/quick/items/qquickimage_p_p.h index 25e267ccff..6a0ba1535f 100644 --- a/src/quick/items/qquickimage_p_p.h +++ b/src/quick/items/qquickimage_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index 8b127ba571..0bdfab67a9 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,7 +42,7 @@ #include "qquickimagebase_p.h" #include "qquickimagebase_p_p.h" -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> QT_BEGIN_NAMESPACE @@ -202,11 +202,11 @@ void QQuickImageBase::load() emit statusChanged(d->status); update(); } else { - QDeclarativePixmap::Options options; + QQuickPixmap::Options options; if (d->async) - options |= QDeclarativePixmap::Asynchronous; + options |= QQuickPixmap::Asynchronous; if (d->cache) - options |= QDeclarativePixmap::Cache; + options |= QQuickPixmap::Cache; d->pix.clear(this); pixmapChange(); d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), options); diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h index bbda9dba9a..dfff1e4b0e 100644 --- a/src/quick/items/qquickimagebase_p.h +++ b/src/quick/items/qquickimagebase_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickimagebase_p_p.h b/src/quick/items/qquickimagebase_p_p.h index dd9185676f..7c2fce1e79 100644 --- a/src/quick/items/qquickimagebase_p_p.h +++ b/src/quick/items/qquickimagebase_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,7 +56,7 @@ #include "qquickimplicitsizeitem_p_p.h" #include "qquickimagebase_p.h" -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> QT_BEGIN_NAMESPACE @@ -76,7 +76,7 @@ public: { } - QDeclarativePixmap pix; + QQuickPixmap pix; QQuickImageBase::Status status; QUrl url; qreal progress; diff --git a/src/quick/items/qquickimplicitsizeitem.cpp b/src/quick/items/qquickimplicitsizeitem.cpp index 040263e35a..427be42312 100644 --- a/src/quick/items/qquickimplicitsizeitem.cpp +++ b/src/quick/items/qquickimplicitsizeitem.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickimplicitsizeitem_p.h b/src/quick/items/qquickimplicitsizeitem_p.h index 5c4bac3585..a6d58325d8 100644 --- a/src/quick/items/qquickimplicitsizeitem_p.h +++ b/src/quick/items/qquickimplicitsizeitem_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickimplicitsizeitem_p_p.h b/src/quick/items/qquickimplicitsizeitem_p_p.h index 15ca8b3127..84e3027e64 100644 --- a/src/quick/items/qquickimplicitsizeitem_p_p.h +++ b/src/quick/items/qquickimplicitsizeitem_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 04f4c1f801..357c72cc71 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,15 +42,15 @@ #include "qquickitem.h" #include "qquickcanvas.h" -#include <QtDeclarative/qjsengine.h> +#include <QtQml/qjsengine.h> #include "qquickcanvas_p.h" #include "qquickevents_p_p.h" #include "qquickscreen_p.h" -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlengine.h> +#include <QtQml/qqmlcomponent.h> +#include <QtQml/qqmlinfo.h> #include <QtGui/qpen.h> #include <QtGui/qcursor.h> #include <QtGui/qguiapplication.h> @@ -59,13 +59,14 @@ #include <QtCore/qcoreevent.h> #include <QtCore/qnumeric.h> -#include <private/qdeclarativeengine_p.h> -#include <QtQuick/private/qdeclarativestategroup_p.h> -#include <private/qdeclarativeopenmetaobject_p.h> -#include <QtQuick/private/qdeclarativestate_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlengine_p.h> +#include <QtQuick/private/qquickstategroup_p.h> +#include <private/qqmlopenmetaobject_p.h> +#include <QtQuick/private/qquickstate_p.h> #include <private/qlistmodelinterface_p.h> #include <private/qquickitem_p.h> -#include <private/qdeclarativeaccessors_p.h> +#include <private/qqmlaccessors_p.h> #include <QtQuick/private/qquickaccessibleattached_p.h> #include <float.h> @@ -74,7 +75,7 @@ QT_BEGIN_NAMESPACE -static void QQuickItem_parentNotifier(QObject *o, intptr_t, QDeclarativeNotifier **n) +static void QQuickItem_parentNotifier(QObject *o, intptr_t, QQmlNotifier **n) { QQuickItemPrivate *d = QQuickItemPrivate::get(static_cast<QQuickItem *>(o)); *n = &d->parentNotifier; @@ -86,11 +87,11 @@ QML_PRIVATE_ACCESSOR(QQuickItem, qreal, y, y) QML_PRIVATE_ACCESSOR(QQuickItem, qreal, width, width) QML_PRIVATE_ACCESSOR(QQuickItem, qreal, height, height) -static QDeclarativeAccessors QQuickItem_parent = { QQuickItem_parentRead, QQuickItem_parentNotifier }; -static QDeclarativeAccessors QQuickItem_x = { QQuickItem_xRead, 0 }; -static QDeclarativeAccessors QQuickItem_y = { QQuickItem_yRead, 0 }; -static QDeclarativeAccessors QQuickItem_width = { QQuickItem_widthRead, 0 }; -static QDeclarativeAccessors QQuickItem_height = { QQuickItem_heightRead, 0 }; +static QQmlAccessors QQuickItem_parent = { QQuickItem_parentRead, QQuickItem_parentNotifier }; +static QQmlAccessors QQuickItem_x = { QQuickItem_xRead, 0 }; +static QQmlAccessors QQuickItem_y = { QQuickItem_yRead, 0 }; +static QQmlAccessors QQuickItem_width = { QQuickItem_widthRead, 0 }; +static QQmlAccessors QQuickItem_height = { QQuickItem_heightRead, 0 }; QML_DECLARE_PROPERTIES(QQuickItem) { { QML_PROPERTY_NAME(parent), 0, &QQuickItem_parent }, @@ -233,7 +234,7 @@ void QQuickItemPrivate::registerAccessorProperties() rotations you must specify the axis to rotate around in addition to the origin point. The following example shows various 3D-like rotations applied to an \l Image. - \snippet doc/src/snippets/declarative/rotation.qml 0 + \snippet doc/src/snippets/qml/rotation.qml 0 \image axisrotation.png @@ -491,7 +492,7 @@ void QQuickItemKeyFilter::componentComplete() The following example provides key navigation for a 2x2 grid of items: - \snippet doc/src/snippets/declarative/keynavigation.qml 0 + \snippet doc/src/snippets/qml/keynavigation.qml 0 The top-left item initially receives focus by setting \l {Item::}{focus} to \c true. When an arrow key is pressed, the focus will move to the @@ -912,13 +913,13 @@ bool QQuickKeysAttachedPrivate::isConnected(const char *signalName) be used to test for a certain key; in this case, the left cursor key: - \snippet doc/src/snippets/declarative/keys/keys-pressed.qml key item + \snippet doc/src/snippets/qml/keys/keys-pressed.qml key item Some keys may alternatively be handled via specific signal properties, for example \e onSelectPressed. These handlers automatically set \e event.accepted to true. - \snippet doc/src/snippets/declarative/keys/keys-handler.qml key item + \snippet doc/src/snippets/qml/keys/keys-handler.qml key item See \l{Qt::Key}{Qt.Key} for the list of keyboard codes. @@ -1460,7 +1461,7 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj) from left to right by default, they are now positioned from right to left instead, as demonstrated by the numbering and opacity of the items: - \snippet doc/src/snippets/declarative/layoutmirroring.qml 0 + \snippet doc/src/snippets/qml/layoutmirroring.qml 0 \image layoutmirroring.png @@ -2351,7 +2352,7 @@ void QQuickItemPrivate::init(QQuickItem *parent) } } -void QQuickItemPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o) +void QQuickItemPrivate::data_append(QQmlListProperty<QObject> *prop, QObject *o) { if (!o) return; @@ -2410,14 +2411,14 @@ void QQuickItemPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QOb specify it. */ -int QQuickItemPrivate::data_count(QDeclarativeListProperty<QObject> *prop) +int QQuickItemPrivate::data_count(QQmlListProperty<QObject> *prop) { Q_UNUSED(prop); // XXX todo return 0; } -QObject *QQuickItemPrivate::data_at(QDeclarativeListProperty<QObject> *prop, int i) +QObject *QQuickItemPrivate::data_at(QQmlListProperty<QObject> *prop, int i) { Q_UNUSED(prop); Q_UNUSED(i); @@ -2425,13 +2426,13 @@ QObject *QQuickItemPrivate::data_at(QDeclarativeListProperty<QObject> *prop, int return 0; } -void QQuickItemPrivate::data_clear(QDeclarativeListProperty<QObject> *prop) +void QQuickItemPrivate::data_clear(QQmlListProperty<QObject> *prop) { Q_UNUSED(prop); // XXX todo } -QObject *QQuickItemPrivate::resources_at(QDeclarativeListProperty<QObject> *prop, int index) +QObject *QQuickItemPrivate::resources_at(QQmlListProperty<QObject> *prop, int index) { const QObjectList children = prop->object->children(); if (index < children.count()) @@ -2440,18 +2441,18 @@ QObject *QQuickItemPrivate::resources_at(QDeclarativeListProperty<QObject> *prop return 0; } -void QQuickItemPrivate::resources_append(QDeclarativeListProperty<QObject> *prop, QObject *o) +void QQuickItemPrivate::resources_append(QQmlListProperty<QObject> *prop, QObject *o) { // XXX todo - do we really want this behavior? o->setParent(prop->object); } -int QQuickItemPrivate::resources_count(QDeclarativeListProperty<QObject> *prop) +int QQuickItemPrivate::resources_count(QQmlListProperty<QObject> *prop) { return prop->object->children().count(); } -void QQuickItemPrivate::resources_clear(QDeclarativeListProperty<QObject> *prop) +void QQuickItemPrivate::resources_clear(QQmlListProperty<QObject> *prop) { // XXX todo - do we really want this behavior? const QObjectList children = prop->object->children(); @@ -2459,7 +2460,7 @@ void QQuickItemPrivate::resources_clear(QDeclarativeListProperty<QObject> *prop) children.at(index)->setParent(0); } -QQuickItem *QQuickItemPrivate::children_at(QDeclarativeListProperty<QQuickItem> *prop, int index) +QQuickItem *QQuickItemPrivate::children_at(QQmlListProperty<QQuickItem> *prop, int index) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); if (index >= p->childItems.count() || index < 0) @@ -2468,7 +2469,7 @@ QQuickItem *QQuickItemPrivate::children_at(QDeclarativeListProperty<QQuickItem> return p->childItems.at(index); } -void QQuickItemPrivate::children_append(QDeclarativeListProperty<QQuickItem> *prop, QQuickItem *o) +void QQuickItemPrivate::children_append(QQmlListProperty<QQuickItem> *prop, QQuickItem *o) { if (!o) return; @@ -2480,13 +2481,13 @@ void QQuickItemPrivate::children_append(QDeclarativeListProperty<QQuickItem> *pr o->setParentItem(that); } -int QQuickItemPrivate::children_count(QDeclarativeListProperty<QQuickItem> *prop) +int QQuickItemPrivate::children_count(QQmlListProperty<QQuickItem> *prop) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); return p->childItems.count(); } -void QQuickItemPrivate::children_clear(QDeclarativeListProperty<QQuickItem> *prop) +void QQuickItemPrivate::children_clear(QQmlListProperty<QQuickItem> *prop) { QQuickItem *that = static_cast<QQuickItem *>(prop->object); QQuickItemPrivate *p = QQuickItemPrivate::get(that); @@ -2494,13 +2495,13 @@ void QQuickItemPrivate::children_clear(QDeclarativeListProperty<QQuickItem> *pro p->childItems.at(0)->setParentItem(0); } -void QQuickItemPrivate::visibleChildren_append(QDeclarativeListProperty<QQuickItem>*, QQuickItem *self) +void QQuickItemPrivate::visibleChildren_append(QQmlListProperty<QQuickItem>*, QQuickItem *self) { // do nothing qmlInfo(self) << "QQuickItem: visibleChildren property is readonly and cannot be assigned to."; } -int QQuickItemPrivate::visibleChildren_count(QDeclarativeListProperty<QQuickItem> *prop) +int QQuickItemPrivate::visibleChildren_count(QQmlListProperty<QQuickItem> *prop) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); int visibleCount = 0; @@ -2512,7 +2513,7 @@ int QQuickItemPrivate::visibleChildren_count(QDeclarativeListProperty<QQuickItem return visibleCount; } -QQuickItem *QQuickItemPrivate::visibleChildren_at(QDeclarativeListProperty<QQuickItem> *prop, int index) +QQuickItem *QQuickItemPrivate::visibleChildren_at(QQmlListProperty<QQuickItem> *prop, int index) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); const int childCount = p->childItems.count(); @@ -2527,7 +2528,7 @@ QQuickItem *QQuickItemPrivate::visibleChildren_at(QDeclarativeListProperty<QQuic return 0; } -int QQuickItemPrivate::transform_count(QDeclarativeListProperty<QQuickTransform> *prop) +int QQuickItemPrivate::transform_count(QQmlListProperty<QQuickTransform> *prop) { QQuickItem *that = static_cast<QQuickItem *>(prop->object); QQuickItemPrivate *p = QQuickItemPrivate::get(that); @@ -2573,7 +2574,7 @@ void QQuickTransform::prependToItem(QQuickItem *item) p->dirty(QQuickItemPrivate::Transform); } -void QQuickItemPrivate::transform_append(QDeclarativeListProperty<QQuickTransform> *prop, QQuickTransform *transform) +void QQuickItemPrivate::transform_append(QQmlListProperty<QQuickTransform> *prop, QQuickTransform *transform) { if (!transform) return; @@ -2582,7 +2583,7 @@ void QQuickItemPrivate::transform_append(QDeclarativeListProperty<QQuickTransfor transform->appendToItem(that); } -QQuickTransform *QQuickItemPrivate::transform_at(QDeclarativeListProperty<QQuickTransform> *prop, int idx) +QQuickTransform *QQuickItemPrivate::transform_at(QQmlListProperty<QQuickTransform> *prop, int idx) { QQuickItem *that = static_cast<QQuickItem *>(prop->object); QQuickItemPrivate *p = QQuickItemPrivate::get(that); @@ -2593,7 +2594,7 @@ QQuickTransform *QQuickItemPrivate::transform_at(QDeclarativeListProperty<QQuick return p->transforms.at(idx); } -void QQuickItemPrivate::transform_clear(QDeclarativeListProperty<QQuickTransform> *prop) +void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop) { QQuickItem *that = static_cast<QQuickItem *>(prop->object); QQuickItemPrivate *p = QQuickItemPrivate::get(that); @@ -2852,9 +2853,9 @@ void QQuickItemPrivate::siblingOrderChanged() } } -QDeclarativeListProperty<QObject> QQuickItemPrivate::data() +QQmlListProperty<QObject> QQuickItemPrivate::data() { - return QDeclarativeListProperty<QObject>(q_func(), 0, QQuickItemPrivate::data_append, + return QQmlListProperty<QObject>(q_func(), 0, QQuickItemPrivate::data_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, QQuickItemPrivate::data_clear); @@ -3233,7 +3234,7 @@ void QQuickItem::polish() } } -void QQuickItem::mapFromItem(QDeclarativeV8Function *args) const +void QQuickItem::mapFromItem(QQmlV8Function *args) const { if (args->Length() != 0) { v8::Local<v8::Value> item = (*args)[0]; @@ -3276,7 +3277,7 @@ QTransform QQuickItem::itemTransform(QQuickItem *other, bool *ok) const return t; } -void QQuickItem::mapToItem(QDeclarativeV8Function *args) const +void QQuickItem::mapToItem(QQmlV8Function *args) const { if (args->Length() != 0) { v8::Local<v8::Value> item = (*args)[0]; @@ -3332,17 +3333,17 @@ QQuickItem *QQuickItem::childAt(qreal x, qreal y) const return 0; } -QDeclarativeListProperty<QObject> QQuickItemPrivate::resources() +QQmlListProperty<QObject> QQuickItemPrivate::resources() { - return QDeclarativeListProperty<QObject>(q_func(), 0, QQuickItemPrivate::resources_append, + return QQmlListProperty<QObject>(q_func(), 0, QQuickItemPrivate::resources_append, QQuickItemPrivate::resources_count, QQuickItemPrivate::resources_at, QQuickItemPrivate::resources_clear); } -QDeclarativeListProperty<QQuickItem> QQuickItemPrivate::children() +QQmlListProperty<QQuickItem> QQuickItemPrivate::children() { - return QDeclarativeListProperty<QQuickItem>(q_func(), 0, QQuickItemPrivate::children_append, + return QQmlListProperty<QQuickItem>(q_func(), 0, QQuickItemPrivate::children_append, QQuickItemPrivate::children_count, QQuickItemPrivate::children_at, QQuickItemPrivate::children_clear); @@ -3355,20 +3356,20 @@ QDeclarativeListProperty<QQuickItem> QQuickItemPrivate::children() Note that a child's visibility may have changed explicitly, or because the visibility of this (it's parent) item or another grandparent changed. */ -QDeclarativeListProperty<QQuickItem> QQuickItemPrivate::visibleChildren() +QQmlListProperty<QQuickItem> QQuickItemPrivate::visibleChildren() { - return QDeclarativeListProperty<QQuickItem>(q_func(), 0, QQuickItemPrivate::visibleChildren_append, + return QQmlListProperty<QQuickItem>(q_func(), 0, QQuickItemPrivate::visibleChildren_append, QQuickItemPrivate::visibleChildren_count, QQuickItemPrivate::visibleChildren_at); } -QDeclarativeListProperty<QDeclarativeState> QQuickItemPrivate::states() +QQmlListProperty<QQuickState> QQuickItemPrivate::states() { return _states()->statesProperty(); } -QDeclarativeListProperty<QDeclarativeTransition> QQuickItemPrivate::transitions() +QQmlListProperty<QQuickTransition> QQuickItemPrivate::transitions() { return _states()->transitionsProperty(); } @@ -3398,9 +3399,9 @@ void QQuickItem::setState(const QString &state) d->setState(state); } -QDeclarativeListProperty<QQuickTransform> QQuickItem::transform() +QQmlListProperty<QQuickTransform> QQuickItem::transform() { - return QDeclarativeListProperty<QQuickTransform>(this, 0, QQuickItemPrivate::transform_append, + return QQmlListProperty<QQuickTransform>(this, 0, QQuickItemPrivate::transform_append, QQuickItemPrivate::transform_count, QQuickItemPrivate::transform_at, QQuickItemPrivate::transform_clear); @@ -3439,11 +3440,11 @@ void QQuickItem::componentComplete() d->extra->contents->complete(); } -QDeclarativeStateGroup *QQuickItemPrivate::_states() +QQuickStateGroup *QQuickItemPrivate::_states() { Q_Q(QQuickItem); if (!_stateGroup) { - _stateGroup = new QDeclarativeStateGroup; + _stateGroup = new QQuickStateGroup; if (!componentComplete) _stateGroup->classBegin(); FAST_CONNECT(_stateGroup, SIGNAL(stateChanged(QString)), @@ -5566,7 +5567,7 @@ void QQuickItemLayer::deactivateEffect() \sa samplerName */ -void QQuickItemLayer::setEffect(QDeclarativeComponent *component) +void QQuickItemLayer::setEffect(QQmlComponent *component) { if (component == m_effectComponent) return; diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index 7f98db9168..c44192bd3a 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,8 +43,8 @@ #define QQUICKITEM_H #include <QtQuick/qtquickglobal.h> -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativecomponent.h> +#include <QtQml/qqml.h> +#include <QtQml/qqmlcomponent.h> #include <QtCore/QObject> #include <QtCore/QList> @@ -81,10 +81,10 @@ private: }; class QQuickItemLayer; -class QDeclarativeV8Function; -class QDeclarativeState; +class QQmlV8Function; +class QQuickState; class QQuickAnchorLine; -class QDeclarativeTransition; +class QQuickTransition; class QQuickKeyEvent; class QQuickAnchors; class QQuickItemPrivate; @@ -95,15 +95,15 @@ class QSGNode; class QSGTransformNode; class QSGTextureProvider; -class Q_QUICK_EXPORT QQuickItem : public QObject, public QDeclarativeParserStatus +class Q_QUICK_EXPORT QQuickItem : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(QQuickItem *parent READ parentItem WRITE setParentItem NOTIFY parentChanged DESIGNABLE false FINAL) - Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QDeclarativeListProperty<QObject> data READ data DESIGNABLE false) - Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QDeclarativeListProperty<QObject> resources READ resources DESIGNABLE false) - Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QDeclarativeListProperty<QQuickItem> children READ children NOTIFY childrenChanged DESIGNABLE false) + Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QObject> data READ data DESIGNABLE false) + Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QObject> resources READ resources DESIGNABLE false) + Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QQuickItem> children READ children NOTIFY childrenChanged DESIGNABLE false) Q_PROPERTY(QPointF pos READ pos FINAL) Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL) @@ -115,10 +115,10 @@ class Q_QUICK_EXPORT QQuickItem : public QObject, public QDeclarativeParserStatu Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) - Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QDeclarativeListProperty<QQuickItem> visibleChildren READ visibleChildren NOTIFY visibleChildrenChanged DESIGNABLE false) + Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QQuickItem> visibleChildren READ visibleChildren NOTIFY visibleChildrenChanged DESIGNABLE false) - Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QDeclarativeListProperty<QDeclarativeState> states READ states DESIGNABLE false) - Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitions DESIGNABLE false) + Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QQuickState> states READ states DESIGNABLE false) + Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QQuickTransition> transitions READ transitions DESIGNABLE false) Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) Q_PROPERTY(QRectF childrenRect READ childrenRect NOTIFY childrenRectChanged DESIGNABLE false FINAL) Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQuickAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL) @@ -140,7 +140,7 @@ class Q_QUICK_EXPORT QQuickItem : public QObject, public QDeclarativeParserStatu Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged) Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // XXX todo - notify? - Q_PROPERTY(QDeclarativeListProperty<QQuickTransform> transform READ transform DESIGNABLE false FINAL) + Q_PROPERTY(QQmlListProperty<QQuickTransform> transform READ transform DESIGNABLE false FINAL) Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged) Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged) @@ -215,7 +215,7 @@ public: qreal baselineOffset() const; void setBaselineOffset(qreal); - QDeclarativeListProperty<QQuickTransform> transform(); + QQmlListProperty<QQuickTransform> transform(); qreal x() const; qreal y() const; @@ -303,8 +303,8 @@ public: void polish(); - Q_INVOKABLE void mapFromItem(QDeclarativeV8Function*) const; - Q_INVOKABLE void mapToItem(QDeclarativeV8Function*) const; + Q_INVOKABLE void mapFromItem(QQmlV8Function*) const; + Q_INVOKABLE void mapToItem(QQmlV8Function*) const; Q_INVOKABLE void forceActiveFocus(); Q_INVOKABLE QQuickItem *childAt(qreal x, qreal y) const; diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index c2cc7d000b..8adb80e88b 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -65,14 +65,14 @@ #include "qquickclipnode_p.h" #include <private/qpodvector_p.h> -#include <QtQuick/private/qdeclarativestate_p.h> -#include <private/qdeclarativenullablevalue_p_p.h> -#include <private/qdeclarativenotifier_p.h> -#include <private/qdeclarativeglobal_p.h> +#include <QtQuick/private/qquickstate_p.h> +#include <private/qqmlnullablevalue_p_p.h> +#include <private/qqmlnotifier_p.h> +#include <private/qqmlglobal_p.h> #include <private/qlazilyallocated_p.h> -#include <qdeclarative.h> -#include <qdeclarativecontext.h> +#include <qqml.h> +#include <qqmlcontext.h> #include <QtCore/qlist.h> #include <QtCore/qdebug.h> @@ -149,7 +149,7 @@ class QQuickItemLayer : public QObject, public QQuickItemChangeListener Q_PROPERTY(QQuickShaderEffectSource::WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged) Q_PROPERTY(QQuickShaderEffectSource::Format format READ format WRITE setFormat NOTIFY formatChanged) Q_PROPERTY(QByteArray samplerName READ name WRITE setName NOTIFY nameChanged) - Q_PROPERTY(QDeclarativeComponent *effect READ effect WRITE setEffect NOTIFY effectChanged) + Q_PROPERTY(QQmlComponent *effect READ effect WRITE setEffect NOTIFY effectChanged) public: QQuickItemLayer(QQuickItem *item); ~QQuickItemLayer(); @@ -181,8 +181,8 @@ public: QByteArray name() const { return m_name; } void setName(const QByteArray &name); - QDeclarativeComponent *effect() const { return m_effectComponent; } - void setEffect(QDeclarativeComponent *effect); + QQmlComponent *effect() const { return m_effectComponent; } + void setEffect(QQmlComponent *effect); QQuickShaderEffectSource *effectSource() const { return m_effectSource; } @@ -203,7 +203,7 @@ signals: void mipmapChanged(bool mipmap); void wrapModeChanged(QQuickShaderEffectSource::WrapMode mode); void nameChanged(const QByteArray &name); - void effectChanged(QDeclarativeComponent *component); + void effectChanged(QQmlComponent *component); void smoothChanged(bool smooth); void formatChanged(QQuickShaderEffectSource::Format format); void sourceRectChanged(const QRectF &sourceRect); @@ -224,7 +224,7 @@ private: QSize m_size; QRectF m_sourceRect; QByteArray m_name; - QDeclarativeComponent *m_effectComponent; + QQmlComponent *m_effectComponent; QQuickItem *m_effect; QQuickShaderEffectSource *m_effectSource; }; @@ -243,13 +243,13 @@ public: ~QQuickItemPrivate(); void init(QQuickItem *parent); - QDeclarativeListProperty<QObject> data(); - QDeclarativeListProperty<QObject> resources(); - QDeclarativeListProperty<QQuickItem> children(); - QDeclarativeListProperty<QQuickItem> visibleChildren(); + QQmlListProperty<QObject> data(); + QQmlListProperty<QObject> resources(); + QQmlListProperty<QQuickItem> children(); + QQmlListProperty<QQuickItem> visibleChildren(); - QDeclarativeListProperty<QDeclarativeState> states(); - QDeclarativeListProperty<QDeclarativeTransition> transitions(); + QQmlListProperty<QQuickState> states(); + QQmlListProperty<QQuickTransition> transitions(); QString state() const; void setState(const QString &); @@ -265,33 +265,33 @@ public: QQuickItemLayer *layer() const; // data property - static void data_append(QDeclarativeListProperty<QObject> *, QObject *); - static int data_count(QDeclarativeListProperty<QObject> *); - static QObject *data_at(QDeclarativeListProperty<QObject> *, int); - static void data_clear(QDeclarativeListProperty<QObject> *); + static void data_append(QQmlListProperty<QObject> *, QObject *); + static int data_count(QQmlListProperty<QObject> *); + static QObject *data_at(QQmlListProperty<QObject> *, int); + static void data_clear(QQmlListProperty<QObject> *); // resources property - static QObject *resources_at(QDeclarativeListProperty<QObject> *, int); - static void resources_append(QDeclarativeListProperty<QObject> *, QObject *); - static int resources_count(QDeclarativeListProperty<QObject> *); - static void resources_clear(QDeclarativeListProperty<QObject> *); + static QObject *resources_at(QQmlListProperty<QObject> *, int); + static void resources_append(QQmlListProperty<QObject> *, QObject *); + static int resources_count(QQmlListProperty<QObject> *); + static void resources_clear(QQmlListProperty<QObject> *); // children property - static void children_append(QDeclarativeListProperty<QQuickItem> *, QQuickItem *); - static int children_count(QDeclarativeListProperty<QQuickItem> *); - static QQuickItem *children_at(QDeclarativeListProperty<QQuickItem> *, int); - static void children_clear(QDeclarativeListProperty<QQuickItem> *); + static void children_append(QQmlListProperty<QQuickItem> *, QQuickItem *); + static int children_count(QQmlListProperty<QQuickItem> *); + static QQuickItem *children_at(QQmlListProperty<QQuickItem> *, int); + static void children_clear(QQmlListProperty<QQuickItem> *); // visibleChildren property - static void visibleChildren_append(QDeclarativeListProperty<QQuickItem> *prop, QQuickItem *o); - static int visibleChildren_count(QDeclarativeListProperty<QQuickItem> *prop); - static QQuickItem *visibleChildren_at(QDeclarativeListProperty<QQuickItem> *prop, int index); + static void visibleChildren_append(QQmlListProperty<QQuickItem> *prop, QQuickItem *o); + static int visibleChildren_count(QQmlListProperty<QQuickItem> *prop); + static QQuickItem *visibleChildren_at(QQmlListProperty<QQuickItem> *prop, int index); // transform property - static int transform_count(QDeclarativeListProperty<QQuickTransform> *list); - static void transform_append(QDeclarativeListProperty<QQuickTransform> *list, QQuickTransform *); - static QQuickTransform *transform_at(QDeclarativeListProperty<QQuickTransform> *list, int); - static void transform_clear(QDeclarativeListProperty<QQuickTransform> *list); + static int transform_count(QQmlListProperty<QQuickTransform> *list); + static void transform_append(QQmlListProperty<QQuickTransform> *list, QQuickTransform *); + static QQuickTransform *transform_at(QQmlListProperty<QQuickTransform> *list, int); + static void transform_clear(QQmlListProperty<QQuickTransform> *list); enum ChangeType { Geometry = 0x01, @@ -372,8 +372,8 @@ public: void updateOrAddGeometryChangeListener(QQuickItemChangeListener *listener, GeometryChangeTypes types); void updateOrRemoveGeometryChangeListener(QQuickItemChangeListener *listener, GeometryChangeTypes types); - QDeclarativeStateGroup *_states(); - QDeclarativeStateGroup *_stateGroup; + QQuickStateGroup *_states(); + QQuickStateGroup *_stateGroup; inline QQuickItem::TransformOrigin origin() const; @@ -453,7 +453,7 @@ public: inline QSGContext *sceneGraphContext() const; QQuickItem *parentItem; - QDeclarativeNotifier parentNotifier; + QQmlNotifier parentNotifier; QList<QQuickItem *> childItems; mutable QList<QQuickItem *> *sortedChildItems; @@ -723,7 +723,7 @@ class QQuickKeysAttached : public QObject, public QQuickItemKeyFilter Q_DECLARE_PRIVATE(QQuickKeysAttached) Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(QDeclarativeListProperty<QQuickItem> forwardTo READ forwardTo) + Q_PROPERTY(QQmlListProperty<QQuickItem> forwardTo READ forwardTo) Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) Q_ENUMS(Priority) @@ -745,9 +745,9 @@ public: Priority priority() const; void setPriority(Priority); - QDeclarativeListProperty<QQuickItem> forwardTo() { + QQmlListProperty<QQuickItem> forwardTo() { Q_D(QQuickKeysAttached); - return QDeclarativeListProperty<QQuickItem>(this, d->targets); + return QQmlListProperty<QQuickItem>(this, d->targets); } virtual void componentComplete(); diff --git a/src/quick/items/qquickanimation.cpp b/src/quick/items/qquickitemanimation.cpp index 4880190697..1316a3d84a 100644 --- a/src/quick/items/qquickanimation.cpp +++ b/src/quick/items/qquickitemanimation.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#include "qquickanimation_p.h" -#include "qquickanimation_p_p.h" +#include "qquickitemanimation_p.h" +#include "qquickitemanimation_p_p.h" #include "qquickstateoperations_p.h" -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativepath_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qquickpath_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtCore/qmath.h> #include "private/qsequentialanimationgroupjob_p.h" #include "private/qparallelanimationgroupjob_p.h" @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE the transition, ensures the item animates smoothly as it moves to its new parent: - \snippet doc/src/snippets/declarative/parentanimation.qml 0 + \snippet doc/src/snippets/qml/parentanimation.qml 0 A ParentAnimation can contain any number of animations. These animations will be run in parallel; to run them sequentially, define them within a @@ -93,7 +93,7 @@ QT_BEGIN_NAMESPACE \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} */ QQuickParentAnimation::QQuickParentAnimation(QObject *parent) - : QDeclarativeAnimationGroup(*(new QQuickParentAnimationPrivate), parent) + : QQuickAnimationGroup(*(new QQuickParentAnimationPrivate), parent) { } @@ -204,8 +204,8 @@ QPointF QQuickParentAnimationPrivate::computeTransformOrigin(QQuickItem::Transfo } } -QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { @@ -216,14 +216,14 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction QQuickParentAnimationData() {} ~QQuickParentAnimationData() { qDeleteAll(pc); } - QDeclarativeStateActions actions; + QQuickStateActions actions; //### reverse should probably apply on a per-action basis bool reverse; QList<QQuickParentChange *> pc; virtual void doAction() { for (int ii = 0; ii < actions.count(); ++ii) { - const QDeclarativeAction &action = actions.at(ii); + const QQuickAction &action = actions.at(ii); if (reverse) action.event->reverse(); else @@ -238,7 +238,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction bool hasExplicit = false; if (d->target && d->newParent) { data->reverse = false; - QDeclarativeAction myAction; + QQuickAction myAction; QQuickParentChange *pc = new QQuickParentChange; pc->setObject(d->target); pc->setParent(d->newParent); @@ -248,7 +248,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction hasExplicit = true; if (d->via) { viaData->reverse = false; - QDeclarativeAction myVAction; + QQuickAction myVAction; QQuickParentChange *vpc = new QQuickParentChange; vpc->setObject(d->target); vpc->setParent(d->via); @@ -262,12 +262,12 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction if (!hasExplicit) for (int i = 0; i < actions.size(); ++i) { - QDeclarativeAction &action = actions[i]; - if (action.event && action.event->type() == QDeclarativeActionEvent::ParentChange + QQuickAction &action = actions[i]; + if (action.event && action.event->type() == QQuickActionEvent::ParentChange && (!d->target || static_cast<QQuickParentChange*>(action.event)->object() == d->target)) { QQuickParentChange *pc = static_cast<QQuickParentChange*>(action.event); - QDeclarativeAction myAction = action; + QQuickAction myAction = action; data->reverse = action.reverseEvent; //### this logic differs from PropertyAnimation @@ -287,18 +287,18 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction if (d->via) { viaData->reverse = false; - QDeclarativeAction myAction; + QQuickAction myAction; QQuickParentChange *vpc = new QQuickParentChange; vpc->setObject(pc->object()); vpc->setParent(d->via); myAction.event = vpc; viaData->pc << vpc; viaData->actions << myAction; - QDeclarativeAction dummyAction; - QDeclarativeAction &xAction = pc->xIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; - QDeclarativeAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; - QDeclarativeAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; - QDeclarativeAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; + QQuickAction dummyAction; + QQuickAction &xAction = pc->xIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; + QQuickAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; + QQuickAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; + QQuickAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; QQuickItem *target = pc->object(); QQuickItem *targetParent = action.reverseEvent ? pc->originalParent() : pc->parent(); @@ -393,7 +393,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction } //TODO: simplify/clarify logic - bool forwards = direction == QDeclarativeAbstractAnimation::Forward; + bool forwards = direction == QQuickAbstractAnimation::Forward; if (forwards) { topLevelGroup->appendAnimation(d->via ? viaAction : targetAction); topLevelGroup->appendAnimation(ag); @@ -424,7 +424,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction In the following snippet we animate the addition of a right anchor to a \l Rectangle: - \snippet doc/src/snippets/declarative/anchoranimation.qml 0 + \snippet doc/src/snippets/qml/anchoranimation.qml 0 For convenience, when an AnchorAnimation is used in a \l Transition, it will animate any AnchorChanges that have occurred during the state change. @@ -439,7 +439,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QDeclarativeStateAction \sa {QML Animation and Transitions}, AnchorChanges */ QQuickAnchorAnimation::QQuickAnchorAnimation(QObject *parent) -: QDeclarativeAbstractAnimation(*(new QQuickAnchorAnimationPrivate), parent) +: QQuickAbstractAnimation(*(new QQuickAnchorAnimationPrivate), parent) { } @@ -454,10 +454,10 @@ QQuickAnchorAnimation::~QQuickAnchorAnimation() If no targets are specified all AnchorChanges will be animated by the AnchorAnimation. */ -QDeclarativeListProperty<QQuickItem> QQuickAnchorAnimation::targets() +QQmlListProperty<QQuickItem> QQuickAnchorAnimation::targets() { Q_D(QQuickAnchorAnimation); - return QDeclarativeListProperty<QQuickItem>(this, d->targets); + return QQmlListProperty<QQuickItem>(this, d->targets); } /*! @@ -520,15 +520,15 @@ void QQuickAnchorAnimation::setEasing(const QEasingCurve &e) emit easingChanged(e); } -QAbstractAnimationJob* QQuickAnchorAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickAnchorAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { Q_UNUSED(modified); Q_UNUSED(defaultTarget); Q_D(QQuickAnchorAnimation); - QDeclarativeAnimationPropertyUpdater *data = new QDeclarativeAnimationPropertyUpdater; + QQuickAnimationPropertyUpdater *data = new QQuickAnimationPropertyUpdater; data->interpolatorType = QMetaType::QReal; data->interpolator = d->interpolator; data->reverse = direction == Backward ? true : false; @@ -536,14 +536,14 @@ QAbstractAnimationJob* QQuickAnchorAnimation::transition(QDeclarativeStateAction data->fromDefined = false; for (int ii = 0; ii < actions.count(); ++ii) { - QDeclarativeAction &action = actions[ii]; - if (action.event && action.event->type() == QDeclarativeActionEvent::AnchorChanges + QQuickAction &action = actions[ii]; + if (action.event && action.event->type() == QQuickActionEvent::AnchorChanges && (d->targets.isEmpty() || d->targets.contains(static_cast<QQuickAnchorChanges*>(action.event)->object()))) { data->actions << static_cast<QQuickAnchorChanges*>(action.event)->additionalActions(); } } - QDeclarativeBulkValueAnimator *animator = new QDeclarativeBulkValueAnimator; + QQuickBulkValueAnimator *animator = new QQuickBulkValueAnimator; if (data->actions.count()) { animator->setAnimValue(data); animator->setFromSourcedValue(&data->fromSourced); @@ -580,7 +580,7 @@ QAbstractAnimationJob* QQuickAnchorAnimation::transition(QDeclarativeStateAction \sa {QML Animation and Transitions}, PathInterpolator */ QQuickPathAnimation::QQuickPathAnimation(QObject *parent) -: QDeclarativeAbstractAnimation(*(new QQuickPathAnimationPrivate), parent) +: QQuickAbstractAnimation(*(new QQuickPathAnimationPrivate), parent) { } @@ -655,13 +655,13 @@ void QQuickPathAnimation::setEasing(const QEasingCurve &e) For more information on defining a path see the \l Path documentation. */ -QDeclarativePath *QQuickPathAnimation::path() const +QQuickPath *QQuickPathAnimation::path() const { Q_D(const QQuickPathAnimation); return d->path; } -void QQuickPathAnimation::setPath(QDeclarativePath *path) +void QQuickPathAnimation::setPath(QQuickPath *path) { Q_D(QQuickPathAnimation); if (d->path == path) @@ -824,8 +824,8 @@ void QQuickPathAnimation::setEndRotation(qreal rotation) emit endRotationChanged(d->endRotation); } -QAbstractAnimationJob* QQuickPathAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickPathAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { @@ -866,7 +866,7 @@ QAbstractAnimationJob* QQuickPathAnimation::transition(QDeclarativeStateActions int origModifiedSize = modified.count(); for (int i = 0; i < actions.count(); ++i) { - QDeclarativeAction &action = actions[i]; + QQuickAction &action = actions[i]; if (action.event) continue; if (action.specifiedObject == target && action.property.name() == QLatin1String("x")) { @@ -894,7 +894,7 @@ QAbstractAnimationJob* QQuickPathAnimation::transition(QDeclarativeStateActions // treat interruptions specially, otherwise we end up with strange paths if ((data->reverse || prevData.reverse) && prevData.currentV > 0 && prevData.currentV < 1) { if (!data->fromDefined && !data->toDefined && !prevData.painterPath.isEmpty()) { - QPointF pathPos = QDeclarativePath::sequentialPointAt(prevData.painterPath, prevData.pathLength, prevData.attributePoints, prevData.prevBez, prevData.currentV); + QPointF pathPos = QQuickPath::sequentialPointAt(prevData.painterPath, prevData.pathLength, prevData.attributePoints, prevData.prevBez, prevData.currentV); if (!prevData.anchorPoint.isNull()) pathPos -= prevData.anchorPoint; if (pathPos == data->target->pos()) { //only treat as interruption if we interrupted ourself diff --git a/src/quick/items/qquickanimation_p.h b/src/quick/items/qquickitemanimation_p.h index 0823ba0cdd..a3a7e77871 100644 --- a/src/quick/items/qquickanimation_p.h +++ b/src/quick/items/qquickitemanimation_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,19 +39,19 @@ ** ****************************************************************************/ -#ifndef QQUICKANIMATION_H -#define QQUICKANIMATION_H +#ifndef QQUICKITEMANIMATION_H +#define QQUICKITEMANIMATION_H #include "qquickitem.h" -#include <QtQuick/private/qdeclarativeanimation_p.h> +#include <QtQuick/private/qquickanimation_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QQuickParentAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QQuickParentAnimation : public QDeclarativeAnimationGroup +class Q_QUICK_PRIVATE_EXPORT QQuickParentAnimation : public QQuickAnimationGroup { Q_OBJECT Q_DECLARE_PRIVATE(QQuickParentAnimation) @@ -79,18 +79,18 @@ Q_SIGNALS: void viaChanged(); protected: - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); }; class QQuickAnchorAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QQuickAnchorAnimation : public QDeclarativeAbstractAnimation +class Q_QUICK_PRIVATE_EXPORT QQuickAnchorAnimation : public QQuickAbstractAnimation { Q_OBJECT Q_DECLARE_PRIVATE(QQuickAnchorAnimation) - Q_PROPERTY(QDeclarativeListProperty<QQuickItem> targets READ targets) + Q_PROPERTY(QQmlListProperty<QQuickItem> targets READ targets) Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged) @@ -98,7 +98,7 @@ public: QQuickAnchorAnimation(QObject *parent=0); virtual ~QQuickAnchorAnimation(); - QDeclarativeListProperty<QQuickItem> targets(); + QQmlListProperty<QQuickItem> targets(); int duration() const; void setDuration(int); @@ -111,23 +111,23 @@ Q_SIGNALS: void easingChanged(const QEasingCurve&); protected: - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); }; class QQuickItem; -class QDeclarativePath; +class QQuickPath; class QQuickPathAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QQuickPathAnimation : public QDeclarativeAbstractAnimation +class Q_QUICK_PRIVATE_EXPORT QQuickPathAnimation : public QQuickAbstractAnimation { Q_OBJECT Q_DECLARE_PRIVATE(QQuickPathAnimation) Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged) - Q_PROPERTY(QDeclarativePath *path READ path WRITE setPath NOTIFY pathChanged) + Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged) Q_PROPERTY(QQuickItem *target READ target WRITE setTargetObject NOTIFY targetChanged) Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) Q_PROPERTY(QPointF anchorPoint READ anchorPoint WRITE setAnchorPoint NOTIFY anchorPointChanged) @@ -154,8 +154,8 @@ public: QEasingCurve easing() const; void setEasing(const QEasingCurve &); - QDeclarativePath *path() const; - void setPath(QDeclarativePath *); + QQuickPath *path() const; + void setPath(QQuickPath *); QQuickItem *target() const; void setTargetObject(QQuickItem *); @@ -176,8 +176,8 @@ public: void setEndRotation(qreal); protected: - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); Q_SIGNALS: @@ -200,4 +200,4 @@ QML_DECLARE_TYPE(QQuickPathAnimation) QT_END_HEADER -#endif // QQUICKANIMATION_H +#endif // QQUICKITEMANIMATION_H diff --git a/src/quick/items/qquickanimation_p_p.h b/src/quick/items/qquickitemanimation_p_p.h index c34b5ab963..f61b255218 100644 --- a/src/quick/items/qquickanimation_p_p.h +++ b/src/quick/items/qquickitemanimation_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -53,19 +53,19 @@ // We mean it. // -#include "qquickanimation_p.h" +#include "qquickitemanimation_p.h" -#include <private/qdeclarativepath_p.h> -#include <private/qdeclarativeanimation_p_p.h> +#include <private/qquickpath_p.h> +#include <private/qquickanimation_p_p.h> QT_BEGIN_NAMESPACE -class QQuickParentAnimationPrivate : public QDeclarativeAnimationGroupPrivate +class QQuickParentAnimationPrivate : public QQuickAnimationGroupPrivate { Q_DECLARE_PUBLIC(QQuickParentAnimation) public: QQuickParentAnimationPrivate() - : QDeclarativeAnimationGroupPrivate(), target(0), newParent(0), via(0) {} + : QQuickAnimationGroupPrivate(), target(0), newParent(0), via(0) {} QQuickItem *target; QQuickItem *newParent; @@ -74,7 +74,7 @@ public: QPointF computeTransformOrigin(QQuickItem::TransformOrigin origin, qreal width, qreal height) const; }; -class QQuickAnchorAnimationPrivate : public QDeclarativeAbstractAnimationPrivate +class QQuickAnchorAnimationPrivate : public QQuickAbstractAnimationPrivate { Q_DECLARE_PUBLIC(QQuickAnchorAnimation) public: @@ -86,7 +86,7 @@ public: QList<QQuickItem*> targets; }; -class QQuickPathAnimationUpdater : public QDeclarativeBulkValueUpdater +class QQuickPathAnimationUpdater : public QQuickBulkValueUpdater { public: QQuickPathAnimationUpdater() : path(0), target(0), reverse(false), @@ -97,12 +97,12 @@ public: void setValue(qreal v); - QDeclarativePath *path; + QQuickPath *path; QPainterPath painterPath; - QDeclarativeCachedBezier prevBez; + QQuickCachedBezier prevBez; qreal pathLength; - QList<QDeclarativePath::AttributePoint> attributePoints; + QList<QQuickPath::AttributePoint> attributePoints; QQuickItem *target; bool reverse; @@ -112,18 +112,18 @@ public: qreal toX; qreal toY; qreal currentV; - QDeclarativeNullableValue<qreal> interruptStart; + QQmlNullableValue<qreal> interruptStart; //TODO: bundle below into common struct QQuickPathAnimation::Orientation orientation; QPointF anchorPoint; qreal entryInterval; qreal exitInterval; - QDeclarativeNullableValue<qreal> endRotation; - QDeclarativeNullableValue<qreal> startRotation; + QQmlNullableValue<qreal> endRotation; + QQmlNullableValue<qreal> startRotation; }; class QQuickPathAnimationPrivate; -class QQuickPathAnimationAnimator : public QDeclarativeBulkValueAnimator +class QQuickPathAnimationAnimator : public QQuickBulkValueAnimator { public: QQuickPathAnimationAnimator(QQuickPathAnimationPrivate * = 0); @@ -136,20 +136,20 @@ private: QQuickPathAnimationPrivate *animationTemplate; }; -class QQuickPathAnimationPrivate : public QDeclarativeAbstractAnimationPrivate +class QQuickPathAnimationPrivate : public QQuickAbstractAnimationPrivate { Q_DECLARE_PUBLIC(QQuickPathAnimation) public: QQuickPathAnimationPrivate() : path(0), target(0), orientation(QQuickPathAnimation::Fixed), entryDuration(0), exitDuration(0), duration(250) {} - QDeclarativePath *path; + QQuickPath *path; QQuickItem *target; QQuickPathAnimation::Orientation orientation; QPointF anchorPoint; qreal entryDuration; qreal exitDuration; - QDeclarativeNullableValue<qreal> endRotation; + QQmlNullableValue<qreal> endRotation; int duration; QEasingCurve easingCurve; QHash<QQuickItem*, QQuickPathAnimationAnimator* > activeAnimations; diff --git a/src/quick/items/qquickitemchangelistener_p.h b/src/quick/items/qquickitemchangelistener_p.h index d59b5b8856..3a5c25f5f5 100644 --- a/src/quick/items/qquickitemchangelistener_p.h +++ b/src/quick/items/qquickitemchangelistener_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index a4cfa26205..64b84d35dd 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -61,8 +61,8 @@ #include "qquickvisualdatamodel_p.h" #include "qquickgridview_p.h" #include "qquickpathview_p.h" -#include <private/qdeclarativepath_p.h> -#include <private/qdeclarativepathinterpolator_p.h> +#include <private/qquickpath_p.h> +#include <private/qquickpathinterpolator_p.h> #include "qquickpositioners_p.h" #include "qquickrepeater_p.h" #include "qquickloader_p.h" @@ -70,7 +70,7 @@ #include "qquickflipable_p.h" #include "qquicktranslate_p.h" #include "qquickstateoperations_p.h" -#include "qquickanimation_p.h" +#include "qquickitemanimation_p.h" #include <private/qquickshadereffect_p.h> #include <QtQuick/private/qquickshadereffectsource_p.h> //#include <private/qquickpincharea_p.h> @@ -81,21 +81,21 @@ #include "qquickdrag_p.h" #include "qquickdroparea_p.h" #include "qquickmultipointtoucharea_p.h" -#include <private/qdeclarativemetatype_p.h> +#include <private/qqmlmetatype_p.h> #include <QtQuick/private/qquickaccessibleattached_p.h> -static QDeclarativePrivate::AutoParentResult qquickitem_autoParent(QObject *obj, QObject *parent) +static QQmlPrivate::AutoParentResult qquickitem_autoParent(QObject *obj, QObject *parent) { QQuickItem *item = qobject_cast<QQuickItem *>(obj); if (!item) - return QDeclarativePrivate::IncompatibleObject; + return QQmlPrivate::IncompatibleObject; QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent); if (!parentItem) - return QDeclarativePrivate::IncompatibleParent; + return QQmlPrivate::IncompatibleParent; item->setParentItem(parentItem); - return QDeclarativePrivate::Parented; + return QQmlPrivate::Parented; } static bool compareQQuickAnchorLines(const void *p1, const void *p2) @@ -107,8 +107,8 @@ static bool compareQQuickAnchorLines(const void *p1, const void *p2) static void qt_quickitems_defineModule(const char *uri, int major, int minor) { - QDeclarativePrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; - QDeclarativePrivate::qmlregister(QDeclarativePrivate::AutoParentRegistration, &autoparent); + QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; + QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent); QQuickItemPrivate::registerAccessorProperties(); #ifdef QT_NO_MOVIE @@ -121,7 +121,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickFlickable>(uri,major,minor,"Flickable"); qmlRegisterType<QQuickFlipable>(uri,major,minor,"Flipable"); qmlRegisterType<QQuickFlow>(uri,major,minor,"Flow"); -// qmlRegisterType<QDeclarativeFocusPanel>(uri,major,minor,"FocusPanel"); +// qmlRegisterType<QQuickFocusPanel>(uri,major,minor,"FocusPanel"); qmlRegisterType<QQuickFocusScope>(uri,major,minor,"FocusScope"); qmlRegisterType<QQuickGradient>(uri,major,minor,"Gradient"); qmlRegisterType<QQuickGradientStop>(uri,major,minor,"GradientStop"); @@ -132,15 +132,15 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickListView>(uri,major,minor,"ListView"); qmlRegisterType<QQuickLoader>(uri,major,minor,"Loader"); qmlRegisterType<QQuickMouseArea>(uri,major,minor,"MouseArea"); - qmlRegisterType<QDeclarativePath>(uri,major,minor,"Path"); - qmlRegisterType<QDeclarativePathAttribute>(uri,major,minor,"PathAttribute"); - qmlRegisterType<QDeclarativePathCubic>(uri,major,minor,"PathCubic"); - qmlRegisterType<QDeclarativePathLine>(uri,major,minor,"PathLine"); - qmlRegisterType<QDeclarativePathPercent>(uri,major,minor,"PathPercent"); - qmlRegisterType<QDeclarativePathQuad>(uri,major,minor,"PathQuad"); - qmlRegisterType<QDeclarativePathCatmullRomCurve>("QtQuick",2,0,"PathCurve"); - qmlRegisterType<QDeclarativePathArc>("QtQuick",2,0,"PathArc"); - qmlRegisterType<QDeclarativePathSvg>("QtQuick",2,0,"PathSvg"); + qmlRegisterType<QQuickPath>(uri,major,minor,"Path"); + qmlRegisterType<QQuickPathAttribute>(uri,major,minor,"PathAttribute"); + qmlRegisterType<QQuickPathCubic>(uri,major,minor,"PathCubic"); + qmlRegisterType<QQuickPathLine>(uri,major,minor,"PathLine"); + qmlRegisterType<QQuickPathPercent>(uri,major,minor,"PathPercent"); + qmlRegisterType<QQuickPathQuad>(uri,major,minor,"PathQuad"); + qmlRegisterType<QQuickPathCatmullRomCurve>("QtQuick",2,0,"PathCurve"); + qmlRegisterType<QQuickPathArc>("QtQuick",2,0,"PathArc"); + qmlRegisterType<QQuickPathSvg>("QtQuick",2,0,"PathSvg"); qmlRegisterType<QQuickPathView>(uri,major,minor,"PathView"); qmlRegisterUncreatableType<QQuickBasePositioner>(uri,major,minor,"Positioner", QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); @@ -168,8 +168,8 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickKeyEvent>(); qmlRegisterType<QQuickMouseEvent>(); qmlRegisterType<QQuickTransform>(); - qmlRegisterType<QDeclarativePathElement>(); - qmlRegisterType<QDeclarativeCurve>(); + qmlRegisterType<QQuickPathElement>(); + qmlRegisterType<QQuickCurve>(); qmlRegisterType<QQuickScaleGrid>(); qmlRegisterType<QQuickTextLine>(); #ifndef QT_NO_VALIDATOR @@ -179,7 +179,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickPen>(); qmlRegisterType<QQuickFlickableVisibleArea>(); qRegisterMetaType<QQuickAnchorLine>("QQuickAnchorLine"); - QDeclarativeMetaType::setQQuickAnchorLineCompareFunction(compareQQuickAnchorLines); + QQmlMetaType::setQQuickAnchorLineCompareFunction(compareQQuickAnchorLines); qmlRegisterUncreatableType<QQuickKeyNavigationAttached>(uri,major,minor,"KeyNavigation",QQuickKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); qmlRegisterUncreatableType<QQuickKeysAttached>(uri,major,minor,"Keys",QQuickKeysAttached::tr("Keys is only available via attached properties")); @@ -208,7 +208,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickAnchorAnimation>(uri, major, minor,"AnchorAnimation"); qmlRegisterType<QQuickParentAnimation>(uri, major, minor,"ParentAnimation"); qmlRegisterType<QQuickPathAnimation>("QtQuick",2,0,"PathAnimation"); - qmlRegisterType<QDeclarativePathInterpolator>("QtQuick",2,0,"PathInterpolator"); + qmlRegisterType<QQuickPathInterpolator>("QtQuick",2,0,"PathInterpolator"); qmlRegisterType<QQuickDropArea>("QtQuick", 2, 0, "DropArea"); qmlRegisterType<QQuickDropEvent>(); diff --git a/src/quick/items/qquickitemsmodule_p.h b/src/quick/items/qquickitemsmodule_p.h index cc51771a0b..1d6844ca5e 100644 --- a/src/quick/items/qquickitemsmodule_p.h +++ b/src/quick/items/qquickitemsmodule_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,7 +42,7 @@ #ifndef QQUICKITEMSMODULE_P_H #define QQUICKITEMSMODULE_P_H -#include <qdeclarative.h> +#include <qqml.h> QT_BEGIN_HEADER diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 533e1f6852..418b3196ed 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qquickitemview_p_p.h" -#include <QtQuick/private/qdeclarativetransition_p.h> +#include <QtQuick/private/qquicktransition_p.h> QT_BEGIN_NAMESPACE @@ -253,7 +253,7 @@ void FxViewItemTransitionManager::startTransition(FxViewItem *item, FxViewItemTr QQuickItemViewPrivate *vp = static_cast<QQuickItemViewPrivate*>(QObjectPrivate::get(item->itemView())); - QDeclarativeTransition *trans = 0; + QQuickTransition *trans = 0; switch (type) { case NoTransition: break; @@ -312,16 +312,16 @@ void FxViewItemTransitionManager::startTransition(FxViewItem *item, FxViewItemTr emit attached->targetItemsChanged(); } - QDeclarativeStateOperation::ActionList actions; - actions << QDeclarativeAction(item->item, QLatin1String("x"), QVariant(to.x())); - actions << QDeclarativeAction(item->item, QLatin1String("y"), QVariant(to.y())); + QQuickStateOperation::ActionList actions; + actions << QQuickAction(item->item, QLatin1String("x"), QVariant(to.x())); + actions << QQuickAction(item->item, QLatin1String("y"), QVariant(to.y())); - QDeclarativeTransitionManager::transition(actions, trans, item->item); + QQuickTransitionManager::transition(actions, trans, item->item); } void FxViewItemTransitionManager::finished() { - QDeclarativeTransitionManager::finished(); + QQuickTransitionManager::finished(); m_active = false; @@ -346,14 +346,14 @@ bool QQuickItemViewChangeSet::hasPendingChanges() const return !pendingChanges.isEmpty(); } -void QQuickItemViewChangeSet::applyChanges(const QDeclarativeChangeSet &changeSet) +void QQuickItemViewChangeSet::applyChanges(const QQuickChangeSet &changeSet) { pendingChanges.apply(changeSet); int moveId = -1; int moveOffset = 0; - foreach (const QDeclarativeChangeSet::Remove &r, changeSet.removes()) { + foreach (const QQuickChangeSet::Remove &r, changeSet.removes()) { itemCount -= r.count; if (moveId == -1 && newCurrentIndex >= r.index + r.count) { newCurrentIndex -= r.count; @@ -372,7 +372,7 @@ void QQuickItemViewChangeSet::applyChanges(const QDeclarativeChangeSet &changeSe currentChanged = true; } } - foreach (const QDeclarativeChangeSet::Insert &i, changeSet.inserts()) { + foreach (const QQuickChangeSet::Insert &i, changeSet.inserts()) { if (moveId == -1) { if (itemCount && newCurrentIndex >= i.index) { newCurrentIndex += i.count; @@ -758,9 +758,9 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent) \sa QtQuick2::ViewTransition::targetIndexes */ -QDeclarativeListProperty<QObject> QQuickViewTransitionAttached::targetItems() +QQmlListProperty<QObject> QQuickViewTransitionAttached::targetItems() { - return QDeclarativeListProperty<QObject>(this, m_targetItems); + return QQmlListProperty<QObject>(this, m_targetItems); } QQuickViewTransitionAttached *QQuickViewTransitionAttached::qmlAttachedProperties(QObject *obj) @@ -810,8 +810,8 @@ void QQuickItemView::setModel(const QVariant &model) if (d->modelVariant == model) return; if (d->model) { - disconnect(d->model, SIGNAL(modelUpdated(QDeclarativeChangeSet,bool)), - this, SLOT(modelUpdated(QDeclarativeChangeSet,bool))); + disconnect(d->model, SIGNAL(modelUpdated(QQuickChangeSet,bool)), + this, SLOT(modelUpdated(QQuickChangeSet,bool))); disconnect(d->model, SIGNAL(initItem(int,QQuickItem*)), this, SLOT(initItem(int,QQuickItem*))); disconnect(d->model, SIGNAL(createdItem(int,QQuickItem*)), this, SLOT(createdItem(int,QQuickItem*))); disconnect(d->model, SIGNAL(destroyingItem(QQuickItem*)), this, SLOT(destroyingItem(QQuickItem*))); @@ -873,14 +873,14 @@ void QQuickItemView::setModel(const QVariant &model) polish(); } } - connect(d->model, SIGNAL(modelUpdated(QDeclarativeChangeSet,bool)), - this, SLOT(modelUpdated(QDeclarativeChangeSet,bool))); + connect(d->model, SIGNAL(modelUpdated(QQuickChangeSet,bool)), + this, SLOT(modelUpdated(QQuickChangeSet,bool))); emit countChanged(); } emit modelChanged(); } -QDeclarativeComponent *QQuickItemView::delegate() const +QQmlComponent *QQuickItemView::delegate() const { Q_D(const QQuickItemView); if (d->model) { @@ -891,7 +891,7 @@ QDeclarativeComponent *QQuickItemView::delegate() const return 0; } -void QQuickItemView::setDelegate(QDeclarativeComponent *delegate) +void QQuickItemView::setDelegate(QQmlComponent *delegate) { Q_D(QQuickItemView); if (delegate == this->delegate()) @@ -1026,7 +1026,7 @@ Qt::LayoutDirection QQuickItemView::effectiveLayoutDirection() const } -QDeclarativeComponent *QQuickItemView::header() const +QQmlComponent *QQuickItemView::header() const { Q_D(const QQuickItemView); return d->headerComponent; @@ -1039,7 +1039,7 @@ QQuickItem *QQuickItemView::headerItem() const return d->header ? d->header->item : 0; } -void QQuickItemView::setHeader(QDeclarativeComponent *headerComponent) +void QQuickItemView::setHeader(QQmlComponent *headerComponent) { Q_D(QQuickItemView); if (d->headerComponent != headerComponent) { @@ -1062,7 +1062,7 @@ void QQuickItemView::setHeader(QDeclarativeComponent *headerComponent) } } -QDeclarativeComponent *QQuickItemView::footer() const +QQmlComponent *QQuickItemView::footer() const { Q_D(const QQuickItemView); return d->footerComponent; @@ -1075,7 +1075,7 @@ QQuickItem *QQuickItemView::footerItem() const return d->footer ? d->footer->item : 0; } -void QQuickItemView::setFooter(QDeclarativeComponent *footerComponent) +void QQuickItemView::setFooter(QQmlComponent *footerComponent) { Q_D(QQuickItemView); if (d->footerComponent != footerComponent) { @@ -1095,14 +1095,14 @@ void QQuickItemView::setFooter(QDeclarativeComponent *footerComponent) } } -QDeclarativeComponent *QQuickItemView::highlight() const +QQmlComponent *QQuickItemView::highlight() const { Q_D(const QQuickItemView); const_cast<QQuickItemViewPrivate*>(d)->applyPendingChanges(); return d->highlightComponent; } -void QQuickItemView::setHighlight(QDeclarativeComponent *highlightComponent) +void QQuickItemView::setHighlight(QQmlComponent *highlightComponent) { Q_D(QQuickItemView); if (highlightComponent != d->highlightComponent) { @@ -1225,13 +1225,13 @@ void QQuickItemView::setHighlightMoveDuration(int duration) } } -QDeclarativeTransition *QQuickItemView::populateTransition() const +QQuickTransition *QQuickItemView::populateTransition() const { Q_D(const QQuickItemView); return d->populateTransition; } -void QQuickItemView::setPopulateTransition(QDeclarativeTransition *transition) +void QQuickItemView::setPopulateTransition(QQuickTransition *transition) { Q_D(QQuickItemView); if (d->populateTransition != transition) { @@ -1240,13 +1240,13 @@ void QQuickItemView::setPopulateTransition(QDeclarativeTransition *transition) } } -QDeclarativeTransition *QQuickItemView::addTransition() const +QQuickTransition *QQuickItemView::addTransition() const { Q_D(const QQuickItemView); return d->addTransition; } -void QQuickItemView::setAddTransition(QDeclarativeTransition *transition) +void QQuickItemView::setAddTransition(QQuickTransition *transition) { Q_D(QQuickItemView); if (d->addTransition != transition) { @@ -1255,13 +1255,13 @@ void QQuickItemView::setAddTransition(QDeclarativeTransition *transition) } } -QDeclarativeTransition *QQuickItemView::addDisplacedTransition() const +QQuickTransition *QQuickItemView::addDisplacedTransition() const { Q_D(const QQuickItemView); return d->addDisplacedTransition; } -void QQuickItemView::setAddDisplacedTransition(QDeclarativeTransition *transition) +void QQuickItemView::setAddDisplacedTransition(QQuickTransition *transition) { Q_D(QQuickItemView); if (d->addDisplacedTransition != transition) { @@ -1270,13 +1270,13 @@ void QQuickItemView::setAddDisplacedTransition(QDeclarativeTransition *transitio } } -QDeclarativeTransition *QQuickItemView::moveTransition() const +QQuickTransition *QQuickItemView::moveTransition() const { Q_D(const QQuickItemView); return d->moveTransition; } -void QQuickItemView::setMoveTransition(QDeclarativeTransition *transition) +void QQuickItemView::setMoveTransition(QQuickTransition *transition) { Q_D(QQuickItemView); if (d->moveTransition != transition) { @@ -1285,13 +1285,13 @@ void QQuickItemView::setMoveTransition(QDeclarativeTransition *transition) } } -QDeclarativeTransition *QQuickItemView::moveDisplacedTransition() const +QQuickTransition *QQuickItemView::moveDisplacedTransition() const { Q_D(const QQuickItemView); return d->moveDisplacedTransition; } -void QQuickItemView::setMoveDisplacedTransition(QDeclarativeTransition *transition) +void QQuickItemView::setMoveDisplacedTransition(QQuickTransition *transition) { Q_D(QQuickItemView); if (d->moveDisplacedTransition != transition) { @@ -1300,13 +1300,13 @@ void QQuickItemView::setMoveDisplacedTransition(QDeclarativeTransition *transiti } } -QDeclarativeTransition *QQuickItemView::removeTransition() const +QQuickTransition *QQuickItemView::removeTransition() const { Q_D(const QQuickItemView); return d->removeTransition; } -void QQuickItemView::setRemoveTransition(QDeclarativeTransition *transition) +void QQuickItemView::setRemoveTransition(QQuickTransition *transition) { Q_D(QQuickItemView); if (d->removeTransition != transition) { @@ -1315,13 +1315,13 @@ void QQuickItemView::setRemoveTransition(QDeclarativeTransition *transition) } } -QDeclarativeTransition *QQuickItemView::removeDisplacedTransition() const +QQuickTransition *QQuickItemView::removeDisplacedTransition() const { Q_D(const QQuickItemView); return d->removeDisplacedTransition; } -void QQuickItemView::setRemoveDisplacedTransition(QDeclarativeTransition *transition) +void QQuickItemView::setRemoveDisplacedTransition(QQuickTransition *transition) { Q_D(QQuickItemView); if (d->removeDisplacedTransition != transition) { @@ -1522,7 +1522,7 @@ void QQuickItemViewPrivate::transitionNextReposition(FxViewItem *item, FxViewIte } } -int QQuickItemViewPrivate::findMoveKeyIndex(QDeclarativeChangeSet::MoveKey key, const QVector<QDeclarativeChangeSet::Remove> &changes) const +int QQuickItemViewPrivate::findMoveKeyIndex(QQuickChangeSet::MoveKey key, const QVector<QQuickChangeSet::Remove> &changes) const { for (int i=0; i<changes.count(); i++) { for (int j=changes[i].index; j<changes[i].index + changes[i].count; j++) { @@ -1621,7 +1621,7 @@ void QQuickItemView::destroyRemoved() polish(); } -void QQuickItemView::modelUpdated(const QDeclarativeChangeSet &changeSet, bool reset) +void QQuickItemView::modelUpdated(const QQuickChangeSet &changeSet, bool reset) { Q_D(QQuickItemView); if (reset) { @@ -2354,7 +2354,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult || !currentChanges.pendingChanges.inserts().isEmpty(); FxViewItem *prevFirstVisible = firstVisibleItem(); - QDeclarativeNullableValue<qreal> prevViewPos; + QQmlNullableValue<qreal> prevViewPos; int prevFirstVisibleIndex = -1; if (prevFirstVisible) { prevViewPos = prevFirstVisible->position(); @@ -2365,8 +2365,8 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult totalInsertionResult->visiblePos = prevViewPos; totalRemovalResult->visiblePos = prevViewPos; - const QVector<QDeclarativeChangeSet::Remove> &removals = currentChanges.pendingChanges.removes(); - const QVector<QDeclarativeChangeSet::Insert> &insertions = currentChanges.pendingChanges.inserts(); + const QVector<QQuickChangeSet::Remove> &removals = currentChanges.pendingChanges.removes(); + const QVector<QQuickChangeSet::Insert> &insertions = currentChanges.pendingChanges.inserts(); ChangeResult insertionResult(prevViewPos); ChangeResult removalResult(prevViewPos); @@ -2385,7 +2385,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult } } if (runDelayedRemoveTransition) { - QDeclarativeChangeSet::Remove removal; + QQuickChangeSet::Remove removal; for (QList<FxViewItem*>::Iterator it = visibleItems.begin(); it != visibleItems.end();) { FxViewItem *item = *it; if (item->index == -1 && !item->attached->delayRemove()) { @@ -2453,7 +2453,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult // Whatever removed/moved items remain are no longer visible items. prepareRemoveTransitions(¤tChanges.removedItems); - for (QHash<QDeclarativeChangeSet::MoveKey, FxViewItem *>::Iterator it = currentChanges.removedItems.begin(); + for (QHash<QQuickChangeSet::MoveKey, FxViewItem *>::Iterator it = currentChanges.removedItems.begin(); it != currentChanges.removedItems.end(); ++it) { releaseItem(it.value()); } @@ -2483,7 +2483,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult return visibleAffected; } -bool QQuickItemViewPrivate::applyRemovalChange(const QDeclarativeChangeSet::Remove &removal, ChangeResult *removeResult, int *removedCount) +bool QQuickItemViewPrivate::applyRemovalChange(const QQuickChangeSet::Remove &removal, ChangeResult *removeResult, int *removedCount) { Q_Q(QQuickItemView); bool visibleAffected = false; @@ -2533,7 +2533,7 @@ bool QQuickItemViewPrivate::applyRemovalChange(const QDeclarativeChangeSet::Remo return visibleAffected; } -void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QDeclarativeChangeSet::Remove &removal, ChangeResult *removeResult) +void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQuickChangeSet::Remove &removal, ChangeResult *removeResult) { if (removeResult->visiblePos.isValid()) { if (item->position() < removeResult->visiblePos) @@ -2546,7 +2546,7 @@ void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QDeclarativeChang transitionNextReposition(item, FxViewItemTransitionManager::MoveTransition, true); } else { // track item so it is released later - currentChanges.removedItems.insertMulti(QDeclarativeChangeSet::MoveKey(), item); + currentChanges.removedItems.insertMulti(QQuickChangeSet::MoveKey(), item); } if (!removeResult->changedFirstItem && item == *visibleItems.constBegin()) removeResult->changedFirstItem = true; @@ -2558,7 +2558,7 @@ void QQuickItemViewPrivate::repositionFirstItem(FxViewItem *prevVisibleItemsFirs ChangeResult *insertionResult, ChangeResult *removalResult) { - const QDeclarativeNullableValue<qreal> prevViewPos = insertionResult->visiblePos; + const QQmlNullableValue<qreal> prevViewPos = insertionResult->visiblePos; // reposition visibleItems.first() correctly so that the content y doesn't jump if (visibleItems.count()) { @@ -2629,13 +2629,13 @@ void QQuickItemViewPrivate::prepareVisibleItemTransitions() } } -void QQuickItemViewPrivate::prepareRemoveTransitions(QHash<QDeclarativeChangeSet::MoveKey, FxViewItem *> *removedItems) +void QQuickItemViewPrivate::prepareRemoveTransitions(QHash<QQuickChangeSet::MoveKey, FxViewItem *> *removedItems) { removeTransitionIndexes.clear(); removeTransitionTargets.clear(); if (canTransition(FxViewItemTransitionManager::RemoveTransition, true)) { - for (QHash<QDeclarativeChangeSet::MoveKey, FxViewItem *>::Iterator it = removedItems->begin(); + for (QHash<QQuickChangeSet::MoveKey, FxViewItem *>::Iterator it = removedItems->begin(); it != removedItems->end(); ) { bool isRemove = it.key().moveId < 0; if (isRemove) { @@ -2710,7 +2710,7 @@ FxViewItem *QQuickItemViewPrivate::createItem(int modelIndex, bool asynchronous) if (QQuickItem *item = model->item(modelIndex, asynchronous)) { item->setParentItem(q->contentItem()); - QDeclarative_setParent_noEvent(item, q->contentItem()); + QQml_setParent_noEvent(item, q->contentItem()); requestedIndex = -1; FxViewItem *viewItem = requestedItem; if (!viewItem) @@ -2757,7 +2757,7 @@ void QQuickItemView::initItem(int index, QQuickItem *item) if (d->requestedAsync) item->setVisible(false); item->setParentItem(contentItem()); - QDeclarative_setParent_noEvent(item, contentItem()); + QQml_setParent_noEvent(item, contentItem()); d->requestedItem = d->newViewItem(index, item); } } @@ -2790,18 +2790,18 @@ QQuickItem *QQuickItemViewPrivate::createHighlightItem() return createComponentItem(highlightComponent, true, true); } -QQuickItem *QQuickItemViewPrivate::createComponentItem(QDeclarativeComponent *component, bool receiveItemGeometryChanges, bool createDefault) +QQuickItem *QQuickItemViewPrivate::createComponentItem(QQmlComponent *component, bool receiveItemGeometryChanges, bool createDefault) { Q_Q(QQuickItemView); QQuickItem *item = 0; if (component) { - QDeclarativeContext *creationContext = component->creationContext(); - QDeclarativeContext *context = new QDeclarativeContext( + QQmlContext *creationContext = component->creationContext(); + QQmlContext *context = new QQmlContext( creationContext ? creationContext : qmlContext(q)); QObject *nobj = component->create(context); if (nobj) { - QDeclarative_setParent_noEvent(context, nobj); + QQml_setParent_noEvent(context, nobj); item = qobject_cast<QQuickItem *>(nobj); if (!item) delete nobj; @@ -2812,7 +2812,7 @@ QQuickItem *QQuickItemViewPrivate::createComponentItem(QDeclarativeComponent *co item = new QQuickItem; } if (item) { - QDeclarative_setParent_noEvent(item, q->contentItem()); + QQml_setParent_noEvent(item, q->contentItem()); item->setParentItem(q->contentItem()); if (receiveItemGeometryChanges) { QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); diff --git a/src/quick/items/qquickitemview_p.h b/src/quick/items/qquickitemview_p.h index 0d3cd1c3ce..01a6ee28ec 100644 --- a/src/quick/items/qquickitemview_p.h +++ b/src/quick/items/qquickitemview_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,9 +48,9 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) +QT_MODULE(Qml) -class QDeclarativeChangeSet; +class QQuickChangeSet; class QQuickItemViewPrivate; @@ -59,7 +59,7 @@ class Q_AUTOTEST_EXPORT QQuickItemView : public QQuickFlickable Q_OBJECT Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) - Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) @@ -71,20 +71,20 @@ class Q_AUTOTEST_EXPORT QQuickItemView : public QQuickFlickable Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged) Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged) - Q_PROPERTY(QDeclarativeComponent *header READ header WRITE setHeader NOTIFY headerChanged) + Q_PROPERTY(QQmlComponent *header READ header WRITE setHeader NOTIFY headerChanged) Q_PROPERTY(QQuickItem *headerItem READ headerItem NOTIFY headerItemChanged) - Q_PROPERTY(QDeclarativeComponent *footer READ footer WRITE setFooter NOTIFY footerChanged) + Q_PROPERTY(QQmlComponent *footer READ footer WRITE setFooter NOTIFY footerChanged) Q_PROPERTY(QQuickItem *footerItem READ footerItem NOTIFY footerItemChanged) - Q_PROPERTY(QDeclarativeTransition *populate READ populateTransition WRITE setPopulateTransition NOTIFY populateTransitionChanged) - Q_PROPERTY(QDeclarativeTransition *add READ addTransition WRITE setAddTransition NOTIFY addTransitionChanged) - Q_PROPERTY(QDeclarativeTransition *addDisplaced READ addDisplacedTransition WRITE setAddDisplacedTransition NOTIFY addDisplacedTransitionChanged) - Q_PROPERTY(QDeclarativeTransition *move READ moveTransition WRITE setMoveTransition NOTIFY moveTransitionChanged) - Q_PROPERTY(QDeclarativeTransition *moveDisplaced READ moveDisplacedTransition WRITE setMoveDisplacedTransition NOTIFY moveDisplacedTransitionChanged) - Q_PROPERTY(QDeclarativeTransition *remove READ removeTransition WRITE setRemoveTransition NOTIFY removeTransitionChanged) - Q_PROPERTY(QDeclarativeTransition *removeDisplaced READ removeDisplacedTransition WRITE setRemoveDisplacedTransition NOTIFY removeDisplacedTransitionChanged) + Q_PROPERTY(QQuickTransition *populate READ populateTransition WRITE setPopulateTransition NOTIFY populateTransitionChanged) + Q_PROPERTY(QQuickTransition *add READ addTransition WRITE setAddTransition NOTIFY addTransitionChanged) + Q_PROPERTY(QQuickTransition *addDisplaced READ addDisplacedTransition WRITE setAddDisplacedTransition NOTIFY addDisplacedTransitionChanged) + Q_PROPERTY(QQuickTransition *move READ moveTransition WRITE setMoveTransition NOTIFY moveTransitionChanged) + Q_PROPERTY(QQuickTransition *moveDisplaced READ moveDisplacedTransition WRITE setMoveDisplacedTransition NOTIFY moveDisplacedTransitionChanged) + Q_PROPERTY(QQuickTransition *remove READ removeTransition WRITE setRemoveTransition NOTIFY removeTransitionChanged) + Q_PROPERTY(QQuickTransition *removeDisplaced READ removeDisplacedTransition WRITE setRemoveDisplacedTransition NOTIFY removeDisplacedTransitionChanged) - Q_PROPERTY(QDeclarativeComponent *highlight READ highlight WRITE setHighlight NOTIFY highlightChanged) + Q_PROPERTY(QQmlComponent *highlight READ highlight WRITE setHighlight NOTIFY highlightChanged) Q_PROPERTY(QQuickItem *highlightItem READ highlightItem NOTIFY highlightItemChanged) Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem NOTIFY highlightFollowsCurrentItemChanged) Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged) @@ -102,8 +102,8 @@ public: QVariant model() const; void setModel(const QVariant &); - QDeclarativeComponent *delegate() const; - void setDelegate(QDeclarativeComponent *); + QQmlComponent *delegate() const; + void setDelegate(QQmlComponent *); int count() const; @@ -122,37 +122,37 @@ public: void setLayoutDirection(Qt::LayoutDirection); Qt::LayoutDirection effectiveLayoutDirection() const; - QDeclarativeComponent *footer() const; - void setFooter(QDeclarativeComponent *); + QQmlComponent *footer() const; + void setFooter(QQmlComponent *); QQuickItem *footerItem() const; - QDeclarativeComponent *header() const; - void setHeader(QDeclarativeComponent *); + QQmlComponent *header() const; + void setHeader(QQmlComponent *); QQuickItem *headerItem() const; - QDeclarativeTransition *populateTransition() const; - void setPopulateTransition(QDeclarativeTransition *transition); + QQuickTransition *populateTransition() const; + void setPopulateTransition(QQuickTransition *transition); - QDeclarativeTransition *addTransition() const; - void setAddTransition(QDeclarativeTransition *transition); + QQuickTransition *addTransition() const; + void setAddTransition(QQuickTransition *transition); - QDeclarativeTransition *addDisplacedTransition() const; - void setAddDisplacedTransition(QDeclarativeTransition *transition); + QQuickTransition *addDisplacedTransition() const; + void setAddDisplacedTransition(QQuickTransition *transition); - QDeclarativeTransition *moveTransition() const; - void setMoveTransition(QDeclarativeTransition *transition); + QQuickTransition *moveTransition() const; + void setMoveTransition(QQuickTransition *transition); - QDeclarativeTransition *moveDisplacedTransition() const; - void setMoveDisplacedTransition(QDeclarativeTransition *transition); + QQuickTransition *moveDisplacedTransition() const; + void setMoveDisplacedTransition(QQuickTransition *transition); - QDeclarativeTransition *removeTransition() const; - void setRemoveTransition(QDeclarativeTransition *transition); + QQuickTransition *removeTransition() const; + void setRemoveTransition(QQuickTransition *transition); - QDeclarativeTransition *removeDisplacedTransition() const; - void setRemoveDisplacedTransition(QDeclarativeTransition *transition); + QQuickTransition *removeDisplacedTransition() const; + void setRemoveDisplacedTransition(QQuickTransition *transition); - QDeclarativeComponent *highlight() const; - void setHighlight(QDeclarativeComponent *); + QQmlComponent *highlight() const; + void setHighlight(QQmlComponent *); QQuickItem *highlightItem() const; @@ -234,7 +234,7 @@ protected slots: void destroyRemoved(); void createdItem(int index, QQuickItem *item); void initItem(int index, QQuickItem *item); - void modelUpdated(const QDeclarativeChangeSet &changeSet, bool reset); + void modelUpdated(const QQuickChangeSet &changeSet, bool reset); void destroyingItem(QQuickItem *item); void animStopped(); void trackedPositionChanged(); @@ -333,7 +333,7 @@ class QQuickViewTransitionAttached : public QObject Q_PROPERTY(QPointF destination READ destination NOTIFY destinationChanged) Q_PROPERTY(QList<int> targetIndexes READ targetIndexes NOTIFY targetIndexesChanged) - Q_PROPERTY(QDeclarativeListProperty<QObject> targetItems READ targetItems NOTIFY targetItemsChanged) + Q_PROPERTY(QQmlListProperty<QObject> targetItems READ targetItems NOTIFY targetItemsChanged) public: QQuickViewTransitionAttached(QObject *parent); @@ -343,7 +343,7 @@ public: QPointF destination() const { return m_destination; } QList<int> targetIndexes() const { return m_targetIndexes; } - QDeclarativeListProperty<QObject> targetItems(); + QQmlListProperty<QObject> targetItems(); static QQuickViewTransitionAttached *qmlAttachedProperties(QObject *); diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index 05927c0d68..a4892e8972 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -46,8 +46,8 @@ #include "qquickflickable_p_p.h" #include "qquickvisualdatamodel_p.h" #include "qquickvisualitemmodel_p.h" -#include <private/qdeclarativetransitionmanager_p_p.h> -#include <private/qdeclarativechangeset_p.h> +#include <private/qquicktransitionmanager_p_p.h> +#include <private/qquickchangeset_p.h> QT_BEGIN_HEADER @@ -58,7 +58,7 @@ QT_MODULE(Declarative) class FxViewItem; -class FxViewItemTransitionManager : public QDeclarativeTransitionManager +class FxViewItemTransitionManager : public QQuickTransitionManager { public: enum TransitionType { @@ -142,12 +142,12 @@ public: void prepare(int currentIndex, int count); void reset(); - void applyChanges(const QDeclarativeChangeSet &changeSet); + void applyChanges(const QQuickChangeSet &changeSet); int itemCount; int newCurrentIndex; - QDeclarativeChangeSet pendingChanges; - QHash<QDeclarativeChangeSet::MoveKey, FxViewItem *> removedItems; + QQuickChangeSet pendingChanges; + QHash<QQuickChangeSet::MoveKey, FxViewItem *> removedItems; bool active : 1; bool currentChanged : 1; @@ -162,7 +162,7 @@ public: QQuickItemViewPrivate(); struct ChangeResult { - QDeclarativeNullableValue<qreal> visiblePos; + QQmlNullableValue<qreal> visiblePos; bool changedFirstItem; qreal sizeChangesBeforeVisiblePos; qreal sizeChangesAfterVisiblePos; @@ -174,7 +174,7 @@ public: sizeChangesBeforeVisiblePos(0), sizeChangesAfterVisiblePos(0), countChangeBeforeVisible(0), countChangeAfterVisibleItems(0) {} - ChangeResult(const QDeclarativeNullableValue<qreal> &p) + ChangeResult(const QQmlNullableValue<qreal> &p) : visiblePos(p), changedFirstItem(false), sizeChangesBeforeVisiblePos(0), sizeChangesAfterVisiblePos(0), countChangeBeforeVisible(0), countChangeAfterVisibleItems(0) {} @@ -228,7 +228,7 @@ public: virtual void releaseItem(FxViewItem *item); QQuickItem *createHighlightItem(); - QQuickItem *createComponentItem(QDeclarativeComponent *component, bool receiveItemGeometryChanges, bool createDefault = false); + QQuickItem *createComponentItem(QQmlComponent *component, bool receiveItemGeometryChanges, bool createDefault = false); void updateCurrent(int modelIndex); void updateTrackedItem(); @@ -238,19 +238,19 @@ public: void positionViewAtIndex(int index, int mode); void applyPendingChanges(); bool applyModelChanges(ChangeResult *insertionResult, ChangeResult *removalResult); - bool applyRemovalChange(const QDeclarativeChangeSet::Remove &removal, ChangeResult *changeResult, int *removedCount); - void removeItem(FxViewItem *item, const QDeclarativeChangeSet::Remove &removal, ChangeResult *removeResult); + bool applyRemovalChange(const QQuickChangeSet::Remove &removal, ChangeResult *changeResult, int *removedCount); + void removeItem(FxViewItem *item, const QQuickChangeSet::Remove &removal, ChangeResult *removeResult); void repositionFirstItem(FxViewItem *prevVisibleItemsFirst, qreal prevVisibleItemsFirstPos, FxViewItem *prevFirstVisible, ChangeResult *insertionResult, ChangeResult *removalResult); void prepareVisibleItemTransitions(); - void prepareRemoveTransitions(QHash<QDeclarativeChangeSet::MoveKey, FxViewItem *> *removedItems); + void prepareRemoveTransitions(QHash<QQuickChangeSet::MoveKey, FxViewItem *> *removedItems); bool prepareNonVisibleItemTransition(FxViewItem *item, const QRectF &viewBounds); bool canTransition(FxViewItemTransitionManager::TransitionType type, bool asTarget) const; bool hasItemTransitions() const; void transitionNextReposition(FxViewItem *item, FxViewItemTransitionManager::TransitionType type, bool isTarget); - int findMoveKeyIndex(QDeclarativeChangeSet::MoveKey key, const QVector<QDeclarativeChangeSet::Remove> &changes) const; + int findMoveKeyIndex(QQuickChangeSet::MoveKey key, const QVector<QQuickChangeSet::Remove> &changes) const; void checkVisible() const; void showVisibleItems() const; @@ -262,7 +262,7 @@ public: hData.markExtentsDirty(); } - QDeclarativeGuard<QQuickVisualModel> model; + QQmlGuard<QQuickVisualModel> model; QVariant modelVariant; int itemCount; int buffer; @@ -282,25 +282,25 @@ public: QQuickItemViewChangeSet currentChanges; // XXX split into struct - QDeclarativeComponent *highlightComponent; + QQmlComponent *highlightComponent; FxViewItem *highlight; int highlightRange; // enum value qreal highlightRangeStart; qreal highlightRangeEnd; int highlightMoveDuration; - QDeclarativeComponent *headerComponent; + QQmlComponent *headerComponent; FxViewItem *header; - QDeclarativeComponent *footerComponent; + QQmlComponent *footerComponent; FxViewItem *footer; - QDeclarativeTransition *populateTransition; - QDeclarativeTransition *addTransition; - QDeclarativeTransition *addDisplacedTransition; - QDeclarativeTransition *moveTransition; - QDeclarativeTransition *moveDisplacedTransition; - QDeclarativeTransition *removeTransition; - QDeclarativeTransition *removeDisplacedTransition; + QQuickTransition *populateTransition; + QQuickTransition *addTransition; + QQuickTransition *addDisplacedTransition; + QQuickTransition *moveTransition; + QQuickTransition *moveDisplacedTransition; + QQuickTransition *removeTransition; + QQuickTransition *removeDisplacedTransition; QList<int> addTransitionIndexes; QList<int> moveTransitionIndexes; @@ -311,8 +311,8 @@ public: struct MovedItem { FxViewItem *item; - QDeclarativeChangeSet::MoveKey moveKey; - MovedItem(FxViewItem *i, QDeclarativeChangeSet::MoveKey k) + QQuickChangeSet::MoveKey moveKey; + MovedItem(FxViewItem *i, QQuickChangeSet::MoveKey k) : item(i), moveKey(k) {} }; QList<FxViewItem *> releasePendingTransition; @@ -372,7 +372,7 @@ protected: virtual void layoutVisibleItems(int fromModelIndex = 0) = 0; virtual void changedVisibleIndex(int newIndex) = 0; - virtual bool applyInsertionChange(const QDeclarativeChangeSet::Insert &insert, ChangeResult *changeResult, + virtual bool applyInsertionChange(const QQuickChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *newItems, QList<MovedItem> *movingIntoView) = 0; virtual bool needsRefillForAddedOrRemovedIndex(int) const { return false; } diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 906b9b3781..beb607dde5 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,14 +43,14 @@ #include "qquickitemview_p_p.h" #include "qquickvisualitemmodel_p.h" -#include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlexpression.h> +#include <QtQml/qqmlengine.h> +#include <QtQml/qqmlinfo.h> #include <QtGui/qevent.h> #include <QtCore/qmath.h> #include <QtCore/qcoreapplication.h> -#include <private/qdeclarativesmoothedanimation_p_p.h> +#include <private/qquicksmoothedanimation_p_p.h> #include <private/qlistmodelinterface_p.h> #include "qplatformdefs.h" @@ -106,7 +106,7 @@ public: virtual void setPosition(qreal pos); virtual void layoutVisibleItems(int fromModelIndex = 0); - virtual bool applyInsertionChange(const QDeclarativeChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView); + virtual bool applyInsertionChange(const QQuickChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView); virtual void translateAndTransitionItemsAfter(int afterIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult); virtual void updateSections(); @@ -132,7 +132,7 @@ public: virtual void fixupPosition(); virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent); virtual void flick(QQuickItemViewPrivate::AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, - QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity); + QQuickTimeLineCallback::Callback fixupCallback, qreal velocity); QQuickListView::Orientation orient; qreal visiblePos; @@ -205,7 +205,7 @@ void QQuickViewSection::setCriteria(QQuickViewSection::SectionCriteria criteria) } } -void QQuickViewSection::setDelegate(QDeclarativeComponent *delegate) +void QQuickViewSection::setDelegate(QQmlComponent *delegate) { if (delegate != m_delegate) { m_delegate = delegate; @@ -833,7 +833,7 @@ void QQuickListViewPrivate::createHighlight() } const QLatin1String posProp(orient == QQuickListView::Vertical ? "y" : "x"); highlightPosAnimator = new QSmoothedAnimation; - highlightPosAnimator->target = QDeclarativeProperty(item, posProp); + highlightPosAnimator->target = QQmlProperty(item, posProp); highlightPosAnimator->velocity = highlightMoveSpeed; highlightPosAnimator->userDuration = highlightMoveDuration; @@ -841,7 +841,7 @@ void QQuickListViewPrivate::createHighlight() highlightSizeAnimator = new QSmoothedAnimation; highlightSizeAnimator->velocity = highlightResizeSpeed; highlightSizeAnimator->userDuration = highlightResizeDuration; - highlightSizeAnimator->target = QDeclarativeProperty(item, sizeProp); + highlightSizeAnimator->target = QQmlProperty(item, sizeProp); highlight = newHighlight; changed = true; @@ -896,22 +896,22 @@ QQuickItem * QQuickListViewPrivate::getSectionItem(const QString §ion) sectionItem = sectionCache[i]; sectionCache[i] = 0; sectionItem->setVisible(true); - QDeclarativeContext *context = QDeclarativeEngine::contextForObject(sectionItem)->parentContext(); + QQmlContext *context = QQmlEngine::contextForObject(sectionItem)->parentContext(); context->setContextProperty(QLatin1String("section"), section); } else { - QDeclarativeContext *creationContext = sectionCriteria->delegate()->creationContext(); - QDeclarativeContext *context = new QDeclarativeContext( + QQmlContext *creationContext = sectionCriteria->delegate()->creationContext(); + QQmlContext *context = new QQmlContext( creationContext ? creationContext : qmlContext(q)); context->setContextProperty(QLatin1String("section"), section); QObject *nobj = sectionCriteria->delegate()->beginCreate(context); if (nobj) { - QDeclarative_setParent_noEvent(context, nobj); + QQml_setParent_noEvent(context, nobj); sectionItem = qobject_cast<QQuickItem *>(nobj); if (!sectionItem) { delete nobj; } else { sectionItem->setZ(2); - QDeclarative_setParent_noEvent(sectionItem, contentItem); + QQml_setParent_noEvent(sectionItem, contentItem); sectionItem->setParentItem(contentItem); } } else { @@ -949,7 +949,7 @@ void QQuickListViewPrivate::updateInlineSection(FxListItemSG *listItem) listItem->section = getSectionItem(listItem->attached->m_section); listItem->setPosition(pos); } else { - QDeclarativeContext *context = QDeclarativeEngine::contextForObject(listItem->section)->parentContext(); + QQmlContext *context = QQmlEngine::contextForObject(listItem->section)->parentContext(); context->setContextProperty(QLatin1String("section"), listItem->attached->m_section); } } else if (listItem->section) { @@ -1002,7 +1002,7 @@ void QQuickListViewPrivate::updateStickySections() if (!currentSectionItem) { currentSectionItem = getSectionItem(currentSection); } else if (currentStickySection != currentSection) { - QDeclarativeContext *context = QDeclarativeEngine::contextForObject(currentSectionItem)->parentContext(); + QQmlContext *context = QQmlEngine::contextForObject(currentSectionItem)->parentContext(); context->setContextProperty(QLatin1String("section"), currentSection); } currentStickySection = currentSection; @@ -1035,7 +1035,7 @@ void QQuickListViewPrivate::updateStickySections() if (!nextSectionItem) { nextSectionItem = getSectionItem(nextSection); } else if (nextStickySection != nextSection) { - QDeclarativeContext *context = QDeclarativeEngine::contextForObject(nextSectionItem)->parentContext(); + QQmlContext *context = QQmlEngine::contextForObject(nextSectionItem)->parentContext(); context->setContextProperty(QLatin1String("section"), nextSection); } nextStickySection = nextSection; @@ -1414,7 +1414,7 @@ void QQuickListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte } void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize, - QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity) + QQuickTimeLineCallback::Callback fixupCallback, qreal velocity) { Q_Q(QQuickListView); @@ -1528,7 +1528,7 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte } timeline.reset(data.move); timeline.accel(data.move, v, accel, maxDistance + overshootDist); - timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this)); + timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this)); if (!hData.flicking && q->xflick()) { hData.flicking = true; emit q->flickingChanged(); @@ -1569,7 +1569,7 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte } timeline.reset(data.move); timeline.accelDistance(data.move, v, -dist); - timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this)); + timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this)); } } else { correctFlick = false; @@ -1601,13 +1601,13 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte The following example shows the definition of a simple list model defined in a file called \c ContactModel.qml: - \snippet doc/src/snippets/declarative/listview/ContactModel.qml 0 + \snippet doc/src/snippets/qml/listview/ContactModel.qml 0 Another component can display this model data in a ListView, like this: - \snippet doc/src/snippets/declarative/listview/listview.qml import + \snippet doc/src/snippets/qml/listview/listview.qml import \codeline - \snippet doc/src/snippets/declarative/listview/listview.qml classdocs simple + \snippet doc/src/snippets/qml/listview/listview.qml classdocs simple \image listview-simple.png @@ -1618,7 +1618,7 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte An improved list view is shown below. The delegate is visually improved and is moved into a separate \c contactDelegate component. - \snippet doc/src/snippets/declarative/listview/listview.qml classdocs advanced + \snippet doc/src/snippets/qml/listview/listview.qml classdocs advanced \image listview-highlight.png The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property, @@ -1633,7 +1633,7 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte this attached property directly as \c ListView.isCurrentItem, while the child \c contactInfo object must refer to this property as \c wrapper.ListView.isCurrentItem. - \snippet doc/src/snippets/declarative/listview/listview.qml isCurrentItem + \snippet doc/src/snippets/qml/listview/listview.qml isCurrentItem \note Views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary @@ -1659,7 +1659,7 @@ QQuickListView::~QQuickListView() This property may be used to adjust the appearance of the current item, for example: - \snippet doc/src/snippets/declarative/listview/listview.qml isCurrentItem + \snippet doc/src/snippets/qml/listview/listview.qml isCurrentItem */ /*! @@ -1706,7 +1706,7 @@ QQuickListView::~QQuickListView() until an animation completes. The example delegate below ensures that the animation completes before the item is removed from the list. - \snippet doc/src/snippets/declarative/listview/listview.qml delayRemove + \snippet doc/src/snippets/qml/listview/listview.qml delayRemove If a \l remove transition has been specified, it will not be applied until delayRemove is returned to \c false. @@ -1816,7 +1816,7 @@ QQuickListView::~QQuickListView() Here is a highlight with its motion defined by a \l {SpringAnimation} item: - \snippet doc/src/snippets/declarative/listview/listview.qml highlightFollowsCurrentItem + \snippet doc/src/snippets/qml/listview/listview.qml highlightFollowsCurrentItem Note that the highlight animation also affects the way that the view is scrolled. This is because the view moves to maintain the @@ -2662,7 +2662,7 @@ void QQuickListView::updateSections() } } -bool QQuickListViewPrivate::applyInsertionChange(const QDeclarativeChangeSet::Insert &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView) +bool QQuickListViewPrivate::applyInsertionChange(const QQuickChangeSet::Insert &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView) { int modelIndex = change.index; int count = change.count; diff --git a/src/quick/items/qquicklistview_p.h b/src/quick/items/qquicklistview_p.h index bffd935616..239647a954 100644 --- a/src/quick/items/qquicklistview_p.h +++ b/src/quick/items/qquicklistview_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include "qquickitemview_p.h" -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> QT_BEGIN_HEADER @@ -57,7 +57,7 @@ class Q_AUTOTEST_EXPORT QQuickViewSection : public QObject Q_OBJECT Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged) Q_PROPERTY(SectionCriteria criteria READ criteria WRITE setCriteria NOTIFY criteriaChanged) - Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(int labelPositioning READ labelPositioning WRITE setLabelPositioning NOTIFY labelPositioningChanged) Q_ENUMS(SectionCriteria) Q_ENUMS(LabelPositioning) @@ -71,8 +71,8 @@ public: SectionCriteria criteria() const { return m_criteria; } void setCriteria(SectionCriteria); - QDeclarativeComponent *delegate() const { return m_delegate; } - void setDelegate(QDeclarativeComponent *delegate); + QQmlComponent *delegate() const { return m_delegate; } + void setDelegate(QQmlComponent *delegate); QString sectionString(const QString &value); @@ -89,7 +89,7 @@ Q_SIGNALS: private: QString m_property; SectionCriteria m_criteria; - QDeclarativeComponent *m_delegate; + QQmlComponent *m_delegate; int m_labelPositioning; QQuickListViewPrivate *m_view; }; @@ -197,7 +197,7 @@ Q_SIGNALS: void viewChanged(); public: - QDeclarativeGuard<QQuickListView> m_view; + QQmlGuard<QQuickListView> m_view; }; diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index 92724f4095..bbc51a4d26 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -41,12 +41,12 @@ #include "qquickloader_p_p.h" -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlglobal_p.h> -#include <private/qdeclarativecomponent_p.h> +#include <private/qqmlcomponent_p.h> #include <private/qv8_p.h> @@ -133,7 +133,7 @@ void QQuickLoaderPrivate::initResize() Here is a Loader that loads "Page1.qml" as a component when the \l MouseArea is clicked: - \snippet doc/src/snippets/declarative/loader/simple.qml 0 + \snippet doc/src/snippets/qml/loader/simple.qml 0 The loaded item can be accessed using the \l item property. @@ -165,8 +165,8 @@ void QQuickLoaderPrivate::initResize() \o sizeloader.qml \o sizeitem.qml \row - \o \snippet doc/src/snippets/declarative/loader/sizeloader.qml 0 - \o \snippet doc/src/snippets/declarative/loader/sizeitem.qml 0 + \o \snippet doc/src/snippets/qml/loader/sizeloader.qml 0 + \o \snippet doc/src/snippets/qml/loader/sizeitem.qml 0 \row \o The red rectangle will be sized to the size of the root item. \o The red rectangle will be 50x50, centered in the root item. @@ -185,8 +185,8 @@ void QQuickLoaderPrivate::initResize() \o application.qml \o MyItem.qml \row - \o \snippet doc/src/snippets/declarative/loader/connections.qml 0 - \o \snippet doc/src/snippets/declarative/loader/MyItem.qml 0 + \o \snippet doc/src/snippets/qml/loader/connections.qml 0 + \o \snippet doc/src/snippets/qml/loader/MyItem.qml 0 \endtable Alternatively, since \c MyItem.qml is loaded within the scope of the @@ -212,8 +212,8 @@ void QQuickLoaderPrivate::initResize() \o application.qml \o KeyReader.qml \row - \o \snippet doc/src/snippets/declarative/loader/focus.qml 0 - \o \snippet doc/src/snippets/declarative/loader/KeyReader.qml 0 + \o \snippet doc/src/snippets/qml/loader/focus.qml 0 + \o \snippet doc/src/snippets/qml/loader/KeyReader.qml 0 \endtable Once \c KeyReader.qml is loaded, it accepts key events and sets @@ -344,7 +344,7 @@ void QQuickLoader::loadFromSource() } if (isComponentComplete()) { - d->component = new QDeclarativeComponent(qmlEngine(this), d->source, this); + d->component = new QQmlComponent(qmlEngine(this), d->source, this); d->load(); } } @@ -371,13 +371,13 @@ void QQuickLoader::loadFromSource() \sa source, progress */ -QDeclarativeComponent *QQuickLoader::sourceComponent() const +QQmlComponent *QQuickLoader::sourceComponent() const { Q_D(const QQuickLoader); return d->component; } -void QQuickLoader::setSourceComponent(QDeclarativeComponent *comp) +void QQuickLoader::setSourceComponent(QQmlComponent *comp) { Q_D(QQuickLoader); if (comp == d->component) @@ -476,7 +476,7 @@ void QQuickLoader::loadFromSourceComponent() \sa source, active */ -void QQuickLoader::setSource(QDeclarativeV8Function *args) +void QQuickLoader::setSource(QQmlV8Function *args) { Q_ASSERT(args); Q_D(QQuickLoader); @@ -516,7 +516,7 @@ void QQuickLoaderPrivate::load() if (!component->isLoading()) { _q_sourceLoaded(); } else { - QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), + QObject::connect(component, SIGNAL(statusChanged(QQmlComponent::Status)), q, SLOT(_q_sourceLoaded())); QObject::connect(component, SIGNAL(progressChanged(qreal)), q, SIGNAL(progressChanged())); @@ -541,15 +541,15 @@ void QQuickLoaderPrivate::setInitialState(QObject *obj) QQuickItem *item = qobject_cast<QQuickItem*>(obj); if (item) { - QDeclarative_setParent_noEvent(itemContext, obj); - QDeclarative_setParent_noEvent(item, q); + QQml_setParent_noEvent(itemContext, obj); + QQml_setParent_noEvent(item, q); item->setParentItem(q); } if (initialPropertyValues.IsEmpty()) return; - QDeclarativeComponentPrivate *d = QDeclarativeComponentPrivate::get(component); + QQmlComponentPrivate *d = QQmlComponentPrivate::get(component); Q_ASSERT(d && d->engine); d->initializeObjectWithInitialProperties(qmlGlobalForIpv, initialPropertyValues, obj); } @@ -559,13 +559,13 @@ void QQuickLoaderIncubator::statusChanged(Status status) loader->incubatorStateChanged(status); } -void QQuickLoaderPrivate::incubatorStateChanged(QDeclarativeIncubator::Status status) +void QQuickLoaderPrivate::incubatorStateChanged(QQmlIncubator::Status status) { Q_Q(QQuickLoader); - if (status == QDeclarativeIncubator::Loading || status == QDeclarativeIncubator::Null) + if (status == QQmlIncubator::Loading || status == QQmlIncubator::Null) return; - if (status == QDeclarativeIncubator::Ready) { + if (status == QQmlIncubator::Ready) { QObject *obj = incubator->object(); item = qobject_cast<QQuickItem*>(obj); if (item) { @@ -579,9 +579,9 @@ void QQuickLoaderPrivate::incubatorStateChanged(QDeclarativeIncubator::Status st emit q->itemChanged(); } incubator->clear(); - } else if (status == QDeclarativeIncubator::Error) { + } else if (status == QQmlIncubator::Error) { if (!incubator->errors().isEmpty()) - QDeclarativeEnginePrivate::warning(qmlEngine(q), incubator->errors()); + QQmlEnginePrivate::warning(qmlEngine(q), incubator->errors()); delete itemContext; itemContext = 0; delete incubator->object(); @@ -603,7 +603,7 @@ void QQuickLoaderPrivate::_q_sourceLoaded() Q_Q(QQuickLoader); if (!component || !component->errors().isEmpty()) { if (component) - QDeclarativeEnginePrivate::warning(qmlEngine(q), component->errors()); + QQmlEnginePrivate::warning(qmlEngine(q), component->errors()); if (loadingFromSource) emit q->sourceChanged(); else @@ -614,17 +614,17 @@ void QQuickLoaderPrivate::_q_sourceLoaded() return; } - QDeclarativeContext *creationContext = component->creationContext(); + QQmlContext *creationContext = component->creationContext(); if (!creationContext) creationContext = qmlContext(q); - itemContext = new QDeclarativeContext(creationContext); + itemContext = new QQmlContext(creationContext); itemContext->setContextObject(q); delete incubator; - incubator = new QQuickLoaderIncubator(this, asynchronous ? QDeclarativeIncubator::Asynchronous : QDeclarativeIncubator::AsynchronousIfNested); + incubator = new QQuickLoaderIncubator(this, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested); component->create(*incubator, itemContext); - if (incubator && incubator->status() == QDeclarativeIncubator::Loading) + if (incubator && incubator->status() == QQmlIncubator::Loading) emit q->statusChanged(); } @@ -677,11 +677,11 @@ QQuickLoader::Status QQuickLoader::status() const if (d->component) { switch (d->component->status()) { - case QDeclarativeComponent::Loading: + case QQmlComponent::Loading: return Loading; - case QDeclarativeComponent::Error: + case QQmlComponent::Error: return Error; - case QDeclarativeComponent::Null: + case QQmlComponent::Null: return Null; default: break; @@ -690,9 +690,9 @@ QQuickLoader::Status QQuickLoader::status() const if (d->incubator) { switch (d->incubator->status()) { - case QDeclarativeIncubator::Loading: + case QQmlIncubator::Loading: return Loading; - case QDeclarativeIncubator::Error: + case QQmlIncubator::Error: return Error; default: break; @@ -711,7 +711,7 @@ void QQuickLoader::componentComplete() QQuickItem::componentComplete(); if (active()) { if (d->loadingFromSource) { - d->component = new QDeclarativeComponent(qmlEngine(this), d->source, this); + d->component = new QQmlComponent(qmlEngine(this), d->source, this); } d->load(); } @@ -826,19 +826,19 @@ void QQuickLoader::geometryChanged(const QRectF &newGeometry, const QRectF &oldG QQuickItem::geometryChanged(newGeometry, oldGeometry); } -QUrl QQuickLoaderPrivate::resolveSourceUrl(QDeclarativeV8Function *args) +QUrl QQuickLoaderPrivate::resolveSourceUrl(QQmlV8Function *args) { QV8Engine *v8engine = args->engine(); QString arg = v8engine->toString((*args)[0]->ToString()); if (arg.isEmpty()) return QUrl(); - QDeclarativeContextData *context = args->context(); + QQmlContextData *context = args->context(); Q_ASSERT(context); return context->resolvedUrl(QUrl(arg)); } -v8::Handle<v8::Object> QQuickLoaderPrivate::extractInitialPropertyValues(QDeclarativeV8Function *args, QObject *loader, bool *error) +v8::Handle<v8::Object> QQuickLoaderPrivate::extractInitialPropertyValues(QQmlV8Function *args, QObject *loader, bool *error) { v8::Local<v8::Object> valuemap; if (args->Length() >= 2) { diff --git a/src/quick/items/qquickloader_p.h b/src/quick/items/qquickloader_p.h index a6cc5a18d9..c5f544b0e8 100644 --- a/src/quick/items/qquickloader_p.h +++ b/src/quick/items/qquickloader_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,7 +56,7 @@ class Q_AUTOTEST_EXPORT QQuickLoader : public QQuickImplicitSizeItem Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged) Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_PROPERTY(QDeclarativeComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceComponentChanged) + Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceComponentChanged) Q_PROPERTY(QQuickItem *item READ item NOTIFY itemChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) @@ -69,13 +69,13 @@ public: bool active() const; void setActive(bool newVal); - Q_INVOKABLE void setSource(QDeclarativeV8Function *); + Q_INVOKABLE void setSource(QQmlV8Function *); QUrl source() const; void setSource(const QUrl &); - QDeclarativeComponent *sourceComponent() const; - void setSourceComponent(QDeclarativeComponent *); + QQmlComponent *sourceComponent() const; + void setSourceComponent(QQmlComponent *); void resetSourceComponent(); enum Status { Null, Ready, Loading, Error }; diff --git a/src/quick/items/qquickloader_p_p.h b/src/quick/items/qquickloader_p_p.h index 3ef0038493..1ad7756ed8 100644 --- a/src/quick/items/qquickloader_p_p.h +++ b/src/quick/items/qquickloader_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,7 +56,7 @@ #include "qquickloader_p.h" #include "qquickimplicitsizeitem_p_p.h" #include "qquickitemchangelistener_p.h" -#include <qdeclarativeincubator.h> +#include <qqmlincubator.h> #include <private/qv8_p.h> @@ -64,10 +64,10 @@ QT_BEGIN_NAMESPACE class QQuickLoaderPrivate; -class QQuickLoaderIncubator : public QDeclarativeIncubator +class QQuickLoaderIncubator : public QQmlIncubator { public: - QQuickLoaderIncubator(QQuickLoaderPrivate *l, IncubationMode mode) : QDeclarativeIncubator(mode), loader(l) {} + QQuickLoaderIncubator(QQuickLoaderPrivate *l, IncubationMode mode) : QQmlIncubator(mode), loader(l) {} protected: virtual void statusChanged(Status); @@ -77,7 +77,7 @@ private: QQuickLoaderPrivate *loader; }; -class QDeclarativeContext; +class QQmlContext; class QQuickLoaderPrivate : public QQuickImplicitSizeItemPrivate, public QQuickItemChangeListener { Q_DECLARE_PUBLIC(QQuickLoader) @@ -91,16 +91,16 @@ public: void initResize(); void load(); - void incubatorStateChanged(QDeclarativeIncubator::Status status); + void incubatorStateChanged(QQmlIncubator::Status status); void setInitialState(QObject *o); void disposeInitialPropertyValues(); - QUrl resolveSourceUrl(QDeclarativeV8Function *args); - v8::Handle<v8::Object> extractInitialPropertyValues(QDeclarativeV8Function *args, QObject *loader, bool *error); + QUrl resolveSourceUrl(QQmlV8Function *args); + v8::Handle<v8::Object> extractInitialPropertyValues(QQmlV8Function *args, QObject *loader, bool *error); QUrl source; QQuickItem *item; - QDeclarativeComponent *component; - QDeclarativeContext *itemContext; + QQmlComponent *component; + QQmlContext *itemContext; QQuickLoaderIncubator *incubator; v8::Persistent<v8::Object> initialPropertyValues; v8::Persistent<v8::Object> qmlGlobalForIpv; diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index d0894e9590..ec2c980879 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -348,9 +348,9 @@ bool QQuickMouseAreaPrivate::propagateHelper(QQuickMouseEvent *ev, QQuickItem *i The following example uses a MouseArea in a \l Rectangle that changes the \l Rectangle color to red when clicked: - \snippet doc/src/snippets/declarative/mousearea/mousearea.qml import + \snippet doc/src/snippets/qml/mousearea/mousearea.qml import \codeline - \snippet doc/src/snippets/declarative/mousearea/mousearea.qml intro + \snippet doc/src/snippets/qml/mousearea/mousearea.qml intro \clearfloat Many MouseArea signals pass a \l{MouseEvent}{mouse} parameter that contains @@ -360,7 +360,7 @@ bool QQuickMouseAreaPrivate::propagateHelper(QQuickMouseEvent *ev, QQuickItem *i Here is an extension of the previous example that produces a different color when the area is right clicked: - \snippet doc/src/snippets/declarative/mousearea/mousearea.qml intro-extended + \snippet doc/src/snippets/qml/mousearea/mousearea.qml intro-extended Behavioral Change in QtQuick 2.0 @@ -659,7 +659,7 @@ void QQuickMouseArea::setPropagateComposedEvents(bool prevent) The code below displays "right" when the right mouse buttons is pressed: - \snippet doc/src/snippets/declarative/mousearea/mousearea.qml mousebuttons + \snippet doc/src/snippets/qml/mousearea/mousearea.qml mousebuttons \sa acceptedButtons */ @@ -1148,7 +1148,7 @@ bool QQuickMouseArea::setPressed(bool p) The following example displays a \l Rectangle that can be dragged along the X-axis. The opacity of the rectangle is reduced when it is dragged to the right. - \snippet doc/src/snippets/declarative/mousearea/mousearea.qml drag + \snippet doc/src/snippets/qml/mousearea/mousearea.qml drag \note Items cannot be dragged if they are anchored for the requested \c drag.axis. For example, if \c anchors.left or \c anchors.right was set @@ -1159,7 +1159,7 @@ bool QQuickMouseArea::setPressed(bool p) If \c drag.filterChildren is set to true, a drag can override descendant MouseAreas. This enables a parent MouseArea to handle drags, for example, while descendants handle clicks: - \snippet doc/src/snippets/declarative/mousearea/mouseareadragfilter.qml dragfilter + \snippet doc/src/snippets/qml/mousearea/mouseareadragfilter.qml dragfilter */ diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h index 0723f8326f..93a0635eb5 100644 --- a/src/quick/items/qquickmousearea_p.h +++ b/src/quick/items/qquickmousearea_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -132,7 +132,7 @@ class Q_QUICK_EXPORT QQuickMouseArea : public QQuickItem Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedChanged) Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged) Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged) - Q_PROPERTY(QQuickDrag *drag READ drag CONSTANT) //### add flicking to QQuickDrag or add a QDeclarativeFlick ??? + Q_PROPERTY(QQuickDrag *drag READ drag CONSTANT) //### add flicking to QQuickDrag or add a QQuickFlick ??? Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged) Q_PROPERTY(bool propagateComposedEvents READ propagateComposedEvents WRITE setPropagateComposedEvents NOTIFY propagateComposedEventsChanged) diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h index 2060671698..bcdf033cba 100644 --- a/src/quick/items/qquickmousearea_p_p.h +++ b/src/quick/items/qquickmousearea_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -99,7 +99,7 @@ public: QPointF startScene; QPointF targetStartPos; QPointF lastPos; - QDeclarativeNullableValue<QPointF> lastScenePos; + QQmlNullableValue<QPointF> lastScenePos; Qt::MouseButton lastButton; Qt::MouseButtons lastButtons; Qt::KeyboardModifiers lastModifiers; diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp index c1c60c1756..7dd6ec0589 100644 --- a/src/quick/items/qquickmultipointtoucharea.cpp +++ b/src/quick/items/qquickmultipointtoucharea.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -309,7 +309,7 @@ void QQuickTouchPoint::setSceneY(qreal sceneY) In the following example, we have two small rectangles that follow our touch points. - \snippet doc/src/snippets/declarative/multipointtoucharea/multipointtoucharea.qml 0 + \snippet doc/src/snippets/qml/multipointtoucharea/multipointtoucharea.qml 0 By default this property holds an empty list. diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h index ccb086fd7e..3651278735 100644 --- a/src/quick/items/qquickmultipointtoucharea_p.h +++ b/src/quick/items/qquickmultipointtoucharea_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -166,7 +166,7 @@ private: class QQuickGrabGestureEvent : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativeListProperty<QObject> touchPoints READ touchPoints) + Q_PROPERTY(QQmlListProperty<QObject> touchPoints READ touchPoints) Q_PROPERTY(qreal dragThreshold READ dragThreshold) public: QQuickGrabGestureEvent() : _grab(false), _dragThreshold(qApp->styleHints()->startDragDistance()) {} @@ -174,8 +174,8 @@ public: Q_INVOKABLE void grab() { _grab = true; } bool wantsGrab() const { return _grab; } - QDeclarativeListProperty<QObject> touchPoints() { - return QDeclarativeListProperty<QObject>(this, _touchPoints); + QQmlListProperty<QObject> touchPoints() { + return QQmlListProperty<QObject>(this, _touchPoints); } qreal dragThreshold() const { return _dragThreshold; } @@ -190,7 +190,7 @@ class Q_AUTOTEST_EXPORT QQuickMultiPointTouchArea : public QQuickItem { Q_OBJECT - Q_PROPERTY(QDeclarativeListProperty<QQuickTouchPoint> touchPoints READ touchPoints) + Q_PROPERTY(QQmlListProperty<QQuickTouchPoint> touchPoints READ touchPoints) Q_PROPERTY(int minimumTouchPoints READ minimumTouchPoints WRITE setMinimumTouchPoints NOTIFY minimumTouchPointsChanged) Q_PROPERTY(int maximumTouchPoints READ maximumTouchPoints WRITE setMaximumTouchPoints NOTIFY maximumTouchPointsChanged) @@ -203,21 +203,21 @@ public: int maximumTouchPoints() const; void setMaximumTouchPoints(int num); - QDeclarativeListProperty<QQuickTouchPoint> touchPoints() { - return QDeclarativeListProperty<QQuickTouchPoint>(this, 0, QQuickMultiPointTouchArea::touchPoint_append, QQuickMultiPointTouchArea::touchPoint_count, QQuickMultiPointTouchArea::touchPoint_at, 0); + QQmlListProperty<QQuickTouchPoint> touchPoints() { + return QQmlListProperty<QQuickTouchPoint>(this, 0, QQuickMultiPointTouchArea::touchPoint_append, QQuickMultiPointTouchArea::touchPoint_count, QQuickMultiPointTouchArea::touchPoint_at, 0); } - static void touchPoint_append(QDeclarativeListProperty<QQuickTouchPoint> *list, QQuickTouchPoint* touch) { + static void touchPoint_append(QQmlListProperty<QQuickTouchPoint> *list, QQuickTouchPoint* touch) { QQuickMultiPointTouchArea *q = static_cast<QQuickMultiPointTouchArea*>(list->object); q->addTouchPrototype(touch); } - static int touchPoint_count(QDeclarativeListProperty<QQuickTouchPoint> *list) { + static int touchPoint_count(QQmlListProperty<QQuickTouchPoint> *list) { QQuickMultiPointTouchArea *q = static_cast<QQuickMultiPointTouchArea*>(list->object); return q->_touchPrototypes.count(); } - static QQuickTouchPoint* touchPoint_at(QDeclarativeListProperty<QQuickTouchPoint> *list, int index) { + static QQuickTouchPoint* touchPoint_at(QQmlListProperty<QQuickTouchPoint> *list, int index) { QQuickMultiPointTouchArea *q = static_cast<QQuickMultiPointTouchArea*>(list->object); return q->_touchPrototypes[index]; } diff --git a/src/quick/items/qquickninepatchnode.cpp b/src/quick/items/qquickninepatchnode.cpp index ff265b3a97..649fa527ee 100644 --- a/src/quick/items/qquickninepatchnode.cpp +++ b/src/quick/items/qquickninepatchnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickninepatchnode_p.h b/src/quick/items/qquickninepatchnode_p.h index 277b368de7..c2761f74e5 100644 --- a/src/quick/items/qquickninepatchnode_p.h +++ b/src/quick/items/qquickninepatchnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp index 02afc0c4f5..349f2ff3c1 100644 --- a/src/quick/items/qquickpainteditem.cpp +++ b/src/quick/items/qquickpainteditem.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickpainteditem.h b/src/quick/items/qquickpainteditem.h index 06768796ca..15afdf8339 100644 --- a/src/quick/items/qquickpainteditem.h +++ b/src/quick/items/qquickpainteditem.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickpainteditem_p.h b/src/quick/items/qquickpainteditem_p.h index 8c0a1475a7..d98216ffb0 100644 --- a/src/quick/items/qquickpainteditem_p.h +++ b/src/quick/items/qquickpainteditem_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index afc336fa04..f8098c8f65 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,10 +43,11 @@ #include "qquickpathview_p_p.h" #include "qquickcanvas.h" -#include <QtQuick/private/qdeclarativestate_p.h> -#include <private/qdeclarativeopenmetaobject_p.h> +#include <QtQuick/private/qquickstate_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlopenmetaobject_p.h> #include <private/qlistmodelinterface_p.h> -#include <private/qdeclarativechangeset_p.h> +#include <private/qquickchangeset_p.h> #include <QtGui/qevent.h> #include <QtGui/qevent.h> @@ -78,16 +79,16 @@ inline qreal qmlMod(qreal x, qreal y) return fmod(x, y); } -static QDeclarativeOpenMetaObjectType *qPathViewAttachedType = 0; +static QQmlOpenMetaObjectType *qPathViewAttachedType = 0; QQuickPathViewAttached::QQuickPathViewAttached(QObject *parent) : QObject(parent), m_percent(-1), m_view(0), m_onPath(false), m_isCurrent(false) { if (qPathViewAttachedType) { - m_metaobject = new QDeclarativeOpenMetaObject(this, qPathViewAttachedType); + m_metaobject = new QQmlOpenMetaObject(this, qPathViewAttachedType); m_metaobject->setCached(true); } else { - m_metaobject = new QDeclarativeOpenMetaObject(this); + m_metaobject = new QQmlOpenMetaObject(this); } } @@ -126,7 +127,7 @@ QQuickItem *QQuickPathViewPrivate::getItem(int modelIndex, qreal z, bool onPath) inRequest = true; QQuickItem *item = model->item(modelIndex, false); if (item) { - QDeclarative_setParent_noEvent(item, q); + QQml_setParent_noEvent(item, q); item->setParentItem(q); requestedIndex = -1; qPathViewAttachedType = attType; @@ -153,7 +154,7 @@ void QQuickPathView::createdItem(int index, QQuickItem *item) att->setOnPath(false); } item->setParentItem(this); - QDeclarative_setParent_noEvent(item, this); + QQml_setParent_noEvent(item, this); d->updateItem(item, index < d->firstIndex ? 0.0 : 1.0); } else { d->requestedIndex = -1; @@ -200,12 +201,12 @@ QQuickPathViewAttached *QQuickPathViewPrivate::attached(QQuickItem *item) return static_cast<QQuickPathViewAttached *>(qmlAttachedPropertiesObject<QQuickPathView>(item, false)); } -QDeclarativeOpenMetaObjectType *QQuickPathViewPrivate::attachedType() +QQmlOpenMetaObjectType *QQuickPathViewPrivate::attachedType() { Q_Q(QQuickPathView); if (!attType) { // pre-create one metatype to share with all attached objects - attType = new QDeclarativeOpenMetaObjectType(&QQuickPathViewAttached::staticMetaObject, qmlEngine(q)); + attType = new QQmlOpenMetaObjectType(&QQuickPathViewAttached::staticMetaObject, qmlEngine(q)); foreach (const QString &attr, path->attributes()) attType->createProperty(attr.toUtf8()); } @@ -273,12 +274,12 @@ void QQuickPathViewPrivate::createHighlight() QQuickItem *item = 0; if (highlightComponent) { - QDeclarativeContext *creationContext = highlightComponent->creationContext(); - QDeclarativeContext *highlightContext = new QDeclarativeContext( + QQmlContext *creationContext = highlightComponent->creationContext(); + QQmlContext *highlightContext = new QQmlContext( creationContext ? creationContext : qmlContext(q)); QObject *nobj = highlightComponent->create(highlightContext); if (nobj) { - QDeclarative_setParent_noEvent(highlightContext, nobj); + QQml_setParent_noEvent(highlightContext, nobj); item = qobject_cast<QQuickItem *>(nobj); if (!item) delete nobj; @@ -289,7 +290,7 @@ void QQuickPathViewPrivate::createHighlight() item = new QQuickItem; } if (item) { - QDeclarative_setParent_noEvent(item, q); + QQml_setParent_noEvent(item, q); item->setParentItem(q); highlightItem = item; changed = true; @@ -426,11 +427,11 @@ void QQuickPathViewPrivate::regenerate() For example, if there is a simple list model defined in a file \c ContactModel.qml like this: - \snippet doc/src/snippets/declarative/pathview/ContactModel.qml 0 + \snippet doc/src/snippets/qml/pathview/ContactModel.qml 0 This data can be represented as a PathView, like this: - \snippet doc/src/snippets/declarative/pathview/pathview.qml 0 + \snippet doc/src/snippets/qml/pathview/pathview.qml 0 \image pathview.gif @@ -463,7 +464,7 @@ void QQuickPathViewPrivate::regenerate() this attached property directly as \c PathView.isCurrentItem, while the child \c nameText object must refer to this property as \c wrapper.PathView.isCurrentItem. - \snippet doc/src/snippets/declarative/pathview/pathview.qml 1 + \snippet doc/src/snippets/qml/pathview/pathview.qml 1 \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary @@ -525,7 +526,7 @@ QQuickPathView::~QQuickPathView() This property may be used to adjust the appearance of the current item. - \snippet doc/src/snippets/declarative/pathview/pathview.qml 1 + \snippet doc/src/snippets/qml/pathview/pathview.qml 1 */ /*! @@ -551,8 +552,8 @@ void QQuickPathView::setModel(const QVariant &model) return; if (d->model) { - disconnect(d->model, SIGNAL(modelUpdated(QDeclarativeChangeSet,bool)), - this, SLOT(modelUpdated(QDeclarativeChangeSet,bool))); + disconnect(d->model, SIGNAL(modelUpdated(QQuickChangeSet,bool)), + this, SLOT(modelUpdated(QQuickChangeSet,bool))); disconnect(d->model, SIGNAL(createdItem(int,QQuickItem*)), this, SLOT(createdItem(int,QQuickItem*))); disconnect(d->model, SIGNAL(initItem(int,QQuickItem*)), this, SLOT(initItem(int,QQuickItem*))); for (int i=0; i<d->items.count(); i++){ @@ -583,8 +584,8 @@ void QQuickPathView::setModel(const QVariant &model) } d->modelCount = 0; if (d->model) { - connect(d->model, SIGNAL(modelUpdated(QDeclarativeChangeSet,bool)), - this, SLOT(modelUpdated(QDeclarativeChangeSet,bool))); + connect(d->model, SIGNAL(modelUpdated(QQuickChangeSet,bool)), + this, SLOT(modelUpdated(QQuickChangeSet,bool))); connect(d->model, SIGNAL(createdItem(int,QQuickItem*)), this, SLOT(createdItem(int,QQuickItem*))); connect(d->model, SIGNAL(initItem(int,QQuickItem*)), this, SLOT(initItem(int,QQuickItem*))); d->modelCount = d->model->count(); @@ -617,13 +618,13 @@ int QQuickPathView::count() const This property holds the path used to lay out the items. For more information see the \l Path documentation. */ -QDeclarativePath *QQuickPathView::path() const +QQuickPath *QQuickPathView::path() const { Q_D(const QQuickPathView); return d->path; } -void QQuickPathView::setPath(QDeclarativePath *path) +void QQuickPathView::setPath(QQuickPath *path) { Q_D(QQuickPathView); if (d->path == path) @@ -786,13 +787,13 @@ void QQuickPathViewPrivate::setAdjustedOffset(qreal o) \sa highlightItem, highlightRangeMode */ -QDeclarativeComponent *QQuickPathView::highlight() const +QQmlComponent *QQuickPathView::highlight() const { Q_D(const QQuickPathView); return d->highlightComponent; } -void QQuickPathView::setHighlight(QDeclarativeComponent *highlight) +void QQuickPathView::setHighlight(QQmlComponent *highlight) { Q_D(QQuickPathView); if (highlight != d->highlightComponent) { @@ -1069,9 +1070,9 @@ bool QQuickPathView::isFlicking() const item in the delegate. Here is an example delegate: - \snippet doc/src/snippets/declarative/pathview/pathview.qml 1 + \snippet doc/src/snippets/qml/pathview/pathview.qml 1 */ -QDeclarativeComponent *QQuickPathView::delegate() const +QQmlComponent *QQuickPathView::delegate() const { Q_D(const QQuickPathView); if (d->model) { @@ -1082,7 +1083,7 @@ QDeclarativeComponent *QQuickPathView::delegate() const return 0; } -void QQuickPathView::setDelegate(QDeclarativeComponent *delegate) +void QQuickPathView::setDelegate(QQmlComponent *delegate) { Q_D(QQuickPathView); if (delegate == this->delegate()) @@ -1337,7 +1338,7 @@ void QQuickPathViewPrivate::handleMouseReleaseEvent(QMouseEvent *) offsetAdj = 0.0; moveOffset.setValue(offset); tl.accel(moveOffset, velocity, accel, dist); - tl.callback(QDeclarativeTimeLineCallback(&moveOffset, fixOffsetCallback, this)); + tl.callback(QQuickTimeLineCallback(&moveOffset, fixOffsetCallback, this)); if (!flicking) { flicking = true; emit q->flickingChanged(); @@ -1583,7 +1584,7 @@ void QQuickPathView::refill() d->releaseItem(d->itemCache.takeLast()); } -void QQuickPathView::modelUpdated(const QDeclarativeChangeSet &changeSet, bool reset) +void QQuickPathView::modelUpdated(const QQuickChangeSet &changeSet, bool reset) { Q_D(QQuickPathView); if (!d->model || !d->model->isValid() || !d->path || !isComponentComplete()) @@ -1604,7 +1605,7 @@ void QQuickPathView::modelUpdated(const QDeclarativeChangeSet &changeSet, bool r int moveOffset; bool currentChanged = false; bool changedOffset = false; - foreach (const QDeclarativeChangeSet::Remove &r, changeSet.removes()) { + foreach (const QQuickChangeSet::Remove &r, changeSet.removes()) { if (moveId == -1 && d->currentIndex >= r.index + r.count) { d->currentIndex -= r.count; currentChanged = true; @@ -1630,7 +1631,7 @@ void QQuickPathView::modelUpdated(const QDeclarativeChangeSet &changeSet, bool r } d->modelCount -= r.count; } - foreach (const QDeclarativeChangeSet::Insert &i, changeSet.inserts()) { + foreach (const QQuickChangeSet::Insert &i, changeSet.inserts()) { if (d->modelCount) { if (moveId == -1 && i.index <= d->currentIndex) { d->currentIndex += i.count; diff --git a/src/quick/items/qquickpathview_p.h b/src/quick/items/qquickpathview_p.h index 77348302ea..8f1ecd6caf 100644 --- a/src/quick/items/qquickpathview_p.h +++ b/src/quick/items/qquickpathview_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,13 +44,13 @@ #include "qquickitem.h" -#include <private/qdeclarativepath_p.h> +#include <private/qquickpath_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeChangeSet; +class QQuickChangeSet; class QQuickPathViewPrivate; class QQuickPathViewAttached; @@ -59,12 +59,12 @@ class Q_AUTOTEST_EXPORT QQuickPathView : public QQuickItem Q_OBJECT Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) - Q_PROPERTY(QDeclarativePath *path READ path WRITE setPath NOTIFY pathChanged) + Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged) Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) Q_PROPERTY(QQuickItem *currentItem READ currentItem NOTIFY currentItemChanged) Q_PROPERTY(qreal offset READ offset WRITE setOffset NOTIFY offsetChanged) - Q_PROPERTY(QDeclarativeComponent *highlight READ highlight WRITE setHighlight NOTIFY highlightChanged) + Q_PROPERTY(QQmlComponent *highlight READ highlight WRITE setHighlight NOTIFY highlightChanged) Q_PROPERTY(QQuickItem *highlightItem READ highlightItem NOTIFY highlightItemChanged) Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged) @@ -80,7 +80,7 @@ class Q_AUTOTEST_EXPORT QQuickPathView : public QQuickItem Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(int pathItemCount READ pathItemCount WRITE setPathItemCount NOTIFY pathItemCountChanged) Q_ENUMS(HighlightRangeMode) @@ -92,8 +92,8 @@ public: QVariant model() const; void setModel(const QVariant &); - QDeclarativePath *path() const; - void setPath(QDeclarativePath *); + QQuickPath *path() const; + void setPath(QQuickPath *); int currentIndex() const; void setCurrentIndex(int idx); @@ -103,8 +103,8 @@ public: qreal offset() const; void setOffset(qreal offset); - QDeclarativeComponent *highlight() const; - void setHighlight(QDeclarativeComponent *highlight); + QQmlComponent *highlight() const; + void setHighlight(QQmlComponent *highlight); QQuickItem *highlightItem(); enum HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange }; @@ -134,8 +134,8 @@ public: int count() const; - QDeclarativeComponent *delegate() const; - void setDelegate(QDeclarativeComponent *); + QQmlComponent *delegate() const; + void setDelegate(QQmlComponent *); int pathItemCount() const; void setPathItemCount(int); @@ -186,7 +186,7 @@ private Q_SLOTS: void refill(); void ticked(); void movementEnding(); - void modelUpdated(const QDeclarativeChangeSet &changeSet, bool reset); + void modelUpdated(const QQuickChangeSet &changeSet, bool reset); void createdItem(int index, QQuickItem *item); void initItem(int index, QQuickItem *item); void destroyingItem(QQuickItem *item); @@ -198,7 +198,7 @@ private: Q_DECLARE_PRIVATE(QQuickPathView) }; -class QDeclarativeOpenMetaObject; +class QQmlOpenMetaObject; class QQuickPathViewAttached : public QObject { Q_OBJECT @@ -241,7 +241,7 @@ private: friend class QQuickPathViewPrivate; friend class QQuickPathView; QQuickPathView *m_view; - QDeclarativeOpenMetaObject *m_metaobject; + QQmlOpenMetaObject *m_metaobject; bool m_onPath : 1; bool m_isCurrent : 1; }; diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h index b57aa13cbf..a80c01f320 100644 --- a/src/quick/items/qquickpathview_p_p.h +++ b/src/quick/items/qquickpathview_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -57,17 +57,17 @@ #include "qquickitem_p.h" #include "qquickvisualdatamodel_p.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include <QtCore/qdatetime.h> #include <QtCore/qcoreapplication.h> -#include <private/qdeclarativeanimation_p_p.h> -#include <private/qdeclarativeguard_p.h> -#include <private/qdeclarativetimeline_p_p.h> +#include <private/qquickanimation_p_p.h> +#include <private/qqmlguard_p.h> +#include <private/qquicktimeline_p_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeOpenMetaObjectType; +class QQmlOpenMetaObjectType; class QQuickPathViewAttached; class QQuickPathViewPrivate : public QQuickItemPrivate, public QQuickItemChangeListener { @@ -114,7 +114,7 @@ public: QQuickItem *getItem(int modelIndex, qreal z = 0, bool onPath=true); void releaseItem(QQuickItem *item); QQuickPathViewAttached *attached(QQuickItem *item); - QDeclarativeOpenMetaObjectType *attachedType(); + QQmlOpenMetaObjectType *attachedType(); void clear(); void updateMappedRange(); qreal positionOfIndex(qreal index) const; @@ -143,9 +143,9 @@ public: void addVelocitySample(qreal v); qreal calcVelocity() const; - QDeclarativePath *path; + QQuickPath *path; int currentIndex; - QDeclarativeGuard<QQuickItem> currentItem; + QQmlGuard<QQuickItem> currentItem; qreal currentItemOffset; qreal startPc; QPointF startPoint; @@ -169,24 +169,24 @@ public: QPointF lastPos; qreal dragMargin; qreal deceleration; - QDeclarativeTimeLine tl; - QDeclarativeTimeLineValueProxy<QQuickPathViewPrivate> moveOffset; + QQuickTimeLine tl; + QQuickTimeLineValueProxy<QQuickPathViewPrivate> moveOffset; int firstIndex; int pathItems; int requestedIndex; qreal requestedZ; QList<QQuickItem *> items; QList<QQuickItem *> itemCache; - QDeclarativeGuard<QQuickVisualModel> model; + QQmlGuard<QQuickVisualModel> model; QVariant modelVariant; enum MovementReason { Other, SetIndex, Mouse }; MovementReason moveReason; enum MovementDirection { Shortest, Negative, Positive }; MovementDirection moveDirection; - QDeclarativeOpenMetaObjectType *attType; - QDeclarativeComponent *highlightComponent; + QQmlOpenMetaObjectType *attType; + QQmlComponent *highlightComponent; QQuickItem *highlightItem; - QDeclarativeTimeLineValueProxy<QQuickPathViewPrivate> moveHighlight; + QQuickTimeLineValueProxy<QQuickPathViewPrivate> moveHighlight; qreal highlightPosition; qreal highlightRangeStart; qreal highlightRangeEnd; diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp index 77d2a360b8..739f74d69a 100644 --- a/src/quick/items/qquickpositioners.cpp +++ b/src/quick/items/qquickpositioners.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,15 +42,15 @@ #include "qquickpositioners_p.h" #include "qquickpositioners_p_p.h" -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqml.h> +#include <QtQml/qqmlinfo.h> #include <QtCore/qmath.h> #include <QtCore/qcoreapplication.h> -#include <QtQuick/private/qdeclarativestate_p.h> -#include <QtQuick/private/qdeclarativestategroup_p.h> -#include <private/qdeclarativestateoperations_p.h> -#include <QtQuick/private/qdeclarativetransition_p.h> +#include <QtQuick/private/qquickstate_p.h> +#include <QtQuick/private/qquickstategroup_p.h> +#include <private/qquickstatechangescript_p.h> +#include <QtQuick/private/qquicktransition_p.h> QT_BEGIN_NAMESPACE @@ -137,13 +137,13 @@ void QQuickBasePositioner::setSpacing(qreal s) emit spacingChanged(); } -QDeclarativeTransition *QQuickBasePositioner::move() const +QQuickTransition *QQuickBasePositioner::move() const { Q_D(const QQuickBasePositioner); return d->moveTransition; } -void QQuickBasePositioner::setMove(QDeclarativeTransition *mt) +void QQuickBasePositioner::setMove(QQuickTransition *mt) { Q_D(QQuickBasePositioner); if (mt == d->moveTransition) @@ -152,13 +152,13 @@ void QQuickBasePositioner::setMove(QDeclarativeTransition *mt) emit moveChanged(); } -QDeclarativeTransition *QQuickBasePositioner::add() const +QQuickTransition *QQuickBasePositioner::add() const { Q_D(const QQuickBasePositioner); return d->addTransition; } -void QQuickBasePositioner::setAdd(QDeclarativeTransition *add) +void QQuickBasePositioner::setAdd(QQuickTransition *add) { Q_D(QQuickBasePositioner); if (add == d->addTransition) @@ -266,12 +266,12 @@ void QQuickBasePositioner::positionX(qreal x, const PositionedItem &target) if (!d->addTransition || !d->addTransition->enabled()) target.item->setX(x); else - d->addActions << QDeclarativeAction(target.item, QLatin1String("x"), QVariant(x)); + d->addActions << QQuickAction(target.item, QLatin1String("x"), QVariant(x)); } else if (x != target.item->x()) { if (!d->moveTransition || !d->moveTransition->enabled()) target.item->setX(x); else - d->moveActions << QDeclarativeAction(target.item, QLatin1String("x"), QVariant(x)); + d->moveActions << QQuickAction(target.item, QLatin1String("x"), QVariant(x)); } } } @@ -284,12 +284,12 @@ void QQuickBasePositioner::positionY(qreal y, const PositionedItem &target) if (!d->addTransition || !d->addTransition->enabled()) target.item->setY(y); else - d->addActions << QDeclarativeAction(target.item, QLatin1String("y"), QVariant(y)); + d->addActions << QQuickAction(target.item, QLatin1String("y"), QVariant(y)); } else if (y != target.item->y()) { if (!d->moveTransition || !d->moveTransition->enabled()) target.item->setY(y); else - d->moveActions << QDeclarativeAction(target.item, QLatin1String("y"), QVariant(y)); + d->moveActions << QQuickAction(target.item, QLatin1String("y"), QVariant(y)); } } } @@ -454,7 +454,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem) Below is a Column that contains three rectangles of various sizes: - \snippet doc/src/snippets/declarative/column/vertical-positioner.qml document + \snippet doc/src/snippets/qml/column/vertical-positioner.qml document The Column automatically positions these items in a vertical formation, like this: @@ -483,7 +483,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem) For example, the Column below sets the \l move property to a specific \l Transition: - \snippet doc/src/snippets/declarative/column/column-transitions.qml document + \snippet doc/src/snippets/qml/column/column-transitions.qml document When the Space key is pressed, the \l {Item::visible}{visible} value of the green \l Rectangle is toggled. As it appears and disappears, the blue \l Rectangle moves within @@ -491,7 +491,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem) \image verticalpositioner_transition.gif - \sa Row, Grid, Flow, Positioner, {declarative/positioners}{Positioners example} + \sa Row, Grid, Flow, Positioner, {qml/positioners}{Positioners example} */ /*! \qmlproperty Transition QtQuick2::Column::add @@ -519,7 +519,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem) addition or removal of other items in the positioner, or when items move due to a move operation in a related model, or when items resize themselves. - \sa add, {declarative/positioners}{Positioners example} + \sa add, {qml/positioners}{Positioners example} */ /*! \qmlproperty real QtQuick2::Column::spacing @@ -593,7 +593,7 @@ void QQuickColumn::reportConflictingAnchors() Below is a Row that contains three rectangles of various sizes: - \snippet doc/src/snippets/declarative/row/row.qml document + \snippet doc/src/snippets/qml/row/row.qml document The Row automatically positions these items in a horizontal formation, like this: @@ -615,7 +615,7 @@ void QQuickColumn::reportConflictingAnchors() \l{Item Layouts}. - \sa Column, Grid, Flow, Positioner, {declarative/positioners}{Positioners example} + \sa Column, Grid, Flow, Positioner, {qml/positioners}{Positioners example} */ /*! \qmlproperty Transition QtQuick2::Row::add @@ -655,7 +655,7 @@ void QQuickColumn::reportConflictingAnchors() } \endqml - \sa add, {declarative/positioners}{Positioners example} + \sa add, {qml/positioners}{Positioners example} */ /*! \qmlproperty real QtQuick2::Row::spacing @@ -684,7 +684,7 @@ QQuickRow::QQuickRow(QQuickItem *parent) the right anchor remains to the right of the row. \endlist - \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example} + \sa Grid::layoutDirection, Flow::layoutDirection, {qml/righttoleft/layoutdirection}{Layout directions example} */ Qt::LayoutDirection QQuickRow::layoutDirection() const @@ -813,7 +813,7 @@ void QQuickRow::reportConflictingAnchors() For example, below is a Grid that contains five rectangles of various sizes: - \snippet doc/src/snippets/declarative/grid/grid.qml document + \snippet doc/src/snippets/qml/grid/grid.qml document The Grid automatically positions the child items in a grid formation: @@ -829,7 +829,7 @@ void QQuickRow::reportConflictingAnchors() \l{Item Layouts}. - \sa Flow, Row, Column, Positioner, {declarative/positioners}{Positioners example} + \sa Flow, Row, Column, Positioner, {qml/positioners}{Positioners example} */ /*! \qmlproperty Transition QtQuick2::Grid::add @@ -868,7 +868,7 @@ void QQuickRow::reportConflictingAnchors() } \endqml - \sa add, {declarative/positioners}{Positioners example} + \sa add, {qml/positioners}{Positioners example} */ /*! \qmlproperty qreal QtQuick2::Grid::spacing @@ -1023,7 +1023,7 @@ void QQuickGrid::setColumnSpacing(const qreal columnSpacing) \l Grid::flow property. \endlist - \sa Flow::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example} + \sa Flow::layoutDirection, Row::layoutDirection, {qml/righttoleft/layoutdirection}{Layout directions example} */ Qt::LayoutDirection QQuickGrid::layoutDirection() const { @@ -1228,7 +1228,7 @@ void QQuickGrid::reportConflictingAnchors() Below is a Flow that contains various \l Text items: - \snippet doc/src/snippets/declarative/flow.qml flow item + \snippet doc/src/snippets/qml/flow.qml flow item The Flow item automatically positions the child \l Text items side by side, wrapping as necessary: @@ -1244,7 +1244,7 @@ void QQuickGrid::reportConflictingAnchors() For more information on using Flow and other related positioner-type elements, see \l{Item Layouts}. - \sa Column, Row, Grid, Positioner, {declarative/positioners}{Positioners example} + \sa Column, Row, Grid, Positioner, {qml/positioners}{Positioners example} */ /*! \qmlproperty Transition QtQuick2::Flow::add @@ -1284,7 +1284,7 @@ void QQuickGrid::reportConflictingAnchors() } \endqml - \sa add, {declarative/positioners}{Positioners example} + \sa add, {qml/positioners}{Positioners example} */ /*! \qmlproperty real QtQuick2::Flow::spacing @@ -1362,7 +1362,7 @@ void QQuickFlow::setFlow(Flow flow) \l Flow::flow property. \endlist - \sa Grid::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example} + \sa Grid::layoutDirection, Row::layoutDirection, {qml/righttoleft/layoutdirection}{Layout directions example} */ Qt::LayoutDirection QQuickFlow::layoutDirection() const diff --git a/src/quick/items/qquickpositioners_p.h b/src/quick/items/qquickpositioners_p.h index a4f18cfc21..a2ad572c0e 100644 --- a/src/quick/items/qquickpositioners_p.h +++ b/src/quick/items/qquickpositioners_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,7 +44,7 @@ #include "qquickimplicitsizeitem_p.h" -#include <QtQuick/private/qdeclarativestate_p.h> +#include <QtQuick/private/qquickstate_p.h> #include <private/qpodvector_p.h> #include <QtCore/qobject.h> @@ -92,8 +92,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickBasePositioner : public QQuickImplicitSizeIte Q_OBJECT Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) - Q_PROPERTY(QDeclarativeTransition *move READ move WRITE setMove NOTIFY moveChanged) - Q_PROPERTY(QDeclarativeTransition *add READ add WRITE setAdd NOTIFY addChanged) + Q_PROPERTY(QQuickTransition *move READ move WRITE setMove NOTIFY moveChanged) + Q_PROPERTY(QQuickTransition *add READ add WRITE setAdd NOTIFY addChanged) public: enum PositionerType { None = 0x0, Horizontal = 0x1, Vertical = 0x2, Both = 0x3 }; QQuickBasePositioner(PositionerType, QQuickItem *parent); @@ -102,11 +102,11 @@ public: qreal spacing() const; void setSpacing(qreal); - QDeclarativeTransition *move() const; - void setMove(QDeclarativeTransition *); + QQuickTransition *move() const; + void setMove(QQuickTransition *); - QDeclarativeTransition *add() const; - void setAdd(QDeclarativeTransition *); + QQuickTransition *add() const; + void setAdd(QQuickTransition *); static QQuickPositionerAttached *qmlAttachedProperties(QObject *obj); diff --git a/src/quick/items/qquickpositioners_p_p.h b/src/quick/items/qquickpositioners_p_p.h index d281f1a372..39ca806b5e 100644 --- a/src/quick/items/qquickpositioners_p_p.h +++ b/src/quick/items/qquickpositioners_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,9 +56,9 @@ #include "qquickpositioners_p.h" #include "qquickimplicitsizeitem_p_p.h" -#include <QtQuick/private/qdeclarativestate_p.h> -#include <private/qdeclarativetransitionmanager_p_p.h> -#include <private/qdeclarativestateoperations_p.h> +#include <QtQuick/private/qquickstate_p.h> +#include <private/qquicktransitionmanager_p_p.h> +#include <private/qquickstatechangescript_p.h> #include <QtCore/qobject.h> #include <QtCore/qstring.h> @@ -87,12 +87,12 @@ public: qreal spacing; QQuickBasePositioner::PositionerType type; - QDeclarativeTransition *moveTransition; - QDeclarativeTransition *addTransition; - QDeclarativeStateOperation::ActionList addActions; - QDeclarativeStateOperation::ActionList moveActions; - QDeclarativeTransitionManager addTransitionManager; - QDeclarativeTransitionManager moveTransitionManager; + QQuickTransition *moveTransition; + QQuickTransition *addTransition; + QQuickStateOperation::ActionList addActions; + QQuickStateOperation::ActionList moveActions; + QQuickTransitionManager addTransitionManager; + QQuickTransitionManager moveTransitionManager; void watchChanges(QQuickItem *other); void unwatchChanges(QQuickItem* other); diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp index e2dbf17a29..062df127b3 100644 --- a/src/quick/items/qquickrectangle.cpp +++ b/src/quick/items/qquickrectangle.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -207,7 +207,7 @@ void QQuickGradientStop::updateGradient() with red, blending to yellow at one third of the height of the rectangle, and ending with green: - \snippet doc/src/snippets/declarative/gradient.qml code + \snippet doc/src/snippets/qml/gradient.qml code \clearfloat \section1 Performance and Limitations @@ -248,9 +248,9 @@ QQuickGradient::~QQuickGradient() delete m_gradient; } -QDeclarativeListProperty<QQuickGradientStop> QQuickGradient::stops() +QQmlListProperty<QQuickGradientStop> QQuickGradient::stops() { - return QDeclarativeListProperty<QQuickGradientStop>(this, m_stops); + return QQmlListProperty<QQuickGradientStop>(this, m_stops); } const QGradient *QQuickGradient::gradient() const @@ -309,7 +309,7 @@ int QQuickRectanglePrivate::doUpdateSlotIdx = -1; The following example shows the effects of some of the common properties on a Rectangle item, which in this case is used to create a square: - \snippet doc/src/snippets/declarative/rectangle/rectangle.qml document + \snippet doc/src/snippets/qml/rectangle/rectangle.qml document \clearfloat \section1 Performance @@ -370,7 +370,7 @@ void QQuickRectangle::doUpdate() \inlineimage rect-border-width.png \enddiv - \snippet doc/src/snippets/declarative/rectangle/rect-border-width.qml 0 + \snippet doc/src/snippets/qml/rectangle/rect-border-width.qml 0 \clearfloat Here, the innermost rectangle's border is clipped on the bottom and right edges by its @@ -394,7 +394,7 @@ QQuickPen *QQuickRectangle::border() \inlineimage declarative-rect_gradient.png \enddiv - \snippet doc/src/snippets/declarative/rectangle/rectangle-gradient.qml rectangles + \snippet doc/src/snippets/qml/rectangle/rectangle-gradient.qml rectangles \clearfloat If both a gradient and a color are specified, the gradient will be used. @@ -463,7 +463,7 @@ void QQuickRectangle::setRadius(qreal radius) The following example shows rectangles with colors specified using hexadecimal and named color notation: - \snippet doc/src/snippets/declarative/rectangle/rectangle-colors.qml rectangles + \snippet doc/src/snippets/qml/rectangle/rectangle-colors.qml rectangles \clearfloat If both a gradient and a color are specified, the gradient will be used. diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h index 621e9dd980..eec2b56fd3 100644 --- a/src/quick/items/qquickrectangle_p.h +++ b/src/quick/items/qquickrectangle_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -111,14 +111,14 @@ class Q_AUTOTEST_EXPORT QQuickGradient : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativeListProperty<QQuickGradientStop> stops READ stops) + Q_PROPERTY(QQmlListProperty<QQuickGradientStop> stops READ stops) Q_CLASSINFO("DefaultProperty", "stops") public: QQuickGradient(QObject *parent=0); ~QQuickGradient(); - QDeclarativeListProperty<QQuickGradientStop> stops(); + QQmlListProperty<QQuickGradientStop> stops(); const QGradient *gradient() const; diff --git a/src/quick/items/qquickrectangle_p_p.h b/src/quick/items/qquickrectangle_p_p.h index b2f53108a4..cb923ee563 100644 --- a/src/quick/items/qquickrectangle_p_p.h +++ b/src/quick/items/qquickrectangle_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp index 4dcbac772d..d26ebed85e 100644 --- a/src/quick/items/qquickrepeater.cpp +++ b/src/quick/items/qquickrepeater.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,10 +43,10 @@ #include "qquickrepeater_p_p.h" #include "qquickvisualdatamodel_p.h" -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativelistaccessor_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qquicklistaccessor_p.h> #include <private/qlistmodelinterface_p.h> -#include <private/qdeclarativechangeset_p.h> +#include <private/qquickchangeset_p.h> QT_BEGIN_NAMESPACE @@ -79,9 +79,9 @@ QQuickRepeaterPrivate::~QQuickRepeaterPrivate() The following Repeater creates three instances of a \l Rectangle item within a \l Row: - \snippet doc/src/snippets/declarative/repeaters/repeater.qml import + \snippet doc/src/snippets/qml/repeaters/repeater.qml import \codeline - \snippet doc/src/snippets/declarative/repeaters/repeater.qml simple + \snippet doc/src/snippets/qml/repeaters/repeater.qml simple \image repeater-simple.png @@ -96,7 +96,7 @@ QQuickRepeaterPrivate::~QQuickRepeaterPrivate() a Repeater to be used inside a layout. For example, the following Repeater's items are stacked between a red rectangle and a blue rectangle: - \snippet doc/src/snippets/declarative/repeaters/repeater.qml layout + \snippet doc/src/snippets/qml/repeaters/repeater.qml layout \image repeater.png @@ -186,8 +186,8 @@ void QQuickRepeater::setModel(const QVariant &model) clear(); if (d->model) { - disconnect(d->model, SIGNAL(modelUpdated(QDeclarativeChangeSet,bool)), - this, SLOT(modelUpdated(QDeclarativeChangeSet,bool))); + disconnect(d->model, SIGNAL(modelUpdated(QQuickChangeSet,bool)), + this, SLOT(modelUpdated(QQuickChangeSet,bool))); disconnect(d->model, SIGNAL(createdItem(int,QQuickItem*)), this, SLOT(createdItem(int,QQuickItem*))); disconnect(d->model, SIGNAL(initItem(int,QQuickItem*)), this, SLOT(initItem(int,QQuickItem*))); // disconnect(d->model, SIGNAL(destroyingItem(QQuickItem*)), this, SLOT(destroyingItem(QQuickItem*))); @@ -212,8 +212,8 @@ void QQuickRepeater::setModel(const QVariant &model) dataModel->setModel(model); } if (d->model) { - connect(d->model, SIGNAL(modelUpdated(QDeclarativeChangeSet,bool)), - this, SLOT(modelUpdated(QDeclarativeChangeSet,bool))); + connect(d->model, SIGNAL(modelUpdated(QQuickChangeSet,bool)), + this, SLOT(modelUpdated(QQuickChangeSet,bool))); connect(d->model, SIGNAL(createdItem(int,QQuickItem*)), this, SLOT(createdItem(int,QQuickItem*))); connect(d->model, SIGNAL(initItem(int,QQuickItem*)), this, SLOT(initItem(int,QQuickItem*))); // connect(d->model, SIGNAL(destroyingItem(QQuickItem*)), this, SLOT(destroyingItem(QQuickItem*))); @@ -235,7 +235,7 @@ void QQuickRepeater::setModel(const QVariant &model) \table \row - \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml index + \o \snippet doc/src/snippets/qml/repeaters/repeater.qml index \o \image repeater-index.png \endtable @@ -246,7 +246,7 @@ void QQuickRepeater::setModel(const QVariant &model) \table \row - \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml modeldata + \o \snippet doc/src/snippets/qml/repeaters/repeater.qml modeldata \o \image repeater-modeldata.png \endtable @@ -256,7 +256,7 @@ void QQuickRepeater::setModel(const QVariant &model) \sa {QML Data Models} */ -QDeclarativeComponent *QQuickRepeater::delegate() const +QQmlComponent *QQuickRepeater::delegate() const { Q_D(const QQuickRepeater); if (d->model) { @@ -267,7 +267,7 @@ QDeclarativeComponent *QQuickRepeater::delegate() const return 0; } -void QQuickRepeater::setDelegate(QDeclarativeComponent *delegate) +void QQuickRepeater::setDelegate(QQmlComponent *delegate) { Q_D(QQuickRepeater); if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model)) @@ -379,7 +379,7 @@ void QQuickRepeaterPrivate::createItems() break; } deletables[ii] = item; - QDeclarative_setParent_noEvent(item, q->parentItem()); + QQml_setParent_noEvent(item, q->parentItem()); item->setParentItem(q->parentItem()); if (ii > 0 && deletables.at(ii-1)) { item->stackAfter(deletables.at(ii-1)); @@ -408,11 +408,11 @@ void QQuickRepeater::createdItem(int, QQuickItem *) void QQuickRepeater::initItem(int, QQuickItem *item) { - QDeclarative_setParent_noEvent(item, parentItem()); + QQml_setParent_noEvent(item, parentItem()); item->setParentItem(parentItem()); } -void QQuickRepeater::modelUpdated(const QDeclarativeChangeSet &changeSet, bool reset) +void QQuickRepeater::modelUpdated(const QQuickChangeSet &changeSet, bool reset) { Q_D(QQuickRepeater); @@ -426,7 +426,7 @@ void QQuickRepeater::modelUpdated(const QDeclarativeChangeSet &changeSet, bool r int difference = 0; QHash<int, QVector<QPointer<QQuickItem> > > moved; - foreach (const QDeclarativeChangeSet::Remove &remove, changeSet.removes()) { + foreach (const QQuickChangeSet::Remove &remove, changeSet.removes()) { int index = qMin(remove.index, d->deletables.count()); int count = qMin(remove.index + remove.count, d->deletables.count()) - index; if (remove.isMove()) { @@ -447,7 +447,7 @@ void QQuickRepeater::modelUpdated(const QDeclarativeChangeSet &changeSet, bool r } d->createFrom = -1; - foreach (const QDeclarativeChangeSet::Insert &insert, changeSet.inserts()) { + foreach (const QQuickChangeSet::Insert &insert, changeSet.inserts()) { int index = qMin(insert.index, d->deletables.count()); if (insert.isMove()) { QVector<QPointer<QQuickItem> > items = moved.value(insert.moveId); diff --git a/src/quick/items/qquickrepeater_p.h b/src/quick/items/qquickrepeater_p.h index f23b1a3034..c67b065def 100644 --- a/src/quick/items/qquickrepeater_p.h +++ b/src/quick/items/qquickrepeater_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,7 +48,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeChangeSet; +class QQuickChangeSet; class QQuickRepeaterPrivate; class Q_AUTOTEST_EXPORT QQuickRepeater : public QQuickItem @@ -56,7 +56,7 @@ class Q_AUTOTEST_EXPORT QQuickRepeater : public QQuickItem Q_OBJECT Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) - Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) Q_CLASSINFO("DefaultProperty", "delegate") @@ -67,8 +67,8 @@ public: QVariant model() const; void setModel(const QVariant &); - QDeclarativeComponent *delegate() const; - void setDelegate(QDeclarativeComponent *); + QQmlComponent *delegate() const; + void setDelegate(QQmlComponent *); int count() const; @@ -93,7 +93,7 @@ protected: private Q_SLOTS: void createdItem(int index, QQuickItem *item); void initItem(int, QQuickItem *item); - void modelUpdated(const QDeclarativeChangeSet &changeSet, bool reset); + void modelUpdated(const QQuickChangeSet &changeSet, bool reset); private: Q_DISABLE_COPY(QQuickRepeater) diff --git a/src/quick/items/qquickrepeater_p_p.h b/src/quick/items/qquickrepeater_p_p.h index 761e00c7b0..88e0c94218 100644 --- a/src/quick/items/qquickrepeater_p_p.h +++ b/src/quick/items/qquickrepeater_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE -class QDeclarativeContext; +class QQmlContext; class QQuickVisualModel; class QQuickRepeaterPrivate : public QQuickItemPrivate { diff --git a/src/quick/items/qquickscalegrid.cpp b/src/quick/items/qquickscalegrid.cpp index c9b1d3eba7..de10d8de47 100644 --- a/src/quick/items/qquickscalegrid.cpp +++ b/src/quick/items/qquickscalegrid.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -41,7 +41,7 @@ #include "qquickscalegrid_p_p.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/items/qquickscalegrid_p_p.h b/src/quick/items/qquickscalegrid_p_p.h index 9d02b6afb3..ae5627a48e 100644 --- a/src/quick/items/qquickscalegrid_p_p.h +++ b/src/quick/items/qquickscalegrid_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,10 +44,10 @@ #include "qquickborderimage_p.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include <QtCore/qobject.h> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> #include <private/qtquickglobal_p.h> QT_BEGIN_HEADER diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index 3dfeb90ee0..a00df4600d 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h index 7e2c389d6c..1a501f2f0f 100644 --- a/src/quick/items/qquickscreen_p.h +++ b/src/quick/items/qquickscreen_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,10 +42,10 @@ #ifndef QQUICKSCREEN_P_H #define QQUICKSCREEN_P_H -#include <qdeclarative.h> +#include <qqml.h> #include <QRect> #include <QSize> -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlglobal_p.h> QT_BEGIN_HEADER diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index d90d8761c8..3024c31d51 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h index 2217cbc827..4475c22b28 100644 --- a/src/quick/items/qquickshadereffect_p.h +++ b/src/quick/items/qquickshadereffect_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickshadereffectmesh.cpp b/src/quick/items/qquickshadereffectmesh.cpp index 8a43fb55f0..eff5910a09 100644 --- a/src/quick/items/qquickshadereffectmesh.cpp +++ b/src/quick/items/qquickshadereffectmesh.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickshadereffectmesh_p.h b/src/quick/items/qquickshadereffectmesh_p.h index 2e57d7db4c..0d8f5a24d0 100644 --- a/src/quick/items/qquickshadereffectmesh_p.h +++ b/src/quick/items/qquickshadereffectmesh_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativeparserstatus.h" +#include "qqmlparserstatus.h" #include <QtQuick/qtquickglobal.h> #include <QtGui/qcolor.h> diff --git a/src/quick/items/qquickshadereffectnode.cpp b/src/quick/items/qquickshadereffectnode.cpp index c809c70612..ae61ad940d 100644 --- a/src/quick/items/qquickshadereffectnode.cpp +++ b/src/quick/items/qquickshadereffectnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickshadereffectnode_p.h b/src/quick/items/qquickshadereffectnode_p.h index 295ac61d94..fc47f626e1 100644 --- a/src/quick/items/qquickshadereffectnode_p.h +++ b/src/quick/items/qquickshadereffectnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index 54590292c5..708d75d137 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h index 55d72c18d9..793e89cd69 100644 --- a/src/quick/items/qquickshadereffectsource_p.h +++ b/src/quick/items/qquickshadereffectsource_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquicksprite.cpp b/src/quick/items/qquicksprite.cpp index 4de7880916..817a6b411a 100644 --- a/src/quick/items/qquicksprite.cpp +++ b/src/quick/items/qquicksprite.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qquicksprite_p.h" -#include <qdeclarative.h> +#include <qqml.h> #include <QDebug> QT_BEGIN_NAMESPACE diff --git a/src/quick/items/qquicksprite_p.h b/src/quick/items/qquicksprite_p.h index 4c5e5ff58e..7c5c20bb50 100644 --- a/src/quick/items/qquicksprite_p.h +++ b/src/quick/items/qquicksprite_p.h @@ -45,8 +45,8 @@ #include <QObject> #include <QUrl> #include <QVariantMap> -#include <QDeclarativeListProperty> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QQmlListProperty> +#include <QtQuick/private/qquickpixmapcache_p.h> #include "qquickspriteengine_p.h" QT_BEGIN_HEADER @@ -298,7 +298,7 @@ private: int m_frameDuration; int m_frameDurationVariation; bool m_frameSync; - QDeclarativePixmap m_pix; + QQuickPixmap m_pix; }; QT_END_NAMESPACE diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp index c19a5e65c9..5a78472b45 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -41,8 +41,8 @@ #include "qquickspriteengine_p.h" #include "qquicksprite_p.h" -#include <qdeclarativeinfo.h> -#include <qdeclarative.h> +#include <qqmlinfo.h> +#include <qqml.h> #include <QDebug> #include <QPainter> #include <QSet> @@ -307,27 +307,27 @@ void QQuickStochasticEngine::setGoal(int state, int sprite, bool jump) return; } -QDeclarativePixmap::Status QQuickSpriteEngine::status()//Composed status of all Sprites +QQuickPixmap::Status QQuickSpriteEngine::status()//Composed status of all Sprites { if (!m_startedImageAssembly) - return QDeclarativePixmap::Null; + return QQuickPixmap::Null; int null, loading, ready; null = loading = ready = 0; foreach (QQuickSprite* s, m_sprites) { switch (s->m_pix.status()) { - case QDeclarativePixmap::Null : null++; break; - case QDeclarativePixmap::Loading : loading++; break; - case QDeclarativePixmap::Error : return QDeclarativePixmap::Error; - case QDeclarativePixmap::Ready : ready++; break; + case QQuickPixmap::Null : null++; break; + case QQuickPixmap::Loading : loading++; break; + case QQuickPixmap::Error : return QQuickPixmap::Error; + case QQuickPixmap::Ready : ready++; break; } } if (null) - return QDeclarativePixmap::Null; + return QQuickPixmap::Null; if (loading) - return QDeclarativePixmap::Loading; + return QQuickPixmap::Loading; if (ready) - return QDeclarativePixmap::Ready; - return QDeclarativePixmap::Null; + return QQuickPixmap::Ready; + return QQuickPixmap::Null; } void QQuickSpriteEngine::startAssemblingImage() @@ -348,13 +348,13 @@ void QQuickSpriteEngine::startAssemblingImage() QImage QQuickSpriteEngine::assembledImage() { - QDeclarativePixmap::Status stat = status(); - if (stat == QDeclarativePixmap::Error) + QQuickPixmap::Status stat = status(); + if (stat == QQuickPixmap::Error) foreach (QQuickSprite* s, m_sprites) if (s->m_pix.isError()) qmlInfo(s) << s->m_pix.error(); - if (stat != QDeclarativePixmap::Ready) + if (stat != QQuickPixmap::Ready) return QImage(); int h = 0; diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h index 500d526da5..751b75f231 100644 --- a/src/quick/items/qquickspriteengine_p.h +++ b/src/quick/items/qquickspriteengine_p.h @@ -47,10 +47,10 @@ #include <QTimer> #include <QTime> #include <QList> -#include <QDeclarativeListProperty> +#include <QQmlListProperty> #include <QImage> #include <QPair> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> QT_BEGIN_HEADER @@ -178,15 +178,15 @@ class Q_AUTOTEST_EXPORT QQuickStochasticEngine : public QObject Q_OBJECT //TODO: Optimize single state case? Q_PROPERTY(QString globalGoal READ globalGoal WRITE setGlobalGoal NOTIFY globalGoalChanged) - Q_PROPERTY(QDeclarativeListProperty<QQuickStochasticState> states READ states) + Q_PROPERTY(QQmlListProperty<QQuickStochasticState> states READ states) public: explicit QQuickStochasticEngine(QObject *parent = 0); QQuickStochasticEngine(QList<QQuickStochasticState*> states, QObject *parent=0); ~QQuickStochasticEngine(); - QDeclarativeListProperty<QQuickStochasticState> states() + QQmlListProperty<QQuickStochasticState> states() { - return QDeclarativeListProperty<QQuickStochasticState>(this, m_states); + return QQmlListProperty<QQuickStochasticState>(this, m_states); } QString globalGoal() const @@ -255,14 +255,14 @@ protected: class QQuickSpriteEngine : public QQuickStochasticEngine { Q_OBJECT - Q_PROPERTY(QDeclarativeListProperty<QQuickSprite> sprites READ sprites) + Q_PROPERTY(QQmlListProperty<QQuickSprite> sprites READ sprites) public: explicit QQuickSpriteEngine(QObject *parent = 0); QQuickSpriteEngine(QList<QQuickSprite*> sprites, QObject *parent=0); ~QQuickSpriteEngine(); - QDeclarativeListProperty<QQuickSprite> sprites() + QQmlListProperty<QQuickSprite> sprites() { - return QDeclarativeListProperty<QQuickSprite>(this, m_sprites); + return QQmlListProperty<QQuickSprite>(this, m_sprites); } QQuickSprite* sprite(int sprite=0); @@ -280,12 +280,12 @@ public: virtual void restart(int index=0); virtual void advance(int index=0); - //Similar API to QDeclarativePixmap for async loading convenience - bool isNull() { return status() == QDeclarativePixmap::Null; } - bool isReady() { return status() == QDeclarativePixmap::Ready; } - bool isLoading() { return status() == QDeclarativePixmap::Loading; } - bool isError() { return status() == QDeclarativePixmap::Error; } - QDeclarativePixmap::Status status();//Composed status of all Sprites + //Similar API to QQuickPixmap for async loading convenience + bool isNull() { return status() == QQuickPixmap::Null; } + bool isReady() { return status() == QQuickPixmap::Ready; } + bool isLoading() { return status() == QQuickPixmap::Loading; } + bool isError() { return status() == QQuickPixmap::Error; } + QQuickPixmap::Status status();//Composed status of all Sprites void startAssemblingImage(); QImage assembledImage(); @@ -296,24 +296,24 @@ private: }; //Common use is to have your own list property which is transparently an engine -inline void spriteAppend(QDeclarativeListProperty<QQuickSprite> *p, QQuickSprite* s) +inline void spriteAppend(QQmlListProperty<QQuickSprite> *p, QQuickSprite* s) { reinterpret_cast<QList<QQuickSprite *> *>(p->data)->append(s); p->object->metaObject()->invokeMethod(p->object, "createEngine"); } -inline QQuickSprite* spriteAt(QDeclarativeListProperty<QQuickSprite> *p, int idx) +inline QQuickSprite* spriteAt(QQmlListProperty<QQuickSprite> *p, int idx) { return reinterpret_cast<QList<QQuickSprite *> *>(p->data)->at(idx); } -inline void spriteClear(QDeclarativeListProperty<QQuickSprite> *p) +inline void spriteClear(QQmlListProperty<QQuickSprite> *p) { reinterpret_cast<QList<QQuickSprite *> *>(p->data)->clear(); p->object->metaObject()->invokeMethod(p->object, "createEngine"); } -inline int spriteCount(QDeclarativeListProperty<QQuickSprite> *p) +inline int spriteCount(QQmlListProperty<QQuickSprite> *p) { return reinterpret_cast<QList<QQuickSprite *> *>(p->data)->count(); } diff --git a/src/quick/items/qquickspriteimage.cpp b/src/quick/items/qquickspriteimage.cpp index 1b3b57710a..6edb3ad8c3 100644 --- a/src/quick/items/qquickspriteimage.cpp +++ b/src/quick/items/qquickspriteimage.cpp @@ -49,7 +49,7 @@ #include <QtQuick/qsgtexturematerial.h> #include <QtQuick/qsgtexture.h> #include <QtQuick/qquickcanvas.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QFile> #include <cmath> #include <qmath.h> @@ -294,9 +294,9 @@ void QQuickSpriteImage::setGoalSprite(const QString &sprite) } } -QDeclarativeListProperty<QQuickSprite> QQuickSpriteImage::sprites() +QQmlListProperty<QQuickSprite> QQuickSpriteImage::sprites() { - return QDeclarativeListProperty<QQuickSprite>(this, &m_sprites, spriteAppend, spriteCount, spriteAt, spriteClear); + return QQmlListProperty<QQuickSprite>(this, &m_sprites, spriteAppend, spriteCount, spriteAt, spriteClear); } void QQuickSpriteImage::createEngine() @@ -327,11 +327,11 @@ QSGGeometryNode* QQuickSpriteImage::buildNode() if (!m_spriteEngine) { qmlInfo(this) << "No sprite engine..."; return 0; - } else if (m_spriteEngine->status() == QDeclarativePixmap::Null) { + } else if (m_spriteEngine->status() == QQuickPixmap::Null) { m_spriteEngine->startAssemblingImage(); update();//Schedule another update, where we will check again return 0; - } else if (m_spriteEngine->status() == QDeclarativePixmap::Loading) { + } else if (m_spriteEngine->status() == QQuickPixmap::Loading) { update();//Schedule another update, where we will check again return 0; } diff --git a/src/quick/items/qquickspriteimage_p.h b/src/quick/items/qquickspriteimage_p.h index 8017263bb1..1574afcb75 100644 --- a/src/quick/items/qquickspriteimage_p.h +++ b/src/quick/items/qquickspriteimage_p.h @@ -62,13 +62,13 @@ class Q_AUTOTEST_EXPORT QQuickSpriteImage : public QQuickItem Q_PROPERTY(QString goalSprite READ goalSprite WRITE setGoalSprite NOTIFY goalSpriteChanged) Q_PROPERTY(QString currentSprite READ currentSprite NOTIFY currentSpriteChanged) //###try to share similar spriteEngines for less overhead? - Q_PROPERTY(QDeclarativeListProperty<QQuickSprite> sprites READ sprites) + Q_PROPERTY(QQmlListProperty<QQuickSprite> sprites READ sprites) Q_CLASSINFO("DefaultProperty", "sprites") public: explicit QQuickSpriteImage(QQuickItem *parent = 0); - QDeclarativeListProperty<QQuickSprite> sprites(); + QQmlListProperty<QQuickSprite> sprites(); bool running() const { diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index c4dd0fd146..037a48ceed 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,14 +42,14 @@ #include "qquickstateoperations_p.h" #include "qquickitem_p.h" -#include <private/qdeclarativestate_p_p.h> +#include <private/qquickstate_p_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtCore/qmath.h> QT_BEGIN_NAMESPACE -class QQuickParentChangePrivate : public QDeclarativeStateOperationPrivate +class QQuickParentChangePrivate : public QQuickStateOperationPrivate { Q_DECLARE_PUBLIC(QQuickParentChange) public: @@ -57,18 +57,18 @@ public: rewindParent(0), rewindStackBefore(0) {} QQuickItem *target; - QDeclarativeGuard<QQuickItem> parent; - QDeclarativeGuard<QQuickItem> origParent; - QDeclarativeGuard<QQuickItem> origStackBefore; + QQmlGuard<QQuickItem> parent; + QQmlGuard<QQuickItem> origParent; + QQmlGuard<QQuickItem> origStackBefore; QQuickItem *rewindParent; QQuickItem *rewindStackBefore; - QDeclarativeNullableValue<QDeclarativeScriptString> xString; - QDeclarativeNullableValue<QDeclarativeScriptString> yString; - QDeclarativeNullableValue<QDeclarativeScriptString> widthString; - QDeclarativeNullableValue<QDeclarativeScriptString> heightString; - QDeclarativeNullableValue<QDeclarativeScriptString> scaleString; - QDeclarativeNullableValue<QDeclarativeScriptString> rotationString; + QQmlNullableValue<QQmlScriptString> xString; + QQmlNullableValue<QQmlScriptString> yString; + QQmlNullableValue<QQmlScriptString> widthString; + QQmlNullableValue<QQmlScriptString> heightString; + QQmlNullableValue<QQmlScriptString> scaleString; + QQmlNullableValue<QQmlScriptString> rotationString; void doChange(QQuickItem *targetParent, QQuickItem *stackBefore = 0); }; @@ -148,7 +148,7 @@ void QQuickParentChangePrivate::doChange(QQuickItem *targetParent, QQuickItem *s } QQuickParentChange::QQuickParentChange(QObject *parent) - : QDeclarativeStateOperation(*(new QQuickParentChangePrivate), parent) + : QQuickStateOperation(*(new QQuickParentChangePrivate), parent) { } @@ -156,13 +156,13 @@ QQuickParentChange::~QQuickParentChange() { } -QDeclarativeScriptString QQuickParentChange::x() const +QQmlScriptString QQuickParentChange::x() const { Q_D(const QQuickParentChange); return d->xString.value; } -void QQuickParentChange::setX(QDeclarativeScriptString x) +void QQuickParentChange::setX(QQmlScriptString x) { Q_D(QQuickParentChange); d->xString = x; @@ -174,13 +174,13 @@ bool QQuickParentChange::xIsSet() const return d->xString.isValid(); } -QDeclarativeScriptString QQuickParentChange::y() const +QQmlScriptString QQuickParentChange::y() const { Q_D(const QQuickParentChange); return d->yString.value; } -void QQuickParentChange::setY(QDeclarativeScriptString y) +void QQuickParentChange::setY(QQmlScriptString y) { Q_D(QQuickParentChange); d->yString = y; @@ -192,13 +192,13 @@ bool QQuickParentChange::yIsSet() const return d->yString.isValid(); } -QDeclarativeScriptString QQuickParentChange::width() const +QQmlScriptString QQuickParentChange::width() const { Q_D(const QQuickParentChange); return d->widthString.value; } -void QQuickParentChange::setWidth(QDeclarativeScriptString width) +void QQuickParentChange::setWidth(QQmlScriptString width) { Q_D(QQuickParentChange); d->widthString = width; @@ -210,13 +210,13 @@ bool QQuickParentChange::widthIsSet() const return d->widthString.isValid(); } -QDeclarativeScriptString QQuickParentChange::height() const +QQmlScriptString QQuickParentChange::height() const { Q_D(const QQuickParentChange); return d->heightString.value; } -void QQuickParentChange::setHeight(QDeclarativeScriptString height) +void QQuickParentChange::setHeight(QQmlScriptString height) { Q_D(QQuickParentChange); d->heightString = height; @@ -228,13 +228,13 @@ bool QQuickParentChange::heightIsSet() const return d->heightString.isValid(); } -QDeclarativeScriptString QQuickParentChange::scale() const +QQmlScriptString QQuickParentChange::scale() const { Q_D(const QQuickParentChange); return d->scaleString.value; } -void QQuickParentChange::setScale(QDeclarativeScriptString scale) +void QQuickParentChange::setScale(QQmlScriptString scale) { Q_D(QQuickParentChange); d->scaleString = scale; @@ -246,13 +246,13 @@ bool QQuickParentChange::scaleIsSet() const return d->scaleString.isValid(); } -QDeclarativeScriptString QQuickParentChange::rotation() const +QQmlScriptString QQuickParentChange::rotation() const { Q_D(const QQuickParentChange); return d->rotationString.value; } -void QQuickParentChange::setRotation(QDeclarativeScriptString rotation) +void QQuickParentChange::setRotation(QQmlScriptString rotation) { Q_D(QQuickParentChange); d->rotationString = rotation; @@ -294,7 +294,7 @@ void QQuickParentChange::setParent(QQuickItem *parent) d->parent = parent; } -QDeclarativeStateOperation::ActionList QQuickParentChange::actions() +QQuickStateOperation::ActionList QQuickParentChange::actions() { Q_D(QQuickParentChange); if (!d->target || !d->parent) @@ -302,7 +302,7 @@ QDeclarativeStateOperation::ActionList QQuickParentChange::actions() ActionList actions; - QDeclarativeAction a; + QQuickAction a; a.event = this; actions << a; @@ -311,13 +311,13 @@ QDeclarativeStateOperation::ActionList QQuickParentChange::actions() QString script = d->xString.value.script(); qreal x = script.toFloat(&ok); if (ok) { - QDeclarativeAction xa(d->target, QLatin1String("x"), x); + QQuickAction xa(d->target, QLatin1String("x"), x); actions << xa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - QDeclarativeProperty property(d->target, QLatin1String("x")); + QQmlBinding *newBinding = new QQmlBinding(script, d->target, qmlContext(this)); + QQmlProperty property(d->target, QLatin1String("x")); newBinding->setTarget(property); - QDeclarativeAction xa; + QQuickAction xa; xa.property = property; xa.toBinding = newBinding; xa.fromValue = xa.property.read(); @@ -331,13 +331,13 @@ QDeclarativeStateOperation::ActionList QQuickParentChange::actions() QString script = d->yString.value.script(); qreal y = script.toFloat(&ok); if (ok) { - QDeclarativeAction ya(d->target, QLatin1String("y"), y); + QQuickAction ya(d->target, QLatin1String("y"), y); actions << ya; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - QDeclarativeProperty property(d->target, QLatin1String("y")); + QQmlBinding *newBinding = new QQmlBinding(script, d->target, qmlContext(this)); + QQmlProperty property(d->target, QLatin1String("y")); newBinding->setTarget(property); - QDeclarativeAction ya; + QQuickAction ya; ya.property = property; ya.toBinding = newBinding; ya.fromValue = ya.property.read(); @@ -351,13 +351,13 @@ QDeclarativeStateOperation::ActionList QQuickParentChange::actions() QString script = d->scaleString.value.script(); qreal scale = script.toFloat(&ok); if (ok) { - QDeclarativeAction sa(d->target, QLatin1String("scale"), scale); + QQuickAction sa(d->target, QLatin1String("scale"), scale); actions << sa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - QDeclarativeProperty property(d->target, QLatin1String("scale")); + QQmlBinding *newBinding = new QQmlBinding(script, d->target, qmlContext(this)); + QQmlProperty property(d->target, QLatin1String("scale")); newBinding->setTarget(property); - QDeclarativeAction sa; + QQuickAction sa; sa.property = property; sa.toBinding = newBinding; sa.fromValue = sa.property.read(); @@ -371,13 +371,13 @@ QDeclarativeStateOperation::ActionList QQuickParentChange::actions() QString script = d->rotationString.value.script(); qreal rotation = script.toFloat(&ok); if (ok) { - QDeclarativeAction ra(d->target, QLatin1String("rotation"), rotation); + QQuickAction ra(d->target, QLatin1String("rotation"), rotation); actions << ra; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - QDeclarativeProperty property(d->target, QLatin1String("rotation")); + QQmlBinding *newBinding = new QQmlBinding(script, d->target, qmlContext(this)); + QQmlProperty property(d->target, QLatin1String("rotation")); newBinding->setTarget(property); - QDeclarativeAction ra; + QQuickAction ra; ra.property = property; ra.toBinding = newBinding; ra.fromValue = ra.property.read(); @@ -391,13 +391,13 @@ QDeclarativeStateOperation::ActionList QQuickParentChange::actions() QString script = d->widthString.value.script(); qreal width = script.toFloat(&ok); if (ok) { - QDeclarativeAction wa(d->target, QLatin1String("width"), width); + QQuickAction wa(d->target, QLatin1String("width"), width); actions << wa; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - QDeclarativeProperty property(d->target, QLatin1String("width")); + QQmlBinding *newBinding = new QQmlBinding(script, d->target, qmlContext(this)); + QQmlProperty property(d->target, QLatin1String("width")); newBinding->setTarget(property); - QDeclarativeAction wa; + QQuickAction wa; wa.property = property; wa.toBinding = newBinding; wa.fromValue = wa.property.read(); @@ -411,13 +411,13 @@ QDeclarativeStateOperation::ActionList QQuickParentChange::actions() QString script = d->heightString.value.script(); qreal height = script.toFloat(&ok); if (ok) { - QDeclarativeAction ha(d->target, QLatin1String("height"), height); + QQuickAction ha(d->target, QLatin1String("height"), height); actions << ha; } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(script, d->target, qmlContext(this)); - QDeclarativeProperty property(d->target, QLatin1String("height")); + QQmlBinding *newBinding = new QQmlBinding(script, d->target, qmlContext(this)); + QQmlProperty property(d->target, QLatin1String("height")); newBinding->setTarget(property); - QDeclarativeAction ha; + QQuickAction ha; ha.property = property; ha.toBinding = newBinding; ha.fromValue = ha.property.read(); @@ -437,7 +437,7 @@ void QQuickParentChange::saveOriginals() d->origStackBefore = d->rewindStackBefore; } -/*void QQuickParentChange::copyOriginals(QDeclarativeActionEvent *other) +/*void QQuickParentChange::copyOriginals(QQuickActionEvent *other) { Q_D(QQuickParentChange); QQuickParentChange *pc = static_cast<QQuickParentChange*>(other); @@ -465,12 +465,12 @@ void QQuickParentChange::reverse(Reason) d->doChange(d->origParent, d->origStackBefore); } -QDeclarativeActionEvent::EventType QQuickParentChange::type() const +QQuickActionEvent::EventType QQuickParentChange::type() const { return ParentChange; } -bool QQuickParentChange::override(QDeclarativeActionEvent*other) +bool QQuickParentChange::override(QQuickActionEvent*other) { Q_D(QQuickParentChange); if (other->type() != ParentChange) @@ -527,13 +527,13 @@ public: QQuickItem *fill; QQuickItem *centerIn; - QDeclarativeScriptString leftScript; - QDeclarativeScriptString rightScript; - QDeclarativeScriptString topScript; - QDeclarativeScriptString bottomScript; - QDeclarativeScriptString hCenterScript; - QDeclarativeScriptString vCenterScript; - QDeclarativeScriptString baselineScript; + QQmlScriptString leftScript; + QQmlScriptString rightScript; + QQmlScriptString topScript; + QQmlScriptString bottomScript; + QQmlScriptString hCenterScript; + QQmlScriptString vCenterScript; + QQmlScriptString baselineScript; /*qreal leftMargin; qreal rightMargin; @@ -554,13 +554,13 @@ QQuickAnchorSet::~QQuickAnchorSet() { } -QDeclarativeScriptString QQuickAnchorSet::top() const +QQmlScriptString QQuickAnchorSet::top() const { Q_D(const QQuickAnchorSet); return d->topScript; } -void QQuickAnchorSet::setTop(const QDeclarativeScriptString &edge) +void QQuickAnchorSet::setTop(const QQmlScriptString &edge) { Q_D(QQuickAnchorSet); d->usedAnchors |= QQuickAnchors::TopAnchor; @@ -576,13 +576,13 @@ void QQuickAnchorSet::resetTop() d->resetAnchors |= QQuickAnchors::TopAnchor; } -QDeclarativeScriptString QQuickAnchorSet::bottom() const +QQmlScriptString QQuickAnchorSet::bottom() const { Q_D(const QQuickAnchorSet); return d->bottomScript; } -void QQuickAnchorSet::setBottom(const QDeclarativeScriptString &edge) +void QQuickAnchorSet::setBottom(const QQmlScriptString &edge) { Q_D(QQuickAnchorSet); d->usedAnchors |= QQuickAnchors::BottomAnchor; @@ -598,13 +598,13 @@ void QQuickAnchorSet::resetBottom() d->resetAnchors |= QQuickAnchors::BottomAnchor; } -QDeclarativeScriptString QQuickAnchorSet::verticalCenter() const +QQmlScriptString QQuickAnchorSet::verticalCenter() const { Q_D(const QQuickAnchorSet); return d->vCenterScript; } -void QQuickAnchorSet::setVerticalCenter(const QDeclarativeScriptString &edge) +void QQuickAnchorSet::setVerticalCenter(const QQmlScriptString &edge) { Q_D(QQuickAnchorSet); d->usedAnchors |= QQuickAnchors::VCenterAnchor; @@ -620,13 +620,13 @@ void QQuickAnchorSet::resetVerticalCenter() d->resetAnchors |= QQuickAnchors::VCenterAnchor; } -QDeclarativeScriptString QQuickAnchorSet::baseline() const +QQmlScriptString QQuickAnchorSet::baseline() const { Q_D(const QQuickAnchorSet); return d->baselineScript; } -void QQuickAnchorSet::setBaseline(const QDeclarativeScriptString &edge) +void QQuickAnchorSet::setBaseline(const QQmlScriptString &edge) { Q_D(QQuickAnchorSet); d->usedAnchors |= QQuickAnchors::BaselineAnchor; @@ -642,13 +642,13 @@ void QQuickAnchorSet::resetBaseline() d->resetAnchors |= QQuickAnchors::BaselineAnchor; } -QDeclarativeScriptString QQuickAnchorSet::left() const +QQmlScriptString QQuickAnchorSet::left() const { Q_D(const QQuickAnchorSet); return d->leftScript; } -void QQuickAnchorSet::setLeft(const QDeclarativeScriptString &edge) +void QQuickAnchorSet::setLeft(const QQmlScriptString &edge) { Q_D(QQuickAnchorSet); d->usedAnchors |= QQuickAnchors::LeftAnchor; @@ -664,13 +664,13 @@ void QQuickAnchorSet::resetLeft() d->resetAnchors |= QQuickAnchors::LeftAnchor; } -QDeclarativeScriptString QQuickAnchorSet::right() const +QQmlScriptString QQuickAnchorSet::right() const { Q_D(const QQuickAnchorSet); return d->rightScript; } -void QQuickAnchorSet::setRight(const QDeclarativeScriptString &edge) +void QQuickAnchorSet::setRight(const QQmlScriptString &edge) { Q_D(QQuickAnchorSet); d->usedAnchors |= QQuickAnchors::RightAnchor; @@ -686,13 +686,13 @@ void QQuickAnchorSet::resetRight() d->resetAnchors |= QQuickAnchors::RightAnchor; } -QDeclarativeScriptString QQuickAnchorSet::horizontalCenter() const +QQmlScriptString QQuickAnchorSet::horizontalCenter() const { Q_D(const QQuickAnchorSet); return d->hCenterScript; } -void QQuickAnchorSet::setHorizontalCenter(const QDeclarativeScriptString &edge) +void QQuickAnchorSet::setHorizontalCenter(const QQmlScriptString &edge) { Q_D(QQuickAnchorSet); d->usedAnchors |= QQuickAnchors::HCenterAnchor; @@ -743,7 +743,7 @@ void QQuickAnchorSet::resetCenterIn() } -class QQuickAnchorChangesPrivate : public QDeclarativeStateOperationPrivate +class QQuickAnchorChangesPrivate : public QQuickStateOperationPrivate { public: QQuickAnchorChangesPrivate() @@ -761,21 +761,21 @@ public: QQuickItem *target; QQuickAnchorSet *anchorSet; - QDeclarativeBinding *leftBinding; - QDeclarativeBinding *rightBinding; - QDeclarativeBinding *hCenterBinding; - QDeclarativeBinding *topBinding; - QDeclarativeBinding *bottomBinding; - QDeclarativeBinding *vCenterBinding; - QDeclarativeBinding *baselineBinding; - - QDeclarativeAbstractBinding *origLeftBinding; - QDeclarativeAbstractBinding *origRightBinding; - QDeclarativeAbstractBinding *origHCenterBinding; - QDeclarativeAbstractBinding *origTopBinding; - QDeclarativeAbstractBinding *origBottomBinding; - QDeclarativeAbstractBinding *origVCenterBinding; - QDeclarativeAbstractBinding *origBaselineBinding; + QQmlBinding *leftBinding; + QQmlBinding *rightBinding; + QQmlBinding *hCenterBinding; + QQmlBinding *topBinding; + QQmlBinding *bottomBinding; + QQmlBinding *vCenterBinding; + QQmlBinding *baselineBinding; + + QQmlAbstractBinding *origLeftBinding; + QQmlAbstractBinding *origRightBinding; + QQmlAbstractBinding *origHCenterBinding; + QQmlAbstractBinding *origTopBinding; + QQmlAbstractBinding *origBottomBinding; + QQmlAbstractBinding *origVCenterBinding; + QQmlAbstractBinding *origBaselineBinding; QQuickAnchorLine rewindLeft; QQuickAnchorLine rewindRight; @@ -808,24 +808,24 @@ public: bool applyOrigVCenter; bool applyOrigBaseline; - QDeclarativeNullableValue<qreal> origWidth; - QDeclarativeNullableValue<qreal> origHeight; + QQmlNullableValue<qreal> origWidth; + QQmlNullableValue<qreal> origHeight; qreal origX; qreal origY; - QList<QDeclarativeAbstractBinding*> oldBindings; + QList<QQmlAbstractBinding*> oldBindings; - QDeclarativeProperty leftProp; - QDeclarativeProperty rightProp; - QDeclarativeProperty hCenterProp; - QDeclarativeProperty topProp; - QDeclarativeProperty bottomProp; - QDeclarativeProperty vCenterProp; - QDeclarativeProperty baselineProp; + QQmlProperty leftProp; + QQmlProperty rightProp; + QQmlProperty hCenterProp; + QQmlProperty topProp; + QQmlProperty bottomProp; + QQmlProperty vCenterProp; + QQmlProperty baselineProp; }; QQuickAnchorChanges::QQuickAnchorChanges(QObject *parent) - : QDeclarativeStateOperation(*(new QQuickAnchorChangesPrivate), parent) + : QQuickStateOperation(*(new QQuickAnchorChangesPrivate), parent) { } @@ -839,44 +839,44 @@ QQuickAnchorChanges::ActionList QQuickAnchorChanges::actions() d->leftBinding = d->rightBinding = d->hCenterBinding = d->topBinding = d->bottomBinding = d->vCenterBinding = d->baselineBinding = 0; - d->leftProp = QDeclarativeProperty(d->target, QLatin1String("anchors.left")); - d->rightProp = QDeclarativeProperty(d->target, QLatin1String("anchors.right")); - d->hCenterProp = QDeclarativeProperty(d->target, QLatin1String("anchors.horizontalCenter")); - d->topProp = QDeclarativeProperty(d->target, QLatin1String("anchors.top")); - d->bottomProp = QDeclarativeProperty(d->target, QLatin1String("anchors.bottom")); - d->vCenterProp = QDeclarativeProperty(d->target, QLatin1String("anchors.verticalCenter")); - d->baselineProp = QDeclarativeProperty(d->target, QLatin1String("anchors.baseline")); + d->leftProp = QQmlProperty(d->target, QLatin1String("anchors.left")); + d->rightProp = QQmlProperty(d->target, QLatin1String("anchors.right")); + d->hCenterProp = QQmlProperty(d->target, QLatin1String("anchors.horizontalCenter")); + d->topProp = QQmlProperty(d->target, QLatin1String("anchors.top")); + d->bottomProp = QQmlProperty(d->target, QLatin1String("anchors.bottom")); + d->vCenterProp = QQmlProperty(d->target, QLatin1String("anchors.verticalCenter")); + d->baselineProp = QQmlProperty(d->target, QLatin1String("anchors.baseline")); if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::LeftAnchor) { - d->leftBinding = new QDeclarativeBinding(d->anchorSet->d_func()->leftScript.script(), d->target, qmlContext(this)); + d->leftBinding = new QQmlBinding(d->anchorSet->d_func()->leftScript.script(), d->target, qmlContext(this)); d->leftBinding->setTarget(d->leftProp); } if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::RightAnchor) { - d->rightBinding = new QDeclarativeBinding(d->anchorSet->d_func()->rightScript.script(), d->target, qmlContext(this)); + d->rightBinding = new QQmlBinding(d->anchorSet->d_func()->rightScript.script(), d->target, qmlContext(this)); d->rightBinding->setTarget(d->rightProp); } if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::HCenterAnchor) { - d->hCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->hCenterScript.script(), d->target, qmlContext(this)); + d->hCenterBinding = new QQmlBinding(d->anchorSet->d_func()->hCenterScript.script(), d->target, qmlContext(this)); d->hCenterBinding->setTarget(d->hCenterProp); } if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::TopAnchor) { - d->topBinding = new QDeclarativeBinding(d->anchorSet->d_func()->topScript.script(), d->target, qmlContext(this)); + d->topBinding = new QQmlBinding(d->anchorSet->d_func()->topScript.script(), d->target, qmlContext(this)); d->topBinding->setTarget(d->topProp); } if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::BottomAnchor) { - d->bottomBinding = new QDeclarativeBinding(d->anchorSet->d_func()->bottomScript.script(), d->target, qmlContext(this)); + d->bottomBinding = new QQmlBinding(d->anchorSet->d_func()->bottomScript.script(), d->target, qmlContext(this)); d->bottomBinding->setTarget(d->bottomProp); } if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::VCenterAnchor) { - d->vCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->vCenterScript.script(), d->target, qmlContext(this)); + d->vCenterBinding = new QQmlBinding(d->anchorSet->d_func()->vCenterScript.script(), d->target, qmlContext(this)); d->vCenterBinding->setTarget(d->vCenterProp); } if (d->anchorSet->d_func()->usedAnchors & QQuickAnchors::BaselineAnchor) { - d->baselineBinding = new QDeclarativeBinding(d->anchorSet->d_func()->baselineScript.script(), d->target, qmlContext(this)); + d->baselineBinding = new QQmlBinding(d->anchorSet->d_func()->baselineScript.script(), d->target, qmlContext(this)); d->baselineBinding->setTarget(d->baselineProp); } - QDeclarativeAction a; + QQuickAction a; a.event = this; return ActionList() << a; } @@ -910,43 +910,43 @@ void QQuickAnchorChanges::execute(Reason reason) if (d->applyOrigLeft) { if (!d->origLeftBinding) targetPrivate->anchors()->resetLeft(); - QDeclarativePropertyPrivate::setBinding(d->leftProp, d->origLeftBinding); + QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding); } if (d->applyOrigRight) { if (!d->origRightBinding) targetPrivate->anchors()->resetRight(); - QDeclarativePropertyPrivate::setBinding(d->rightProp, d->origRightBinding); + QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding); } if (d->applyOrigHCenter) { if (!d->origHCenterBinding) targetPrivate->anchors()->resetHorizontalCenter(); - QDeclarativePropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding); + QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding); } if (d->applyOrigTop) { if (!d->origTopBinding) targetPrivate->anchors()->resetTop(); - QDeclarativePropertyPrivate::setBinding(d->topProp, d->origTopBinding); + QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding); } if (d->applyOrigBottom) { if (!d->origBottomBinding) targetPrivate->anchors()->resetBottom(); - QDeclarativePropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding); + QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding); } if (d->applyOrigVCenter) { if (!d->origVCenterBinding) targetPrivate->anchors()->resetVerticalCenter(); - QDeclarativePropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding); + QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding); } if (d->applyOrigBaseline) { if (!d->origBaselineBinding) targetPrivate->anchors()->resetBaseline(); - QDeclarativePropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding); + QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding); } //destroy old bindings if (reason == ActualChange) { for (int i = 0; i < d->oldBindings.size(); ++i) { - QDeclarativeAbstractBinding *binding = d->oldBindings.at(i); + QQmlAbstractBinding *binding = d->oldBindings.at(i); if (binding) binding->destroy(); } @@ -956,48 +956,48 @@ void QQuickAnchorChanges::execute(Reason reason) //reset any anchors that have been specified as "undefined" if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::LeftAnchor) { targetPrivate->anchors()->resetLeft(); - QDeclarativePropertyPrivate::setBinding(d->leftProp, 0); + QQmlPropertyPrivate::setBinding(d->leftProp, 0); } if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::RightAnchor) { targetPrivate->anchors()->resetRight(); - QDeclarativePropertyPrivate::setBinding(d->rightProp, 0); + QQmlPropertyPrivate::setBinding(d->rightProp, 0); } if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::HCenterAnchor) { targetPrivate->anchors()->resetHorizontalCenter(); - QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0); + QQmlPropertyPrivate::setBinding(d->hCenterProp, 0); } if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::TopAnchor) { targetPrivate->anchors()->resetTop(); - QDeclarativePropertyPrivate::setBinding(d->topProp, 0); + QQmlPropertyPrivate::setBinding(d->topProp, 0); } if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::BottomAnchor) { targetPrivate->anchors()->resetBottom(); - QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0); + QQmlPropertyPrivate::setBinding(d->bottomProp, 0); } if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::VCenterAnchor) { targetPrivate->anchors()->resetVerticalCenter(); - QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0); + QQmlPropertyPrivate::setBinding(d->vCenterProp, 0); } if (d->anchorSet->d_func()->resetAnchors & QQuickAnchors::BaselineAnchor) { targetPrivate->anchors()->resetBaseline(); - QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0); + QQmlPropertyPrivate::setBinding(d->baselineProp, 0); } //set any anchors that have been specified if (d->leftBinding) - QDeclarativePropertyPrivate::setBinding(d->leftBinding->property(), d->leftBinding); + QQmlPropertyPrivate::setBinding(d->leftBinding->property(), d->leftBinding); if (d->rightBinding) - QDeclarativePropertyPrivate::setBinding(d->rightBinding->property(), d->rightBinding); + QQmlPropertyPrivate::setBinding(d->rightBinding->property(), d->rightBinding); if (d->hCenterBinding) - QDeclarativePropertyPrivate::setBinding(d->hCenterBinding->property(), d->hCenterBinding); + QQmlPropertyPrivate::setBinding(d->hCenterBinding->property(), d->hCenterBinding); if (d->topBinding) - QDeclarativePropertyPrivate::setBinding(d->topBinding->property(), d->topBinding); + QQmlPropertyPrivate::setBinding(d->topBinding->property(), d->topBinding); if (d->bottomBinding) - QDeclarativePropertyPrivate::setBinding(d->bottomBinding->property(), d->bottomBinding); + QQmlPropertyPrivate::setBinding(d->bottomBinding->property(), d->bottomBinding); if (d->vCenterBinding) - QDeclarativePropertyPrivate::setBinding(d->vCenterBinding->property(), d->vCenterBinding); + QQmlPropertyPrivate::setBinding(d->vCenterBinding->property(), d->vCenterBinding); if (d->baselineBinding) - QDeclarativePropertyPrivate::setBinding(d->baselineBinding->property(), d->baselineBinding); + QQmlPropertyPrivate::setBinding(d->baselineBinding->property(), d->baselineBinding); } bool QQuickAnchorChanges::isReversable() @@ -1015,49 +1015,49 @@ void QQuickAnchorChanges::reverse(Reason reason) //reset any anchors set by the state if (d->leftBinding) { targetPrivate->anchors()->resetLeft(); - QDeclarativePropertyPrivate::setBinding(d->leftBinding->property(), 0); + QQmlPropertyPrivate::setBinding(d->leftBinding->property(), 0); if (reason == ActualChange) { d->leftBinding->destroy(); d->leftBinding = 0; } } if (d->rightBinding) { targetPrivate->anchors()->resetRight(); - QDeclarativePropertyPrivate::setBinding(d->rightBinding->property(), 0); + QQmlPropertyPrivate::setBinding(d->rightBinding->property(), 0); if (reason == ActualChange) { d->rightBinding->destroy(); d->rightBinding = 0; } } if (d->hCenterBinding) { targetPrivate->anchors()->resetHorizontalCenter(); - QDeclarativePropertyPrivate::setBinding(d->hCenterBinding->property(), 0); + QQmlPropertyPrivate::setBinding(d->hCenterBinding->property(), 0); if (reason == ActualChange) { d->hCenterBinding->destroy(); d->hCenterBinding = 0; } } if (d->topBinding) { targetPrivate->anchors()->resetTop(); - QDeclarativePropertyPrivate::setBinding(d->topBinding->property(), 0); + QQmlPropertyPrivate::setBinding(d->topBinding->property(), 0); if (reason == ActualChange) { d->topBinding->destroy(); d->topBinding = 0; } } if (d->bottomBinding) { targetPrivate->anchors()->resetBottom(); - QDeclarativePropertyPrivate::setBinding(d->bottomBinding->property(), 0); + QQmlPropertyPrivate::setBinding(d->bottomBinding->property(), 0); if (reason == ActualChange) { d->bottomBinding->destroy(); d->bottomBinding = 0; } } if (d->vCenterBinding) { targetPrivate->anchors()->resetVerticalCenter(); - QDeclarativePropertyPrivate::setBinding(d->vCenterBinding->property(), 0); + QQmlPropertyPrivate::setBinding(d->vCenterBinding->property(), 0); if (reason == ActualChange) { d->vCenterBinding->destroy(); d->vCenterBinding = 0; } } if (d->baselineBinding) { targetPrivate->anchors()->resetBaseline(); - QDeclarativePropertyPrivate::setBinding(d->baselineBinding->property(), 0); + QQmlPropertyPrivate::setBinding(d->baselineBinding->property(), 0); if (reason == ActualChange) { d->baselineBinding->destroy(); d->baselineBinding = 0; } @@ -1065,19 +1065,19 @@ void QQuickAnchorChanges::reverse(Reason reason) //restore previous anchors if (d->origLeftBinding) - QDeclarativePropertyPrivate::setBinding(d->leftProp, d->origLeftBinding); + QQmlPropertyPrivate::setBinding(d->leftProp, d->origLeftBinding); if (d->origRightBinding) - QDeclarativePropertyPrivate::setBinding(d->rightProp, d->origRightBinding); + QQmlPropertyPrivate::setBinding(d->rightProp, d->origRightBinding); if (d->origHCenterBinding) - QDeclarativePropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding); + QQmlPropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding); if (d->origTopBinding) - QDeclarativePropertyPrivate::setBinding(d->topProp, d->origTopBinding); + QQmlPropertyPrivate::setBinding(d->topProp, d->origTopBinding); if (d->origBottomBinding) - QDeclarativePropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding); + QQmlPropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding); if (d->origVCenterBinding) - QDeclarativePropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding); + QQmlPropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding); if (d->origBaselineBinding) - QDeclarativePropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding); + QQmlPropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding); //restore any absolute geometry changed by the state's anchors QQuickAnchors::Anchors stateVAnchors = d->anchorSet->d_func()->usedAnchors & QQuickAnchors::Vertical_Mask; @@ -1116,39 +1116,39 @@ void QQuickAnchorChanges::reverse(Reason reason) d->target->setY(d->origY); } -QDeclarativeActionEvent::EventType QQuickAnchorChanges::type() const +QQuickActionEvent::EventType QQuickAnchorChanges::type() const { return AnchorChanges; } -QList<QDeclarativeAction> QQuickAnchorChanges::additionalActions() +QList<QQuickAction> QQuickAnchorChanges::additionalActions() { Q_D(QQuickAnchorChanges); - QList<QDeclarativeAction> extra; + QList<QQuickAction> extra; QQuickAnchors::Anchors combined = d->anchorSet->d_func()->usedAnchors | d->anchorSet->d_func()->resetAnchors; bool hChange = combined & QQuickAnchors::Horizontal_Mask; bool vChange = combined & QQuickAnchors::Vertical_Mask; if (d->target) { - QDeclarativeAction a; + QQuickAction a; if (hChange && d->fromX != d->toX) { - a.property = QDeclarativeProperty(d->target, QLatin1String("x")); + a.property = QQmlProperty(d->target, QLatin1String("x")); a.toValue = d->toX; extra << a; } if (vChange && d->fromY != d->toY) { - a.property = QDeclarativeProperty(d->target, QLatin1String("y")); + a.property = QQmlProperty(d->target, QLatin1String("y")); a.toValue = d->toY; extra << a; } if (hChange && d->fromWidth != d->toWidth) { - a.property = QDeclarativeProperty(d->target, QLatin1String("width")); + a.property = QQmlProperty(d->target, QLatin1String("width")); a.toValue = d->toWidth; extra << a; } if (vChange && d->fromHeight != d->toHeight) { - a.property = QDeclarativeProperty(d->target, QLatin1String("height")); + a.property = QQmlProperty(d->target, QLatin1String("height")); a.toValue = d->toHeight; extra << a; } @@ -1168,13 +1168,13 @@ void QQuickAnchorChanges::saveOriginals() if (!d->target) return; - d->origLeftBinding = QDeclarativePropertyPrivate::binding(d->leftProp); - d->origRightBinding = QDeclarativePropertyPrivate::binding(d->rightProp); - d->origHCenterBinding = QDeclarativePropertyPrivate::binding(d->hCenterProp); - d->origTopBinding = QDeclarativePropertyPrivate::binding(d->topProp); - d->origBottomBinding = QDeclarativePropertyPrivate::binding(d->bottomProp); - d->origVCenterBinding = QDeclarativePropertyPrivate::binding(d->vCenterProp); - d->origBaselineBinding = QDeclarativePropertyPrivate::binding(d->baselineProp); + d->origLeftBinding = QQmlPropertyPrivate::binding(d->leftProp); + d->origRightBinding = QQmlPropertyPrivate::binding(d->rightProp); + d->origHCenterBinding = QQmlPropertyPrivate::binding(d->hCenterProp); + d->origTopBinding = QQmlPropertyPrivate::binding(d->topProp); + d->origBottomBinding = QQmlPropertyPrivate::binding(d->bottomProp); + d->origVCenterBinding = QQmlPropertyPrivate::binding(d->vCenterProp); + d->origBaselineBinding = QQmlPropertyPrivate::binding(d->baselineProp); QQuickItemPrivate *targetPrivate = QQuickItemPrivate::get(d->target); if (targetPrivate->widthValid) @@ -1190,7 +1190,7 @@ void QQuickAnchorChanges::saveOriginals() saveCurrentValues(); } -void QQuickAnchorChanges::copyOriginals(QDeclarativeActionEvent *other) +void QQuickAnchorChanges::copyOriginals(QQuickActionEvent *other) { Q_D(QQuickAnchorChanges); QQuickAnchorChanges *ac = static_cast<QQuickAnchorChanges*>(other); @@ -1248,39 +1248,39 @@ void QQuickAnchorChanges::clearBindings() d->anchorSet->d_func()->usedAnchors; if (d->applyOrigLeft || (combined & QQuickAnchors::LeftAnchor)) { targetPrivate->anchors()->resetLeft(); - QDeclarativePropertyPrivate::setBinding(d->leftProp, 0); + QQmlPropertyPrivate::setBinding(d->leftProp, 0); } if (d->applyOrigRight || (combined & QQuickAnchors::RightAnchor)) { targetPrivate->anchors()->resetRight(); - QDeclarativePropertyPrivate::setBinding(d->rightProp, 0); + QQmlPropertyPrivate::setBinding(d->rightProp, 0); } if (d->applyOrigHCenter || (combined & QQuickAnchors::HCenterAnchor)) { targetPrivate->anchors()->resetHorizontalCenter(); - QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0); + QQmlPropertyPrivate::setBinding(d->hCenterProp, 0); } if (d->applyOrigTop || (combined & QQuickAnchors::TopAnchor)) { targetPrivate->anchors()->resetTop(); - QDeclarativePropertyPrivate::setBinding(d->topProp, 0); + QQmlPropertyPrivate::setBinding(d->topProp, 0); } if (d->applyOrigBottom || (combined & QQuickAnchors::BottomAnchor)) { targetPrivate->anchors()->resetBottom(); - QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0); + QQmlPropertyPrivate::setBinding(d->bottomProp, 0); } if (d->applyOrigVCenter || (combined & QQuickAnchors::VCenterAnchor)) { targetPrivate->anchors()->resetVerticalCenter(); - QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0); + QQmlPropertyPrivate::setBinding(d->vCenterProp, 0); } if (d->applyOrigBaseline || (combined & QQuickAnchors::BaselineAnchor)) { targetPrivate->anchors()->resetBaseline(); - QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0); + QQmlPropertyPrivate::setBinding(d->baselineProp, 0); } } -bool QQuickAnchorChanges::override(QDeclarativeActionEvent*other) +bool QQuickAnchorChanges::override(QQuickActionEvent*other) { if (other->type() != AnchorChanges) return false; - if (static_cast<QDeclarativeActionEvent*>(this) == other) + if (static_cast<QQuickActionEvent*>(this) == other) return true; if (static_cast<QQuickAnchorChanges*>(other)->object() == object()) return true; diff --git a/src/quick/items/qquickstateoperations_p.h b/src/quick/items/qquickstateoperations_p.h index ff1671d53a..2523cc6d4f 100644 --- a/src/quick/items/qquickstateoperations_p.h +++ b/src/quick/items/qquickstateoperations_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,28 +45,28 @@ #include "qquickitem.h" #include "qquickanchors_p.h" -#include <QtQuick/private/qdeclarativestate_p.h> +#include <QtQuick/private/qquickstate_p.h> -#include <QtDeclarative/qdeclarativescriptstring.h> +#include <QtQml/qqmlscriptstring.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QQuickParentChangePrivate; -class Q_AUTOTEST_EXPORT QQuickParentChange : public QDeclarativeStateOperation, public QDeclarativeActionEvent +class Q_AUTOTEST_EXPORT QQuickParentChange : public QQuickStateOperation, public QQuickActionEvent { Q_OBJECT Q_DECLARE_PRIVATE(QQuickParentChange) Q_PROPERTY(QQuickItem *target READ object WRITE setObject) Q_PROPERTY(QQuickItem *parent READ parent WRITE setParent) - Q_PROPERTY(QDeclarativeScriptString x READ x WRITE setX) - Q_PROPERTY(QDeclarativeScriptString y READ y WRITE setY) - Q_PROPERTY(QDeclarativeScriptString width READ width WRITE setWidth) - Q_PROPERTY(QDeclarativeScriptString height READ height WRITE setHeight) - Q_PROPERTY(QDeclarativeScriptString scale READ scale WRITE setScale) - Q_PROPERTY(QDeclarativeScriptString rotation READ rotation WRITE setRotation) + Q_PROPERTY(QQmlScriptString x READ x WRITE setX) + Q_PROPERTY(QQmlScriptString y READ y WRITE setY) + Q_PROPERTY(QQmlScriptString width READ width WRITE setWidth) + Q_PROPERTY(QQmlScriptString height READ height WRITE setHeight) + Q_PROPERTY(QQmlScriptString scale READ scale WRITE setScale) + Q_PROPERTY(QQmlScriptString rotation READ rotation WRITE setRotation) public: QQuickParentChange(QObject *parent=0); ~QQuickParentChange(); @@ -79,39 +79,39 @@ public: QQuickItem *originalParent() const; - QDeclarativeScriptString x() const; - void setX(QDeclarativeScriptString x); + QQmlScriptString x() const; + void setX(QQmlScriptString x); bool xIsSet() const; - QDeclarativeScriptString y() const; - void setY(QDeclarativeScriptString y); + QQmlScriptString y() const; + void setY(QQmlScriptString y); bool yIsSet() const; - QDeclarativeScriptString width() const; - void setWidth(QDeclarativeScriptString width); + QQmlScriptString width() const; + void setWidth(QQmlScriptString width); bool widthIsSet() const; - QDeclarativeScriptString height() const; - void setHeight(QDeclarativeScriptString height); + QQmlScriptString height() const; + void setHeight(QQmlScriptString height); bool heightIsSet() const; - QDeclarativeScriptString scale() const; - void setScale(QDeclarativeScriptString scale); + QQmlScriptString scale() const; + void setScale(QQmlScriptString scale); bool scaleIsSet() const; - QDeclarativeScriptString rotation() const; - void setRotation(QDeclarativeScriptString rotation); + QQmlScriptString rotation() const; + void setRotation(QQmlScriptString rotation); bool rotationIsSet() const; virtual ActionList actions(); virtual void saveOriginals(); - //virtual void copyOriginals(QDeclarativeActionEvent*); + //virtual void copyOriginals(QQuickActionEvent*); virtual void execute(Reason reason = ActualChange); virtual bool isReversable(); virtual void reverse(Reason reason = ActualChange); virtual EventType type() const; - virtual bool override(QDeclarativeActionEvent*other); + virtual bool override(QQuickActionEvent*other); virtual void rewind(); virtual void saveCurrentValues(); }; @@ -122,13 +122,13 @@ class Q_AUTOTEST_EXPORT QQuickAnchorSet : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativeScriptString left READ left WRITE setLeft RESET resetLeft) - Q_PROPERTY(QDeclarativeScriptString right READ right WRITE setRight RESET resetRight) - Q_PROPERTY(QDeclarativeScriptString horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter) - Q_PROPERTY(QDeclarativeScriptString top READ top WRITE setTop RESET resetTop) - Q_PROPERTY(QDeclarativeScriptString bottom READ bottom WRITE setBottom RESET resetBottom) - Q_PROPERTY(QDeclarativeScriptString verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter) - Q_PROPERTY(QDeclarativeScriptString baseline READ baseline WRITE setBaseline RESET resetBaseline) + Q_PROPERTY(QQmlScriptString left READ left WRITE setLeft RESET resetLeft) + Q_PROPERTY(QQmlScriptString right READ right WRITE setRight RESET resetRight) + Q_PROPERTY(QQmlScriptString horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter) + Q_PROPERTY(QQmlScriptString top READ top WRITE setTop RESET resetTop) + Q_PROPERTY(QQmlScriptString bottom READ bottom WRITE setBottom RESET resetBottom) + Q_PROPERTY(QQmlScriptString verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter) + Q_PROPERTY(QQmlScriptString baseline READ baseline WRITE setBaseline RESET resetBaseline) //Q_PROPERTY(QQuickItem *fill READ fill WRITE setFill RESET resetFill) //Q_PROPERTY(QQuickItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn) @@ -145,32 +145,32 @@ public: QQuickAnchorSet(QObject *parent=0); virtual ~QQuickAnchorSet(); - QDeclarativeScriptString left() const; - void setLeft(const QDeclarativeScriptString &edge); + QQmlScriptString left() const; + void setLeft(const QQmlScriptString &edge); void resetLeft(); - QDeclarativeScriptString right() const; - void setRight(const QDeclarativeScriptString &edge); + QQmlScriptString right() const; + void setRight(const QQmlScriptString &edge); void resetRight(); - QDeclarativeScriptString horizontalCenter() const; - void setHorizontalCenter(const QDeclarativeScriptString &edge); + QQmlScriptString horizontalCenter() const; + void setHorizontalCenter(const QQmlScriptString &edge); void resetHorizontalCenter(); - QDeclarativeScriptString top() const; - void setTop(const QDeclarativeScriptString &edge); + QQmlScriptString top() const; + void setTop(const QQmlScriptString &edge); void resetTop(); - QDeclarativeScriptString bottom() const; - void setBottom(const QDeclarativeScriptString &edge); + QQmlScriptString bottom() const; + void setBottom(const QQmlScriptString &edge); void resetBottom(); - QDeclarativeScriptString verticalCenter() const; - void setVerticalCenter(const QDeclarativeScriptString &edge); + QQmlScriptString verticalCenter() const; + void setVerticalCenter(const QQmlScriptString &edge); void resetVerticalCenter(); - QDeclarativeScriptString baseline() const; - void setBaseline(const QDeclarativeScriptString &edge); + QQmlScriptString baseline() const; + void setBaseline(const QQmlScriptString &edge); void resetBaseline(); QQuickItem *fill() const; @@ -224,7 +224,7 @@ private: }; class QQuickAnchorChangesPrivate; -class Q_AUTOTEST_EXPORT QQuickAnchorChanges : public QDeclarativeStateOperation, public QDeclarativeActionEvent +class Q_AUTOTEST_EXPORT QQuickAnchorChanges : public QQuickStateOperation, public QQuickActionEvent { Q_OBJECT Q_DECLARE_PRIVATE(QQuickAnchorChanges) @@ -247,16 +247,16 @@ public: virtual bool isReversable(); virtual void reverse(Reason reason = ActualChange); virtual EventType type() const; - virtual bool override(QDeclarativeActionEvent*other); + virtual bool override(QQuickActionEvent*other); virtual bool changesBindings(); virtual void saveOriginals(); virtual bool needsCopy() { return true; } - virtual void copyOriginals(QDeclarativeActionEvent*); + virtual void copyOriginals(QQuickActionEvent*); virtual void clearBindings(); virtual void rewind(); virtual void saveCurrentValues(); - QList<QDeclarativeAction> additionalActions(); + QList<QQuickAction> additionalActions(); virtual void saveTargetValues(); }; diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 6f8aa383cd..7aa4276f8d 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,12 +43,13 @@ #include "qquicktext_p_p.h" #include <QtQuick/private/qsgcontext_p.h> +#include <private/qqmlglobal_p.h> #include <private/qsgadaptationlayer_p.h> #include "qquicktextnode_p.h" #include "qquickimage_p_p.h" #include <QtQuick/private/qsgtexture_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtGui/qevent.h> #include <QtGui/qabstracttextdocumentlayout.h> #include <QtGui/qpainter.h> @@ -59,8 +60,8 @@ #include <QtGui/qinputmethod.h> #include <private/qtextengine_p.h> -#include <private/qdeclarativestyledtext_p.h> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <private/qquickstyledtext_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> #include <qmath.h> #include <limits.h> @@ -111,11 +112,11 @@ QQuickTextDocumentWithImageResources::~QQuickTextDocumentWithImageResources() QVariant QQuickTextDocumentWithImageResources::loadResource(int type, const QUrl &name) { - QDeclarativeContext *context = qmlContext(parent()); + QQmlContext *context = qmlContext(parent()); QUrl url = m_baseUrl.resolved(name); if (type == QTextDocument::ImageResource) { - QDeclarativePixmap *p = loadPixmap(context, url); + QQuickPixmap *p = loadPixmap(context, url); return p->image(); } @@ -152,10 +153,10 @@ QSizeF QQuickTextDocumentWithImageResources::intrinsicSize( QSizeF size(width, height); if (!hasWidth || !hasHeight) { - QDeclarativeContext *context = qmlContext(parent()); + QQmlContext *context = qmlContext(parent()); QUrl url = m_baseUrl.resolved(QUrl(imageFormat.name())); - QDeclarativePixmap *p = loadPixmap(context, url); + QQuickPixmap *p = loadPixmap(context, url); if (!p->isReady()) { if (!hasWidth) size.setWidth(16); @@ -190,10 +191,10 @@ void QQuickTextDocumentWithImageResources::drawObject( QImage QQuickTextDocumentWithImageResources::image(const QTextImageFormat &format) { - QDeclarativeContext *context = qmlContext(parent()); + QQmlContext *context = qmlContext(parent()); QUrl url = m_baseUrl.resolved(QUrl(format.name())); - QDeclarativePixmap *p = loadPixmap(context, url); + QQuickPixmap *p = loadPixmap(context, url); return p->image(); } @@ -206,14 +207,14 @@ void QQuickTextDocumentWithImageResources::setBaseUrl(const QUrl &url, bool clea } } -QDeclarativePixmap *QQuickTextDocumentWithImageResources::loadPixmap( - QDeclarativeContext *context, const QUrl &url) +QQuickPixmap *QQuickTextDocumentWithImageResources::loadPixmap( + QQmlContext *context, const QUrl &url) { - QHash<QUrl, QDeclarativePixmap *>::Iterator iter = m_resources.find(url); + QHash<QUrl, QQuickPixmap *>::Iterator iter = m_resources.find(url); if (iter == m_resources.end()) { - QDeclarativePixmap *p = new QDeclarativePixmap(context->engine(), url); + QQuickPixmap *p = new QQuickPixmap(context->engine(), url); iter = m_resources.insert(url, p); if (p->isLoading()) { @@ -222,7 +223,7 @@ QDeclarativePixmap *QQuickTextDocumentWithImageResources::loadPixmap( } } - QDeclarativePixmap *p = *iter; + QQuickPixmap *p = *iter; if (p->isError()) { if (!errors.contains(url)) { errors.insert(url); @@ -234,7 +235,7 @@ QDeclarativePixmap *QQuickTextDocumentWithImageResources::loadPixmap( void QQuickTextDocumentWithImageResources::clearResources() { - foreach (QDeclarativePixmap *pixmap, m_resources) + foreach (QQuickPixmap *pixmap, m_resources) pixmap->clear(this); qDeleteAll(m_resources); m_resources.clear(); @@ -298,7 +299,7 @@ void QQuickTextPrivate::updateLayout() if (!richText) { if (textHasChanged) { if (styledText && !text.isEmpty()) { - QDeclarativeStyledText::parse(text, layout, imgTags, q->baseUrl(), qmlContext(q), !maximumLineCountValid); + QQuickStyledText::parse(text, layout, imgTags, q->baseUrl(), qmlContext(q), !maximumLineCountValid); } else { layout.clearAdditionalFormats(); multilengthEos = text.indexOf(QLatin1Char('\x9c')); @@ -341,7 +342,7 @@ void QQuickText::imageDownloadFinished() if (d->nbActiveDownloads == 0) { bool needToUpdateLayout = false; - foreach (QDeclarativeStyledTextImgTag *img, d->visibleImgTags) { + foreach (QQuickStyledTextImgTag *img, d->visibleImgTags) { if (!img->size.isValid()) { img->size = img->pix->implicitSize(); needToUpdateLayout = true; @@ -945,15 +946,15 @@ void QQuickTextPrivate::setLineGeometry(QTextLine &line, qreal lineWidth, qreal qreal textHeight = line.height(); qreal totalLineHeight = textHeight; - QList<QDeclarativeStyledTextImgTag *> imagesInLine; + QList<QQuickStyledTextImgTag *> imagesInLine; - foreach (QDeclarativeStyledTextImgTag *image, imgTags) { + foreach (QQuickStyledTextImgTag *image, imgTags) { if (image->position >= line.textStart() && image->position < line.textStart() + line.textLength()) { if (!image->pix) { QUrl url = q->baseUrl().resolved(image->url); - image->pix = new QDeclarativePixmap(qmlEngine(q), url, image->size); + image->pix = new QQuickPixmap(qmlEngine(q), url, image->size); if (image->pix->isLoading()) { image->pix->connectFinished(q, SLOT(imageDownloadFinished())); nbActiveDownloads++; @@ -970,9 +971,9 @@ void QQuickTextPrivate::setLineGeometry(QTextLine &line, qreal lineWidth, qreal } qreal ih = qreal(image->size.height()); - if (image->align == QDeclarativeStyledTextImgTag::Top) + if (image->align == QQuickStyledTextImgTag::Top) image->pos.setY(0); - else if (image->align == QDeclarativeStyledTextImgTag::Middle) + else if (image->align == QQuickStyledTextImgTag::Middle) image->pos.setY((textHeight / 2.0) - (ih / 2.0)); else image->pos.setY(textHeight - ih); @@ -981,7 +982,7 @@ void QQuickTextPrivate::setLineGeometry(QTextLine &line, qreal lineWidth, qreal } } - foreach (QDeclarativeStyledTextImgTag *image, imagesInLine) { + foreach (QQuickStyledTextImgTag *image, imagesInLine) { totalLineHeight = qMax(totalLineHeight, textTop + image->pos.y() + image->size.height()); image->pos.setX(line.cursorToX(image->position)); image->pos.setY(image->pos.y() + height + textTop); @@ -1117,7 +1118,7 @@ QQuickText::~QQuickText() The link must be in rich text or HTML format and the \a link string provides access to the particular link. - \snippet doc/src/snippets/declarative/text/onLinkActivated.qml 0 + \snippet doc/src/snippets/qml/text/onLinkActivated.qml 0 The example code will display the text "The main website is at \l{http://qt.nokia.com}{Nokia Qt DF}." @@ -1841,7 +1842,7 @@ QUrl QQuickText::baseUrl() const { Q_D(const QQuickText); if (d->baseUrl.isEmpty()) { - if (QDeclarativeContext *context = qmlContext(this)) + if (QQmlContext *context = qmlContext(this)) const_cast<QQuickTextPrivate *>(d)->baseUrl = context->baseUrl(); } return d->baseUrl; @@ -1867,7 +1868,7 @@ void QQuickText::setBaseUrl(const QUrl &url) void QQuickText::resetBaseUrl() { - if (QDeclarativeContext *context = qmlContext(this)) + if (QQmlContext *context = qmlContext(this)) setBaseUrl(context->baseUrl()); else setBaseUrl(QUrl()); @@ -2008,8 +2009,8 @@ QSGNode *QQuickText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data node->addTextLayout(QPoint(0, bounds.y()), d->elideLayout, color, d->style, styleColor, linkColor); } - foreach (QDeclarativeStyledTextImgTag *img, d->visibleImgTags) { - QDeclarativePixmap *pix = img->pix; + foreach (QQuickStyledTextImgTag *img, d->visibleImgTags) { + QQuickPixmap *pix = img->pix; if (pix && pix->isReady()) node->addImage(QRectF(img->pos.x(), img->pos.y() + bounds.y(), pix->width(), pix->height()), pix->image()); } diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h index 37287b5445..d73c6e1a10 100644 --- a/src/quick/items/qquicktext_p.h +++ b/src/quick/items/qquicktext_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h index 555f41ff94..0f8c93a9e3 100644 --- a/src/quick/items/qquicktext_p_p.h +++ b/src/quick/items/qquicktext_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,10 +56,10 @@ #include "qquicktext_p.h" #include "qquickimplicitsizeitem_p_p.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include <QtGui/qabstracttextdocumentlayout.h> #include <QtGui/qtextlayout.h> -#include <private/qdeclarativestyledtext_p.h> +#include <private/qquickstyledtext_p.h> QT_BEGIN_NAMESPACE @@ -93,8 +93,8 @@ public: QUrl baseUrl; QFont font; QFont sourceFont; - QList<QDeclarativeStyledTextImgTag*> imgTags; - QList<QDeclarativeStyledTextImgTag*> visibleImgTags; + QList<QQuickStyledTextImgTag*> imgTags; + QList<QQuickStyledTextImgTag*> visibleImgTags; QTextLayout layout; QTextLayout *elideLayout; @@ -165,7 +165,7 @@ public: } }; -class QDeclarativePixmap; +class QQuickPixmap; class QQuickTextDocumentWithImageResources : public QTextDocument, public QTextObjectInterface { Q_OBJECT @@ -194,13 +194,13 @@ Q_SIGNALS: protected: QVariant loadResource(int type, const QUrl &name); - QDeclarativePixmap *loadPixmap(QDeclarativeContext *context, const QUrl &name); + QQuickPixmap *loadPixmap(QQmlContext *context, const QUrl &name); private slots: void requestFinished(); private: - QHash<QUrl, QDeclarativePixmap *> m_resources; + QHash<QUrl, QQuickPixmap *> m_resources; QUrl m_baseUrl; int outstanding; diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index 6f3c32db7d..6eed95767b 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,15 +48,15 @@ #include "qquicktextnode_p.h" #include <QtQuick/qsgsimplerectnode.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtGui/qguiapplication.h> #include <QtGui/qevent.h> #include <QtGui/qpainter.h> #include <QtGui/qtextobject.h> #include <QtCore/qmath.h> -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativeproperty_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlproperty_p.h> #include <private/qtextengine_p.h> #include <private/qsgadaptationlayer_p.h> @@ -692,7 +692,7 @@ QUrl QQuickTextEdit::baseUrl() const { Q_D(const QQuickTextEdit); if (d->baseUrl.isEmpty()) { - if (QDeclarativeContext *context = qmlContext(this)) + if (QQmlContext *context = qmlContext(this)) const_cast<QQuickTextEditPrivate *>(d)->baseUrl = context->baseUrl(); } return d->baseUrl; @@ -711,7 +711,7 @@ void QQuickTextEdit::setBaseUrl(const QUrl &url) void QQuickTextEdit::resetBaseUrl() { - if (QDeclarativeContext *context = qmlContext(this)) + if (QQmlContext *context = qmlContext(this)) setBaseUrl(context->baseUrl()); else setBaseUrl(QUrl()); @@ -919,16 +919,16 @@ void QQuickTextEdit::setCursorPosition(int pos) needed, and the x and y properties of delegate instance will be set so as to be one pixel before the top left of the current character. - Note that the root item of the delegate component must be a QDeclarativeItem or - QDeclarativeItem derived item. + Note that the root item of the delegate component must be a QQuickItem or + QQuickItem derived item. */ -QDeclarativeComponent* QQuickTextEdit::cursorDelegate() const +QQmlComponent* QQuickTextEdit::cursorDelegate() const { Q_D(const QQuickTextEdit); return d->cursorComponent; } -void QQuickTextEdit::setCursorDelegate(QDeclarativeComponent* c) +void QQuickTextEdit::setCursorDelegate(QQmlComponent* c) { Q_D(QQuickTextEdit); if (d->cursorComponent) { @@ -956,13 +956,13 @@ void QQuickTextEdit::loadCursorDelegate() Q_D(QQuickTextEdit); if (d->cursorComponent->isLoading() || !isComponentComplete()) return; - QDeclarativeContext *creationContext = d->cursorComponent->creationContext(); + QQmlContext *creationContext = d->cursorComponent->creationContext(); QObject *object = d->cursorComponent->create(creationContext ? creationContext : qmlContext(this)); d->cursor = qobject_cast<QQuickItem*>(object); if (d->cursor) { d->control->setCursorWidth(0); updateCursor(); - QDeclarative_setParent_noEvent(d->cursor, this); + QQml_setParent_noEvent(d->cursor, this); d->cursor->setParentItem(this); d->cursor->setHeight(QFontMetrics(d->font).height()); moveCursorDelegate(); diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h index 5f6317ab09..4dcb7f48d6 100644 --- a/src/quick/items/qquicktextedit_p.h +++ b/src/quick/items/qquicktextedit_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -80,7 +80,7 @@ class Q_AUTOTEST_EXPORT QQuickTextEdit : public QQuickImplicitSizeItem Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged) Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged) - Q_PROPERTY(QDeclarativeComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged) + Q_PROPERTY(QQmlComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged) Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged) Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged) Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged) @@ -172,8 +172,8 @@ public: int cursorPosition() const; void setCursorPosition(int pos); - QDeclarativeComponent* cursorDelegate() const; - void setCursorDelegate(QDeclarativeComponent*); + QQmlComponent* cursorDelegate() const; + void setCursorDelegate(QQmlComponent*); int selectionStart() const; int selectionEnd() const; diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h index d69e24f6bc..3004d5b833 100644 --- a/src/quick/items/qquicktextedit_p_p.h +++ b/src/quick/items/qquicktextedit_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -56,7 +56,7 @@ #include "qquicktextedit_p.h" #include "qquickimplicitsizeitem_p_p.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE class QTextLayout; @@ -121,7 +121,7 @@ public: qreal textMargin; int lastSelectionStart; int lastSelectionEnd; - QDeclarativeComponent* cursorComponent; + QQmlComponent* cursorComponent; QQuickItem* cursor; QQuickTextEdit::TextFormat format; QQuickTextDocumentWithImageResources *document; diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 9b11e2e43a..ab5afa334d 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,9 +43,9 @@ #include "qquicktextinput_p_p.h" #include "qquickcanvas.h" -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlglobal_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> #include <QtGui/qevent.h> #include <QTextBoundaryFinder> #include "qquicktextnode_p.h" @@ -1215,16 +1215,16 @@ void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints) needed, and the x property of delegate instance will be set so as to be one pixel before the top left of the current character. - Note that the root item of the delegate component must be a QDeclarativeItem or - QDeclarativeItem derived item. + Note that the root item of the delegate component must be a QQuickItem or + QQuickItem derived item. */ -QDeclarativeComponent* QQuickTextInput::cursorDelegate() const +QQmlComponent* QQuickTextInput::cursorDelegate() const { Q_D(const QQuickTextInput); return d->cursorComponent; } -void QQuickTextInput::setCursorDelegate(QDeclarativeComponent* c) +void QQuickTextInput::setCursorDelegate(QQmlComponent* c) { Q_D(QQuickTextInput); if (d->cursorComponent == c) @@ -1271,7 +1271,7 @@ void QQuickTextInput::createCursor() if (d->cursorItem) delete d->cursorItem; - QDeclarativeContext *creationContext = d->cursorComponent->creationContext(); + QQmlContext *creationContext = d->cursorComponent->creationContext(); QObject *object = d->cursorComponent->create(creationContext ? creationContext : qmlContext(this)); d->cursorItem = qobject_cast<QQuickItem*>(object); if (!d->cursorItem) { @@ -1282,7 +1282,7 @@ void QQuickTextInput::createCursor() QRectF r = cursorRectangle(); - QDeclarative_setParent_noEvent(d->cursorItem, this); + QQml_setParent_noEvent(d->cursorItem, this); d->cursorItem->setParentItem(this); d->cursorItem->setPos(r.topLeft()); d->cursorItem->setHeight(r.height()); @@ -1332,7 +1332,7 @@ QRectF QQuickTextInput::positionToRectangle(int pos) const \endlist */ -void QQuickTextInput::positionAt(QDeclarativeV8Function *args) const +void QQuickTextInput::positionAt(QQmlV8Function *args) const { Q_D(const QQuickTextInput); diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index 0e60cf6ce4..8961dbc3e1 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -77,7 +77,7 @@ class Q_AUTOTEST_EXPORT QQuickTextInput : public QQuickImplicitSizeItem Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged) Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged) - Q_PROPERTY(QDeclarativeComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged) + Q_PROPERTY(QQmlComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged) Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged) Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged) Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged) @@ -150,7 +150,7 @@ public: //Auxilliary functions needed to control the TextInput from QML - Q_INVOKABLE void positionAt(QDeclarativeV8Function *args) const; + Q_INVOKABLE void positionAt(QQmlV8Function *args) const; Q_INVOKABLE QRectF positionToRectangle(int pos) const; Q_INVOKABLE void moveCursorSelection(int pos); Q_INVOKABLE void moveCursorSelection(int pos, SelectionMode mode); @@ -220,8 +220,8 @@ public: QString displayText() const; - QDeclarativeComponent* cursorDelegate() const; - void setCursorDelegate(QDeclarativeComponent*); + QQmlComponent* cursorDelegate() const; + void setCursorDelegate(QQmlComponent*); bool focusOnPress() const; void setFocusOnPress(bool); diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h index e48b000e5c..2575694888 100644 --- a/src/quick/items/qquicktextinput_p_p.h +++ b/src/quick/items/qquicktextinput_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -46,7 +46,7 @@ #include "qquicktext_p.h" #include "qquickimplicitsizeitem_p_p.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include <QtCore/qelapsedtimer.h> #include <QtCore/qpointer.h> #include <QtCore/qbasictimer.h> @@ -174,9 +174,9 @@ public: QPointF pressPos; QPointF tripleClickStartPoint; - QDeclarativeGuard<QDeclarativeComponent> cursorComponent; + QQmlGuard<QQmlComponent> cursorComponent; #ifndef QT_NO_VALIDATOR - QDeclarativeGuard<QValidator> m_validator; + QQmlGuard<QValidator> m_validator; #endif QTextLayout m_textLayout; diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp index a3daead6cb..5be4963809 100644 --- a/src/quick/items/qquicktextnode.cpp +++ b/src/quick/items/qquicktextnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -55,7 +55,7 @@ #include <qrawfont.h> #include <qtexttable.h> #include <qtextlist.h> -#include <private/qdeclarativestyledtext_p.h> +#include <private/qquickstyledtext_p.h> #include <private/qquicktext_p_p.h> #include <private/qfont_p.h> #include <private/qfontengine_p.h> diff --git a/src/quick/items/qquicktextnode_p.h b/src/quick/items/qquicktextnode_p.h index 9c2217bfd0..2ecd20d933 100644 --- a/src/quick/items/qquicktextnode_p.h +++ b/src/quick/items/qquicktextnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquicktranslate.cpp b/src/quick/items/qquicktranslate.cpp index a1a1f59173..6cfa7a0338 100644 --- a/src/quick/items/qquicktranslate.cpp +++ b/src/quick/items/qquicktranslate.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquicktranslate_p.h b/src/quick/items/qquicktranslate_p.h index 82901d7c6a..d2d8c3abc5 100644 --- a/src/quick/items/qquicktranslate_p.h +++ b/src/quick/items/qquicktranslate_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index 76d82a4713..7d1411aa6e 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -46,11 +46,11 @@ #include "qquickitem_p.h" #include "qquickitemchangelistener_p.h" -#include <private/qdeclarativeprofilerservice_p.h> -#include <private/qdeclarativeinspectorservice_p.h> +#include <private/qqmlprofilerservice_p.h> +#include <private/qqmlinspectorservice_p.h> -#include <QtDeclarative/qdeclarativeengine.h> -#include <private/qdeclarativeengine_p.h> +#include <QtQml/qqmlengine.h> +#include <private/qqmlengine_p.h> #include <QtCore/qbasictimer.h> @@ -62,8 +62,8 @@ void QQuickViewPrivate::init() engine.setIncubationController(q->incubationController()); - if (QDeclarativeDebugService::isDebuggingEnabled()) - QDeclarativeInspectorService::instance()->addView(q); + if (QQmlDebugService::isDebuggingEnabled()) + QQmlInspectorService::instance()->addView(q); } QQuickViewPrivate::QQuickViewPrivate() @@ -73,8 +73,8 @@ QQuickViewPrivate::QQuickViewPrivate() QQuickViewPrivate::~QQuickViewPrivate() { - if (QDeclarativeDebugService::isDebuggingEnabled()) - QDeclarativeInspectorService::instance()->removeView(q_func()); + if (QQmlDebugService::isDebuggingEnabled()) + QQmlInspectorService::instance()->removeView(q_func()); delete root; } @@ -91,11 +91,11 @@ void QQuickViewPrivate::execute() component = 0; } if (!source.isEmpty()) { - component = new QDeclarativeComponent(&engine, source, q); + component = new QQmlComponent(&engine, source, q); if (!component->isLoading()) { q->continueExecute(); } else { - QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), + QObject::connect(component, SIGNAL(statusChanged(QQmlComponent::Status)), q, SLOT(continueExecute())); } } @@ -120,7 +120,7 @@ void QQuickViewPrivate::itemGeometryChanged(QQuickItem *resizeItem, const QRectF This is a convenience subclass of QQuickCanvas which will automatically load and display a QML scene when given the URL of the main source file. Alternatively, - you can instantiate your own objects using QDeclarativeComponent and place them in a manually setup QQuickCanvas. + you can instantiate your own objects using QQmlComponent and place them in a manually setup QQuickCanvas. Typical usage: @@ -216,23 +216,23 @@ QUrl QQuickView::source() const } /*! - Returns a pointer to the QDeclarativeEngine used for instantiating + Returns a pointer to the QQmlEngine used for instantiating QML Components. */ -QDeclarativeEngine* QQuickView::engine() const +QQmlEngine* QQuickView::engine() const { Q_D(const QQuickView); - return const_cast<QDeclarativeEngine *>(&d->engine); + return const_cast<QQmlEngine *>(&d->engine); } /*! This function returns the root of the context hierarchy. Each QML - component is instantiated in a QDeclarativeContext. QDeclarativeContext's are + component is instantiated in a QQmlContext. QQmlContext's are essential for passing data to QML components. In QML, contexts are arranged hierarchically and this hierarchy is managed by the - QDeclarativeEngine. + QQmlEngine. */ -QDeclarativeContext* QQuickView::rootContext() const +QQmlContext* QQuickView::rootContext() const { Q_D(const QQuickView); return d->engine.rootContext(); @@ -275,12 +275,12 @@ QQuickView::Status QQuickView::status() const Return the list of errors that occurred during the last compile or create operation. When the status is not Error, an empty list is returned. */ -QList<QDeclarativeError> QQuickView::errors() const +QList<QQmlError> QQuickView::errors() const { Q_D(const QQuickView); if (d->component) return d->component->errors(); - return QList<QDeclarativeError>(); + return QList<QQmlError>(); } /*! @@ -377,11 +377,11 @@ QQuickView::ResizeMode QQuickView::resizeMode() const void QQuickView::continueExecute() { Q_D(QQuickView); - disconnect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueExecute())); + disconnect(d->component, SIGNAL(statusChanged(QQmlComponent::Status)), this, SLOT(continueExecute())); if (d->component->isError()) { - QList<QDeclarativeError> errorList = d->component->errors(); - foreach (const QDeclarativeError &error, errorList) { + QList<QQmlError> errorList = d->component->errors(); + foreach (const QQmlError &error, errorList) { qWarning() << error; } emit statusChanged(status()); @@ -391,8 +391,8 @@ void QQuickView::continueExecute() QObject *obj = d->component->create(); if (d->component->isError()) { - QList<QDeclarativeError> errorList = d->component->errors(); - foreach (const QDeclarativeError &error, errorList) { + QList<QQmlError> errorList = d->component->errors(); + foreach (const QQmlError &error, errorList) { qWarning() << error; } emit statusChanged(status()); @@ -422,7 +422,7 @@ void QQuickViewPrivate::setRootObject(QObject *obj) << "loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur." << endl << endl << "To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the" << endl - << "QDeclarativeView class in the qtquick1 module." << endl; + << "QQuickView class in the qtquick1 module." << endl; delete obj; root = 0; } @@ -499,35 +499,35 @@ void QQuickView::resizeEvent(QResizeEvent *e) void QQuickView::keyPressEvent(QKeyEvent *e) { - QDeclarativeProfilerService::addEvent(QDeclarativeProfilerService::Key); + QQmlProfilerService::addEvent(QQmlProfilerService::Key); QQuickCanvas::keyPressEvent(e); } void QQuickView::keyReleaseEvent(QKeyEvent *e) { - QDeclarativeProfilerService::addEvent(QDeclarativeProfilerService::Key); + QQmlProfilerService::addEvent(QQmlProfilerService::Key); QQuickCanvas::keyReleaseEvent(e); } void QQuickView::mouseMoveEvent(QMouseEvent *e) { - QDeclarativeProfilerService::addEvent(QDeclarativeProfilerService::Mouse); + QQmlProfilerService::addEvent(QQmlProfilerService::Mouse); QQuickCanvas::mouseMoveEvent(e); } void QQuickView::mousePressEvent(QMouseEvent *e) { - QDeclarativeProfilerService::addEvent(QDeclarativeProfilerService::Mouse); + QQmlProfilerService::addEvent(QQmlProfilerService::Mouse); QQuickCanvas::mousePressEvent(e); } void QQuickView::mouseReleaseEvent(QMouseEvent *e) { - QDeclarativeProfilerService::addEvent(QDeclarativeProfilerService::Mouse); + QQmlProfilerService::addEvent(QQmlProfilerService::Mouse); QQuickCanvas::mouseReleaseEvent(e); } diff --git a/src/quick/items/qquickview.h b/src/quick/items/qquickview.h index 6f1b1f12cd..89cca506f7 100644 --- a/src/quick/items/qquickview.h +++ b/src/quick/items/qquickview.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,15 +44,15 @@ #include <QtQuick/qquickcanvas.h> #include <QtCore/qurl.h> -#include <QtDeclarative/qdeclarativedebug.h> +#include <QtQml/qqmldebug.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeContext; -class QDeclarativeError; +class QQmlEngine; +class QQmlContext; +class QQmlError; class QQuickItem; class QQuickViewPrivate; @@ -70,8 +70,8 @@ public: QUrl source() const; - QDeclarativeEngine* engine() const; - QDeclarativeContext* rootContext() const; + QQmlEngine* engine() const; + QQmlContext* rootContext() const; QQuickItem *rootObject() const; @@ -82,7 +82,7 @@ public: enum Status { Null, Ready, Loading, Error }; Status status() const; - QList<QDeclarativeError> errors() const; + QList<QQmlError> errors() const; QSize sizeHint() const; QSize initialSize() const; diff --git a/src/quick/items/qquickview_p.h b/src/quick/items/qquickview_p.h index 1dacf2f1ee..9b0e26e30d 100644 --- a/src/quick/items/qquickview_p.h +++ b/src/quick/items/qquickview_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,7 +48,7 @@ #include <QtCore/qelapsedtimer.h> #include <QtCore/qtimer.h> #include <QtCore/qpointer.h> -#include <QtDeclarative/qdeclarativeengine.h> +#include <QtQml/qqmlengine.h> #include "qquickcanvas_p.h" #include "qquickitemchangelistener_p.h" @@ -57,10 +57,10 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeContext; -class QDeclarativeError; +class QQmlContext; +class QQmlError; class QQuickItem; -class QDeclarativeComponent; +class QQmlComponent; class QQuickViewPrivate : public QQuickCanvasPrivate, public QQuickItemChangeListener @@ -87,8 +87,8 @@ public: QUrl source; - QDeclarativeEngine engine; - QDeclarativeComponent *component; + QQmlEngine engine; + QQmlComponent *component; QBasicTimer resizetimer; QQuickView::ResizeMode resizeMode; diff --git a/src/quick/items/qquickvisualadaptormodel.cpp b/src/quick/items/qquickvisualadaptormodel.cpp index f504478a3d..fb85810984 100644 --- a/src/quick/items/qquickvisualadaptormodel.cpp +++ b/src/quick/items/qquickvisualadaptormodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,9 +42,9 @@ #include "qquickvisualadaptormodel_p.h" #include "qquickvisualdatamodel_p_p.h" -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativelistaccessor_p.h> -#include <private/qdeclarativepropertycache_p.h> +#include <private/qqmlengine_p.h> +#include <private/qquicklistaccessor_p.h> +#include <private/qqmlpropertycache_p.h> #include <private/qlistmodelinterface_p.h> #include <private/qmetaobjectbuilder_p.h> #include <private/qintrusivelist_p.h> @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE -class VDMDelegateDataType : public QDeclarativeRefCount +class VDMDelegateDataType : public QQmlRefCount { public: VDMDelegateDataType() @@ -86,7 +86,7 @@ public: } QMetaObject *metaObject; - QDeclarativePropertyCache *propertyCache; + QQmlPropertyCache *propertyCache; int propertyOffset; int signalOffset; bool shared : 1; @@ -166,10 +166,10 @@ public: return 0; } - QDeclarativeGuard<QDeclarativeEngine> m_engine; - QDeclarativeGuard<QListModelInterface> m_listModelInterface; - QDeclarativeGuard<QAbstractItemModel> m_abstractItemModel; - QDeclarativeListAccessor *m_listAccessor; + QQmlGuard<QQmlEngine> m_engine; + QQmlGuard<QListModelInterface> m_listModelInterface; + QQmlGuard<QAbstractItemModel> m_abstractItemModel; + QQuickListAccessor *m_listAccessor; VDMDelegateDataType *m_delegateDataType; CreateModelData createItem; StringValue stringValue; @@ -650,7 +650,7 @@ public: for (int i = previousPropertyCount; i < metaObject->propertyCount() - objectPropertyOffset; ++i) { QMetaProperty property = metaObject->property(i + objectPropertyOffset); if (property.hasNotifySignal()) { - QDeclarativePropertyPrivate::connect( + QQmlPropertyPrivate::connect( m_object, property.notifySignalIndex(), m_data, notifierId); ++notifierId; } @@ -658,7 +658,7 @@ public: return propertyIndex + m_type->propertyOffset - objectPropertyOffset; } - QDeclarativeGuard<QObject> m_object; + QQmlGuard<QObject> m_object; }; class QQuickVDMObjectData : public QQuickVisualDataModelItem, public QQuickVisualAdaptorModelProxyInterface @@ -712,7 +712,7 @@ void QQuickVisualAdaptorModelPrivate::createMetaObject() m_objectList = false; m_propertyData.clear(); - QV8Engine *v8Engine = QDeclarativeEnginePrivate::getV8Engine(m_engine); + QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(m_engine); v8::HandleScope handleScope; v8::Context::Scope contextScope(v8Engine->context()); @@ -722,8 +722,8 @@ void QQuickVisualAdaptorModelPrivate::createMetaObject() v8::String::New("index"), QQuickVisualDataModelItemMetaObject::get_index); if (m_listAccessor - && m_listAccessor->type() != QDeclarativeListAccessor::ListProperty - && m_listAccessor->type() != QDeclarativeListAccessor::Instance) { + && m_listAccessor->type() != QQuickListAccessor::ListProperty + && m_listAccessor->type() != QQuickListAccessor::Instance) { createItem = &QQuickVDMListAccessorData::create; stringValue = &QQuickVDMListAccessorData::stringValue; ft->PrototypeTemplate()->SetAccessor( @@ -794,7 +794,7 @@ void QQuickVisualAdaptorModelPrivate::createMetaObject() } m_delegateDataType->metaObject = m_delegateDataType->builder.toMetaObject(); if (!m_objectList) { - m_delegateDataType->propertyCache = new QDeclarativePropertyCache( + m_delegateDataType->propertyCache = new QQmlPropertyCache( m_engine, m_delegateDataType->metaObject); m_constructor = qPersistentNew<v8::Function>(ft->GetFunction()); } @@ -828,7 +828,7 @@ QVariant QQuickVisualAdaptorModel::model() const return d->m_modelVariant; } -void QQuickVisualAdaptorModel::setModel(const QVariant &model, QDeclarativeEngine *engine) +void QQuickVisualAdaptorModel::setModel(const QVariant &model, QQmlEngine *engine) { Q_D(QQuickVisualAdaptorModel); delete d->m_listAccessor; @@ -904,7 +904,7 @@ void QQuickVisualAdaptorModel::setModel(const QVariant &model, QDeclarativeEngin return; } - d->m_listAccessor = new QDeclarativeListAccessor; + d->m_listAccessor = new QQuickListAccessor; d->m_listAccessor->setList(model, d->m_engine); if ((d->m_count = d->m_listAccessor->count())) emit itemsInserted(0, d->m_count); @@ -964,7 +964,7 @@ QQuickVisualDataModelItem *QQuickVisualAdaptorModel::createItem(QQuickVisualData d->m_cache.insert(item); if (d->m_delegateDataType && d->m_delegateDataType->propertyCache) { - QDeclarativeData *qmldata = QDeclarativeData::get(item, true); + QQmlData *qmldata = QQmlData::get(item, true); qmldata->propertyCache = d->m_delegateDataType->propertyCache; qmldata->propertyCache->addref(); } diff --git a/src/quick/items/qquickvisualadaptormodel_p.h b/src/quick/items/qquickvisualadaptormodel_p.h index 9ae8325450..93de4b1126 100644 --- a/src/quick/items/qquickvisualadaptormodel_p.h +++ b/src/quick/items/qquickvisualadaptormodel_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -49,7 +49,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; class QQuickVisualDataModelItem; class QQuickVisualDataModelItemMetaType; @@ -72,7 +72,7 @@ public: Flags flags() const; QVariant model() const; - void setModel(const QVariant &, QDeclarativeEngine *); + void setModel(const QVariant &, QQmlEngine *); QVariant rootIndex() const; void setRootIndex(const QVariant &root); diff --git a/src/quick/items/qquickvisualdatamodel.cpp b/src/quick/items/qquickvisualdatamodel.cpp index 4fdcc98602..07ad3660be 100644 --- a/src/quick/items/qquickvisualdatamodel.cpp +++ b/src/quick/items/qquickvisualdatamodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,13 +42,13 @@ #include "qquickvisualdatamodel_p_p.h" #include "qquickitem.h" -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> -#include <private/qdeclarativepackage_p.h> +#include <private/qquickpackage_p.h> #include <private/qmetaobjectbuilder_p.h> #include <private/qquickvisualadaptormodel_p.h> -#include <private/qdeclarativechangeset_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qquickchangeset_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE @@ -93,10 +93,10 @@ QHash<QObject*, QQuickVisualDataModelAttached*> QQuickVisualDataModelAttached::a The example below illustrates using a VisualDataModel with a ListView. - \snippet doc/src/snippets/declarative/visualdatamodel.qml 0 + \snippet doc/src/snippets/qml/visualdatamodel.qml 0 */ -QQuickVisualDataModelPrivate::QQuickVisualDataModelPrivate(QDeclarativeContext *ctxt) +QQuickVisualDataModelPrivate::QQuickVisualDataModelPrivate(QQmlContext *ctxt) : m_adaptorModel(0) , m_delegate(0) , m_cacheMetaType(0) @@ -153,7 +153,7 @@ QQuickVisualDataModel::QQuickVisualDataModel() d->init(); } -QQuickVisualDataModel::QQuickVisualDataModel(QDeclarativeContext *ctxt, QObject *parent) +QQuickVisualDataModel::QQuickVisualDataModel(QQmlContext *ctxt, QObject *parent) : QQuickVisualModel(*(new QQuickVisualDataModelPrivate(ctxt)), parent) { Q_D(QQuickVisualDataModel); @@ -223,7 +223,7 @@ void QQuickVisualDataModel::componentComplete() d->m_context = qmlContext(this); d->m_cacheMetaType = new QQuickVisualDataModelItemMetaType( - QDeclarativeEnginePrivate::getV8Engine(d->m_context->engine()), this, groupNames); + QQmlEnginePrivate::getV8Engine(d->m_context->engine()), this, groupNames); d->m_compositor.setGroupCount(d->m_groupCount); d->m_compositor.setDefaultGroups(defaultGroups); @@ -282,13 +282,13 @@ void QQuickVisualDataModel::setModel(const QVariant &model) The index is exposed as an accessible \c index property. Properties of the model are also available depending upon the type of \l {qmlmodels}{Data Model}. */ -QDeclarativeComponent *QQuickVisualDataModel::delegate() const +QQmlComponent *QQuickVisualDataModel::delegate() const { Q_D(const QQuickVisualDataModel); return d->m_delegate; } -void QQuickVisualDataModel::setDelegate(QDeclarativeComponent *delegate) +void QQuickVisualDataModel::setDelegate(QQmlComponent *delegate) { Q_D(QQuickVisualDataModel); if (d->m_transaction) { @@ -329,10 +329,10 @@ void QQuickVisualDataModel::setDelegate(QDeclarativeComponent *delegate) the new directory's contents. \c main.cpp: - \snippet doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp 0 + \snippet doc/src/snippets/qml/visualdatamodel_rootindex/main.cpp 0 \c view.qml: - \snippet doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml 0 + \snippet doc/src/snippets/qml/visualdatamodel_rootindex/view.qml 0 If the \l model is a QAbstractItemModel subclass, the delegate can also reference a \c hasModelChildren property (optionally qualified by a @@ -406,7 +406,7 @@ void QQuickVisualDataModelPrivate::destroy(QObject *object) { QObjectPrivate *p = QObjectPrivate::get(object); Q_ASSERT(p->declarativeData); - QDeclarativeData *data = static_cast<QDeclarativeData*>(p->declarativeData); + QQmlData *data = static_cast<QQmlData*>(p->declarativeData); if (data->ownContext && data->context) data->context->clearContext(); object->deleteLater(); @@ -451,7 +451,7 @@ QQuickVisualDataModel::ReleaseFlags QQuickVisualDataModel::release(QQuickItem *i } void QQuickVisualDataModelPrivate::group_append( - QDeclarativeListProperty<QQuickVisualDataGroup> *property, QQuickVisualDataGroup *group) + QQmlListProperty<QQuickVisualDataGroup> *property, QQuickVisualDataGroup *group) { QQuickVisualDataModelPrivate *d = static_cast<QQuickVisualDataModelPrivate *>(property->data); if (d->m_complete) @@ -465,14 +465,14 @@ void QQuickVisualDataModelPrivate::group_append( } int QQuickVisualDataModelPrivate::group_count( - QDeclarativeListProperty<QQuickVisualDataGroup> *property) + QQmlListProperty<QQuickVisualDataGroup> *property) { QQuickVisualDataModelPrivate *d = static_cast<QQuickVisualDataModelPrivate *>(property->data); return d->m_groupCount - 1; } QQuickVisualDataGroup *QQuickVisualDataModelPrivate::group_at( - QDeclarativeListProperty<QQuickVisualDataGroup> *property, int index) + QQmlListProperty<QQuickVisualDataGroup> *property, int index) { QQuickVisualDataModelPrivate *d = static_cast<QQuickVisualDataModelPrivate *>(property->data); return index >= 0 && index < d->m_groupCount - 1 @@ -495,13 +495,13 @@ QQuickVisualDataGroup *QQuickVisualDataModelPrivate::group_at( The following example illustrates using groups to select items in a model. - \snippet doc/src/snippets/declarative/visualdatagroup.qml 0 + \snippet doc/src/snippets/qml/visualdatagroup.qml 0 */ -QDeclarativeListProperty<QQuickVisualDataGroup> QQuickVisualDataModel::groups() +QQmlListProperty<QQuickVisualDataGroup> QQuickVisualDataModel::groups() { Q_D(QQuickVisualDataModel); - return QDeclarativeListProperty<QQuickVisualDataGroup>( + return QQmlListProperty<QQuickVisualDataGroup>( this, d, QQuickVisualDataModelPrivate::group_append, @@ -587,7 +587,7 @@ void QQuickVisualDataModelPrivate::updateFilterGroup() if (!m_cacheMetaType) return; - QDeclarativeListCompositor::Group previousGroup = m_compositorGroup; + QQuickListCompositor::Group previousGroup = m_compositorGroup; m_compositorGroup = Compositor::Default; for (int i = 1; i < m_groupCount; ++i) { if (m_filterGroup == m_cacheMetaType->groupNames.at(i - 1)) { @@ -598,11 +598,11 @@ void QQuickVisualDataModelPrivate::updateFilterGroup() QQuickVisualDataGroupPrivate::get(m_groups[m_compositorGroup])->emitters.insert(this); if (m_compositorGroup != previousGroup) { - QVector<QDeclarativeChangeSet::Remove> removes; - QVector<QDeclarativeChangeSet::Insert> inserts; + QVector<QQuickChangeSet::Remove> removes; + QVector<QQuickChangeSet::Insert> inserts; m_compositor.transition(previousGroup, m_compositorGroup, &removes, &inserts); - QDeclarativeChangeSet changeSet; + QQuickChangeSet changeSet; changeSet.apply(removes, inserts); emit q->modelUpdated(changeSet, false); @@ -652,19 +652,19 @@ QObject *QQuickVisualDataModel::parts() return d->m_parts; } -void QQuickVisualDataModelPrivate::emitCreatedPackage(QQuickVisualDataModelItem *cacheItem, QDeclarativePackage *package) +void QQuickVisualDataModelPrivate::emitCreatedPackage(QQuickVisualDataModelItem *cacheItem, QQuickPackage *package) { for (int i = 1; i < m_groupCount; ++i) QQuickVisualDataGroupPrivate::get(m_groups[i])->createdPackage(cacheItem->index[i], package); } -void QQuickVisualDataModelPrivate::emitInitPackage(QQuickVisualDataModelItem *cacheItem, QDeclarativePackage *package) +void QQuickVisualDataModelPrivate::emitInitPackage(QQuickVisualDataModelItem *cacheItem, QQuickPackage *package) { for (int i = 1; i < m_groupCount; ++i) QQuickVisualDataGroupPrivate::get(m_groups[i])->initPackage(cacheItem->index[i], package); } -void QQuickVisualDataModelPrivate::emitDestroyingPackage(QDeclarativePackage *package) +void QQuickVisualDataModelPrivate::emitDestroyingPackage(QQuickPackage *package) { for (int i = 1; i < m_groupCount; ++i) QQuickVisualDataGroupPrivate::get(m_groups[i])->destroyingPackage(package); @@ -687,23 +687,23 @@ void QQuickVisualDataModelPrivate::releaseIncubator(QVDMIncubationTask *incubati } } -void QQuickVisualDataModelPrivate::incubatorStatusChanged(QVDMIncubationTask *incubationTask, QDeclarativeIncubator::Status status) +void QQuickVisualDataModelPrivate::incubatorStatusChanged(QVDMIncubationTask *incubationTask, QQmlIncubator::Status status) { Q_Q(QQuickVisualDataModel); - if (status != QDeclarativeIncubator::Ready && status != QDeclarativeIncubator::Error) + if (status != QQmlIncubator::Ready && status != QQmlIncubator::Error) return; QQuickVisualDataModelItem *cacheItem = incubationTask->incubating; cacheItem->incubationTask = 0; - if (status == QDeclarativeIncubator::Ready) { + if (status == QQmlIncubator::Ready) { incubationTask->incubating = 0; releaseIncubator(incubationTask); - if (QDeclarativePackage *package = qobject_cast<QDeclarativePackage *>(cacheItem->object)) + if (QQuickPackage *package = qobject_cast<QQuickPackage *>(cacheItem->object)) emitCreatedPackage(cacheItem, package); else if (QQuickItem *item = qobject_cast<QQuickItem *>(cacheItem->object)) emitCreatedItem(cacheItem, item); - } else if (status == QDeclarativeIncubator::Error) { + } else if (status == QQmlIncubator::Error) { delete incubationTask->incubatingContext; incubationTask->incubatingContext = 0; if (!cacheItem->isReferenced()) { @@ -727,7 +727,7 @@ void QQuickVisualDataModelPrivate::setInitialState(QVDMIncubationTask *incubatio { QQuickVisualDataModelItem *cacheItem = incubationTask->incubating; cacheItem->object = o; - QDeclarative_setParent_noEvent(incubationTask->incubatingContext, cacheItem->object); + QQml_setParent_noEvent(incubationTask->incubatingContext, cacheItem->object); incubationTask->incubatingContext = 0; cacheItem->attached = QQuickVisualDataModelAttached::properties(cacheItem->object); @@ -735,7 +735,7 @@ void QQuickVisualDataModelPrivate::setInitialState(QVDMIncubationTask *incubatio new QQuickVisualDataModelAttachedMetaObject(cacheItem->attached, m_cacheMetaType); cacheItem->attached->emitChanges(); - if (QDeclarativePackage *package = qobject_cast<QDeclarativePackage *>(cacheItem->object)) + if (QQuickPackage *package = qobject_cast<QQuickPackage *>(cacheItem->object)) emitInitPackage(cacheItem, package); else if (QQuickItem *item = qobject_cast<QQuickItem *>(cacheItem->object)) emitInitItem(cacheItem, item); @@ -771,13 +771,13 @@ QObject *QQuickVisualDataModelPrivate::object(Compositor::Group group, int index cacheItem->incubationTask->forceCompletion(); } } else if (!cacheItem->object) { - QVDMIncubationTask *incubator = new QVDMIncubationTask(this, asynchronous ? QDeclarativeIncubator::Asynchronous : QDeclarativeIncubator::AsynchronousIfNested); + QVDMIncubationTask *incubator = new QVDMIncubationTask(this, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested); cacheItem->incubationTask = incubator; - QDeclarativeContext *creationContext = m_delegate->creationContext(); - QDeclarativeContext *rootContext = new QQuickVisualDataModelContext( + QQmlContext *creationContext = m_delegate->creationContext(); + QQmlContext *rootContext = new QQuickVisualDataModelContext( cacheItem, creationContext ? creationContext : m_context.data()); - QDeclarativeContext *ctxt = rootContext; + QQmlContext *ctxt = rootContext; if (m_adaptorModel->flags() & QQuickVisualAdaptorModel::ProxiedObject) { if (QQuickVisualAdaptorModelProxyInterface *proxy = qobject_cast<QQuickVisualAdaptorModelProxyInterface *>(cacheItem)) { ctxt->setContextObject(proxy->proxiedObject()); @@ -913,13 +913,13 @@ void QQuickVisualDataModelPrivate::itemsChanged(const QVector<Compositor::Change if (!m_delegate) return; - QVarLengthArray<QVector<QDeclarativeChangeSet::Change>, Compositor::MaximumGroupCount> translatedChanges(m_groupCount); + QVarLengthArray<QVector<QQuickChangeSet::Change>, Compositor::MaximumGroupCount> translatedChanges(m_groupCount); foreach (const Compositor::Change &change, changes) { for (int i = 1; i < m_groupCount; ++i) { if (change.inGroup(i)) { translatedChanges[i].append( - QDeclarativeChangeSet::Change(change.index[i], change.count)); + QQuickChangeSet::Change(change.index[i], change.count)); } } } @@ -941,7 +941,7 @@ void QQuickVisualDataModel::_q_itemsChanged(int index, int count) void QQuickVisualDataModelPrivate::itemsInserted( const QVector<Compositor::Insert> &inserts, - QVarLengthArray<QVector<QDeclarativeChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts, + QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts, QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems) { int cacheIndex = 0; @@ -959,7 +959,7 @@ void QQuickVisualDataModelPrivate::itemsInserted( for (int i = 1; i < m_groupCount; ++i) { if (insert.inGroup(i)) { (*translatedInserts)[i].append( - QDeclarativeChangeSet::Insert(insert.index[i], insert.count, insert.moveId)); + QQuickChangeSet::Insert(insert.index[i], insert.count, insert.moveId)); inserted[i] += insert.count; } } @@ -995,7 +995,7 @@ void QQuickVisualDataModelPrivate::itemsInserted( void QQuickVisualDataModelPrivate::itemsInserted(const QVector<Compositor::Insert> &inserts) { - QVarLengthArray<QVector<QDeclarativeChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount); + QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount); itemsInserted(inserts, &translatedInserts); Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache)); if (!m_delegate) @@ -1019,7 +1019,7 @@ void QQuickVisualDataModel::_q_itemsInserted(int index, int count) void QQuickVisualDataModelPrivate::itemsRemoved( const QVector<Compositor::Remove> &removes, - QVarLengthArray<QVector<QDeclarativeChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves, + QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves, QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems) { int cacheIndex = 0; @@ -1038,7 +1038,7 @@ void QQuickVisualDataModelPrivate::itemsRemoved( for (int i = 1; i < m_groupCount; ++i) { if (remove.inGroup(i)) { (*translatedRemoves)[i].append( - QDeclarativeChangeSet::Remove(remove.index[i], remove.count, remove.moveId)); + QQuickChangeSet::Remove(remove.index[i], remove.count, remove.moveId)); removed[i] += remove.count; } } @@ -1056,7 +1056,7 @@ void QQuickVisualDataModelPrivate::itemsRemoved( QQuickVisualDataModelItem *cacheItem = m_cache.at(cacheIndex); if (remove.inGroup(Compositor::Persisted) && cacheItem->objectRef == 0 && cacheItem->object) { destroy(cacheItem->object); - if (QDeclarativePackage *package = qobject_cast<QDeclarativePackage *>(cacheItem->object)) + if (QQuickPackage *package = qobject_cast<QQuickPackage *>(cacheItem->object)) emitDestroyingPackage(package); else if (QQuickItem *item = qobject_cast<QQuickItem *>(cacheItem->object)) emitDestroyingItem(item); @@ -1093,7 +1093,7 @@ void QQuickVisualDataModelPrivate::itemsRemoved( void QQuickVisualDataModelPrivate::itemsRemoved(const QVector<Compositor::Remove> &removes) { - QVarLengthArray<QVector<QDeclarativeChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount); + QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount); itemsRemoved(removes, &translatedRemoves); Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache)); if (!m_delegate) @@ -1121,10 +1121,10 @@ void QQuickVisualDataModelPrivate::itemsMoved( { QHash<int, QList<QQuickVisualDataModelItem *> > movedItems; - QVarLengthArray<QVector<QDeclarativeChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount); + QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount); itemsRemoved(removes, &translatedRemoves, &movedItems); - QVarLengthArray<QVector<QDeclarativeChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount); + QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount); itemsInserted(inserts, &translatedInserts, &movedItems); Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache)); Q_ASSERT(movedItems.isEmpty()); @@ -1169,7 +1169,7 @@ QQuickVisualDataModelPrivate::buildChangeList(const QVector<T> &changes) return indexes; } -void QQuickVisualDataModelPrivate::emitModelUpdated(const QDeclarativeChangeSet &changeSet, bool reset) +void QQuickVisualDataModelPrivate::emitModelUpdated(const QQuickChangeSet &changeSet, bool reset) { Q_Q(QQuickVisualDataModel); emit q->modelUpdated(changeSet, reset); @@ -1183,7 +1183,7 @@ void QQuickVisualDataModelPrivate::emitChanges() return; m_transaction = true; - QV8Engine *engine = QDeclarativeEnginePrivate::getV8Engine(m_context->engine()); + QV8Engine *engine = QQmlEnginePrivate::getV8Engine(m_context->engine()); for (int i = 1; i < m_groupCount; ++i) QQuickVisualDataGroupPrivate::get(m_groups[i])->emitChanges(engine); m_transaction = false; @@ -1714,14 +1714,14 @@ void QQuickVisualDataGroupPrivate::setModel(QQuickVisualDataModel *m, Compositor void QQuickVisualDataGroupPrivate::emitChanges(QV8Engine *engine) { Q_Q(QQuickVisualDataGroup); - static int idx = signalIndex("changed(QDeclarativeV8Handle,QDeclarativeV8Handle)"); + static int idx = signalIndex("changed(QQmlV8Handle,QQmlV8Handle)"); if (isSignalConnected(idx) && !changeSet.isEmpty()) { v8::HandleScope handleScope; v8::Context::Scope contextScope(engine->context()); v8::Local<v8::Array> removed = QQuickVisualDataModelPrivate::buildChangeList(changeSet.removes()); v8::Local<v8::Array> inserted = QQuickVisualDataModelPrivate::buildChangeList(changeSet.inserts()); emit q->changed( - QDeclarativeV8Handle::fromHandle(removed), QDeclarativeV8Handle::fromHandle(inserted)); + QQmlV8Handle::fromHandle(removed), QQmlV8Handle::fromHandle(inserted)); } if (changeSet.difference() != 0) emit q->countChanged(); @@ -1734,19 +1734,19 @@ void QQuickVisualDataGroupPrivate::emitModelUpdated(bool reset) changeSet.clear(); } -void QQuickVisualDataGroupPrivate::createdPackage(int index, QDeclarativePackage *package) +void QQuickVisualDataGroupPrivate::createdPackage(int index, QQuickPackage *package) { for (QQuickVisualDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it) it->createdPackage(index, package); } -void QQuickVisualDataGroupPrivate::initPackage(int index, QDeclarativePackage *package) +void QQuickVisualDataGroupPrivate::initPackage(int index, QQuickPackage *package) { for (QQuickVisualDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it) it->initPackage(index, package); } -void QQuickVisualDataGroupPrivate::destroyingPackage(QDeclarativePackage *package) +void QQuickVisualDataGroupPrivate::destroyingPackage(QQuickPackage *package) { for (QQuickVisualDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it) it->destroyingPackage(package); @@ -1867,16 +1867,16 @@ void QQuickVisualDataGroup::setDefaultInclude(bool include) \endlist */ -QDeclarativeV8Handle QQuickVisualDataGroup::get(int index) +QQmlV8Handle QQuickVisualDataGroup::get(int index) { Q_D(QQuickVisualDataGroup); if (!d->model) - return QDeclarativeV8Handle::fromHandle(v8::Undefined());; + return QQmlV8Handle::fromHandle(v8::Undefined());; QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model); if (index < 0 || index >= model->m_compositor.count(d->group)) { qmlInfo(this) << tr("get: index out of range"); - return QDeclarativeV8Handle::fromHandle(v8::Undefined()); + return QQmlV8Handle::fromHandle(v8::Undefined()); } Compositor::iterator it = model->m_compositor.find(d->group, index); @@ -1902,7 +1902,7 @@ QDeclarativeV8Handle QQuickVisualDataGroup::get(int index) ++cacheItem->scriptRef; } - return QDeclarativeV8Handle::fromHandle(cacheItem->indexHandle); + return QQmlV8Handle::fromHandle(cacheItem->indexHandle); } bool QQuickVisualDataGroupPrivate::parseIndex( @@ -1925,7 +1925,7 @@ bool QQuickVisualDataGroupPrivate::parseIndex( return false; } -void QQuickVisualDataGroup::insert(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::insert(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model); @@ -1975,7 +1975,7 @@ void QQuickVisualDataGroup::insert(QDeclarativeV8Function *args) group remain instantiated when not referenced by any view. */ -void QQuickVisualDataGroup::create(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::create(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); if (!d->model) @@ -2030,7 +2030,7 @@ void QQuickVisualDataGroup::create(QDeclarativeV8Function *args) model->emitChanges(); } -void QQuickVisualDataGroup::resolve(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::resolve(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); if (!d->model) @@ -2130,7 +2130,7 @@ void QQuickVisualDataGroup::resolve(QDeclarativeV8Function *args) Removes \a count items starting at \a index from the group. */ -void QQuickVisualDataGroup::remove(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::remove(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); if (!d->model) @@ -2169,7 +2169,7 @@ void QQuickVisualDataGroup::remove(QDeclarativeV8Function *args) } bool QQuickVisualDataGroupPrivate::parseGroupArgs( - QDeclarativeV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const + QQmlV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const { if (!model || !QQuickVisualDataModelPrivate::get(model)->m_cacheMetaType) return false; @@ -2202,7 +2202,7 @@ bool QQuickVisualDataGroupPrivate::parseGroupArgs( Adds \a count items starting at \a index to \a groups. */ -void QQuickVisualDataGroup::addGroups(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::addGroups(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); Compositor::Group group = d->group; @@ -2232,7 +2232,7 @@ void QQuickVisualDataGroup::addGroups(QDeclarativeV8Function *args) Removes \a count items starting at \a index from \a groups. */ -void QQuickVisualDataGroup::removeGroups(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::removeGroups(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); Compositor::Group group = d->group; @@ -2262,7 +2262,7 @@ void QQuickVisualDataGroup::removeGroups(QDeclarativeV8Function *args) Sets the \a groups \a count items starting at \a index belong to. */ -void QQuickVisualDataGroup::setGroups(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::setGroups(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); Compositor::Group group = d->group; @@ -2298,7 +2298,7 @@ void QQuickVisualDataGroup::setGroups(QDeclarativeV8Function *args) Moves \a count at \a from in a group \a to a new position. */ -void QQuickVisualDataGroup::move(QDeclarativeV8Function *args) +void QQuickVisualDataGroup::move(QQmlV8Function *args) { Q_D(QQuickVisualDataGroup); @@ -2424,7 +2424,7 @@ void QQuickVisualPartsModel::updateFilterGroup() m_filterGroup = model->m_filterGroup; } - QDeclarativeListCompositor::Group previousGroup = m_compositorGroup; + QQuickListCompositor::Group previousGroup = m_compositorGroup; m_compositorGroup = Compositor::Default; QQuickVisualDataGroupPrivate::get(model->m_groups[Compositor::Default])->emitters.insert(this); for (int i = 1; i < model->m_groupCount; ++i) { @@ -2436,11 +2436,11 @@ void QQuickVisualPartsModel::updateFilterGroup() QQuickVisualDataGroupPrivate::get(model->m_groups[m_compositorGroup])->emitters.insert(this); if (m_compositorGroup != previousGroup) { - QVector<QDeclarativeChangeSet::Remove> removes; - QVector<QDeclarativeChangeSet::Insert> inserts; + QVector<QQuickChangeSet::Remove> removes; + QVector<QQuickChangeSet::Insert> inserts; model->m_compositor.transition(previousGroup, m_compositorGroup, &removes, &inserts); - QDeclarativeChangeSet changeSet; + QQuickChangeSet changeSet; changeSet.apply(removes, inserts); if (!changeSet.isEmpty()) emit modelUpdated(changeSet, false); @@ -2451,7 +2451,7 @@ void QQuickVisualPartsModel::updateFilterGroup() } void QQuickVisualPartsModel::updateFilterGroup( - Compositor::Group group, const QDeclarativeChangeSet &changeSet) + Compositor::Group group, const QQuickChangeSet &changeSet) { if (!m_inheritGroup) return; @@ -2492,7 +2492,7 @@ QQuickItem *QQuickVisualPartsModel::item(int index, bool asynchronous) QObject *object = model->object(m_compositorGroup, index, asynchronous, true); - if (QDeclarativePackage *package = qobject_cast<QDeclarativePackage *>(object)) { + if (QQuickPackage *package = qobject_cast<QQuickPackage *>(object)) { QObject *part = package->part(m_part); if (!part) return 0; @@ -2516,10 +2516,10 @@ QQuickVisualModel::ReleaseFlags QQuickVisualPartsModel::release(QQuickItem *item { QQuickVisualModel::ReleaseFlags flags = 0; - QHash<QObject *, QDeclarativePackage *>::iterator it = m_packaged.find(item); + QHash<QObject *, QQuickPackage *>::iterator it = m_packaged.find(item); if (it != m_packaged.end()) { - QDeclarativePackage *package = *it; - QDeclarative_setParent_noEvent(item, package); + QQuickPackage *package = *it; + QQml_setParent_noEvent(item, package); QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(m_model); flags = model->release(package); m_packaged.erase(it); @@ -2545,7 +2545,7 @@ void QQuickVisualPartsModel::setWatchedRoles(QList<QByteArray> roles) int QQuickVisualPartsModel::indexOf(QQuickItem *item, QObject *) const { - QHash<QObject *, QDeclarativePackage *>::const_iterator it = m_packaged.find(item); + QHash<QObject *, QQuickPackage *>::const_iterator it = m_packaged.find(item); if (it != m_packaged.end()) { if (QQuickVisualDataModelAttached *attached = QQuickVisualDataModelAttached::properties(*it)) return attached->m_cacheItem->index[m_compositorGroup]; @@ -2553,29 +2553,29 @@ int QQuickVisualPartsModel::indexOf(QQuickItem *item, QObject *) const return -1; } -void QQuickVisualPartsModel::createdPackage(int index, QDeclarativePackage *package) +void QQuickVisualPartsModel::createdPackage(int index, QQuickPackage *package) { if (QQuickItem *item = qobject_cast<QQuickItem *>(package->part(m_part))) emit createdItem(index, item); } -void QQuickVisualPartsModel::initPackage(int index, QDeclarativePackage *package) +void QQuickVisualPartsModel::initPackage(int index, QQuickPackage *package) { if (QQuickItem *item = qobject_cast<QQuickItem *>(package->part(m_part))) emit initItem(index, item); } -void QQuickVisualPartsModel::destroyingPackage(QDeclarativePackage *package) +void QQuickVisualPartsModel::destroyingPackage(QQuickPackage *package) { if (QQuickItem *item = qobject_cast<QQuickItem *>(package->part(m_part))) { Q_ASSERT(!m_packaged.contains(item)); emit destroyingItem(item); item->setParentItem(0); - QDeclarative_setParent_noEvent(item, package); + QQml_setParent_noEvent(item, package); } } -void QQuickVisualPartsModel::emitModelUpdated(const QDeclarativeChangeSet &changeSet, bool reset) +void QQuickVisualPartsModel::emitModelUpdated(const QQuickChangeSet &changeSet, bool reset) { emit modelUpdated(changeSet, reset); if (changeSet.difference() != 0) diff --git a/src/quick/items/qquickvisualdatamodel_p.h b/src/quick/items/qquickvisualdatamodel_p.h index 54cc16d660..ee90d528f4 100644 --- a/src/quick/items/qquickvisualdatamodel_p.h +++ b/src/quick/items/qquickvisualdatamodel_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,7 +42,7 @@ #ifndef QQUICKVISUALDATAMODEL_P_H #define QQUICKVISUALDATAMODEL_P_H -#include <private/qdeclarativelistcompositor_p.h> +#include <private/qquicklistcompositor_p.h> #include <private/qquickvisualitemmodel_p.h> #include <QtCore/qabstractitemmodel.h> @@ -50,7 +50,7 @@ #include <private/qv8engine_p.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlglobal_p.h> QT_BEGIN_HEADER @@ -58,33 +58,33 @@ Q_DECLARE_METATYPE(QModelIndex) QT_BEGIN_NAMESPACE -class QDeclarativeChangeSet; -class QDeclarativeComponent; -class QDeclarativePackage; -class QDeclarativeV8Function; +class QQuickChangeSet; +class QQmlComponent; +class QQuickPackage; +class QQmlV8Function; class QQuickVisualDataGroup; class QQuickVisualDataModelAttached; class QQuickVisualDataModelPrivate; -class Q_QUICK_EXPORT QQuickVisualDataModel : public QQuickVisualModel, public QDeclarativeParserStatus +class Q_QUICK_EXPORT QQuickVisualDataModel : public QQuickVisualModel, public QQmlParserStatus { Q_OBJECT Q_DECLARE_PRIVATE(QQuickVisualDataModel) Q_PROPERTY(QVariant model READ model WRITE setModel) - Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate) Q_PROPERTY(QString filterOnGroup READ filterGroup WRITE setFilterGroup NOTIFY filterGroupChanged RESET resetFilterGroup) Q_PROPERTY(QQuickVisualDataGroup *items READ items CONSTANT) Q_PROPERTY(QQuickVisualDataGroup *persistedItems READ persistedItems CONSTANT) - Q_PROPERTY(QDeclarativeListProperty<QQuickVisualDataGroup> groups READ groups CONSTANT) + Q_PROPERTY(QQmlListProperty<QQuickVisualDataGroup> groups READ groups CONSTANT) Q_PROPERTY(QObject *parts READ parts CONSTANT) Q_PROPERTY(QVariant rootIndex READ rootIndex WRITE setRootIndex NOTIFY rootIndexChanged) Q_CLASSINFO("DefaultProperty", "delegate") - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: QQuickVisualDataModel(); - QQuickVisualDataModel(QDeclarativeContext *, QObject *parent=0); + QQuickVisualDataModel(QQmlContext *, QObject *parent=0); virtual ~QQuickVisualDataModel(); void classBegin(); @@ -93,8 +93,8 @@ public: QVariant model() const; void setModel(const QVariant &); - QDeclarativeComponent *delegate() const; - void setDelegate(QDeclarativeComponent *); + QQmlComponent *delegate() const; + void setDelegate(QQmlComponent *); QVariant rootIndex() const; void setRootIndex(const QVariant &root); @@ -117,7 +117,7 @@ public: QQuickVisualDataGroup *items(); QQuickVisualDataGroup *persistedItems(); - QDeclarativeListProperty<QQuickVisualDataGroup> groups(); + QQmlListProperty<QQuickVisualDataGroup> groups(); QObject *parts(); bool event(QEvent *); @@ -159,23 +159,23 @@ public: bool defaultInclude() const; void setDefaultInclude(bool include); - Q_INVOKABLE QDeclarativeV8Handle get(int index); + Q_INVOKABLE QQmlV8Handle get(int index); public Q_SLOTS: - void insert(QDeclarativeV8Function *); - void create(QDeclarativeV8Function *); - void resolve(QDeclarativeV8Function *); - void remove(QDeclarativeV8Function *); - void addGroups(QDeclarativeV8Function *); - void removeGroups(QDeclarativeV8Function *); - void setGroups(QDeclarativeV8Function *); - void move(QDeclarativeV8Function *); + void insert(QQmlV8Function *); + void create(QQmlV8Function *); + void resolve(QQmlV8Function *); + void remove(QQmlV8Function *); + void addGroups(QQmlV8Function *); + void removeGroups(QQmlV8Function *); + void setGroups(QQmlV8Function *); + void move(QQmlV8Function *); Q_SIGNALS: void countChanged(); void nameChanged(); void defaultIncludeChanged(); - void changed(const QDeclarativeV8Handle &removed, const QDeclarativeV8Handle &inserted); + void changed(const QQmlV8Handle &removed, const QQmlV8Handle &inserted); private: Q_DECLARE_PRIVATE(QQuickVisualDataGroup) }; @@ -194,7 +194,7 @@ public: , m_previousGroups(0) , m_modelChanged(false) { - QDeclarative_setParent_noEvent(this, parent); + QQml_setParent_noEvent(this, parent); } ~QQuickVisualDataModelAttached() { attachedProperties.remove(parent()); } @@ -229,7 +229,7 @@ Q_SIGNALS: public: QQuickVisualDataModelItem *m_cacheItem; int m_previousGroups; - int m_previousIndex[QDeclarativeListCompositor::MaximumGroupCount]; + int m_previousIndex[QQuickListCompositor::MaximumGroupCount]; bool m_modelChanged; static QHash<QObject*, QQuickVisualDataModelAttached*> attachedProperties; diff --git a/src/quick/items/qquickvisualdatamodel_p_p.h b/src/quick/items/qquickvisualdatamodel_p_p.h index 1fb23d78bb..c53ed5bdbb 100644 --- a/src/quick/items/qquickvisualdatamodel_p_p.h +++ b/src/quick/items/qquickvisualdatamodel_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,10 +44,10 @@ #include "qquickvisualdatamodel_p.h" -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeincubator.h> +#include <QtQml/qqmlcontext.h> +#include <QtQml/qqmlincubator.h> -#include <private/qdeclarativeopenmetaobject_p.h> +#include <private/qqmlopenmetaobject_p.h> // // W A R N I N G @@ -62,9 +62,9 @@ QT_BEGIN_NAMESPACE -typedef QDeclarativeListCompositor Compositor; +typedef QQuickListCompositor Compositor; -class QQuickVisualDataModelItemMetaType : public QDeclarativeRefCount +class QQuickVisualDataModelItemMetaType : public QQmlRefCount { public: QQuickVisualDataModelItemMetaType(QV8Engine *engine, QQuickVisualDataModel *model, const QStringList &groupNames); @@ -85,7 +85,7 @@ public: v8::Local<v8::String>, v8::Local<v8::Value> value, const v8::AccessorInfo &info); static v8::Handle<v8::Value> get_index(v8::Local<v8::String>, const v8::AccessorInfo &info); - QDeclarativeGuard<QQuickVisualDataModel> model; + QQmlGuard<QQuickVisualDataModel> model; const int groupCount; const int memberPropertyOffset; const int indexPropertyOffset; @@ -136,8 +136,8 @@ Q_SIGNALS: public: QQuickVisualDataModelItemMetaType * const metaType; - QDeclarativeGuard<QQuickVisualAdaptorModel> model; - QDeclarativeGuard<QObject> object; + QQmlGuard<QQuickVisualAdaptorModel> model; + QQmlGuard<QObject> object; QQuickVisualDataModelAttached *attached; v8::Persistent<v8::Object> indexHandle; v8::Persistent<v8::Value> modelHandle; @@ -145,17 +145,17 @@ public: int objectRef; int scriptRef; int groups; - int index[QDeclarativeListCompositor::MaximumGroupCount]; + int index[QQuickListCompositor::MaximumGroupCount]; QVDMIncubationTask *incubationTask; }; class QQuickVisualDataModelPrivate; -class QVDMIncubationTask : public QDeclarativeIncubator +class QVDMIncubationTask : public QQmlIncubator { public: QVDMIncubationTask(QQuickVisualDataModelPrivate *l, IncubationMode mode) - : QDeclarativeIncubator(mode) + : QQmlIncubator(mode) , incubating(0) , incubatingContext(0) , vdm(l) {} @@ -164,7 +164,7 @@ public: virtual void setInitialState(QObject *); QQuickVisualDataModelItem *incubating; - QDeclarativeContext *incubatingContext; + QQmlContext *incubatingContext; private: QQuickVisualDataModelPrivate *vdm; @@ -174,10 +174,10 @@ private: class QQuickVisualDataGroupEmitter { public: - virtual void emitModelUpdated(const QDeclarativeChangeSet &changeSet, bool reset) = 0; - virtual void createdPackage(int, QDeclarativePackage *) {} - virtual void initPackage(int, QDeclarativePackage *) {} - virtual void destroyingPackage(QDeclarativePackage *) {} + virtual void emitModelUpdated(const QQuickChangeSet &changeSet, bool reset) = 0; + virtual void createdPackage(int, QQuickPackage *) {} + virtual void initPackage(int, QQuickPackage *) {} + virtual void destroyingPackage(QQuickPackage *) {} QIntrusiveListNode emitterNode; }; @@ -198,18 +198,18 @@ public: void emitChanges(QV8Engine *engine); void emitModelUpdated(bool reset); - void createdPackage(int index, QDeclarativePackage *package); - void initPackage(int index, QDeclarativePackage *package); - void destroyingPackage(QDeclarativePackage *package); + void createdPackage(int index, QQuickPackage *package); + void initPackage(int index, QQuickPackage *package); + void destroyingPackage(QQuickPackage *package); bool parseIndex(const v8::Local<v8::Value> &value, int *index, Compositor::Group *group) const; bool parseGroupArgs( - QDeclarativeV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const; + QQmlV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const; Compositor::Group group; - QDeclarativeGuard<QQuickVisualDataModel> model; + QQmlGuard<QQuickVisualDataModel> model; QQuickVisualDataGroupEmitterList emitters; - QDeclarativeChangeSet changeSet; + QQuickChangeSet changeSet; QString name; bool defaultInclude; }; @@ -220,7 +220,7 @@ class QQuickVisualDataModelPrivate : public QObjectPrivate, public QQuickVisualD { Q_DECLARE_PUBLIC(QQuickVisualDataModel) public: - QQuickVisualDataModelPrivate(QDeclarativeContext *); + QQuickVisualDataModelPrivate(QQmlContext *); ~QQuickVisualDataModelPrivate(); static QQuickVisualDataModelPrivate *get(QQuickVisualDataModel *m) { @@ -234,13 +234,13 @@ public: void destroy(QObject *object); QQuickVisualDataModel::ReleaseFlags release(QObject *object); QString stringValue(Compositor::Group group, int index, const QString &name); - void emitCreatedPackage(QQuickVisualDataModelItem *cacheItem, QDeclarativePackage *package); - void emitInitPackage(QQuickVisualDataModelItem *cacheItem, QDeclarativePackage *package); + void emitCreatedPackage(QQuickVisualDataModelItem *cacheItem, QQuickPackage *package); + void emitInitPackage(QQuickVisualDataModelItem *cacheItem, QQuickPackage *package); void emitCreatedItem(QQuickVisualDataModelItem *cacheItem, QQuickItem *item) { emit q_func()->createdItem(cacheItem->index[m_compositorGroup], item); } void emitInitItem(QQuickVisualDataModelItem *cacheItem, QQuickItem *item) { emit q_func()->initItem(cacheItem->index[m_compositorGroup], item); } - void emitDestroyingPackage(QDeclarativePackage *package); + void emitDestroyingPackage(QQuickPackage *package); void emitDestroyingItem(QQuickItem *item) { emit q_func()->destroyingItem(item); } void updateFilterGroup(); @@ -251,12 +251,12 @@ public: void itemsInserted( const QVector<Compositor::Insert> &inserts, - QVarLengthArray<QVector<QDeclarativeChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts, + QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts, QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems = 0); void itemsInserted(const QVector<Compositor::Insert> &inserts); void itemsRemoved( const QVector<Compositor::Remove> &removes, - QVarLengthArray<QVector<QDeclarativeChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves, + QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves, QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems = 0); void itemsRemoved(const QVector<Compositor::Remove> &removes); void itemsMoved( @@ -264,29 +264,29 @@ public: void itemsChanged(const QVector<Compositor::Change> &changes); template <typename T> static v8::Local<v8::Array> buildChangeList(const QVector<T> &changes); void emitChanges(); - void emitModelUpdated(const QDeclarativeChangeSet &changeSet, bool reset); + void emitModelUpdated(const QQuickChangeSet &changeSet, bool reset); bool insert(Compositor::insert_iterator &before, const v8::Local<v8::Object> &object, int groups); - static void group_append(QDeclarativeListProperty<QQuickVisualDataGroup> *property, QQuickVisualDataGroup *group); - static int group_count(QDeclarativeListProperty<QQuickVisualDataGroup> *property); - static QQuickVisualDataGroup *group_at(QDeclarativeListProperty<QQuickVisualDataGroup> *property, int index); + static void group_append(QQmlListProperty<QQuickVisualDataGroup> *property, QQuickVisualDataGroup *group); + static int group_count(QQmlListProperty<QQuickVisualDataGroup> *property); + static QQuickVisualDataGroup *group_at(QQmlListProperty<QQuickVisualDataGroup> *property, int index); void releaseIncubator(QVDMIncubationTask *incubationTask); - void incubatorStatusChanged(QVDMIncubationTask *incubationTask, QDeclarativeIncubator::Status status); + void incubatorStatusChanged(QVDMIncubationTask *incubationTask, QQmlIncubator::Status status); void setInitialState(QVDMIncubationTask *incubationTask, QObject *o); QQuickVisualAdaptorModel *m_adaptorModel; - QDeclarativeComponent *m_delegate; + QQmlComponent *m_delegate; QQuickVisualDataModelItemMetaType *m_cacheMetaType; - QDeclarativeGuard<QDeclarativeContext> m_context; + QQmlGuard<QQmlContext> m_context; QList<QQuickVisualDataModelItem *> m_cache; QQuickVisualDataModelParts *m_parts; QQuickVisualDataGroupEmitterList m_pendingParts; - QDeclarativeListCompositor m_compositor; - QDeclarativeListCompositor::Group m_compositorGroup; + QQuickListCompositor m_compositor; + QQuickListCompositor::Group m_compositorGroup; bool m_complete : 1; bool m_delegateValidated : 1; bool m_reset : 1; @@ -321,7 +321,7 @@ public: void setFilterGroup(const QString &group); void resetFilterGroup(); void updateFilterGroup(); - void updateFilterGroup(Compositor::Group group, const QDeclarativeChangeSet &changeSet); + void updateFilterGroup(Compositor::Group group, const QQuickChangeSet &changeSet); int count() const; bool isValid() const; @@ -332,18 +332,18 @@ public: int indexOf(QQuickItem *item, QObject *objectContext) const; - void emitModelUpdated(const QDeclarativeChangeSet &changeSet, bool reset); + void emitModelUpdated(const QQuickChangeSet &changeSet, bool reset); - void createdPackage(int index, QDeclarativePackage *package); - void initPackage(int index, QDeclarativePackage *package); - void destroyingPackage(QDeclarativePackage *package); + void createdPackage(int index, QQuickPackage *package); + void initPackage(int index, QQuickPackage *package); + void destroyingPackage(QQuickPackage *package); Q_SIGNALS: void filterGroupChanged(); private: QQuickVisualDataModel *m_model; - QHash<QObject *, QDeclarativePackage *> m_packaged; + QHash<QObject *, QQuickPackage *> m_packaged; QString m_part; QString m_filterGroup; QList<QByteArray> m_watchedRoles; @@ -353,11 +353,11 @@ private: class QMetaPropertyBuilder; -class QQuickVisualDataModelPartsMetaObject : public QDeclarativeOpenMetaObject +class QQuickVisualDataModelPartsMetaObject : public QQmlOpenMetaObject { public: QQuickVisualDataModelPartsMetaObject(QObject *parent) - : QDeclarativeOpenMetaObject(parent) {} + : QQmlOpenMetaObject(parent) {} virtual void propertyCreated(int, QMetaPropertyBuilder &); virtual QVariant initialValue(int); @@ -387,15 +387,15 @@ private: QQuickVisualDataModelItemMetaType *metaType; }; -class QQuickVisualDataModelContext : public QDeclarativeContext +class QQuickVisualDataModelContext : public QQmlContext { Q_OBJECT public: QQuickVisualDataModelContext( QQuickVisualDataModelItem *cacheItem, - QDeclarativeContext *parentContext, + QQmlContext *parentContext, QObject *parent = 0) - : QDeclarativeContext(parentContext, parent) + : QQmlContext(parentContext, parent) , cacheItem(cacheItem) { ++cacheItem->scriptRef; diff --git a/src/quick/items/qquickvisualitemmodel.cpp b/src/quick/items/qquickvisualitemmodel.cpp index 2a24e3946c..b1fce55d7d 100644 --- a/src/quick/items/qquickvisualitemmodel.cpp +++ b/src/quick/items/qquickvisualitemmodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,11 +43,11 @@ #include "qquickitem.h" #include <QtCore/qcoreapplication.h> -#include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qdeclarativeengine.h> +#include <QtQml/qqmlcontext.h> +#include <QtQml/qqmlengine.h> -#include <private/qdeclarativechangeset_p.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qquickchangeset_p.h> +#include <private/qqmlglobal_p.h> #include <private/qobject_p.h> #include <QtCore/qhash.h> @@ -64,18 +64,18 @@ class QQuickVisualItemModelPrivate : public QObjectPrivate public: QQuickVisualItemModelPrivate() : QObjectPrivate() {} - static void children_append(QDeclarativeListProperty<QQuickItem> *prop, QQuickItem *item) { - QDeclarative_setParent_noEvent(item, prop->object); + static void children_append(QQmlListProperty<QQuickItem> *prop, QQuickItem *item) { + QQml_setParent_noEvent(item, prop->object); static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children.append(Item(item)); static_cast<QQuickVisualItemModelPrivate *>(prop->data)->itemAppended(); static_cast<QQuickVisualItemModelPrivate *>(prop->data)->emitChildrenChanged(); } - static int children_count(QDeclarativeListProperty<QQuickItem> *prop) { + static int children_count(QQmlListProperty<QQuickItem> *prop) { return static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children.count(); } - static QQuickItem *children_at(QDeclarativeListProperty<QQuickItem> *prop, int index) { + static QQuickItem *children_at(QQmlListProperty<QQuickItem> *prop, int index) { return static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children.at(index).item; } @@ -83,7 +83,7 @@ public: Q_Q(QQuickVisualItemModel); QQuickVisualItemModelAttached *attached = QQuickVisualItemModelAttached::properties(children.last().item); attached->setIndex(children.count()-1); - QDeclarativeChangeSet changeSet; + QQuickChangeSet changeSet; changeSet.insert(children.count() - 1, 1); emit q->modelUpdated(changeSet, false); emit q->countChanged(); @@ -165,10 +165,10 @@ QQuickVisualItemModel::QQuickVisualItemModel(QObject *parent) It is attached to each instance of the delegate. */ -QDeclarativeListProperty<QQuickItem> QQuickVisualItemModel::children() +QQmlListProperty<QQuickItem> QQuickVisualItemModel::children() { Q_D(QQuickVisualItemModel); - return QDeclarativeListProperty<QQuickItem>(this, d, d->children_append, + return QQmlListProperty<QQuickItem>(this, d, d->children_append, d->children_count, d->children_at); } @@ -206,7 +206,7 @@ QQuickVisualModel::ReleaseFlags QQuickVisualItemModel::release(QQuickItem *item) if (d->children[idx].deref()) { // XXX todo - the original did item->scene()->removeItem(). Why? item->setParentItem(0); - QDeclarative_setParent_noEvent(item, this); + QQml_setParent_noEvent(item, this); } } return 0; @@ -217,7 +217,7 @@ QString QQuickVisualItemModel::stringValue(int index, const QString &name) Q_D(QQuickVisualItemModel); if (index < 0 || index >= d->children.count()) return QString(); - return QDeclarativeEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString(); + return QQmlEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString(); } int QQuickVisualItemModel::indexOf(QQuickItem *item, QObject *) const diff --git a/src/quick/items/qquickvisualitemmodel_p.h b/src/quick/items/qquickvisualitemmodel_p.h index f1c9d066be..9f90a29125 100644 --- a/src/quick/items/qquickvisualitemmodel_p.h +++ b/src/quick/items/qquickvisualitemmodel_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -43,7 +43,7 @@ #define QQUICKVISUALITEMMODEL_P_H #include <QtQuick/qtquickglobal.h> -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> #include <QtCore/qobject.h> QT_BEGIN_HEADER @@ -51,7 +51,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QQuickItem; -class QDeclarativeChangeSet; +class QQuickChangeSet; class Q_QUICK_EXPORT QQuickVisualModel : public QObject { @@ -76,7 +76,7 @@ public: Q_SIGNALS: void countChanged(); - void modelUpdated(const QDeclarativeChangeSet &changeSet, bool reset); + void modelUpdated(const QQuickChangeSet &changeSet, bool reset); void createdItem(int index, QQuickItem *item); void initItem(int index, QQuickItem *item); void destroyingItem(QQuickItem *item); @@ -96,7 +96,7 @@ class Q_QUICK_EXPORT QQuickVisualItemModel : public QQuickVisualModel Q_OBJECT Q_DECLARE_PRIVATE(QQuickVisualItemModel) - Q_PROPERTY(QDeclarativeListProperty<QQuickItem> children READ children NOTIFY childrenChanged DESIGNABLE false) + Q_PROPERTY(QQmlListProperty<QQuickItem> children READ children NOTIFY childrenChanged DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "children") public: @@ -112,7 +112,7 @@ public: virtual int indexOf(QQuickItem *item, QObject *objectContext) const; - QDeclarativeListProperty<QQuickItem> children(); + QQmlListProperty<QQuickItem> children(); static QQuickVisualItemModelAttached *qmlAttachedProperties(QObject *obj); diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp index b999e6f85d..55f11bf4c0 100644 --- a/src/quick/items/qquickwindowmanager.cpp +++ b/src/quick/items/qquickwindowmanager.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -51,7 +51,7 @@ #include <QtGui/QPlatformIntegration> #include <QtGui/private/qguiapplication_p.h> -#include <QtDeclarative/private/qdeclarativeglobal_p.h> +#include <QtQml/private/qqmlglobal_p.h> #include <QtQuick/QQuickCanvas> #include <QtQuick/private/qquickcanvas_p.h> diff --git a/src/quick/items/qquickwindowmanager_p.h b/src/quick/items/qquickwindowmanager_p.h index 014b38132e..ed972b5c76 100644 --- a/src/quick/items/qquickwindowmanager_p.h +++ b/src/quick/items/qquickwindowmanager_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/items/qquickwindowmodule_p.h b/src/quick/items/qquickwindowmodule_p.h index b02d29e776..e0da37d22c 100644 --- a/src/quick/items/qquickwindowmodule_p.h +++ b/src/quick/items/qquickwindowmodule_p.h @@ -42,7 +42,7 @@ #ifndef QQUICKWINDOWMODULE_H #define QQUICKWINDOWMODULE_H -#include <qdeclarative.h> +#include <qqml.h> QT_BEGIN_HEADER diff --git a/src/quick/items/syncexcludes b/src/quick/items/syncexcludes index ab7a374a5b..19e41ce643 100644 --- a/src/quick/items/syncexcludes +++ b/src/quick/items/syncexcludes @@ -6,6 +6,6 @@ qdeclarativelayoutitem.cpp qdeclarativelayoutitem_p.h qdeclarativefocuspanel.cpp qdeclarativefocuspanel_p.h -qdeclarativepath_p.h -qdeclarativepath_p_p.h +qquickpath_p.h +qquickpath_p_p.h qdeclarativepath.cpp diff --git a/src/quick/particles/qquickcumulativedirection.cpp b/src/quick/particles/qquickcumulativedirection.cpp index 0a2ac92a64..4f4a2cc46e 100644 --- a/src/quick/particles/qquickcumulativedirection.cpp +++ b/src/quick/particles/qquickcumulativedirection.cpp @@ -54,9 +54,9 @@ QQuickCumulativeDirection::QQuickCumulativeDirection(QObject *parent):QQuickDire { } -QDeclarativeListProperty<QQuickDirection> QQuickCumulativeDirection::directions() +QQmlListProperty<QQuickDirection> QQuickCumulativeDirection::directions() { - return QDeclarativeListProperty<QQuickDirection>(this, m_directions);//TODO: Proper list property + return QQmlListProperty<QQuickDirection>(this, m_directions);//TODO: Proper list property } const QPointF QQuickCumulativeDirection::sample(const QPointF &from) diff --git a/src/quick/particles/qquickcumulativedirection_p.h b/src/quick/particles/qquickcumulativedirection_p.h index 2fbb41151e..38663572fb 100644 --- a/src/quick/particles/qquickcumulativedirection_p.h +++ b/src/quick/particles/qquickcumulativedirection_p.h @@ -42,7 +42,7 @@ #ifndef QQuickCUMULATIVEDIRECTION_P_H #define QQuickCUMULATIVEDIRECTION_P_H #include "qquickdirection_p.h" -#include <QDeclarativeListProperty> +#include <QQmlListProperty> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -50,11 +50,11 @@ QT_BEGIN_NAMESPACE class QQuickCumulativeDirection : public QQuickDirection { Q_OBJECT - Q_PROPERTY(QDeclarativeListProperty<QQuickDirection> directions READ directions) + Q_PROPERTY(QQmlListProperty<QQuickDirection> directions READ directions) Q_CLASSINFO("DefaultProperty", "directions") public: explicit QQuickCumulativeDirection(QObject *parent = 0); - QDeclarativeListProperty<QQuickDirection> directions(); + QQmlListProperty<QQuickDirection> directions(); const QPointF sample(const QPointF &from); private: QList<QQuickDirection*> m_directions; diff --git a/src/quick/particles/qquickcustomaffector.cpp b/src/quick/particles/qquickcustomaffector.cpp index d890400a92..7c991c7352 100644 --- a/src/quick/particles/qquickcustomaffector.cpp +++ b/src/quick/particles/qquickcustomaffector.cpp @@ -41,8 +41,8 @@ #include "qquickcustomaffector_p.h" #include <private/qv8engine_p.h> -#include <private/qdeclarativeengine_p.h> -#include <QDeclarativeEngine> +#include <private/qqmlengine_p.h> +#include <QQmlEngine> #include <QDebug> QT_BEGIN_NAMESPACE @@ -102,7 +102,7 @@ QQuickCustomAffector::QQuickCustomAffector(QQuickItem *parent) : bool QQuickCustomAffector::isAffectConnected() { - static int idx = QObjectPrivate::get(this)->signalIndex("affectParticles(QDeclarativeV8Handle,qreal)"); + static int idx = QObjectPrivate::get(this)->signalIndex("affectParticles(QQmlV8Handle,qreal)"); return QObjectPrivate::get(this)->isSignalConnected(idx); } @@ -130,14 +130,14 @@ void QQuickCustomAffector::affectSystem(qreal dt) dt = 1.0; v8::HandleScope handle_scope; - v8::Context::Scope scope(QDeclarativeEnginePrivate::getV8Engine(qmlEngine(this))->context()); + v8::Context::Scope scope(QQmlEnginePrivate::getV8Engine(qmlEngine(this))->context()); v8::Handle<v8::Array> array = v8::Array::New(toAffect.size()); for (int i=0; i<toAffect.size(); i++) array->Set(i, toAffect[i]->v8Value().toHandle()); if (dt >= simulationCutoff || dt <= simulationDelta) { affectProperties(toAffect, dt); - emit affectParticles(QDeclarativeV8Handle::fromHandle(array), dt); + emit affectParticles(QQmlV8Handle::fromHandle(array), dt); } else { int realTime = m_system->timeInt; m_system->timeInt -= dt * 1000.0; @@ -145,12 +145,12 @@ void QQuickCustomAffector::affectSystem(qreal dt) m_system->timeInt += simulationDelta * 1000.0; dt -= simulationDelta; affectProperties(toAffect, simulationDelta); - emit affectParticles(QDeclarativeV8Handle::fromHandle(array), simulationDelta); + emit affectParticles(QQmlV8Handle::fromHandle(array), simulationDelta); } m_system->timeInt = realTime; if (dt > 0.0) { affectProperties(toAffect, dt); - emit affectParticles(QDeclarativeV8Handle::fromHandle(array), dt); + emit affectParticles(QQmlV8Handle::fromHandle(array), dt); } } diff --git a/src/quick/particles/qquickcustomaffector_p.h b/src/quick/particles/qquickcustomaffector_p.h index c38f53cb01..e831dbce1d 100644 --- a/src/quick/particles/qquickcustomaffector_p.h +++ b/src/quick/particles/qquickcustomaffector_p.h @@ -101,7 +101,7 @@ public: signals: - void affectParticles(QDeclarativeV8Handle particles, qreal dt); + void affectParticles(QQmlV8Handle particles, qreal dt); void positionChanged(QQuickDirection * arg); diff --git a/src/quick/particles/qquickcustomparticle.cpp b/src/quick/particles/qquickcustomparticle.cpp index 347b749ca6..3647e5bfc5 100644 --- a/src/quick/particles/qquickcustomparticle.cpp +++ b/src/quick/particles/qquickcustomparticle.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/particles/qquickcustomparticle_p.h b/src/quick/particles/qquickcustomparticle_p.h index c121141621..29f3d19657 100644 --- a/src/quick/particles/qquickcustomparticle_p.h +++ b/src/quick/particles/qquickcustomparticle_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/particles/qquickimageparticle.cpp b/src/quick/particles/qquickimageparticle.cpp index 2936935f3f..bf576b0a54 100644 --- a/src/quick/particles/qquickimageparticle.cpp +++ b/src/quick/particles/qquickimageparticle.cpp @@ -53,8 +53,8 @@ #include <QOpenGLFunctions> #include <QtQuick/qsgengine.h> #include <QtQuick/private/qsgtexture_p.h> -#include <private/qdeclarativeglobal_p.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <private/qqmlglobal_p.h> +#include <QtQml/qqmlinfo.h> #include <cmath> QT_BEGIN_NAMESPACE @@ -834,9 +834,9 @@ QQuickImageParticle::~QQuickImageParticle() { } -QDeclarativeListProperty<QQuickSprite> QQuickImageParticle::sprites() +QQmlListProperty<QQuickSprite> QQuickImageParticle::sprites() { - return QDeclarativeListProperty<QQuickSprite>(this, &m_sprites, spriteAppend, spriteCount, spriteAt, spriteClear); + return QQmlListProperty<QQuickSprite>(this, &m_sprites, spriteAppend, spriteCount, spriteAt, spriteClear); } void QQuickImageParticle::setImage(const QUrl &image) diff --git a/src/quick/particles/qquickimageparticle_p.h b/src/quick/particles/qquickimageparticle_p.h index a0f1595192..401f4609b0 100644 --- a/src/quick/particles/qquickimageparticle_p.h +++ b/src/quick/particles/qquickimageparticle_p.h @@ -43,8 +43,8 @@ #define ULTRAPARTICLE_H #include "qquickparticlepainter_p.h" #include "qquickdirection_p.h" -#include <private/qdeclarativepixmapcache_p.h> -#include <QDeclarativeListProperty> +#include <private/qquickpixmapcache_p.h> +#include <QQmlListProperty> #include <QtQuick/qsgsimplematerial.h> #include <QtGui/qcolor.h> @@ -150,7 +150,7 @@ class QQuickImageParticle : public QQuickParticlePainter { Q_OBJECT Q_PROPERTY(QUrl source READ image WRITE setImage NOTIFY imageChanged) - Q_PROPERTY(QDeclarativeListProperty<QQuickSprite> sprites READ sprites) + Q_PROPERTY(QQmlListProperty<QQuickSprite> sprites READ sprites) Q_PROPERTY(Status status READ status NOTIFY statusChanged) //### Is it worth having progress like Image has? //Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) @@ -193,7 +193,7 @@ public: enum Status { Null, Ready, Loading, Error }; - QDeclarativeListProperty<QQuickSprite> sprites(); + QQmlListProperty<QQuickSprite> sprites(); QQuickStochasticEngine* spriteEngine() {return m_spriteEngine;} enum EntryEffect { @@ -357,7 +357,7 @@ private slots: private: struct ImageData { QUrl source; - QDeclarativePixmap pix; + QQuickPixmap pix; }; ImageData *m_image; ImageData *m_colorTable; diff --git a/src/quick/particles/qquickitemparticle.cpp b/src/quick/particles/qquickitemparticle.cpp index db9e3d1519..571ca7f8a5 100644 --- a/src/quick/particles/qquickitemparticle.cpp +++ b/src/quick/particles/qquickitemparticle.cpp @@ -43,7 +43,7 @@ #include <private/qquickvisualitemmodel_p.h> #include <QtQuick/qsgnode.h> #include <QTimer> -#include <QDeclarativeComponent> +#include <QQmlComponent> #include <QDebug> QT_BEGIN_NAMESPACE diff --git a/src/quick/particles/qquickitemparticle_p.h b/src/quick/particles/qquickitemparticle_p.h index df104a5644..d02659889e 100644 --- a/src/quick/particles/qquickitemparticle_p.h +++ b/src/quick/particles/qquickitemparticle_p.h @@ -44,7 +44,7 @@ #include "qquickparticlepainter_p.h" #include <QPointer> #include <QSet> -#include <private/qdeclarativeanimation_p_p.h> +#include <private/qquickanimation_p_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -56,7 +56,7 @@ class QQuickItemParticle : public QQuickParticlePainter { Q_OBJECT Q_PROPERTY(bool fade READ fade WRITE setFade NOTIFY fadeChanged) - Q_PROPERTY(QDeclarativeComponent* delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) + Q_PROPERTY(QQmlComponent* delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) public: explicit QQuickItemParticle(QQuickItem *parent = 0); ~QQuickItemParticle(); @@ -66,7 +66,7 @@ public: virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *); static QQuickItemParticleAttached *qmlAttachedProperties(QObject *object); - QDeclarativeComponent* delegate() const + QQmlComponent* delegate() const { return m_delegate; } @@ -74,7 +74,7 @@ public: signals: void fadeChanged(); - void delegateChanged(QDeclarativeComponent* arg); + void delegateChanged(QQmlComponent* arg); public slots: //TODO: Add a follow mode, where moving the delegate causes the logical particle to go with it? @@ -84,7 +84,7 @@ public slots: void give(QQuickItem* item);//give from modelparticle void setFade(bool arg){if (arg == m_fade) return; m_fade = arg; emit fadeChanged();} - void setDelegate(QDeclarativeComponent* arg) + void setDelegate(QQmlComponent* arg) { if (m_delegate != arg) { m_delegate = arg; @@ -108,7 +108,7 @@ private: QSet<QQuickItem*> m_stasis; qreal m_lastT; int m_activeCount; - QDeclarativeComponent* m_delegate; + QQmlComponent* m_delegate; typedef QTickAnimationProxy<QQuickItemParticle, &QQuickItemParticle::tick> Clock; Clock *clock; diff --git a/src/quick/particles/qquickmaskextruder.cpp b/src/quick/particles/qquickmaskextruder.cpp index 3ed2eb953c..5c27cc7678 100644 --- a/src/quick/particles/qquickmaskextruder.cpp +++ b/src/quick/particles/qquickmaskextruder.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include "qquickmaskextruder_p.h" -#include <QtDeclarative/qdeclarative.h> -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqml.h> +#include <QtQml/qqmlinfo.h> #include <QImage> #include <QDebug> QT_BEGIN_NAMESPACE diff --git a/src/quick/particles/qquickmaskextruder_p.h b/src/quick/particles/qquickmaskextruder_p.h index 0c9f10b1b2..94b30720c1 100644 --- a/src/quick/particles/qquickmaskextruder_p.h +++ b/src/quick/particles/qquickmaskextruder_p.h @@ -42,7 +42,7 @@ #ifndef MASKEXTRUDER_H #define MASKEXTRUDER_H #include "qquickparticleextruder_p.h" -#include <private/qdeclarativepixmapcache_p.h> +#include <private/qquickpixmapcache_p.h> #include <QUrl> #include <QImage> @@ -81,7 +81,7 @@ private: void ensureInitialized(const QRectF &r); int m_lastWidth; int m_lastHeight; - QDeclarativePixmap m_pix; + QQuickPixmap m_pix; QImage m_img; QList<QPointF> m_mask;//TODO: More memory efficient datastructures //Perhaps just the mask for the largest bounds is stored, and interpolate up diff --git a/src/quick/particles/qquickparticleemitter.cpp b/src/quick/particles/qquickparticleemitter.cpp index 88c062b1f5..1625f1498a 100644 --- a/src/quick/particles/qquickparticleemitter.cpp +++ b/src/quick/particles/qquickparticleemitter.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qquickparticleemitter_p.h" -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE @@ -253,7 +253,7 @@ QQuickParticleEmitter::~QQuickParticleEmitter() bool QQuickParticleEmitter::isEmitConnected() { - static int idx = QObjectPrivate::get(this)->signalIndex("emitParticles(QDeclarativeV8Handle)"); + static int idx = QObjectPrivate::get(this)->signalIndex("emitParticles(QQmlV8Handle)"); return QObjectPrivate::get(this)->isSignalConnected(idx); } @@ -479,12 +479,12 @@ void QQuickParticleEmitter::emitWindow(int timeStamp) if (isEmitConnected()) { v8::HandleScope handle_scope; - v8::Context::Scope scope(QDeclarativeEnginePrivate::getV8Engine(qmlEngine(this))->context()); + v8::Context::Scope scope(QQmlEnginePrivate::getV8Engine(qmlEngine(this))->context()); v8::Handle<v8::Array> array = v8::Array::New(toEmit.size()); for (int i=0; i<toEmit.size(); i++) array->Set(i, toEmit[i]->v8Value().toHandle()); - emitParticles(QDeclarativeV8Handle::fromHandle(array));//A chance for arbitrary JS changes + emitParticles(QQmlV8Handle::fromHandle(array));//A chance for arbitrary JS changes } foreach (QQuickParticleData* d, toEmit) m_system->emitParticle(d); diff --git a/src/quick/particles/qquickparticleemitter_p.h b/src/quick/particles/qquickparticleemitter_p.h index 684a06be83..bb010a13e9 100644 --- a/src/quick/particles/qquickparticleemitter_p.h +++ b/src/quick/particles/qquickparticleemitter_p.h @@ -121,7 +121,7 @@ public: void setSpeedFromMovement(qreal s); virtual void componentComplete(); signals: - void emitParticles(QDeclarativeV8Handle particles); + void emitParticles(QQmlV8Handle particles); void particlesPerSecondChanged(qreal); void particleDurationChanged(int); void enabledChanged(bool); diff --git a/src/quick/particles/qquickparticlegroup.cpp b/src/quick/particles/qquickparticlegroup.cpp index ae0876f549..c4b230f5e9 100644 --- a/src/quick/particles/qquickparticlegroup.cpp +++ b/src/quick/particles/qquickparticlegroup.cpp @@ -96,20 +96,20 @@ QQuickParticleGroup::QQuickParticleGroup(QObject* parent) } -void delayedRedirect(QDeclarativeListProperty<QObject> *prop, QObject *value) +void delayedRedirect(QQmlListProperty<QObject> *prop, QObject *value) { QQuickParticleGroup* pg = qobject_cast<QQuickParticleGroup*>(prop->object); if (pg) pg->delayRedirect(value); } -QDeclarativeListProperty<QObject> QQuickParticleGroup::particleChildren() +QQmlListProperty<QObject> QQuickParticleGroup::particleChildren() { QQuickParticleSystem* system = qobject_cast<QQuickParticleSystem*>(parent()); if (system) - return QDeclarativeListProperty<QObject>(this, 0, &QQuickParticleSystem::statePropertyRedirect); + return QQmlListProperty<QObject>(this, 0, &QQuickParticleSystem::statePropertyRedirect); else - return QDeclarativeListProperty<QObject>(this, 0, &delayedRedirect); + return QQmlListProperty<QObject>(this, 0, &delayedRedirect); } void QQuickParticleGroup::setSystem(QQuickParticleSystem* arg) diff --git a/src/quick/particles/qquickparticlegroup_p.h b/src/quick/particles/qquickparticlegroup_p.h index f9703e8e03..774eb8df86 100644 --- a/src/quick/particles/qquickparticlegroup_p.h +++ b/src/quick/particles/qquickparticlegroup_p.h @@ -42,11 +42,11 @@ #define QQuickPARTICLEGROUP #include <private/qquickspriteengine_p.h> #include "qquickparticlesystem_p.h" -#include "qdeclarativeparserstatus.h" +#include "qqmlparserstatus.h" QT_BEGIN_NAMESPACE -class QQuickParticleGroup : public QQuickStochasticState, public QDeclarativeParserStatus +class QQuickParticleGroup : public QQuickStochasticState, public QQmlParserStatus { Q_OBJECT //### Would setting limits per group be useful? Or clutter the API? @@ -55,14 +55,14 @@ class QQuickParticleGroup : public QQuickStochasticState, public QDeclarativePar Q_PROPERTY(QQuickParticleSystem* system READ system WRITE setSystem NOTIFY systemChanged) //Intercept children requests and assign to the group & system - Q_PROPERTY(QDeclarativeListProperty<QObject> particleChildren READ particleChildren DESIGNABLE false)//### Hidden property for in-state system definitions - ought not to be used in actual "Sprite" states + Q_PROPERTY(QQmlListProperty<QObject> particleChildren READ particleChildren DESIGNABLE false)//### Hidden property for in-state system definitions - ought not to be used in actual "Sprite" states Q_CLASSINFO("DefaultProperty", "particleChildren") - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: explicit QQuickParticleGroup(QObject* parent = 0); - QDeclarativeListProperty<QObject> particleChildren(); + QQmlListProperty<QObject> particleChildren(); int maximumAlive() const { diff --git a/src/quick/particles/qquickparticlesmodule_p.h b/src/quick/particles/qquickparticlesmodule_p.h index 9ef9cd4711..6d16f00c15 100644 --- a/src/quick/particles/qquickparticlesmodule_p.h +++ b/src/quick/particles/qquickparticlesmodule_p.h @@ -42,7 +42,7 @@ #ifndef QQuickPARTICLESMODULE_H #define QQuickPARTICLESMODULE_H -#include <qdeclarative.h> +#include <qqml.h> QT_BEGIN_HEADER diff --git a/src/quick/particles/qquickparticlesystem.cpp b/src/quick/particles/qquickparticlesystem.cpp index 2a79b8d90d..6dc6d21812 100644 --- a/src/quick/particles/qquickparticlesystem.cpp +++ b/src/quick/particles/qquickparticlesystem.cpp @@ -50,7 +50,8 @@ #include "qquickparticlegroup_p.h" #include "qquicktrailemitter_p.h"//###For auto-follow on states, perhaps should be in emitter? -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> +#include <private/qqmlglobal_p.h> #include <cmath> #include <QDebug> @@ -524,10 +525,10 @@ void QQuickParticleData::clone(const QQuickParticleData& other) animationOwner = other.animationOwner; } -QDeclarativeV8Handle QQuickParticleData::v8Value() +QQmlV8Handle QQuickParticleData::v8Value() { if (!v8Datum) - v8Datum = new QQuickV8ParticleData(QDeclarativeEnginePrivate::getV8Engine(qmlEngine(system)), this); + v8Datum = new QQuickV8ParticleData(QQmlEnginePrivate::getV8Engine(qmlEngine(system)), this); return v8Datum->v8Value(); } //sets the x accleration without affecting the instantaneous x velocity or position @@ -782,7 +783,7 @@ void QQuickParticleSystem::setPaused(bool arg) { } } -void QQuickParticleSystem::statePropertyRedirect(QDeclarativeListProperty<QObject> *prop, QObject *value) +void QQuickParticleSystem::statePropertyRedirect(QQmlListProperty<QObject> *prop, QObject *value) { //Hooks up automatic state-associated stuff QQuickParticleSystem* sys = qobject_cast<QQuickParticleSystem*>(prop->object->parent()); diff --git a/src/quick/particles/qquickparticlesystem_p.h b/src/quick/particles/qquickparticlesystem_p.h index 68b29b9bc0..387219f720 100644 --- a/src/quick/particles/qquickparticlesystem_p.h +++ b/src/quick/particles/qquickparticlesystem_p.h @@ -50,8 +50,8 @@ #include <QSignalMapper> #include <private/qquicksprite_p.h> #include <QAbstractAnimation> -#include <QtDeclarative/qdeclarative.h> -#include <private/qv8engine_p.h> //For QDeclarativeV8Handle +#include <QtQml/qqml.h> +#include <private/qv8engine_p.h> //For QQmlV8Handle QT_BEGIN_HEADER @@ -224,7 +224,7 @@ public: float lifeLeft(); float curSize(); void clone(const QQuickParticleData& other);//Not =, leaves meta-data like index - QDeclarativeV8Handle v8Value(); + QQmlV8Handle v8Value(); void extendLife(float time); private: QQuickV8ParticleData* v8Datum; @@ -314,7 +314,7 @@ public: void registerParticleAffector(QQuickParticleAffector* a); void registerParticleGroup(QQuickParticleGroup* g); - static void statePropertyRedirect(QDeclarativeListProperty<QObject> *prop, QObject *value); + static void statePropertyRedirect(QQmlListProperty<QObject> *prop, QObject *value); static void stateRedirect(QQuickParticleGroup* group, QQuickParticleSystem* sys, QObject *value); bool isPaused() const { diff --git a/src/quick/particles/qquickspritegoal_p.h b/src/quick/particles/qquickspritegoal_p.h index 1986bc9431..44b022ffee 100644 --- a/src/quick/particles/qquickspritegoal_p.h +++ b/src/quick/particles/qquickspritegoal_p.h @@ -42,7 +42,7 @@ #ifndef SPRITEGOALAFFECTOR_H #define SPRITEGOALAFFECTOR_H #include "qquickparticleaffector_p.h" -#include <QtDeclarative/qdeclarativeinfo.h> +#include <QtQml/qqmlinfo.h> QT_BEGIN_HEADER diff --git a/src/quick/particles/qquicktrailemitter.cpp b/src/quick/particles/qquicktrailemitter.cpp index f5bc78c9cb..e5317567fe 100644 --- a/src/quick/particles/qquicktrailemitter.cpp +++ b/src/quick/particles/qquicktrailemitter.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qquicktrailemitter_p.h" -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> #include <cmath> QT_BEGIN_NAMESPACE @@ -126,7 +126,7 @@ QQuickTrailEmitter::QQuickTrailEmitter(QQuickItem *parent) : bool QQuickTrailEmitter::isEmitFollowConnected() { - static int idx = QObjectPrivate::get(this)->signalIndex("emitFollowParticles(QDeclarativeV8Handle,QDeclarativeV8Handle)"); + static int idx = QObjectPrivate::get(this)->signalIndex("emitFollowParticles(QQmlV8Handle,QQmlV8Handle)"); return QObjectPrivate::get(this)->isSignalConnected(idx); } @@ -265,15 +265,15 @@ void QQuickTrailEmitter::emitWindow(int timeStamp) if (isEmitConnected() || isEmitFollowConnected()) { v8::HandleScope handle_scope; - v8::Context::Scope scope(QDeclarativeEnginePrivate::getV8Engine(qmlEngine(this))->context()); + v8::Context::Scope scope(QQmlEnginePrivate::getV8Engine(qmlEngine(this))->context()); v8::Handle<v8::Array> array = v8::Array::New(toEmit.size()); for (int i=0; i<toEmit.size(); i++) array->Set(i, toEmit[i]->v8Value().toHandle()); if (isEmitFollowConnected()) - emitFollowParticles(QDeclarativeV8Handle::fromHandle(array), d->v8Value());//A chance for many arbitrary JS changes + emitFollowParticles(QQmlV8Handle::fromHandle(array), d->v8Value());//A chance for many arbitrary JS changes else if (isEmitConnected()) - emitParticles(QDeclarativeV8Handle::fromHandle(array));//A chance for arbitrary JS changes + emitParticles(QQmlV8Handle::fromHandle(array));//A chance for arbitrary JS changes } foreach (QQuickParticleData* d, toEmit) m_system->emitParticle(d); diff --git a/src/quick/particles/qquicktrailemitter_p.h b/src/quick/particles/qquicktrailemitter_p.h index bae6464c37..f68dd05441 100644 --- a/src/quick/particles/qquicktrailemitter_p.h +++ b/src/quick/particles/qquicktrailemitter_p.h @@ -93,7 +93,7 @@ public: } signals: - void emitFollowParticles(QDeclarativeV8Handle particles, QDeclarativeV8Handle followed); + void emitFollowParticles(QQmlV8Handle particles, QQmlV8Handle followed); void particlesPerParticlePerSecondChanged(int arg); diff --git a/src/quick/particles/qquickturbulence_p.h b/src/quick/particles/qquickturbulence_p.h index cc0dfdc845..f453140cd2 100644 --- a/src/quick/particles/qquickturbulence_p.h +++ b/src/quick/particles/qquickturbulence_p.h @@ -42,7 +42,7 @@ #ifndef TURBULENCEAFFECTOR_H #define TURBULENCEAFFECTOR_H #include "qquickparticleaffector_p.h" -#include <QDeclarativeListProperty> +#include <QQmlListProperty> QT_BEGIN_HEADER diff --git a/src/quick/particles/qquickv8particledata.cpp b/src/quick/particles/qquickv8particledata.cpp index 0a3e9f6e95..3a387d8f01 100644 --- a/src/quick/particles/qquickv8particledata.cpp +++ b/src/quick/particles/qquickv8particledata.cpp @@ -497,9 +497,9 @@ QQuickV8ParticleData::~QQuickV8ParticleData() qPersistentDispose(m_v8Value); } -QDeclarativeV8Handle QQuickV8ParticleData::v8Value() +QQmlV8Handle QQuickV8ParticleData::v8Value() { - return QDeclarativeV8Handle::fromHandle(m_v8Value); + return QQmlV8Handle::fromHandle(m_v8Value); } QT_END_NAMESPACE diff --git a/src/quick/particles/qquickv8particledata_p.h b/src/quick/particles/qquickv8particledata_p.h index 4afcd89cf9..9b4a4435cc 100644 --- a/src/quick/particles/qquickv8particledata_p.h +++ b/src/quick/particles/qquickv8particledata_p.h @@ -53,7 +53,7 @@ class QQuickV8ParticleData { public: QQuickV8ParticleData(QV8Engine*,QQuickParticleData*); ~QQuickV8ParticleData(); - QDeclarativeV8Handle v8Value(); + QQmlV8Handle v8Value(); private: v8::Persistent<v8::Object> m_v8Value; }; diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp index f1417260b9..621c3ff18e 100644 --- a/src/quick/qtquick2.cpp +++ b/src/quick/qtquick2.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -40,32 +40,32 @@ ****************************************************************************/ #include "qtquick2_p.h" -#include <private/qdeclarativeengine_p.h> -#include <private/qdeclarativeutilmodule_p.h> -#include <private/qdeclarativevaluetype_p.h> +#include <private/qqmlengine_p.h> +#include <private/qquickutilmodule_p.h> +#include <private/qqmlvaluetype_p.h> #include <private/qquickitemsmodule_p.h> #include <private/qquickparticlesmodule_p.h> #include <private/qquickwindowmodule_p.h> -#include <private/qdeclarativeenginedebugservice_p.h> -#include <private/qdeclarativedebugstatesdelegate_p.h> -#include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativecontext_p.h> -#include <QtQuick/private/qdeclarativepropertychanges_p.h> -#include <QtQuick/private/qdeclarativestate_p.h> -#include <qdeclarativeproperty.h> +#include <private/qqmlenginedebugservice_p.h> +#include <private/qqmldebugstatesdelegate_p.h> +#include <private/qqmlbinding_p.h> +#include <private/qqmlcontext_p.h> +#include <QtQuick/private/qquickpropertychanges_p.h> +#include <QtQuick/private/qquickstate_p.h> +#include <qqmlproperty.h> #include <QtCore/QWeakPointer> QT_BEGIN_NAMESPACE -class QDeclarativeQtQuick2DebugStatesDelegate : public QDeclarativeDebugStatesDelegate +class QQmlQtQuick2DebugStatesDelegate : public QQmlDebugStatesDelegate { public: - QDeclarativeQtQuick2DebugStatesDelegate(); - virtual ~QDeclarativeQtQuick2DebugStatesDelegate(); - virtual void buildStatesList(QDeclarativeContext *ctxt, bool cleanList); - virtual void updateBinding(QDeclarativeContext *context, - const QDeclarativeProperty &property, + QQmlQtQuick2DebugStatesDelegate(); + virtual ~QQmlQtQuick2DebugStatesDelegate(); + virtual void buildStatesList(QQmlContext *ctxt, bool cleanList); + virtual void updateBinding(QQmlContext *context, + const QQmlProperty &property, const QVariant &expression, bool isLiteralValue, const QString &fileName, int line, int column, bool *isBaseState); @@ -79,37 +79,37 @@ public: private: void buildStatesList(QObject *obj); - QList<QWeakPointer<QDeclarativeState> > m_allStates; + QList<QWeakPointer<QQuickState> > m_allStates; }; -QDeclarativeQtQuick2DebugStatesDelegate::QDeclarativeQtQuick2DebugStatesDelegate() +QQmlQtQuick2DebugStatesDelegate::QQmlQtQuick2DebugStatesDelegate() { } -QDeclarativeQtQuick2DebugStatesDelegate::~QDeclarativeQtQuick2DebugStatesDelegate() +QQmlQtQuick2DebugStatesDelegate::~QQmlQtQuick2DebugStatesDelegate() { } -void QDeclarativeQtQuick2DebugStatesDelegate::buildStatesList(QDeclarativeContext *ctxt, bool cleanList) +void QQmlQtQuick2DebugStatesDelegate::buildStatesList(QQmlContext *ctxt, bool cleanList) { if (cleanList) m_allStates.clear(); - QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(ctxt); + QQmlContextPrivate *ctxtPriv = QQmlContextPrivate::get(ctxt); for (int ii = 0; ii < ctxtPriv->instances.count(); ++ii) { buildStatesList(ctxtPriv->instances.at(ii)); } - QDeclarativeContextData *child = QDeclarativeContextData::get(ctxt)->childContexts; + QQmlContextData *child = QQmlContextData::get(ctxt)->childContexts; while (child) { - buildStatesList(child->asQDeclarativeContext()); + buildStatesList(child->asQQmlContext()); child = child->nextChild; } } -void QDeclarativeQtQuick2DebugStatesDelegate::buildStatesList(QObject *obj) +void QQmlQtQuick2DebugStatesDelegate::buildStatesList(QObject *obj) { - if (QDeclarativeState *state = qobject_cast<QDeclarativeState *>(obj)) { + if (QQuickState *state = qobject_cast<QQuickState *>(obj)) { m_allStates.append(state); } @@ -119,23 +119,23 @@ void QDeclarativeQtQuick2DebugStatesDelegate::buildStatesList(QObject *obj) } } -void QDeclarativeQtQuick2DebugStatesDelegate::updateBinding(QDeclarativeContext *context, - const QDeclarativeProperty &property, +void QQmlQtQuick2DebugStatesDelegate::updateBinding(QQmlContext *context, + const QQmlProperty &property, const QVariant &expression, bool isLiteralValue, const QString &fileName, int line, int column, bool *inBaseState) { QObject *object = property.object(); QString propertyName = property.name(); - foreach (QWeakPointer<QDeclarativeState> statePointer, m_allStates) { - if (QDeclarativeState *state = statePointer.data()) { + foreach (QWeakPointer<QQuickState> statePointer, m_allStates) { + if (QQuickState *state = statePointer.data()) { // here we assume that the revert list on itself defines the base state if (state->isStateActive() && state->containsPropertyInRevertList(object, propertyName)) { *inBaseState = false; - QDeclarativeBinding *newBinding = 0; + QQmlBinding *newBinding = 0; if (!isLiteralValue) { - newBinding = new QDeclarativeBinding(expression.toString(), object, context); + newBinding = new QQmlBinding(expression.toString(), object, context); newBinding->setTarget(property); newBinding->setNotifyOnValueChanged(true); newBinding->setSourceLocation(fileName, line, column); @@ -150,12 +150,12 @@ void QDeclarativeQtQuick2DebugStatesDelegate::updateBinding(QDeclarativeContext } } -bool QDeclarativeQtQuick2DebugStatesDelegate::setBindingForInvalidProperty(QObject *object, +bool QQmlQtQuick2DebugStatesDelegate::setBindingForInvalidProperty(QObject *object, const QString &propertyName, const QVariant &expression, bool isLiteralValue) { - if (QDeclarativePropertyChanges *propertyChanges = qobject_cast<QDeclarativePropertyChanges *>(object)) { + if (QQuickPropertyChanges *propertyChanges = qobject_cast<QQuickPropertyChanges *>(object)) { if (isLiteralValue) propertyChanges->changeValue(propertyName, expression); else @@ -166,26 +166,26 @@ bool QDeclarativeQtQuick2DebugStatesDelegate::setBindingForInvalidProperty(QObje } } -void QDeclarativeQtQuick2DebugStatesDelegate::resetBindingForInvalidProperty(QObject *object, const QString &propertyName) +void QQmlQtQuick2DebugStatesDelegate::resetBindingForInvalidProperty(QObject *object, const QString &propertyName) { - if (QDeclarativePropertyChanges *propertyChanges = qobject_cast<QDeclarativePropertyChanges *>(object)) { + if (QQuickPropertyChanges *propertyChanges = qobject_cast<QQuickPropertyChanges *>(object)) { propertyChanges->removeProperty(propertyName); } } -void QDeclarativeQtQuick2Module::defineModule() +void QQmlQtQuick2Module::defineModule() { - QDeclarativeUtilModule::defineModule(); - QDeclarativeEnginePrivate::defineModule(); + QQuickUtilModule::defineModule(); + QQmlEnginePrivate::defineModule(); QQuickItemsModule::defineModule(); QQuickParticlesModule::defineModule(); QQuickWindowModule::defineModule(); - QDeclarativeValueTypeFactory::registerValueTypes(); + QQmlValueTypeFactory::registerValueTypes(); - if (QDeclarativeEngineDebugService::isDebuggingEnabled()) { - QDeclarativeEngineDebugService::instance()->setStatesDelegate( - new QDeclarativeQtQuick2DebugStatesDelegate); + if (QQmlEngineDebugService::isDebuggingEnabled()) { + QQmlEngineDebugService::instance()->setStatesDelegate( + new QQmlQtQuick2DebugStatesDelegate); } } diff --git a/src/quick/qtquick2_p.h b/src/quick/qtquick2_p.h index e242179dfa..4032991776 100644 --- a/src/quick/qtquick2_p.h +++ b/src/quick/qtquick2_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -48,7 +48,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class Q_QUICK_PRIVATE_EXPORT QDeclarativeQtQuick2Module +class Q_QUICK_PRIVATE_EXPORT QQmlQtQuick2Module { public: static void defineModule(); diff --git a/src/quick/qtquickglobal.h b/src/quick/qtquickglobal.h index b5eb962a2f..a1d8c714e8 100644 --- a/src/quick/qtquickglobal.h +++ b/src/quick/qtquickglobal.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h index 539040727c..34ceeedff9 100644 --- a/src/quick/qtquickglobal_p.h +++ b/src/quick/qtquickglobal_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/quick.pro b/src/quick/quick.pro index b445e84248..0f0120ee79 100644 --- a/src/quick/quick.pro +++ b/src/quick/quick.pro @@ -6,13 +6,13 @@ CONFIG += module CONFIG += dll warn_on MODULE_PRI = ../../modules/qt_quick.pri -QT = core-private gui gui-private network v8-private declarative declarative-private +QT = core-private gui gui-private network v8-private qml qml-private DEFINES += QT_BUILD_QUICK_LIB QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES win32-msvc*:DEFINES *= _CRT_SECURE_NO_WARNINGS solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 -exists("qdeclarative_enable_gcov") { +exists("qqml_enable_gcov") { QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors LIBS += -lgcov } @@ -36,12 +36,12 @@ mac { # FIXME: this is a workaround for broken qmake logic in qtAddModule() # This function refuses to use frameworks unless the framework exists on # the filesystem at the time qmake is run, resulting in a build failure - # if QtQuick is qmaked before QtDeclarative is built and frameworks are + # if QtQuick is qmaked before QtQml is built and frameworks are # in use. qtAddLibrary() contains correct logic to deal with this, so # we'll explicitly call that for now. load(qt) - LIBS -= -lQtDeclarative # in non-framework builds, these should be re-added - LIBS -= -lQtDeclarative_debug # within the qtAddLibrary if appropriate, so no - qtAddLibrary(QtDeclarative) # harm done :) + LIBS -= -lQtQml # in non-framework builds, these should be re-added + LIBS -= -lQtQml_debug # within the qtAddLibrary if appropriate, so no + qtAddLibrary(QtQml) # harm done :) } diff --git a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp index bbea89b5ca..7a219585b0 100644 --- a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h b/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h index 9ef7622a78..3896d03a80 100644 --- a/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsggeometry_p.h b/src/quick/scenegraph/coreapi/qsggeometry_p.h index 0b388ec587..63defa2374 100644 --- a/src/quick/scenegraph/coreapi/qsggeometry_p.h +++ b/src/quick/scenegraph/coreapi/qsggeometry_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp index 308a1fa572..9f0def4706 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h index 0673aca814..450dd2866f 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.h +++ b/src/quick/scenegraph/coreapi/qsgmaterial.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index 88afac7ecc..b9eec27e82 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgnode.h b/src/quick/scenegraph/coreapi/qsgnode.h index b7e776dbe8..6ba110b91e 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.h +++ b/src/quick/scenegraph/coreapi/qsgnode.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp b/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp index 2562e8d56c..78f007af80 100644 --- a/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp +++ b/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h b/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h index 0ad9d76586..c1df82332e 100644 --- a/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h +++ b/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index 9737fbb294..30dd449b4b 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/coreapi/qsgrenderer_p.h b/src/quick/scenegraph/coreapi/qsgrenderer_p.h index 9b177abd6b..9d2402d727 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgrenderer_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index 08e85ab8cb..dcb1e5b8be 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h index 39566c96ac..47dfdb4d8c 100644 --- a/src/quick/scenegraph/qsgadaptationlayer_p.h +++ b/src/quick/scenegraph/qsgadaptationlayer_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 03afed293a..e38a4eef6a 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -50,13 +50,13 @@ #include <QtQuick/private/qsgshareddistancefieldglyphcache_p.h> #include <QtQuick/private/qsgtexture_p.h> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> #include <QGuiApplication> #include <QOpenGLContext> -#include <QDeclarativeImageProvider> -#include <private/qdeclarativeglobal_p.h> +#include <QQmlImageProvider> +#include <private/qqmlglobal_p.h> #include <QtQuick/private/qsgtexture_p.h> #include <QtGui/private/qguiapplication_p.h> @@ -110,7 +110,7 @@ public: QOpenGLContext *gl; QHash<QSGMaterialType *, QSGMaterialShader *> materials; - QHash<QDeclarativeTextureFactory *, QSGTexture *> textures; + QHash<QQuickTextureFactory *, QSGTexture *> textures; QSGDistanceFieldGlyphCacheManager *distanceFieldCacheManager; @@ -160,7 +160,7 @@ void QSGContext::invalidate() } -QSGTexture *QSGContext::textureForFactory(QDeclarativeTextureFactory *factory, QQuickCanvas *canvas) +QSGTexture *QSGContext::textureForFactory(QQuickTextureFactory *factory, QQuickCanvas *canvas) { Q_D(QSGContext); if (!factory) @@ -168,7 +168,7 @@ QSGTexture *QSGContext::textureForFactory(QDeclarativeTextureFactory *factory, Q QSGTexture *texture = d->textures.value(factory); if (!texture) { - if (QDeclarativeDefaultTextureFactory *dtf = qobject_cast<QDeclarativeDefaultTextureFactory *>(factory)) + if (QQuickDefaultTextureFactory *dtf = qobject_cast<QQuickDefaultTextureFactory *>(factory)) texture = createTexture(dtf->image()); else texture = factory->createTexture(canvas); @@ -182,7 +182,7 @@ QSGTexture *QSGContext::textureForFactory(QDeclarativeTextureFactory *factory, Q void QSGContext::textureFactoryDestroyed(QObject *o) { Q_D(QSGContext); - QDeclarativeTextureFactory *f = static_cast<QDeclarativeTextureFactory *>(o); + QQuickTextureFactory *f = static_cast<QQuickTextureFactory *>(o); // This function will only be called on the scene graph thread, so it is // safe to directly delete the texture here. diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index 7fa3838db9..0f8b5ae1de 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -72,7 +72,7 @@ class QSGEngine; class QOpenGLContext; class QOpenGLFramebufferObject; -class QDeclarativeTextureFactory; +class QQuickTextureFactory; class Q_QUICK_EXPORT QSGContext : public QObject { @@ -106,7 +106,7 @@ public: virtual QSurfaceFormat defaultSurfaceFormat() const; - QSGTexture *textureForFactory(QDeclarativeTextureFactory *factory, QQuickCanvas *canvas); + QSGTexture *textureForFactory(QQuickTextureFactory *factory, QQuickCanvas *canvas); static QSGContext *createDefaultContext(); @@ -121,7 +121,7 @@ public: virtual QAnimationDriver *createAnimationDriver(QObject *parent); - static QDeclarativeTextureFactory *createTextureFactoryFromImage(const QImage &image); + static QQuickTextureFactory *createTextureFactoryFromImage(const QImage &image); public slots: diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index 026afb2d56..d5f84553ba 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -136,7 +136,7 @@ QSGContext *QSGContext::createDefaultContext() /*! - \fn QDeclarativeTextureFactory *createTextureFactoryFromImage(const QImage &image) + \fn QQuickTextureFactory *createTextureFactoryFromImage(const QImage &image) Calls into the scene graph adaptation if available and creates a texture factory. The primary purpose of this function is to reimplement hardware @@ -144,7 +144,7 @@ QSGContext *QSGContext::createDefaultContext() the image providers thread. */ -QDeclarativeTextureFactory *QSGContext::createTextureFactoryFromImage(const QImage &image) +QQuickTextureFactory *QSGContext::createTextureFactoryFromImage(const QImage &image) { QSGAdaptionPluginData *plugin = contextFactory(); if (plugin->factory) diff --git a/src/quick/scenegraph/qsgcontextplugin_p.h b/src/quick/scenegraph/qsgcontextplugin_p.h index 081e64ecdd..fa90873dc6 100644 --- a/src/quick/scenegraph/qsgcontextplugin_p.h +++ b/src/quick/scenegraph/qsgcontextplugin_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -46,7 +46,7 @@ #include <QtCore/qplugin.h> #include <QtCore/qfactoryinterface.h> -#include <QDeclarativeImageProvider> +#include <QQmlImageProvider> QT_BEGIN_HEADER @@ -58,7 +58,7 @@ struct Q_QUICK_EXPORT QSGContextFactoryInterface : public QFactoryInterface { virtual QSGContext *create(const QString &key) const = 0; - virtual QDeclarativeTextureFactory *createTextureFactoryFromImage(const QImage &image) = 0; + virtual QQuickTextureFactory *createTextureFactoryFromImage(const QImage &image) = 0; }; #define QSGContextFactoryInterface_iid \ @@ -76,7 +76,7 @@ public: virtual QStringList keys() const = 0; virtual QSGContext *create(const QString &key) const = 0; - virtual QDeclarativeTextureFactory *createTextureFactoryFromImage(const QImage &) { return 0; } + virtual QQuickTextureFactory *createTextureFactoryFromImage(const QImage &) { return 0; } }; QT_END_NAMESPACE diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp index ef5b24d1fd..73dcad6a47 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h index 7fc2ee63d4..76e4a64e60 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultglyphnode.cpp b/src/quick/scenegraph/qsgdefaultglyphnode.cpp index 70f561b61e..f84cd203fa 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index adc092b1c6..33f02a8ac0 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.h b/src/quick/scenegraph/qsgdefaultglyphnode_p.h index b7c7e61014..66662d936a 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.h +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h b/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h index 6b99ade8b0..d640d4cc2c 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultimagenode.cpp b/src/quick/scenegraph/qsgdefaultimagenode.cpp index a6d6df8a00..e6855c4c78 100644 --- a/src/quick/scenegraph/qsgdefaultimagenode.cpp +++ b/src/quick/scenegraph/qsgdefaultimagenode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultimagenode_p.h b/src/quick/scenegraph/qsgdefaultimagenode_p.h index 49c09dbfcd..9062aff2c2 100644 --- a/src/quick/scenegraph/qsgdefaultimagenode_p.h +++ b/src/quick/scenegraph/qsgdefaultimagenode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp index cb385f6dd0..334bd4346f 100644 --- a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp +++ b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp @@ -4,7 +4,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h index 49ca3771c1..2a0aa05b90 100644 --- a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h +++ b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp index 7b30af85c3..79e5c3b0f4 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp index e525d2a458..30b4a2f9b8 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h index df5b8c6f6c..65ac2d499c 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h index 0aee5bb340..c4af15a2af 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgflashnode.cpp b/src/quick/scenegraph/qsgflashnode.cpp index 0988b23920..9359f5d9c5 100644 --- a/src/quick/scenegraph/qsgflashnode.cpp +++ b/src/quick/scenegraph/qsgflashnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgflashnode_p.h b/src/quick/scenegraph/qsgflashnode_p.h index 91614ceb0b..68ae6eecd1 100644 --- a/src/quick/scenegraph/qsgflashnode_p.h +++ b/src/quick/scenegraph/qsgflashnode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgpathsimplifier.cpp b/src/quick/scenegraph/qsgpathsimplifier.cpp index 21e5d473f0..3adf8d71c7 100644 --- a/src/quick/scenegraph/qsgpathsimplifier.cpp +++ b/src/quick/scenegraph/qsgpathsimplifier.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgpathsimplifier_p.h b/src/quick/scenegraph/qsgpathsimplifier_p.h index e60dc4fe37..9e38c5ad00 100644 --- a/src/quick/scenegraph/qsgpathsimplifier_p.h +++ b/src/quick/scenegraph/qsgpathsimplifier_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp index e762898602..799d354400 100644 --- a/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h index cadf4bc55b..851f72d6a7 100644 --- a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgareaallocator.cpp b/src/quick/scenegraph/util/qsgareaallocator.cpp index 635f38fa5e..415037a7b5 100644 --- a/src/quick/scenegraph/util/qsgareaallocator.cpp +++ b/src/quick/scenegraph/util/qsgareaallocator.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgareaallocator_p.h b/src/quick/scenegraph/util/qsgareaallocator_p.h index cab4824c56..998f7ef4d1 100644 --- a/src/quick/scenegraph/util/qsgareaallocator_p.h +++ b/src/quick/scenegraph/util/qsgareaallocator_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp index be4673bdca..caca610fe2 100644 --- a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp +++ b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgdistancefieldutil_p.h b/src/quick/scenegraph/util/qsgdistancefieldutil_p.h index 23da1d121f..cf805e7ff6 100644 --- a/src/quick/scenegraph/util/qsgdistancefieldutil_p.h +++ b/src/quick/scenegraph/util/qsgdistancefieldutil_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgengine.cpp b/src/quick/scenegraph/util/qsgengine.cpp index c5840b2d2b..5d50002870 100644 --- a/src/quick/scenegraph/util/qsgengine.cpp +++ b/src/quick/scenegraph/util/qsgengine.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgengine.h b/src/quick/scenegraph/util/qsgengine.h index 70896d3ef2..f62bdb2ab3 100644 --- a/src/quick/scenegraph/util/qsgengine.h +++ b/src/quick/scenegraph/util/qsgengine.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp index c1d5b04cc1..50c8d1661e 100644 --- a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp +++ b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.h b/src/quick/scenegraph/util/qsgflatcolormaterial.h index 1313a89eef..f1020faa56 100644 --- a/src/quick/scenegraph/util/qsgflatcolormaterial.h +++ b/src/quick/scenegraph/util/qsgflatcolormaterial.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgpainternode.cpp b/src/quick/scenegraph/util/qsgpainternode.cpp index d4a810c30a..1ea64f6205 100644 --- a/src/quick/scenegraph/util/qsgpainternode.cpp +++ b/src/quick/scenegraph/util/qsgpainternode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgpainternode_p.h b/src/quick/scenegraph/util/qsgpainternode_p.h index 0c603c43ca..24b4d26855 100644 --- a/src/quick/scenegraph/util/qsgpainternode_p.h +++ b/src/quick/scenegraph/util/qsgpainternode_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgsimplematerial.h b/src/quick/scenegraph/util/qsgsimplematerial.h index a3579326ee..5e58bd56ca 100644 --- a/src/quick/scenegraph/util/qsgsimplematerial.h +++ b/src/quick/scenegraph/util/qsgsimplematerial.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgsimplerectnode.cpp b/src/quick/scenegraph/util/qsgsimplerectnode.cpp index 4d4ae7c784..09a3b42e98 100644 --- a/src/quick/scenegraph/util/qsgsimplerectnode.cpp +++ b/src/quick/scenegraph/util/qsgsimplerectnode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgsimplerectnode.h b/src/quick/scenegraph/util/qsgsimplerectnode.h index abe9973306..cab8a60ad2 100644 --- a/src/quick/scenegraph/util/qsgsimplerectnode.h +++ b/src/quick/scenegraph/util/qsgsimplerectnode.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp index 0a8edc999c..c347dffbed 100644 --- a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp +++ b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgsimpletexturenode.h b/src/quick/scenegraph/util/qsgsimpletexturenode.h index 8416556d00..d4bdca21ca 100644 --- a/src/quick/scenegraph/util/qsgsimpletexturenode.h +++ b/src/quick/scenegraph/util/qsgsimpletexturenode.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index 7ccedc4c48..5dd4dad6e4 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,7 +45,8 @@ #include <qopenglfunctions.h> #include <QtQuick/private/qsgcontext_p.h> #include <qthread.h> -#include <private/qdeclarativeprofilerservice_p.h> +#include <private/qqmlprofilerservice_p.h> +#include <private/qqmlglobal_p.h> #if !defined(QT_NO_DEBUG) && (defined(Q_OS_LINUX) || defined(Q_OS_MAC)) #include <execinfo.h> diff --git a/src/quick/scenegraph/util/qsgtexture.h b/src/quick/scenegraph/util/qsgtexture.h index 2ff4b5daf8..0b4e6fede2 100644 --- a/src/quick/scenegraph/util/qsgtexture.h +++ b/src/quick/scenegraph/util/qsgtexture.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgtexture_p.h b/src/quick/scenegraph/util/qsgtexture_p.h index bbeeec4b74..3d80035c9a 100644 --- a/src/quick/scenegraph/util/qsgtexture_p.h +++ b/src/quick/scenegraph/util/qsgtexture_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgtexturematerial.cpp b/src/quick/scenegraph/util/qsgtexturematerial.cpp index c5e55a751c..96fc037bfe 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial.cpp +++ b/src/quick/scenegraph/util/qsgtexturematerial.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgtexturematerial.h b/src/quick/scenegraph/util/qsgtexturematerial.h index 123fbaafed..bfc76422f1 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial.h +++ b/src/quick/scenegraph/util/qsgtexturematerial.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgtexturematerial_p.h b/src/quick/scenegraph/util/qsgtexturematerial_p.h index 55d6ad0a78..0895dbd6c2 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial_p.h +++ b/src/quick/scenegraph/util/qsgtexturematerial_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgtextureprovider.cpp b/src/quick/scenegraph/util/qsgtextureprovider.cpp index 0ec0c6f724..6d81e4eb79 100644 --- a/src/quick/scenegraph/util/qsgtextureprovider.cpp +++ b/src/quick/scenegraph/util/qsgtextureprovider.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgtextureprovider.h b/src/quick/scenegraph/util/qsgtextureprovider.h index 578b323c89..8dcc1f2678 100644 --- a/src/quick/scenegraph/util/qsgtextureprovider.h +++ b/src/quick/scenegraph/util/qsgtextureprovider.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp index 8c09780b15..545b5f201e 100644 --- a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp +++ b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/scenegraph/util/qsgvertexcolormaterial.h b/src/quick/scenegraph/util/qsgvertexcolormaterial.h index 3ba37eff4a..52808a50d9 100644 --- a/src/quick/scenegraph/util/qsgvertexcolormaterial.h +++ b/src/quick/scenegraph/util/qsgvertexcolormaterial.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/quick/util/qdeclarativeutilmodule.cpp b/src/quick/util/qdeclarativeutilmodule.cpp deleted file mode 100644 index 02e4e9cf52..0000000000 --- a/src/quick/util/qdeclarativeutilmodule.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtDeclarative module 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 "qdeclarativeutilmodule_p.h" -#include "qdeclarativeanimation_p.h" -#include "qdeclarativeanimation_p_p.h" -#include "qdeclarativebehavior_p.h" -#include "qdeclarativebind_p.h" -#include "qdeclarativeconnections_p.h" -#include "qdeclarativesmoothedanimation_p.h" -#include "qdeclarativefontloader_p.h" -#include "qdeclarativepackage_p.h" -#include "qdeclarativepropertychanges_p.h" -#include "qdeclarativespringanimation_p.h" -#include "qdeclarativestategroup_p.h" -#include "qdeclarativestateoperations_p.h" -#include "qdeclarativestate_p.h" -#include "qdeclarativestate_p_p.h" -#include "qdeclarativesystempalette_p.h" -#include "qdeclarativetimer_p.h" -#include "qdeclarativetransition_p.h" -#include <qdeclarativeinfo.h> -#include <private/qdeclarativetypenotavailable_p.h> -#include <private/qdeclarativeanimationcontroller_p.h> -#include <QtCore/qcoreapplication.h> -#include <QtGui/QInputMethod> - -void QDeclarativeUtilModule::defineModule() -{ - qmlRegisterUncreatableType<QInputMethod>("QtQuick",2,0,"InputPanel", - QInputMethod::tr("InputPanel is an abstract class")); // deprecated - qmlRegisterUncreatableType<QInputMethod>("QtQuick",2,0,"InputMethod", - QInputMethod::tr("InputMethod is an abstract class")); - qmlRegisterUncreatableType<QDeclarativeAbstractAnimation>("QtQuick",2,0,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class")); - - qmlRegisterType<QDeclarativeBehavior>("QtQuick",2,0,"Behavior"); - qmlRegisterType<QDeclarativeBind>("QtQuick",2,0,"Binding"); - qmlRegisterType<QDeclarativeColorAnimation>("QtQuick",2,0,"ColorAnimation"); - qmlRegisterType<QDeclarativeConnections>("QtQuick",2,0,"Connections"); - qmlRegisterType<QDeclarativeSmoothedAnimation>("QtQuick",2,0,"SmoothedAnimation"); - qmlRegisterType<QDeclarativeFontLoader>("QtQuick",2,0,"FontLoader"); - qmlRegisterType<QDeclarativeNumberAnimation>("QtQuick",2,0,"NumberAnimation"); - qmlRegisterType<QDeclarativePackage>("QtQuick",2,0,"Package"); - qmlRegisterType<QDeclarativeParallelAnimation>("QtQuick",2,0,"ParallelAnimation"); - qmlRegisterType<QDeclarativePauseAnimation>("QtQuick",2,0,"PauseAnimation"); - qmlRegisterType<QDeclarativePropertyAction>("QtQuick",2,0,"PropertyAction"); - qmlRegisterType<QDeclarativePropertyAnimation>("QtQuick",2,0,"PropertyAnimation"); - qmlRegisterType<QDeclarativeRotationAnimation>("QtQuick",2,0,"RotationAnimation"); - qmlRegisterType<QDeclarativeScriptAction>("QtQuick",2,0,"ScriptAction"); - qmlRegisterType<QDeclarativeSequentialAnimation>("QtQuick",2,0,"SequentialAnimation"); - qmlRegisterType<QDeclarativeSpringAnimation>("QtQuick",2,0,"SpringAnimation"); - qmlRegisterType<QDeclarativeAnimationController>("QtQuick",2,0,"AnimationController"); - qmlRegisterType<QDeclarativeStateChangeScript>("QtQuick",2,0,"StateChangeScript"); - qmlRegisterType<QDeclarativeStateGroup>("QtQuick",2,0,"StateGroup"); - qmlRegisterType<QDeclarativeState>("QtQuick",2,0,"State"); - qmlRegisterType<QDeclarativeSystemPalette>("QtQuick",2,0,"SystemPalette"); - qmlRegisterType<QDeclarativeTimer>("QtQuick",2,0,"Timer"); - qmlRegisterType<QDeclarativeTransition>("QtQuick",2,0,"Transition"); - qmlRegisterType<QDeclarativeVector3dAnimation>("QtQuick",2,0,"Vector3dAnimation"); - - qmlRegisterType<QDeclarativeStateOperation>(); - - qmlRegisterCustomType<QDeclarativePropertyChanges>("QtQuick",2,0,"PropertyChanges", new QDeclarativePropertyChangesParser); - qmlRegisterCustomType<QDeclarativeConnections>("QtQuick",2,0,"Connections", new QDeclarativeConnectionsParser); -} diff --git a/src/quick/util/qdeclarativeanimation.cpp b/src/quick/util/qquickanimation.cpp index b3b6d93115..51b598b28d 100644 --- a/src/quick/util/qdeclarativeanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,22 +39,22 @@ ** ****************************************************************************/ -#include "qdeclarativeanimation_p.h" -#include "qdeclarativeanimation_p_p.h" +#include "qquickanimation_p.h" +#include "qquickanimation_p_p.h" -#include <private/qdeclarativestateoperations_p.h> -#include <private/qdeclarativecontext_p.h> +#include <private/qquickstatechangescript_p.h> +#include <private/qqmlcontext_p.h> -#include <qdeclarativepropertyvaluesource.h> -#include <qdeclarative.h> -#include <qdeclarativeinfo.h> -#include <qdeclarativeexpression.h> -#include <private/qdeclarativestringconverters_p.h> -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativemetatype_p.h> -#include <private/qdeclarativevaluetype_p.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativeengine_p.h> +#include <qqmlpropertyvaluesource.h> +#include <qqml.h> +#include <qqmlinfo.h> +#include <qqmlexpression.h> +#include <private/qqmlstringconverters_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlmetatype_p.h> +#include <private/qqmlvaluetype_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlengine_p.h> #include <qvariant.h> #include <qcolor.h> @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE /*! - \qmlclass Animation QDeclarativeAbstractAnimation + \qmlclass Animation QQuickAbstractAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \brief The Animation element is the base of all QML animations. @@ -81,25 +81,25 @@ QT_BEGIN_NAMESPACE element directly will result in an error. */ -QDeclarativeAbstractAnimation::QDeclarativeAbstractAnimation(QObject *parent) -: QObject(*(new QDeclarativeAbstractAnimationPrivate), parent) +QQuickAbstractAnimation::QQuickAbstractAnimation(QObject *parent) +: QObject(*(new QQuickAbstractAnimationPrivate), parent) { } -QDeclarativeAbstractAnimation::~QDeclarativeAbstractAnimation() +QQuickAbstractAnimation::~QQuickAbstractAnimation() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); delete d->animationInstance; } -QDeclarativeAbstractAnimation::QDeclarativeAbstractAnimation(QDeclarativeAbstractAnimationPrivate &dd, QObject *parent) +QQuickAbstractAnimation::QQuickAbstractAnimation(QQuickAbstractAnimationPrivate &dd, QObject *parent) : QObject(dd, parent) { } -QAbstractAnimationJob* QDeclarativeAbstractAnimation::qtAnimation() +QAbstractAnimationJob* QQuickAbstractAnimation::qtAnimation() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); return d->animationInstance; } @@ -137,16 +137,16 @@ QAbstractAnimationJob* QDeclarativeAbstractAnimation::qtAnimation() By default, animations are not running. Though, when the animations are assigned to properties, as property value sources using the \e on syntax, they are set to running by default. */ -bool QDeclarativeAbstractAnimation::isRunning() const +bool QQuickAbstractAnimation::isRunning() const { - Q_D(const QDeclarativeAbstractAnimation); + Q_D(const QQuickAbstractAnimation); return d->running; } // the behavior calls this function -void QDeclarativeAbstractAnimation::notifyRunningChanged(bool running) +void QQuickAbstractAnimation::notifyRunningChanged(bool running) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (d->disableUserControl && d->running != running) { d->running = running; emit runningChanged(running); @@ -155,15 +155,15 @@ void QDeclarativeAbstractAnimation::notifyRunningChanged(bool running) //commence is called to start an animation when it is used as a //simple animation, and not as part of a transition -void QDeclarativeAbstractAnimationPrivate::commence() +void QQuickAbstractAnimationPrivate::commence() { - Q_Q(QDeclarativeAbstractAnimation); + Q_Q(QQuickAbstractAnimation); - QDeclarativeStateActions actions; - QDeclarativeProperties properties; + QQuickStateActions actions; + QQmlProperties properties; QAbstractAnimationJob *oldInstance = animationInstance; - animationInstance = q->transition(actions, properties, QDeclarativeAbstractAnimation::Forward); + animationInstance = q->transition(actions, properties, QQuickAbstractAnimation::Forward); if (oldInstance != animationInstance) { animationInstance->addAnimationChangeListener(this, QAbstractAnimationJob::Completion); if (oldInstance) @@ -176,29 +176,29 @@ void QDeclarativeAbstractAnimationPrivate::commence() } } -QDeclarativeProperty QDeclarativeAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj) +QQmlProperty QQuickAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj) { - QDeclarativeProperty prop(obj, str, qmlContext(infoObj)); + QQmlProperty prop(obj, str, qmlContext(infoObj)); if (!prop.isValid()) { - qmlInfo(infoObj) << QDeclarativeAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str); - return QDeclarativeProperty(); + qmlInfo(infoObj) << QQuickAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str); + return QQmlProperty(); } else if (!prop.isWritable()) { - qmlInfo(infoObj) << QDeclarativeAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str); - return QDeclarativeProperty(); + qmlInfo(infoObj) << QQuickAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str); + return QQmlProperty(); } return prop; } -void QDeclarativeAbstractAnimation::setRunning(bool r) +void QQuickAbstractAnimation::setRunning(bool r) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (!d->componentComplete) { d->running = r; if (r == false) d->avoidPropertyValueSourceStart = true; else if (!d->registered) { d->registered = true; - QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this)); + QQmlEnginePrivate *engPriv = QQmlEnginePrivate::get(qmlEngine(this)); static int finalizedIdx = -1; if (finalizedIdx < 0) finalizedIdx = metaObject()->indexOfSlot("componentFinalized()"); @@ -257,15 +257,15 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) By default, animations are not paused. */ -bool QDeclarativeAbstractAnimation::isPaused() const +bool QQuickAbstractAnimation::isPaused() const { - Q_D(const QDeclarativeAbstractAnimation); + Q_D(const QQuickAbstractAnimation); return d->paused; } -void QDeclarativeAbstractAnimation::setPaused(bool p) +void QQuickAbstractAnimation::setPaused(bool p) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (d->paused == p) return; @@ -287,21 +287,21 @@ void QDeclarativeAbstractAnimation::setPaused(bool p) emit pausedChanged(d->paused); } -void QDeclarativeAbstractAnimation::classBegin() +void QQuickAbstractAnimation::classBegin() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); d->componentComplete = false; } -void QDeclarativeAbstractAnimation::componentComplete() +void QQuickAbstractAnimation::componentComplete() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); d->componentComplete = true; } -void QDeclarativeAbstractAnimation::componentFinalized() +void QQuickAbstractAnimation::componentFinalized() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (d->running) { d->running = false; setRunning(true); @@ -328,15 +328,15 @@ void QDeclarativeAbstractAnimation::componentFinalized() \note alwaysRunToEnd has no effect on animations in a Transition. */ -bool QDeclarativeAbstractAnimation::alwaysRunToEnd() const +bool QQuickAbstractAnimation::alwaysRunToEnd() const { - Q_D(const QDeclarativeAbstractAnimation); + Q_D(const QQuickAbstractAnimation); return d->alwaysRunToEnd; } -void QDeclarativeAbstractAnimation::setAlwaysRunToEnd(bool f) +void QQuickAbstractAnimation::setAlwaysRunToEnd(bool f) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (d->alwaysRunToEnd == f) return; @@ -367,15 +367,15 @@ void QDeclarativeAbstractAnimation::setAlwaysRunToEnd(bool f) } \endcode */ -int QDeclarativeAbstractAnimation::loops() const +int QQuickAbstractAnimation::loops() const { - Q_D(const QDeclarativeAbstractAnimation); + Q_D(const QQuickAbstractAnimation); return d->loopCount; } -void QDeclarativeAbstractAnimation::setLoops(int loops) +void QQuickAbstractAnimation::setLoops(int loops) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (loops < 0) loops = -1; @@ -386,44 +386,44 @@ void QDeclarativeAbstractAnimation::setLoops(int loops) emit loopCountChanged(loops); } -int QDeclarativeAbstractAnimation::duration() const +int QQuickAbstractAnimation::duration() const { - Q_D(const QDeclarativeAbstractAnimation); + Q_D(const QQuickAbstractAnimation); return d->animationInstance ? d->animationInstance->duration() : 0; } -int QDeclarativeAbstractAnimation::currentTime() +int QQuickAbstractAnimation::currentTime() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); return d->animationInstance ? d->animationInstance->currentLoopTime() : 0; } -void QDeclarativeAbstractAnimation::setCurrentTime(int time) +void QQuickAbstractAnimation::setCurrentTime(int time) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (d->animationInstance) d->animationInstance->setCurrentTime(time); //TODO save value for start? } -QDeclarativeAnimationGroup *QDeclarativeAbstractAnimation::group() const +QQuickAnimationGroup *QQuickAbstractAnimation::group() const { - Q_D(const QDeclarativeAbstractAnimation); + Q_D(const QQuickAbstractAnimation); return d->group; } -void QDeclarativeAbstractAnimation::setGroup(QDeclarativeAnimationGroup *g) +void QQuickAbstractAnimation::setGroup(QQuickAnimationGroup *g) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (d->group == g) return; if (d->group) - static_cast<QDeclarativeAnimationGroupPrivate *>(d->group->d_func())->animations.removeAll(this); + static_cast<QQuickAnimationGroupPrivate *>(d->group->d_func())->animations.removeAll(this); d->group = g; - if (d->group && !static_cast<QDeclarativeAnimationGroupPrivate *>(d->group->d_func())->animations.contains(this)) - static_cast<QDeclarativeAnimationGroupPrivate *>(d->group->d_func())->animations.append(this); + if (d->group && !static_cast<QQuickAnimationGroupPrivate *>(d->group->d_func())->animations.contains(this)) + static_cast<QQuickAnimationGroupPrivate *>(d->group->d_func())->animations.append(this); //if (g) //if removed from a group, then the group should no longer be the parent setParent(g); @@ -436,7 +436,7 @@ void QDeclarativeAbstractAnimation::setGroup(QDeclarativeAnimationGroup *g) If the animation is already running, calling this method has no effect. The \c running property will be true following a call to \c start(). */ -void QDeclarativeAbstractAnimation::start() +void QQuickAbstractAnimation::start() { setRunning(true); } @@ -448,7 +448,7 @@ void QDeclarativeAbstractAnimation::start() If the animation is already paused, calling this method has no effect. The \c paused property will be true following a call to \c pause(). */ -void QDeclarativeAbstractAnimation::pause() +void QQuickAbstractAnimation::pause() { setPaused(true); } @@ -460,7 +460,7 @@ void QDeclarativeAbstractAnimation::pause() If the animation is not paused, calling this method has no effect. The \c paused property will be false following a call to \c resume(). */ -void QDeclarativeAbstractAnimation::resume() +void QQuickAbstractAnimation::resume() { setPaused(false); } @@ -485,7 +485,7 @@ void QDeclarativeAbstractAnimation::resume() continue running until it completes and then stop. The \c running property will still become false immediately. */ -void QDeclarativeAbstractAnimation::stop() +void QQuickAbstractAnimation::stop() { setRunning(false); } @@ -497,7 +497,7 @@ void QDeclarativeAbstractAnimation::stop() This is a convenience method, and is equivalent to calling \c stop() and then \c start(). */ -void QDeclarativeAbstractAnimation::restart() +void QQuickAbstractAnimation::restart() { stop(); start(); @@ -521,17 +521,17 @@ void QDeclarativeAbstractAnimation::restart() a value of 50, while calling \c complete() will set the \c x property to 100, exactly as though the animation had played the whole way through. */ -void QDeclarativeAbstractAnimation::complete() +void QQuickAbstractAnimation::complete() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); if (isRunning() && d->animationInstance) { d->animationInstance->setCurrentTime(d->animationInstance->duration()); } } -void QDeclarativeAbstractAnimation::setTarget(const QDeclarativeProperty &p) +void QQuickAbstractAnimation::setTarget(const QQmlProperty &p) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); d->defaultProperty = p; if (!d->avoidPropertyValueSourceStart) @@ -543,9 +543,9 @@ void QDeclarativeAbstractAnimation::setTarget(const QDeclarativeProperty &p) so this function allows us to do the same thing as setTarget without that assumption */ -void QDeclarativeAbstractAnimation::setDefaultTarget(const QDeclarativeProperty &p) +void QQuickAbstractAnimation::setDefaultTarget(const QQmlProperty &p) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); d->defaultProperty = p; } @@ -554,34 +554,34 @@ void QDeclarativeAbstractAnimation::setDefaultTarget(const QDeclarativeProperty because something else (like a Behavior) already has control over the animation. */ -void QDeclarativeAbstractAnimation::setDisableUserControl() +void QQuickAbstractAnimation::setDisableUserControl() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); d->disableUserControl = true; } -void QDeclarativeAbstractAnimation::setEnableUserControl() +void QQuickAbstractAnimation::setEnableUserControl() { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); d->disableUserControl = false; } -bool QDeclarativeAbstractAnimation::userControlDisabled() const +bool QQuickAbstractAnimation::userControlDisabled() const { - Q_D(const QDeclarativeAbstractAnimation); + Q_D(const QQuickAbstractAnimation); return d->disableUserControl; } -QAbstractAnimationJob* QDeclarativeAbstractAnimation::initInstance(QAbstractAnimationJob *animation) +QAbstractAnimationJob* QQuickAbstractAnimation::initInstance(QAbstractAnimationJob *animation) { - Q_D(QDeclarativeAbstractAnimation); + Q_D(QQuickAbstractAnimation); animation->setLoopCount(d->loopCount); return animation; } -QAbstractAnimationJob* QDeclarativeAbstractAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickAbstractAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { @@ -592,9 +592,9 @@ QAbstractAnimationJob* QDeclarativeAbstractAnimation::transition(QDeclarativeSta return 0; } -void QDeclarativeAbstractAnimationPrivate::animationFinished(QAbstractAnimationJob*) +void QQuickAbstractAnimationPrivate::animationFinished(QAbstractAnimationJob*) { - Q_Q(QDeclarativeAbstractAnimation); + Q_Q(QQuickAbstractAnimation); q->setRunning(false); if (alwaysRunToEnd && loopCount != 1) { //restore the proper loopCount for the next run @@ -603,7 +603,7 @@ void QDeclarativeAbstractAnimationPrivate::animationFinished(QAbstractAnimationJ } /*! - \qmlclass PauseAnimation QDeclarativePauseAnimation + \qmlclass PauseAnimation QQuickPauseAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits Animation @@ -621,14 +621,14 @@ void QDeclarativeAbstractAnimationPrivate::animationFinished(QAbstractAnimationJ } \endcode - \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ -QDeclarativePauseAnimation::QDeclarativePauseAnimation(QObject *parent) -: QDeclarativeAbstractAnimation(*(new QDeclarativePauseAnimationPrivate), parent) +QQuickPauseAnimation::QQuickPauseAnimation(QObject *parent) +: QQuickAbstractAnimation(*(new QQuickPauseAnimationPrivate), parent) { } -QDeclarativePauseAnimation::~QDeclarativePauseAnimation() +QQuickPauseAnimation::~QQuickPauseAnimation() { } @@ -638,32 +638,32 @@ QDeclarativePauseAnimation::~QDeclarativePauseAnimation() The default value is 250. */ -int QDeclarativePauseAnimation::duration() const +int QQuickPauseAnimation::duration() const { - Q_D(const QDeclarativePauseAnimation); + Q_D(const QQuickPauseAnimation); return d->duration; } -void QDeclarativePauseAnimation::setDuration(int duration) +void QQuickPauseAnimation::setDuration(int duration) { if (duration < 0) { qmlInfo(this) << tr("Cannot set a duration of < 0"); return; } - Q_D(QDeclarativePauseAnimation); + Q_D(QQuickPauseAnimation); if (d->duration == duration) return; d->duration = duration; emit durationChanged(duration); } -QAbstractAnimationJob* QDeclarativePauseAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickPauseAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { - Q_D(QDeclarativePauseAnimation); + Q_D(QQuickPauseAnimation); Q_UNUSED(actions); Q_UNUSED(modified); Q_UNUSED(direction); @@ -673,7 +673,7 @@ QAbstractAnimationJob* QDeclarativePauseAnimation::transition(QDeclarativeStateA } /*! - \qmlclass ColorAnimation QDeclarativeColorAnimation + \qmlclass ColorAnimation QQuickColorAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits PropertyAnimation @@ -686,7 +686,7 @@ QAbstractAnimationJob* QDeclarativePauseAnimation::transition(QDeclarativeStateA as a property value source. It animates the \c color property's value from its current value to a value of "red", over 1000 milliseconds: - \snippet doc/src/snippets/declarative/coloranimation.qml 0 + \snippet doc/src/snippets/qml/coloranimation.qml 0 Like any other animation element, a ColorAnimation can be applied in a number of ways, including transitions, behaviors and property value @@ -699,18 +699,18 @@ QAbstractAnimationJob* QDeclarativePauseAnimation::transition(QDeclarativeStateA \l{PropertyAnimation::}{properties} are explicitly set for the animation, then those are used instead. - \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ -QDeclarativeColorAnimation::QDeclarativeColorAnimation(QObject *parent) -: QDeclarativePropertyAnimation(parent) +QQuickColorAnimation::QQuickColorAnimation(QObject *parent) +: QQuickPropertyAnimation(parent) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); d->interpolatorType = QMetaType::QColor; d->defaultToInterpolatorType = true; d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType); } -QDeclarativeColorAnimation::~QDeclarativeColorAnimation() +QQuickColorAnimation::~QQuickColorAnimation() { } @@ -740,15 +740,15 @@ QDeclarativeColorAnimation::~QDeclarativeColorAnimation() \sa {QML Animation and Transitions} */ -QColor QDeclarativeColorAnimation::from() const +QColor QQuickColorAnimation::from() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->from.value<QColor>(); } -void QDeclarativeColorAnimation::setFrom(const QColor &f) +void QQuickColorAnimation::setFrom(const QColor &f) { - QDeclarativePropertyAnimation::setFrom(f); + QQuickPropertyAnimation::setFrom(f); } /*! @@ -763,15 +763,15 @@ void QDeclarativeColorAnimation::setFrom(const QColor &f) \sa {QML Animation and Transitions} */ -QColor QDeclarativeColorAnimation::to() const +QColor QQuickColorAnimation::to() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->to.value<QColor>(); } -void QDeclarativeColorAnimation::setTo(const QColor &t) +void QQuickColorAnimation::setTo(const QColor &t) { - QDeclarativePropertyAnimation::setTo(t); + QQuickPropertyAnimation::setTo(t); } QActionAnimation::QActionAnimation() @@ -817,7 +817,7 @@ void QActionAnimation::updateState(State newState, State oldState) } /*! - \qmlclass ScriptAction QDeclarativeScriptAction + \qmlclass ScriptAction QQuickScriptAction \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits Animation @@ -840,35 +840,35 @@ void QActionAnimation::updateState(State newState, State oldState) When used as part of a Transition, you can also target a specific StateChangeScript to run using the \c scriptName property. - \snippet doc/src/snippets/declarative/states/statechangescript.qml state and transition + \snippet doc/src/snippets/qml/states/statechangescript.qml state and transition \sa StateChangeScript */ -QDeclarativeScriptAction::QDeclarativeScriptAction(QObject *parent) - :QDeclarativeAbstractAnimation(*(new QDeclarativeScriptActionPrivate), parent) +QQuickScriptAction::QQuickScriptAction(QObject *parent) + :QQuickAbstractAnimation(*(new QQuickScriptActionPrivate), parent) { } -QDeclarativeScriptAction::~QDeclarativeScriptAction() +QQuickScriptAction::~QQuickScriptAction() { } -QDeclarativeScriptActionPrivate::QDeclarativeScriptActionPrivate() - : QDeclarativeAbstractAnimationPrivate(), hasRunScriptScript(false), reversing(false){} +QQuickScriptActionPrivate::QQuickScriptActionPrivate() + : QQuickAbstractAnimationPrivate(), hasRunScriptScript(false), reversing(false){} /*! \qmlproperty script QtQuick2::ScriptAction::script This property holds the script to run. */ -QDeclarativeScriptString QDeclarativeScriptAction::script() const +QQmlScriptString QQuickScriptAction::script() const { - Q_D(const QDeclarativeScriptAction); + Q_D(const QQuickScriptAction); return d->script; } -void QDeclarativeScriptAction::setScript(const QDeclarativeScriptString &script) +void QQuickScriptAction::setScript(const QQmlScriptString &script) { - Q_D(QDeclarativeScriptAction); + Q_D(QQuickScriptAction); d->script = script; } @@ -882,56 +882,56 @@ void QDeclarativeScriptAction::setScript(const QDeclarativeScriptString &script) \note When using scriptName in a reversible transition, the script will only be run when the transition is being run forwards. */ -QString QDeclarativeScriptAction::stateChangeScriptName() const +QString QQuickScriptAction::stateChangeScriptName() const { - Q_D(const QDeclarativeScriptAction); + Q_D(const QQuickScriptAction); return d->name; } -void QDeclarativeScriptAction::setStateChangeScriptName(const QString &name) +void QQuickScriptAction::setStateChangeScriptName(const QString &name) { - Q_D(QDeclarativeScriptAction); + Q_D(QQuickScriptAction); d->name = name; } -QAbstractAnimationAction* QDeclarativeScriptActionPrivate::createAction() +QAbstractAnimationAction* QQuickScriptActionPrivate::createAction() { return new Proxy(this); } -void QDeclarativeScriptActionPrivate::execute() +void QQuickScriptActionPrivate::execute() { - Q_Q(QDeclarativeScriptAction); + Q_Q(QQuickScriptAction); if (hasRunScriptScript && reversing) return; - QDeclarativeScriptString scriptStr = hasRunScriptScript ? runScriptScript : script; + QQmlScriptString scriptStr = hasRunScriptScript ? runScriptScript : script; if (!scriptStr.script().isEmpty()) { - QDeclarativeExpression expr(scriptStr); + QQmlExpression expr(scriptStr); expr.evaluate(); if (expr.hasError()) qmlInfo(q) << expr.error(); } } -QAbstractAnimationJob* QDeclarativeScriptAction::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickScriptAction::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { - Q_D(QDeclarativeScriptAction); + Q_D(QQuickScriptAction); Q_UNUSED(modified); Q_UNUSED(defaultTarget); d->hasRunScriptScript = false; d->reversing = (direction == Backward); for (int ii = 0; ii < actions.count(); ++ii) { - QDeclarativeAction &action = actions[ii]; + QQuickAction &action = actions[ii]; - if (action.event && action.event->type() == QDeclarativeActionEvent::Script - && static_cast<QDeclarativeStateChangeScript*>(action.event)->name() == d->name) { - d->runScriptScript = static_cast<QDeclarativeStateChangeScript*>(action.event)->script(); + if (action.event && action.event->type() == QQuickActionEvent::Script + && static_cast<QQuickStateChangeScript*>(action.event)->name() == d->name) { + d->runScriptScript = static_cast<QQuickStateChangeScript*>(action.event)->script(); d->hasRunScriptScript = true; action.actionDone = true; break; //only match one (names should be unique) @@ -941,7 +941,7 @@ QAbstractAnimationJob* QDeclarativeScriptAction::transition(QDeclarativeStateAct } /*! - \qmlclass PropertyAction QDeclarativePropertyAction + \qmlclass PropertyAction QQuickPropertyAction \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits Animation @@ -956,14 +956,14 @@ QAbstractAnimationJob* QDeclarativeScriptAction::transition(QDeclarativeStateAct \l {Image::}{smooth} property to \c true, animates the width of the image, then sets \l {Image::}{smooth} back to \c false: - \snippet doc/src/snippets/declarative/propertyaction.qml standalone + \snippet doc/src/snippets/qml/propertyaction.qml standalone PropertyAction is also useful for setting the exact point at which a property change should occur during a \l Transition. For example, if PropertyChanges was used in a \l State to rotate an item around a particular \l {Item::}{transformOrigin}, it might be implemented like this: - \snippet doc/src/snippets/declarative/propertyaction.qml transition + \snippet doc/src/snippets/qml/propertyaction.qml transition However, with this code, the \c transformOrigin is not set until \e after the animation, as a \l State is taken to define the values at the \e end of @@ -971,48 +971,48 @@ QAbstractAnimationJob* QDeclarativeScriptAction::transition(QDeclarativeStateAct then jump to \c Item.BottomRight. To fix this, insert a PropertyAction before the RotationAnimation begins: - \snippet doc/src/snippets/declarative/propertyaction-sequential.qml sequential + \snippet doc/src/snippets/qml/propertyaction-sequential.qml sequential This immediately sets the \c transformOrigin property to the value defined in the end state of the \l Transition (i.e. the value defined in the PropertyAction object) so that the rotation animation begins with the correct transform origin. - \sa {QML Animation and Transitions}, QtDeclarative + \sa {QML Animation and Transitions}, QtQml */ -QDeclarativePropertyAction::QDeclarativePropertyAction(QObject *parent) -: QDeclarativeAbstractAnimation(*(new QDeclarativePropertyActionPrivate), parent) +QQuickPropertyAction::QQuickPropertyAction(QObject *parent) +: QQuickAbstractAnimation(*(new QQuickPropertyActionPrivate), parent) { } -QDeclarativePropertyAction::~QDeclarativePropertyAction() +QQuickPropertyAction::~QQuickPropertyAction() { } -QObject *QDeclarativePropertyAction::target() const +QObject *QQuickPropertyAction::target() const { - Q_D(const QDeclarativePropertyAction); + Q_D(const QQuickPropertyAction); return d->target; } -void QDeclarativePropertyAction::setTargetObject(QObject *o) +void QQuickPropertyAction::setTargetObject(QObject *o) { - Q_D(QDeclarativePropertyAction); + Q_D(QQuickPropertyAction); if (d->target == o) return; d->target = o; emit targetChanged(); } -QString QDeclarativePropertyAction::property() const +QString QQuickPropertyAction::property() const { - Q_D(const QDeclarativePropertyAction); + Q_D(const QQuickPropertyAction); return d->propertyName; } -void QDeclarativePropertyAction::setProperty(const QString &n) +void QQuickPropertyAction::setProperty(const QString &n) { - Q_D(QDeclarativePropertyAction); + Q_D(QQuickPropertyAction); if (d->propertyName == n) return; d->propertyName = n; @@ -1034,25 +1034,25 @@ void QDeclarativePropertyAction::setProperty(const QString &n) \sa exclude */ -QString QDeclarativePropertyAction::properties() const +QString QQuickPropertyAction::properties() const { - Q_D(const QDeclarativePropertyAction); + Q_D(const QQuickPropertyAction); return d->properties; } -void QDeclarativePropertyAction::setProperties(const QString &p) +void QQuickPropertyAction::setProperties(const QString &p) { - Q_D(QDeclarativePropertyAction); + Q_D(QQuickPropertyAction); if (d->properties == p) return; d->properties = p; emit propertiesChanged(p); } -QDeclarativeListProperty<QObject> QDeclarativePropertyAction::targets() +QQmlListProperty<QObject> QQuickPropertyAction::targets() { - Q_D(QDeclarativePropertyAction); - return QDeclarativeListProperty<QObject>(this, d->targets); + Q_D(QQuickPropertyAction); + return QQmlListProperty<QObject>(this, d->targets); } /*! @@ -1061,10 +1061,10 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAction::targets() \sa targets */ -QDeclarativeListProperty<QObject> QDeclarativePropertyAction::exclude() +QQmlListProperty<QObject> QQuickPropertyAction::exclude() { - Q_D(QDeclarativePropertyAction); - return QDeclarativeListProperty<QObject>(this, d->exclude); + Q_D(QQuickPropertyAction); + return QQmlListProperty<QObject>(this, d->exclude); } /*! @@ -1076,37 +1076,37 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAction::exclude() \l Transition, or the value of the property change that triggered the \l Behavior. */ -QVariant QDeclarativePropertyAction::value() const +QVariant QQuickPropertyAction::value() const { - Q_D(const QDeclarativePropertyAction); + Q_D(const QQuickPropertyAction); return d->value; } -void QDeclarativePropertyAction::setValue(const QVariant &v) +void QQuickPropertyAction::setValue(const QVariant &v) { - Q_D(QDeclarativePropertyAction); + Q_D(QQuickPropertyAction); if (d->value.isNull || d->value != v) { d->value = v; emit valueChanged(v); } } -QAbstractAnimationJob* QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { - Q_D(QDeclarativePropertyAction); + Q_D(QQuickPropertyAction); Q_UNUSED(direction); - struct QDeclarativeSetPropertyAnimationAction : public QAbstractAnimationAction + struct QQuickSetPropertyAnimationAction : public QAbstractAnimationAction { - QDeclarativeStateActions actions; + QQuickStateActions actions; virtual void doAction() { for (int ii = 0; ii < actions.count(); ++ii) { - const QDeclarativeAction &action = actions.at(ii); - QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + const QQuickAction &action = actions.at(ii); + QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } } }; @@ -1131,22 +1131,22 @@ QAbstractAnimationJob* QDeclarativePropertyAction::transition(QDeclarativeStateA if (defaultTarget && targets.isEmpty()) targets << defaultTarget; - QDeclarativeSetPropertyAnimationAction *data = new QDeclarativeSetPropertyAnimationAction; + QQuickSetPropertyAnimationAction *data = new QQuickSetPropertyAnimationAction; bool hasExplicit = false; //an explicit animation has been specified if (d->value.isValid()) { for (int i = 0; i < props.count(); ++i) { for (int j = 0; j < targets.count(); ++j) { - QDeclarativeAction myAction; + QQuickAction myAction; myAction.property = d->createProperty(targets.at(j), props.at(i), this); if (myAction.property.isValid()) { myAction.toValue = d->value; - QDeclarativePropertyAnimationPrivate::convertVariant(myAction.toValue, myAction.property.propertyType()); + QQuickPropertyAnimationPrivate::convertVariant(myAction.toValue, myAction.property.propertyType()); data->actions << myAction; hasExplicit = true; for (int ii = 0; ii < actions.count(); ++ii) { - QDeclarativeAction &action = actions[ii]; + QQuickAction &action = actions[ii]; if (action.property.object() == myAction.property.object() && myAction.property.name() == action.property.name()) { modified << action.property; @@ -1160,7 +1160,7 @@ QAbstractAnimationJob* QDeclarativePropertyAction::transition(QDeclarativeStateA if (!hasExplicit) for (int ii = 0; ii < actions.count(); ++ii) { - QDeclarativeAction &action = actions[ii]; + QQuickAction &action = actions[ii]; QObject *obj = action.property.object(); QString propertyName = action.property.name(); @@ -1171,11 +1171,11 @@ QAbstractAnimationJob* QDeclarativePropertyAction::transition(QDeclarativeStateA if ((targets.isEmpty() || targets.contains(obj) || (!same && targets.contains(sObj))) && (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && (props.contains(propertyName) || (!same && props.contains(sPropertyName)))) { - QDeclarativeAction myAction = action; + QQuickAction myAction = action; if (d->value.isValid()) myAction.toValue = d->value; - QDeclarativePropertyAnimationPrivate::convertVariant(myAction.toValue, myAction.property.propertyType()); + QQuickPropertyAnimationPrivate::convertVariant(myAction.toValue, myAction.property.propertyType()); modified << action.property; data->actions << myAction; @@ -1193,7 +1193,7 @@ QAbstractAnimationJob* QDeclarativePropertyAction::transition(QDeclarativeStateA } /*! - \qmlclass NumberAnimation QDeclarativeNumberAnimation + \qmlclass NumberAnimation QQuickNumberAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits PropertyAnimation @@ -1206,7 +1206,7 @@ QAbstractAnimationJob* QDeclarativePropertyAction::transition(QDeclarativeStateA as a property value source. It animates the \c x value from its current value to a value of 50, over 1000 milliseconds: - \snippet doc/src/snippets/declarative/numberanimation.qml 0 + \snippet doc/src/snippets/qml/numberanimation.qml 0 Like any other animation element, a NumberAnimation can be applied in a number of ways, including transitions, behaviors and property value @@ -1217,27 +1217,27 @@ QAbstractAnimationJob* QDeclarativePropertyAction::transition(QDeclarativeStateA changes in the number value that it is tracking. If this is the case, use SmoothedAnimation instead. - \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ -QDeclarativeNumberAnimation::QDeclarativeNumberAnimation(QObject *parent) -: QDeclarativePropertyAnimation(parent) +QQuickNumberAnimation::QQuickNumberAnimation(QObject *parent) +: QQuickPropertyAnimation(parent) { init(); } -QDeclarativeNumberAnimation::QDeclarativeNumberAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent) -: QDeclarativePropertyAnimation(dd, parent) +QQuickNumberAnimation::QQuickNumberAnimation(QQuickPropertyAnimationPrivate &dd, QObject *parent) +: QQuickPropertyAnimation(dd, parent) { init(); } -QDeclarativeNumberAnimation::~QDeclarativeNumberAnimation() +QQuickNumberAnimation::~QQuickNumberAnimation() { } -void QDeclarativeNumberAnimation::init() +void QQuickNumberAnimation::init() { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); d->interpolatorType = QMetaType::QReal; d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType); } @@ -1269,15 +1269,15 @@ void QDeclarativeNumberAnimation::init() \sa {QML Animation and Transitions} */ -qreal QDeclarativeNumberAnimation::from() const +qreal QQuickNumberAnimation::from() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->from.toReal(); } -void QDeclarativeNumberAnimation::setFrom(qreal f) +void QQuickNumberAnimation::setFrom(qreal f) { - QDeclarativePropertyAnimation::setFrom(f); + QQuickPropertyAnimation::setFrom(f); } /*! @@ -1291,21 +1291,21 @@ void QDeclarativeNumberAnimation::setFrom(qreal f) \sa {QML Animation and Transitions} */ -qreal QDeclarativeNumberAnimation::to() const +qreal QQuickNumberAnimation::to() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->to.toReal(); } -void QDeclarativeNumberAnimation::setTo(qreal t) +void QQuickNumberAnimation::setTo(qreal t) { - QDeclarativePropertyAnimation::setTo(t); + QQuickPropertyAnimation::setTo(t); } /*! - \qmlclass Vector3dAnimation QDeclarativeVector3dAnimation + \qmlclass Vector3dAnimation QQuickVector3dAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits PropertyAnimation @@ -1319,18 +1319,18 @@ void QDeclarativeNumberAnimation::setTo(qreal t) sources. The \l {QML Animation and Transitions} documentation shows a variety of methods for creating animations. - \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ -QDeclarativeVector3dAnimation::QDeclarativeVector3dAnimation(QObject *parent) -: QDeclarativePropertyAnimation(parent) +QQuickVector3dAnimation::QQuickVector3dAnimation(QObject *parent) +: QQuickPropertyAnimation(parent) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); d->interpolatorType = QMetaType::QVector3D; d->defaultToInterpolatorType = true; d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType); } -QDeclarativeVector3dAnimation::~QDeclarativeVector3dAnimation() +QQuickVector3dAnimation::~QQuickVector3dAnimation() { } @@ -1345,15 +1345,15 @@ QDeclarativeVector3dAnimation::~QDeclarativeVector3dAnimation() \sa {QML Animation and Transitions} */ -QVector3D QDeclarativeVector3dAnimation::from() const +QVector3D QQuickVector3dAnimation::from() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->from.value<QVector3D>(); } -void QDeclarativeVector3dAnimation::setFrom(QVector3D f) +void QQuickVector3dAnimation::setFrom(QVector3D f) { - QDeclarativePropertyAnimation::setFrom(f); + QQuickPropertyAnimation::setFrom(f); } /*! @@ -1367,21 +1367,21 @@ void QDeclarativeVector3dAnimation::setFrom(QVector3D f) \sa {QML Animation and Transitions} */ -QVector3D QDeclarativeVector3dAnimation::to() const +QVector3D QQuickVector3dAnimation::to() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->to.value<QVector3D>(); } -void QDeclarativeVector3dAnimation::setTo(QVector3D t) +void QQuickVector3dAnimation::setTo(QVector3D t) { - QDeclarativePropertyAnimation::setTo(t); + QQuickPropertyAnimation::setTo(t); } /*! - \qmlclass RotationAnimation QDeclarativeRotationAnimation + \qmlclass RotationAnimation QQuickRotationAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits PropertyAnimation @@ -1399,7 +1399,7 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) In the following example we use RotationAnimation to animate the rotation between states via the shortest path: - \snippet doc/src/snippets/declarative/rotationanimation.qml 0 + \snippet doc/src/snippets/qml/rotationanimation.qml 0 Notice the RotationAnimation did not need to set a \l target value. As a convenience, when used in a transition, RotationAnimation will rotate all @@ -1418,7 +1418,7 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) sources. The \l {QML Animation and Transitions} documentation shows a variety of methods for creating animations. - \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ QVariant _q_interpolateShortestRotation(qreal &f, qreal &t, qreal progress) { @@ -1457,16 +1457,16 @@ QVariant _q_interpolateCounterclockwiseRotation(qreal &f, qreal &t, qreal progre return QVariant(f + (newt - f) * progress); } -QDeclarativeRotationAnimation::QDeclarativeRotationAnimation(QObject *parent) -: QDeclarativePropertyAnimation(*(new QDeclarativeRotationAnimationPrivate), parent) +QQuickRotationAnimation::QQuickRotationAnimation(QObject *parent) +: QQuickPropertyAnimation(*(new QQuickRotationAnimationPrivate), parent) { - Q_D(QDeclarativeRotationAnimation); + Q_D(QQuickRotationAnimation); d->interpolatorType = QMetaType::QReal; d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType); d->defaultProperties = QLatin1String("rotation,angle"); } -QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation() +QQuickRotationAnimation::~QQuickRotationAnimation() { } @@ -1496,15 +1496,15 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation() \sa {QML Animation and Transitions} */ -qreal QDeclarativeRotationAnimation::from() const +qreal QQuickRotationAnimation::from() const { - Q_D(const QDeclarativeRotationAnimation); + Q_D(const QQuickRotationAnimation); return d->from.toReal(); } -void QDeclarativeRotationAnimation::setFrom(qreal f) +void QQuickRotationAnimation::setFrom(qreal f) { - QDeclarativePropertyAnimation::setFrom(f); + QQuickPropertyAnimation::setFrom(f); } /*! @@ -1518,15 +1518,15 @@ void QDeclarativeRotationAnimation::setFrom(qreal f) \sa {QML Animation and Transitions} */ -qreal QDeclarativeRotationAnimation::to() const +qreal QQuickRotationAnimation::to() const { - Q_D(const QDeclarativeRotationAnimation); + Q_D(const QQuickRotationAnimation); return d->to.toReal(); } -void QDeclarativeRotationAnimation::setTo(qreal t) +void QQuickRotationAnimation::setTo(qreal t) { - QDeclarativePropertyAnimation::setTo(t); + QQuickPropertyAnimation::setTo(t); } /*! @@ -1544,15 +1544,15 @@ void QDeclarativeRotationAnimation::setTo(qreal t) A rotation from 10 to 350 will rotate 20 degrees counterclockwise. \endlist */ -QDeclarativeRotationAnimation::RotationDirection QDeclarativeRotationAnimation::direction() const +QQuickRotationAnimation::RotationDirection QQuickRotationAnimation::direction() const { - Q_D(const QDeclarativeRotationAnimation); + Q_D(const QQuickRotationAnimation); return d->direction; } -void QDeclarativeRotationAnimation::setDirection(QDeclarativeRotationAnimation::RotationDirection direction) +void QQuickRotationAnimation::setDirection(QQuickRotationAnimation::RotationDirection direction) { - Q_D(QDeclarativeRotationAnimation); + Q_D(QQuickRotationAnimation); if (d->direction == direction) return; @@ -1576,50 +1576,50 @@ void QDeclarativeRotationAnimation::setDirection(QDeclarativeRotationAnimation:: -QDeclarativeAnimationGroup::QDeclarativeAnimationGroup(QObject *parent) -: QDeclarativeAbstractAnimation(*(new QDeclarativeAnimationGroupPrivate), parent) +QQuickAnimationGroup::QQuickAnimationGroup(QObject *parent) +: QQuickAbstractAnimation(*(new QQuickAnimationGroupPrivate), parent) { } -QDeclarativeAnimationGroup::QDeclarativeAnimationGroup(QDeclarativeAnimationGroupPrivate &dd, QObject *parent) - : QDeclarativeAbstractAnimation(dd, parent) +QQuickAnimationGroup::QQuickAnimationGroup(QQuickAnimationGroupPrivate &dd, QObject *parent) + : QQuickAbstractAnimation(dd, parent) { } -void QDeclarativeAnimationGroupPrivate::append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *a) +void QQuickAnimationGroupPrivate::append_animation(QQmlListProperty<QQuickAbstractAnimation> *list, QQuickAbstractAnimation *a) { - QDeclarativeAnimationGroup *q = qobject_cast<QDeclarativeAnimationGroup *>(list->object); + QQuickAnimationGroup *q = qobject_cast<QQuickAnimationGroup *>(list->object); if (q) { a->setGroup(q); } } -void QDeclarativeAnimationGroupPrivate::clear_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list) +void QQuickAnimationGroupPrivate::clear_animation(QQmlListProperty<QQuickAbstractAnimation> *list) { - QDeclarativeAnimationGroup *q = qobject_cast<QDeclarativeAnimationGroup *>(list->object); + QQuickAnimationGroup *q = qobject_cast<QQuickAnimationGroup *>(list->object); if (q) { while (q->d_func()->animations.count()) { - QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0); + QQuickAbstractAnimation *firstAnim = q->d_func()->animations.at(0); firstAnim->setGroup(0); } } } -QDeclarativeAnimationGroup::~QDeclarativeAnimationGroup() +QQuickAnimationGroup::~QQuickAnimationGroup() { } -QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGroup::animations() +QQmlListProperty<QQuickAbstractAnimation> QQuickAnimationGroup::animations() { - Q_D(QDeclarativeAnimationGroup); - QDeclarativeListProperty<QDeclarativeAbstractAnimation> list(this, d->animations); - list.append = &QDeclarativeAnimationGroupPrivate::append_animation; - list.clear = &QDeclarativeAnimationGroupPrivate::clear_animation; + Q_D(QQuickAnimationGroup); + QQmlListProperty<QQuickAbstractAnimation> list(this, d->animations); + list.append = &QQuickAnimationGroupPrivate::append_animation; + list.clear = &QQuickAnimationGroupPrivate::clear_animation; return list; } /*! - \qmlclass SequentialAnimation QDeclarativeSequentialAnimation + \qmlclass SequentialAnimation QQuickSequentialAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits Animation @@ -1633,7 +1633,7 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro The following example runs two number animations in a sequence. The \l Rectangle animates to a \c x position of 50, then to a \c y position of 50. - \snippet doc/src/snippets/declarative/sequentialanimation.qml 0 + \snippet doc/src/snippets/qml/sequentialanimation.qml 0 Animations defined within a \l Transition are automatically run in parallel, so SequentialAnimation can be used to enclose the animations in a \l Transition @@ -1648,24 +1648,24 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro ParallelAnimation, it cannot be individually started and stopped; the SequentialAnimation or ParallelAnimation must be started and stopped as a group. - \sa ParallelAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa ParallelAnimation, {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ -QDeclarativeSequentialAnimation::QDeclarativeSequentialAnimation(QObject *parent) : - QDeclarativeAnimationGroup(parent) +QQuickSequentialAnimation::QQuickSequentialAnimation(QObject *parent) : + QQuickAnimationGroup(parent) { } -QDeclarativeSequentialAnimation::~QDeclarativeSequentialAnimation() +QQuickSequentialAnimation::~QQuickSequentialAnimation() { } -QAbstractAnimationJob* QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickSequentialAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { - Q_D(QDeclarativeAnimationGroup); + Q_D(QQuickAnimationGroup); QSequentialAnimationGroupJob *ag = new QSequentialAnimationGroupJob; @@ -1691,7 +1691,7 @@ QAbstractAnimationJob* QDeclarativeSequentialAnimation::transition(QDeclarativeS /*! - \qmlclass ParallelAnimation QDeclarativeParallelAnimation + \qmlclass ParallelAnimation QQuickParallelAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits Animation @@ -1705,7 +1705,7 @@ QAbstractAnimationJob* QDeclarativeSequentialAnimation::transition(QDeclarativeS The following animation runs two number animations in parallel. The \l Rectangle moves to (50,50) by animating its \c x and \c y properties at the same time. - \snippet doc/src/snippets/declarative/parallelanimation.qml 0 + \snippet doc/src/snippets/qml/parallelanimation.qml 0 Like any other animation element, a ParallelAnimation can be applied in a number of ways, including transitions, behaviors and property value @@ -1716,23 +1716,23 @@ QAbstractAnimationJob* QDeclarativeSequentialAnimation::transition(QDeclarativeS ParallelAnimation, it cannot be individually started and stopped; the SequentialAnimation or ParallelAnimation must be started and stopped as a group. - \sa SequentialAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa SequentialAnimation, {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ -QDeclarativeParallelAnimation::QDeclarativeParallelAnimation(QObject *parent) : - QDeclarativeAnimationGroup(parent) +QQuickParallelAnimation::QQuickParallelAnimation(QObject *parent) : + QQuickAnimationGroup(parent) { } -QDeclarativeParallelAnimation::~QDeclarativeParallelAnimation() +QQuickParallelAnimation::~QQuickParallelAnimation() { } -QAbstractAnimationJob* QDeclarativeParallelAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickParallelAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { - Q_D(QDeclarativeAnimationGroup); + Q_D(QQuickAnimationGroup); QParallelAnimationGroupJob *ag = new QParallelAnimationGroupJob; bool valid = d->defaultProperty.isValid(); @@ -1747,7 +1747,7 @@ QAbstractAnimationJob* QDeclarativeParallelAnimation::transition(QDeclarativeSta } //convert a variant from string type to another animatable type -void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int type) +void QQuickPropertyAnimationPrivate::convertVariant(QVariant &variant, int type) { if (variant.userType() != QVariant::String) { variant.convert((QVariant::Type)type); @@ -1756,42 +1756,42 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int switch (type) { case QVariant::Rect: { - variant.setValue(QDeclarativeStringConverters::rectFFromString(variant.toString()).toRect()); + variant.setValue(QQmlStringConverters::rectFFromString(variant.toString()).toRect()); break; } case QVariant::RectF: { - variant.setValue(QDeclarativeStringConverters::rectFFromString(variant.toString())); + variant.setValue(QQmlStringConverters::rectFFromString(variant.toString())); break; } case QVariant::Point: { - variant.setValue(QDeclarativeStringConverters::pointFFromString(variant.toString()).toPoint()); + variant.setValue(QQmlStringConverters::pointFFromString(variant.toString()).toPoint()); break; } case QVariant::PointF: { - variant.setValue(QDeclarativeStringConverters::pointFFromString(variant.toString())); + variant.setValue(QQmlStringConverters::pointFFromString(variant.toString())); break; } case QVariant::Size: { - variant.setValue(QDeclarativeStringConverters::sizeFFromString(variant.toString()).toSize()); + variant.setValue(QQmlStringConverters::sizeFFromString(variant.toString()).toSize()); break; } case QVariant::SizeF: { - variant.setValue(QDeclarativeStringConverters::sizeFFromString(variant.toString())); + variant.setValue(QQmlStringConverters::sizeFFromString(variant.toString())); break; } case QVariant::Color: { - variant.setValue(QDeclarativeStringConverters::colorFromString(variant.toString())); + variant.setValue(QQmlStringConverters::colorFromString(variant.toString())); break; } case QVariant::Vector3D: { - variant.setValue(QDeclarativeStringConverters::vector3DFromString(variant.toString())); + variant.setValue(QQmlStringConverters::vector3DFromString(variant.toString())); break; } default: - if (QDeclarativeValueTypeFactory::isValueType((uint)type)) { + if (QQmlValueTypeFactory::isValueType((uint)type)) { variant.convert((QVariant::Type)type); } else { - QDeclarativeMetaType::StringConverter converter = QDeclarativeMetaType::customStringConverter(type); + QQmlMetaType::StringConverter converter = QQmlMetaType::customStringConverter(type); if (converter) variant = converter(variant.toString()); } @@ -1799,24 +1799,24 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int } } -QDeclarativeBulkValueAnimator::QDeclarativeBulkValueAnimator() +QQuickBulkValueAnimator::QQuickBulkValueAnimator() : QAbstractAnimationJob(), animValue(0), fromSourced(0), m_duration(250) { } -QDeclarativeBulkValueAnimator::~QDeclarativeBulkValueAnimator() +QQuickBulkValueAnimator::~QQuickBulkValueAnimator() { delete animValue; } -void QDeclarativeBulkValueAnimator::setAnimValue(QDeclarativeBulkValueUpdater *value) +void QQuickBulkValueAnimator::setAnimValue(QQuickBulkValueUpdater *value) { if (isRunning()) stop(); animValue = value; } -void QDeclarativeBulkValueAnimator::updateCurrentTime(int currentTime) +void QQuickBulkValueAnimator::updateCurrentTime(int currentTime) { if (isStopped()) return; @@ -1827,7 +1827,7 @@ void QDeclarativeBulkValueAnimator::updateCurrentTime(int currentTime) animValue->setValue(progress); } -void QDeclarativeBulkValueAnimator::topLevelAnimationLoopChanged() +void QQuickBulkValueAnimator::topLevelAnimationLoopChanged() { //check for new from every top-level loop (when the top level animation is started and all subsequent loops) if (fromSourced) @@ -1835,7 +1835,7 @@ void QDeclarativeBulkValueAnimator::topLevelAnimationLoopChanged() } /*! - \qmlclass PropertyAnimation QDeclarativePropertyAnimation + \qmlclass PropertyAnimation QQuickPropertyAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits Animation @@ -1851,21 +1851,21 @@ void QDeclarativeBulkValueAnimator::topLevelAnimationLoopChanged() For example, to animate any objects that have changed their \c x or \c y properties as a result of a state change, using an \c InOutQuad easing curve: - \snippet doc/src/snippets/declarative/propertyanimation.qml transition + \snippet doc/src/snippets/qml/propertyanimation.qml transition \o In a \l Behavior For example, to animate all changes to a rectangle's \c x property: - \snippet doc/src/snippets/declarative/propertyanimation.qml behavior + \snippet doc/src/snippets/qml/propertyanimation.qml behavior \o As a property value source For example, to repeatedly animate the rectangle's \c x property: - \snippet doc/src/snippets/declarative/propertyanimation.qml propertyvaluesource + \snippet doc/src/snippets/qml/propertyanimation.qml propertyvaluesource \o In a signal handler @@ -1882,7 +1882,7 @@ void QDeclarativeBulkValueAnimator::topLevelAnimationLoopChanged() For example, to animate \c rect's \c width property over 500ms, from its current width to 30: - \snippet doc/src/snippets/declarative/propertyanimation.qml standalone + \snippet doc/src/snippets/qml/propertyanimation.qml standalone \endlist @@ -1893,20 +1893,20 @@ void QDeclarativeBulkValueAnimator::topLevelAnimationLoopChanged() Note that PropertyAnimation inherits the abstract \l Animation element. This includes additional properties and methods for controlling the animation. - \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} + \sa {QML Animation and Transitions}, {qml/animation/basics}{Animation basics example} */ -QDeclarativePropertyAnimation::QDeclarativePropertyAnimation(QObject *parent) -: QDeclarativeAbstractAnimation(*(new QDeclarativePropertyAnimationPrivate), parent) +QQuickPropertyAnimation::QQuickPropertyAnimation(QObject *parent) +: QQuickAbstractAnimation(*(new QQuickPropertyAnimationPrivate), parent) { } -QDeclarativePropertyAnimation::QDeclarativePropertyAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent) -: QDeclarativeAbstractAnimation(dd, parent) +QQuickPropertyAnimation::QQuickPropertyAnimation(QQuickPropertyAnimationPrivate &dd, QObject *parent) +: QQuickAbstractAnimation(dd, parent) { } -QDeclarativePropertyAnimation::~QDeclarativePropertyAnimation() +QQuickPropertyAnimation::~QQuickPropertyAnimation() { } @@ -1916,20 +1916,20 @@ QDeclarativePropertyAnimation::~QDeclarativePropertyAnimation() The default value is 250. */ -int QDeclarativePropertyAnimation::duration() const +int QQuickPropertyAnimation::duration() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->duration; } -void QDeclarativePropertyAnimation::setDuration(int duration) +void QQuickPropertyAnimation::setDuration(int duration) { if (duration < 0) { qmlInfo(this) << tr("Cannot set a duration of < 0"); return; } - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); if (d->duration == duration) return; d->duration = duration; @@ -1947,15 +1947,15 @@ void QDeclarativePropertyAnimation::setDuration(int duration) \sa {QML Animation and Transitions} */ -QVariant QDeclarativePropertyAnimation::from() const +QVariant QQuickPropertyAnimation::from() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->from; } -void QDeclarativePropertyAnimation::setFrom(const QVariant &f) +void QQuickPropertyAnimation::setFrom(const QVariant &f) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); if (d->fromIsDefined && f == d->from) return; d->from = f; @@ -1974,15 +1974,15 @@ void QDeclarativePropertyAnimation::setFrom(const QVariant &f) \sa {QML Animation and Transitions} */ -QVariant QDeclarativePropertyAnimation::to() const +QVariant QQuickPropertyAnimation::to() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->to; } -void QDeclarativePropertyAnimation::setTo(const QVariant &t) +void QQuickPropertyAnimation::setTo(const QVariant &t) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); if (d->toIsDefined && t == d->to) return; d->to = t; @@ -2195,18 +2195,18 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t) groups of three points defining a curve from 0,0 to 1,1 - control1, control2, end point: [cx1, cy1, cx2, cy2, endx, endy, ...]. The last point must be 1,1. - See the \l {declarative/animation/easing}{easing} example for a demonstration of + See the \l {qml/animation/easing}{easing} example for a demonstration of the different easing settings. */ -QEasingCurve QDeclarativePropertyAnimation::easing() const +QEasingCurve QQuickPropertyAnimation::easing() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->easing; } -void QDeclarativePropertyAnimation::setEasing(const QEasingCurve &e) +void QQuickPropertyAnimation::setEasing(const QEasingCurve &e) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); if (d->easing == e) return; @@ -2214,45 +2214,45 @@ void QDeclarativePropertyAnimation::setEasing(const QEasingCurve &e) emit easingChanged(e); } -QObject *QDeclarativePropertyAnimation::target() const +QObject *QQuickPropertyAnimation::target() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->target; } -void QDeclarativePropertyAnimation::setTargetObject(QObject *o) +void QQuickPropertyAnimation::setTargetObject(QObject *o) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); if (d->target == o) return; d->target = o; emit targetChanged(); } -QString QDeclarativePropertyAnimation::property() const +QString QQuickPropertyAnimation::property() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->propertyName; } -void QDeclarativePropertyAnimation::setProperty(const QString &n) +void QQuickPropertyAnimation::setProperty(const QString &n) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); if (d->propertyName == n) return; d->propertyName = n; emit propertyChanged(); } -QString QDeclarativePropertyAnimation::properties() const +QString QQuickPropertyAnimation::properties() const { - Q_D(const QDeclarativePropertyAnimation); + Q_D(const QQuickPropertyAnimation); return d->properties; } -void QDeclarativePropertyAnimation::setProperties(const QString &prop) +void QQuickPropertyAnimation::setProperties(const QString &prop) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); if (d->properties == prop) return; @@ -2350,10 +2350,10 @@ void QDeclarativePropertyAnimation::setProperties(const QString &prop) \sa exclude, {QML Animation and Transitions} */ -QDeclarativeListProperty<QObject> QDeclarativePropertyAnimation::targets() +QQmlListProperty<QObject> QQuickPropertyAnimation::targets() { - Q_D(QDeclarativePropertyAnimation); - return QDeclarativeListProperty<QObject>(this, d->targets); + Q_D(QQuickPropertyAnimation); + return QQmlListProperty<QObject>(this, d->targets); } /*! @@ -2361,28 +2361,28 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAnimation::targets() This property holds the items not to be affected by this animation. \sa PropertyAnimation::targets */ -QDeclarativeListProperty<QObject> QDeclarativePropertyAnimation::exclude() +QQmlListProperty<QObject> QQuickPropertyAnimation::exclude() { - Q_D(QDeclarativePropertyAnimation); - return QDeclarativeListProperty<QObject>(this, d->exclude); + Q_D(QQuickPropertyAnimation); + return QQmlListProperty<QObject>(this, d->exclude); } -void QDeclarativeAnimationPropertyUpdater::setValue(qreal v) +void QQuickAnimationPropertyUpdater::setValue(qreal v) { bool deleted = false; wasDeleted = &deleted; if (reverse) v = 1 - v; for (int ii = 0; ii < actions.count(); ++ii) { - QDeclarativeAction &action = actions[ii]; + QQuickAction &action = actions[ii]; if (v == 1.) { - QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } else { if (!fromSourced && !fromDefined) { action.fromValue = action.property.read(); if (interpolatorType) { - QDeclarativePropertyAnimationPrivate::convertVariant(action.fromValue, interpolatorType); + QQuickPropertyAnimationPrivate::convertVariant(action.fromValue, interpolatorType); } } if (!interpolatorType) { @@ -2393,7 +2393,7 @@ void QDeclarativeAnimationPropertyUpdater::setValue(qreal v) } } if (interpolator) - QDeclarativePropertyPrivate::write(action.property, interpolator(action.fromValue.constData(), action.toValue.constData(), v), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(action.property, interpolator(action.fromValue.constData(), action.toValue.constData(), v), QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } if (deleted) return; @@ -2402,12 +2402,12 @@ void QDeclarativeAnimationPropertyUpdater::setValue(qreal v) fromSourced = true; } -QDeclarativeStateActions QDeclarativePropertyAnimation::createTransitionActions(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateActions &actions, + QQmlProperties &modified, QObject *defaultTarget) { - Q_D(QDeclarativePropertyAnimation); - QDeclarativeStateActions newActions; + Q_D(QQuickPropertyAnimation); + QQuickStateActions newActions; QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(',')); for (int ii = 0; ii < props.count(); ++ii) @@ -2439,7 +2439,7 @@ QDeclarativeStateActions QDeclarativePropertyAnimation::createTransitionActions( if (d->toIsDefined) { for (int i = 0; i < props.count(); ++i) { for (int j = 0; j < targets.count(); ++j) { - QDeclarativeAction myAction; + QQuickAction myAction; myAction.property = d->createProperty(targets.at(j), props.at(i), this); if (myAction.property.isValid()) { if (d->fromIsDefined) { @@ -2451,7 +2451,7 @@ QDeclarativeStateActions QDeclarativePropertyAnimation::createTransitionActions( newActions << myAction; hasExplicit = true; for (int ii = 0; ii < actions.count(); ++ii) { - QDeclarativeAction &action = actions[ii]; + QQuickAction &action = actions[ii]; if (action.property.object() == myAction.property.object() && myAction.property.name() == action.property.name()) { modified << action.property; @@ -2465,7 +2465,7 @@ QDeclarativeStateActions QDeclarativePropertyAnimation::createTransitionActions( if (!hasExplicit) for (int ii = 0; ii < actions.count(); ++ii) { - QDeclarativeAction &action = actions[ii]; + QQuickAction &action = actions[ii]; QObject *obj = action.property.object(); QString propertyName = action.property.name(); @@ -2477,7 +2477,7 @@ QDeclarativeStateActions QDeclarativePropertyAnimation::createTransitionActions( (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && (props.contains(propertyName) || (!same && props.contains(sPropertyName)) || (useType && action.property.propertyType() == d->interpolatorType))) { - QDeclarativeAction myAction = action; + QQuickAction myAction = action; if (d->fromIsDefined) myAction.fromValue = d->from; @@ -2498,21 +2498,21 @@ QDeclarativeStateActions QDeclarativePropertyAnimation::createTransitionActions( return newActions; } -QAbstractAnimationJob* QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickPropertyAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { - Q_D(QDeclarativePropertyAnimation); + Q_D(QQuickPropertyAnimation); - QDeclarativeStateActions dataActions = createTransitionActions(actions, modified, defaultTarget); + QQuickStateActions dataActions = createTransitionActions(actions, modified, defaultTarget); - QDeclarativeBulkValueAnimator *animator = new QDeclarativeBulkValueAnimator; + QQuickBulkValueAnimator *animator = new QQuickBulkValueAnimator; animator->setDuration(d->duration); animator->setEasingCurve(d->easing); if (!dataActions.isEmpty()) { - QDeclarativeAnimationPropertyUpdater *data = new QDeclarativeAnimationPropertyUpdater; + QQuickAnimationPropertyUpdater *data = new QQuickAnimationPropertyUpdater; data->interpolatorType = d->interpolatorType; data->interpolator = d->interpolator; data->reverse = direction == Backward ? true : false; diff --git a/src/quick/util/qdeclarativeanimation_p.h b/src/quick/util/qquickanimation_p.h index ec6a42861d..980a2f5171 100644 --- a/src/quick/util/qdeclarativeanimation_p.h +++ b/src/quick/util/qquickanimation_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEANIMATION_H -#define QDECLARATIVEANIMATION_H +#ifndef QQUICKANIMATION_H +#define QQUICKANIMATION_H -#include "qdeclarativestate_p.h" +#include "qquickstate_p.h" #include <QtGui/qvector3d.h> -#include <qdeclarativepropertyvaluesource.h> -#include <qdeclarative.h> -#include <qdeclarativescriptstring.h> +#include <qqmlpropertyvaluesource.h> +#include <qqml.h> +#include <qqmlscriptstring.h> #include <QtCore/qvariant.h> #include <QtCore/qeasingcurve.h> @@ -58,15 +58,15 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeAbstractAnimationPrivate; -class QDeclarativeAnimationGroup; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeAbstractAnimation : public QObject, public QDeclarativePropertyValueSource, public QDeclarativeParserStatus +class QQuickAbstractAnimationPrivate; +class QQuickAnimationGroup; +class Q_QUICK_PRIVATE_EXPORT QQuickAbstractAnimation : public QObject, public QQmlPropertyValueSource, public QQmlParserStatus { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeAbstractAnimation) + Q_DECLARE_PRIVATE(QQuickAbstractAnimation) - Q_INTERFACES(QDeclarativeParserStatus) - Q_INTERFACES(QDeclarativePropertyValueSource) + Q_INTERFACES(QQmlParserStatus) + Q_INTERFACES(QQmlPropertyValueSource) Q_ENUMS(Loops) Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) @@ -75,8 +75,8 @@ class Q_QUICK_PRIVATE_EXPORT QDeclarativeAbstractAnimation : public QObject, pub Q_CLASSINFO("DefaultMethod", "start()") public: - QDeclarativeAbstractAnimation(QObject *parent=0); - virtual ~QDeclarativeAbstractAnimation(); + QQuickAbstractAnimation(QObject *parent=0); + virtual ~QQuickAbstractAnimation(); enum Loops { Infinite = -2 }; @@ -94,10 +94,10 @@ public: int currentTime(); void setCurrentTime(int); - QDeclarativeAnimationGroup *group() const; - void setGroup(QDeclarativeAnimationGroup *); + QQuickAnimationGroup *group() const; + void setGroup(QQuickAnimationGroup *); - void setDefaultTarget(const QDeclarativeProperty &); + void setDefaultTarget(const QQmlProperty &); void setDisableUserControl(); void setEnableUserControl(); bool userControlDisabled() const; @@ -121,13 +121,13 @@ public Q_SLOTS: void complete(); protected: - QDeclarativeAbstractAnimation(QDeclarativeAbstractAnimationPrivate &dd, QObject *parent); + QQuickAbstractAnimation(QQuickAbstractAnimationPrivate &dd, QObject *parent); QAbstractAnimationJob* initInstance(QAbstractAnimationJob *animation); public: enum TransitionDirection { Forward, Backward }; - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); QAbstractAnimationJob* qtAnimation(); @@ -135,23 +135,23 @@ public: private Q_SLOTS: void componentFinalized(); private: - virtual void setTarget(const QDeclarativeProperty &); + virtual void setTarget(const QQmlProperty &); void notifyRunningChanged(bool running); - friend class QDeclarativeBehavior; - friend class QDeclarativeBehaviorPrivate; + friend class QQuickBehavior; + friend class QQuickBehaviorPrivate; }; -class QDeclarativePauseAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativePauseAnimation : public QDeclarativeAbstractAnimation +class QQuickPauseAnimationPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickPauseAnimation : public QQuickAbstractAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePauseAnimation) + Q_DECLARE_PRIVATE(QQuickPauseAnimation) Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) public: - QDeclarativePauseAnimation(QObject *parent=0); - virtual ~QDeclarativePauseAnimation(); + QQuickPauseAnimation(QObject *parent=0); + virtual ~QQuickPauseAnimation(); int duration() const; void setDuration(int); @@ -160,54 +160,54 @@ Q_SIGNALS: void durationChanged(int); protected: - QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); }; -class QDeclarativeScriptActionPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeScriptAction : public QDeclarativeAbstractAnimation +class QQuickScriptActionPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickScriptAction : public QQuickAbstractAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeScriptAction) + Q_DECLARE_PRIVATE(QQuickScriptAction) - Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript) + Q_PROPERTY(QQmlScriptString script READ script WRITE setScript) Q_PROPERTY(QString scriptName READ stateChangeScriptName WRITE setStateChangeScriptName) public: - QDeclarativeScriptAction(QObject *parent=0); - virtual ~QDeclarativeScriptAction(); + QQuickScriptAction(QObject *parent=0); + virtual ~QQuickScriptAction(); - QDeclarativeScriptString script() const; - void setScript(const QDeclarativeScriptString &); + QQmlScriptString script() const; + void setScript(const QQmlScriptString &); QString stateChangeScriptName() const; void setStateChangeScriptName(const QString &); protected: - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); }; -class QDeclarativePropertyActionPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativePropertyAction : public QDeclarativeAbstractAnimation +class QQuickPropertyActionPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickPropertyAction : public QQuickAbstractAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePropertyAction) + Q_DECLARE_PRIVATE(QQuickPropertyAction) Q_PROPERTY(QObject *target READ target WRITE setTargetObject NOTIFY targetChanged) Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets) - Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude) + Q_PROPERTY(QQmlListProperty<QObject> targets READ targets) + Q_PROPERTY(QQmlListProperty<QObject> exclude READ exclude) Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) public: - QDeclarativePropertyAction(QObject *parent=0); - virtual ~QDeclarativePropertyAction(); + QQuickPropertyAction(QObject *parent=0); + virtual ~QQuickPropertyAction(); QObject *target() const; void setTargetObject(QObject *); @@ -218,8 +218,8 @@ public: QString properties() const; void setProperties(const QString &); - QDeclarativeListProperty<QObject> targets(); - QDeclarativeListProperty<QObject> exclude(); + QQmlListProperty<QObject> targets(); + QQmlListProperty<QObject> exclude(); QVariant value() const; void setValue(const QVariant &); @@ -231,17 +231,17 @@ Q_SIGNALS: void propertyChanged(); protected: - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); }; -class QDeclarativePropertyAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativePropertyAnimation : public QDeclarativeAbstractAnimation +class QQuickPropertyAnimationPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickPropertyAnimation : public QQuickAbstractAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation) + Q_DECLARE_PRIVATE(QQuickPropertyAnimation) Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) Q_PROPERTY(QVariant from READ from WRITE setFrom NOTIFY fromChanged) @@ -250,12 +250,12 @@ class Q_QUICK_PRIVATE_EXPORT QDeclarativePropertyAnimation : public QDeclarative Q_PROPERTY(QObject *target READ target WRITE setTargetObject NOTIFY targetChanged) Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets) - Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude) + Q_PROPERTY(QQmlListProperty<QObject> targets READ targets) + Q_PROPERTY(QQmlListProperty<QObject> exclude READ exclude) public: - QDeclarativePropertyAnimation(QObject *parent=0); - virtual ~QDeclarativePropertyAnimation(); + QQuickPropertyAnimation(QObject *parent=0); + virtual ~QQuickPropertyAnimation(); virtual int duration() const; virtual void setDuration(int); @@ -278,17 +278,17 @@ public: QString properties() const; void setProperties(const QString &); - QDeclarativeListProperty<QObject> targets(); - QDeclarativeListProperty<QObject> exclude(); + QQmlListProperty<QObject> targets(); + QQmlListProperty<QObject> exclude(); protected: - QDeclarativeStateActions createTransitionActions(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + QQuickStateActions createTransitionActions(QQuickStateActions &actions, + QQmlProperties &modified, QObject *defaultTarget = 0); - QDeclarativePropertyAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent); - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + QQuickPropertyAnimation(QQuickPropertyAnimationPrivate &dd, QObject *parent); + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); Q_SIGNALS: @@ -301,16 +301,16 @@ Q_SIGNALS: void propertyChanged(); }; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeColorAnimation : public QDeclarativePropertyAnimation +class Q_QUICK_PRIVATE_EXPORT QQuickColorAnimation : public QQuickPropertyAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation) + Q_DECLARE_PRIVATE(QQuickPropertyAnimation) Q_PROPERTY(QColor from READ from WRITE setFrom) Q_PROPERTY(QColor to READ to WRITE setTo) public: - QDeclarativeColorAnimation(QObject *parent=0); - virtual ~QDeclarativeColorAnimation(); + QQuickColorAnimation(QObject *parent=0); + virtual ~QQuickColorAnimation(); QColor from() const; void setFrom(const QColor &); @@ -319,17 +319,17 @@ public: void setTo(const QColor &); }; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeNumberAnimation : public QDeclarativePropertyAnimation +class Q_QUICK_PRIVATE_EXPORT QQuickNumberAnimation : public QQuickPropertyAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation) + Q_DECLARE_PRIVATE(QQuickPropertyAnimation) Q_PROPERTY(qreal from READ from WRITE setFrom) Q_PROPERTY(qreal to READ to WRITE setTo) public: - QDeclarativeNumberAnimation(QObject *parent=0); - virtual ~QDeclarativeNumberAnimation(); + QQuickNumberAnimation(QObject *parent=0); + virtual ~QQuickNumberAnimation(); qreal from() const; void setFrom(qreal); @@ -338,23 +338,23 @@ public: void setTo(qreal); protected: - QDeclarativeNumberAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent); + QQuickNumberAnimation(QQuickPropertyAnimationPrivate &dd, QObject *parent); private: void init(); }; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeVector3dAnimation : public QDeclarativePropertyAnimation +class Q_QUICK_PRIVATE_EXPORT QQuickVector3dAnimation : public QQuickPropertyAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation) + Q_DECLARE_PRIVATE(QQuickPropertyAnimation) Q_PROPERTY(QVector3D from READ from WRITE setFrom) Q_PROPERTY(QVector3D to READ to WRITE setTo) public: - QDeclarativeVector3dAnimation(QObject *parent=0); - virtual ~QDeclarativeVector3dAnimation(); + QQuickVector3dAnimation(QObject *parent=0); + virtual ~QQuickVector3dAnimation(); QVector3D from() const; void setFrom(QVector3D); @@ -363,11 +363,11 @@ public: void setTo(QVector3D); }; -class QDeclarativeRotationAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeRotationAnimation : public QDeclarativePropertyAnimation +class QQuickRotationAnimationPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickRotationAnimation : public QQuickPropertyAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeRotationAnimation) + Q_DECLARE_PRIVATE(QQuickRotationAnimation) Q_ENUMS(RotationDirection) Q_PROPERTY(qreal from READ from WRITE setFrom) @@ -375,8 +375,8 @@ class Q_QUICK_PRIVATE_EXPORT QDeclarativeRotationAnimation : public QDeclarative Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged) public: - QDeclarativeRotationAnimation(QObject *parent=0); - virtual ~QDeclarativeRotationAnimation(); + QQuickRotationAnimation(QObject *parent=0); + virtual ~QQuickRotationAnimation(); qreal from() const; void setFrom(qreal); @@ -392,54 +392,54 @@ Q_SIGNALS: void directionChanged(); }; -class QDeclarativeAnimationGroupPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeAnimationGroup : public QDeclarativeAbstractAnimation +class QQuickAnimationGroupPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickAnimationGroup : public QQuickAbstractAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup) + Q_DECLARE_PRIVATE(QQuickAnimationGroup) Q_CLASSINFO("DefaultProperty", "animations") - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations READ animations) + Q_PROPERTY(QQmlListProperty<QQuickAbstractAnimation> animations READ animations) public: - QDeclarativeAnimationGroup(QObject *parent); - virtual ~QDeclarativeAnimationGroup(); + QQuickAnimationGroup(QObject *parent); + virtual ~QQuickAnimationGroup(); - QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations(); - friend class QDeclarativeAbstractAnimation; + QQmlListProperty<QQuickAbstractAnimation> animations(); + friend class QQuickAbstractAnimation; protected: - QDeclarativeAnimationGroup(QDeclarativeAnimationGroupPrivate &dd, QObject *parent); + QQuickAnimationGroup(QQuickAnimationGroupPrivate &dd, QObject *parent); }; -class QDeclarativeSequentialAnimation : public QDeclarativeAnimationGroup +class QQuickSequentialAnimation : public QQuickAnimationGroup { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup) + Q_DECLARE_PRIVATE(QQuickAnimationGroup) public: - QDeclarativeSequentialAnimation(QObject *parent=0); - virtual ~QDeclarativeSequentialAnimation(); + QQuickSequentialAnimation(QObject *parent=0); + virtual ~QQuickSequentialAnimation(); protected: - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); }; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeParallelAnimation : public QDeclarativeAnimationGroup +class Q_QUICK_PRIVATE_EXPORT QQuickParallelAnimation : public QQuickAnimationGroup { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup) + Q_DECLARE_PRIVATE(QQuickAnimationGroup) public: - QDeclarativeParallelAnimation(QObject *parent=0); - virtual ~QDeclarativeParallelAnimation(); + QQuickParallelAnimation(QObject *parent=0); + virtual ~QQuickParallelAnimation(); protected: - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); }; @@ -447,18 +447,18 @@ protected: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeAbstractAnimation) -QML_DECLARE_TYPE(QDeclarativePauseAnimation) -QML_DECLARE_TYPE(QDeclarativeScriptAction) -QML_DECLARE_TYPE(QDeclarativePropertyAction) -QML_DECLARE_TYPE(QDeclarativePropertyAnimation) -QML_DECLARE_TYPE(QDeclarativeColorAnimation) -QML_DECLARE_TYPE(QDeclarativeNumberAnimation) -QML_DECLARE_TYPE(QDeclarativeSequentialAnimation) -QML_DECLARE_TYPE(QDeclarativeParallelAnimation) -QML_DECLARE_TYPE(QDeclarativeVector3dAnimation) -QML_DECLARE_TYPE(QDeclarativeRotationAnimation) +QML_DECLARE_TYPE(QQuickAbstractAnimation) +QML_DECLARE_TYPE(QQuickPauseAnimation) +QML_DECLARE_TYPE(QQuickScriptAction) +QML_DECLARE_TYPE(QQuickPropertyAction) +QML_DECLARE_TYPE(QQuickPropertyAnimation) +QML_DECLARE_TYPE(QQuickColorAnimation) +QML_DECLARE_TYPE(QQuickNumberAnimation) +QML_DECLARE_TYPE(QQuickSequentialAnimation) +QML_DECLARE_TYPE(QQuickParallelAnimation) +QML_DECLARE_TYPE(QQuickVector3dAnimation) +QML_DECLARE_TYPE(QQuickRotationAnimation) QT_END_HEADER -#endif // QDECLARATIVEANIMATION_H +#endif // QQUICKANIMATION_H diff --git a/src/quick/util/qdeclarativeanimation_p_p.h b/src/quick/util/qquickanimation_p_p.h index a6b47cbc17..e32453aef3 100644 --- a/src/quick/util/qdeclarativeanimation_p_p.h +++ b/src/quick/util/qquickanimation_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEANIMATION2_P_H -#define QDECLARATIVEANIMATION2_P_H +#ifndef QQUICKANIMATION2_P_H +#define QQUICKANIMATION2_P_H // // W A R N I N G @@ -53,12 +53,12 @@ // We mean it. // -#include "qdeclarativeanimation_p.h" +#include "qquickanimation_p.h" -#include <private/qdeclarativenullablevalue_p_p.h> +#include <private/qqmlnullablevalue_p_p.h> -#include <qdeclarative.h> -#include <qdeclarativecontext.h> +#include <qqml.h> +#include <qqmlcontext.h> #include <private/qvariantanimation_p.h> #include "private/qpauseanimationjob_p.h" @@ -83,7 +83,7 @@ public: //templated animation action //allows us to specify an action that calls a function of a class. -//(so that class doesn't have to inherit QDeclarativeAbstractAnimationAction) +//(so that class doesn't have to inherit QQuickAbstractAnimationAction) template<class T, void (T::*method)()> class QAnimationActionProxy : public QAbstractAnimationAction { @@ -116,23 +116,23 @@ private: QAbstractAnimationAction *animAction; }; -class QDeclarativeBulkValueUpdater +class QQuickBulkValueUpdater { public: - virtual ~QDeclarativeBulkValueUpdater() {} + virtual ~QQuickBulkValueUpdater() {} virtual void setValue(qreal value) = 0; }; -//animates QDeclarativeBulkValueUpdater (assumes start and end values will be reals or compatible) -class Q_AUTOTEST_EXPORT QDeclarativeBulkValueAnimator : public QAbstractAnimationJob +//animates QQuickBulkValueUpdater (assumes start and end values will be reals or compatible) +class Q_AUTOTEST_EXPORT QQuickBulkValueAnimator : public QAbstractAnimationJob { - Q_DISABLE_COPY(QDeclarativeBulkValueAnimator) + Q_DISABLE_COPY(QQuickBulkValueAnimator) public: - QDeclarativeBulkValueAnimator(); - ~QDeclarativeBulkValueAnimator(); + QQuickBulkValueAnimator(); + ~QQuickBulkValueAnimator(); - void setAnimValue(QDeclarativeBulkValueUpdater *value); - QDeclarativeBulkValueUpdater *getAnimValue() const { return animValue; } + void setAnimValue(QQuickBulkValueUpdater *value); + QQuickBulkValueUpdater *getAnimValue() const { return animValue; } void setFromSourcedValue(bool *value) { fromSourced = value; } @@ -147,7 +147,7 @@ protected: void topLevelAnimationLoopChanged(); private: - QDeclarativeBulkValueUpdater *animValue; + QQuickBulkValueUpdater *animValue; bool *fromSourced; int m_duration; QEasingCurve easing; @@ -168,11 +168,11 @@ private: T *m_instance; }; -class QDeclarativeAbstractAnimationPrivate : public QObjectPrivate, public QAnimationJobChangeListener +class QQuickAbstractAnimationPrivate : public QObjectPrivate, public QAnimationJobChangeListener { - Q_DECLARE_PUBLIC(QDeclarativeAbstractAnimation) + Q_DECLARE_PUBLIC(QQuickAbstractAnimation) public: - QDeclarativeAbstractAnimationPrivate() + QQuickAbstractAnimationPrivate() : running(false), paused(false), alwaysRunToEnd(false), /*connectedTimeLine(false), */componentComplete(true), avoidPropertyValueSourceStart(false), disableUserControl(false), @@ -192,48 +192,48 @@ public: void commence(); virtual void animationFinished(QAbstractAnimationJob *); - QDeclarativeProperty defaultProperty; + QQmlProperty defaultProperty; - QDeclarativeAnimationGroup *group; + QQuickAnimationGroup *group; QAbstractAnimationJob* animationInstance; - static QDeclarativeProperty createProperty(QObject *obj, const QString &str, QObject *infoObj); + static QQmlProperty createProperty(QObject *obj, const QString &str, QObject *infoObj); }; -class QDeclarativePauseAnimationPrivate : public QDeclarativeAbstractAnimationPrivate +class QQuickPauseAnimationPrivate : public QQuickAbstractAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativePauseAnimation) + Q_DECLARE_PUBLIC(QQuickPauseAnimation) public: - QDeclarativePauseAnimationPrivate() - : QDeclarativeAbstractAnimationPrivate(), duration(250) {} + QQuickPauseAnimationPrivate() + : QQuickAbstractAnimationPrivate(), duration(250) {} int duration; }; -class QDeclarativeScriptActionPrivate : public QDeclarativeAbstractAnimationPrivate +class QQuickScriptActionPrivate : public QQuickAbstractAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativeScriptAction) + Q_DECLARE_PUBLIC(QQuickScriptAction) public: - QDeclarativeScriptActionPrivate(); + QQuickScriptActionPrivate(); - QDeclarativeScriptString script; + QQmlScriptString script; QString name; - QDeclarativeScriptString runScriptScript; + QQmlScriptString runScriptScript; bool hasRunScriptScript; bool reversing; void execute(); QAbstractAnimationAction* createAction(); - typedef QAnimationActionProxy<QDeclarativeScriptActionPrivate, - &QDeclarativeScriptActionPrivate::execute> Proxy; + typedef QAnimationActionProxy<QQuickScriptActionPrivate, + &QQuickScriptActionPrivate::execute> Proxy; }; -class QDeclarativePropertyActionPrivate : public QDeclarativeAbstractAnimationPrivate +class QQuickPropertyActionPrivate : public QQuickAbstractAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativePropertyAction) + Q_DECLARE_PUBLIC(QQuickPropertyAction) public: - QDeclarativePropertyActionPrivate() - : QDeclarativeAbstractAnimationPrivate(), target(0) {} + QQuickPropertyActionPrivate() + : QQuickAbstractAnimationPrivate(), target(0) {} QObject *target; QString propertyName; @@ -241,27 +241,27 @@ public: QList<QObject *> targets; QList<QObject *> exclude; - QDeclarativeNullableValue<QVariant> value; + QQmlNullableValue<QVariant> value; }; -class QDeclarativeAnimationGroupPrivate : public QDeclarativeAbstractAnimationPrivate +class QQuickAnimationGroupPrivate : public QQuickAbstractAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativeAnimationGroup) + Q_DECLARE_PUBLIC(QQuickAnimationGroup) public: - QDeclarativeAnimationGroupPrivate() - : QDeclarativeAbstractAnimationPrivate() {} + QQuickAnimationGroupPrivate() + : QQuickAbstractAnimationPrivate() {} - static void append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *role); - static void clear_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list); - QList<QDeclarativeAbstractAnimation *> animations; + static void append_animation(QQmlListProperty<QQuickAbstractAnimation> *list, QQuickAbstractAnimation *role); + static void clear_animation(QQmlListProperty<QQuickAbstractAnimation> *list); + QList<QQuickAbstractAnimation *> animations; }; -class QDeclarativePropertyAnimationPrivate : public QDeclarativeAbstractAnimationPrivate +class QQuickPropertyAnimationPrivate : public QQuickAbstractAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativePropertyAnimation) + Q_DECLARE_PUBLIC(QQuickPropertyAnimation) public: - QDeclarativePropertyAnimationPrivate() - : QDeclarativeAbstractAnimationPrivate(), target(0), fromSourced(false), fromIsDefined(false), toIsDefined(false), + QQuickPropertyAnimationPrivate() + : QQuickAbstractAnimationPrivate(), target(0), fromSourced(false), fromIsDefined(false), toIsDefined(false), defaultToInterpolatorType(0), interpolatorType(0), interpolator(0), duration(250), actions(0) {} QVariant from; @@ -283,31 +283,31 @@ public: int duration; QEasingCurve easing; - // for animations that don't use the QDeclarativeBulkValueAnimator - QDeclarativeStateActions *actions; + // for animations that don't use the QQuickBulkValueAnimator + QQuickStateActions *actions; static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress); static void convertVariant(QVariant &variant, int type); }; -class QDeclarativeRotationAnimationPrivate : public QDeclarativePropertyAnimationPrivate +class QQuickRotationAnimationPrivate : public QQuickPropertyAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativeRotationAnimation) + Q_DECLARE_PUBLIC(QQuickRotationAnimation) public: - QDeclarativeRotationAnimationPrivate() : direction(QDeclarativeRotationAnimation::Numerical) {} + QQuickRotationAnimationPrivate() : direction(QQuickRotationAnimation::Numerical) {} - QDeclarativeRotationAnimation::RotationDirection direction; + QQuickRotationAnimation::RotationDirection direction; }; -class Q_AUTOTEST_EXPORT QDeclarativeAnimationPropertyUpdater : public QDeclarativeBulkValueUpdater +class Q_AUTOTEST_EXPORT QQuickAnimationPropertyUpdater : public QQuickBulkValueUpdater { public: - QDeclarativeAnimationPropertyUpdater() : prevInterpolatorType(0), wasDeleted(0) {} - ~QDeclarativeAnimationPropertyUpdater() { if (wasDeleted) *wasDeleted = true; } + QQuickAnimationPropertyUpdater() : prevInterpolatorType(0), wasDeleted(0) {} + ~QQuickAnimationPropertyUpdater() { if (wasDeleted) *wasDeleted = true; } void setValue(qreal v); - QDeclarativeStateActions actions; + QQuickStateActions actions; int interpolatorType; //for Number/ColorAnimation QVariantAnimation::Interpolator interpolator; int prevInterpolatorType; //for generic @@ -319,4 +319,4 @@ public: QT_END_NAMESPACE -#endif // QDECLARATIVEANIMATION2_P_H +#endif // QQUICKANIMATION2_P_H diff --git a/src/quick/util/qdeclarativeanimationcontroller.cpp b/src/quick/util/qquickanimationcontroller.cpp index 3901a65cb6..a3e343f26d 100644 --- a/src/quick/util/qdeclarativeanimationcontroller.cpp +++ b/src/quick/util/qquickanimationcontroller.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,29 +39,29 @@ ** ****************************************************************************/ -#include "qdeclarativeanimationcontroller_p.h" -#include <QtDeclarative/qdeclarativeinfo.h> -#include <private/qdeclarativeengine_p.h> +#include "qquickanimationcontroller_p.h" +#include <QtQml/qqmlinfo.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeAnimationControllerPrivate : public QObjectPrivate +class QQuickAnimationControllerPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeAnimationController) + Q_DECLARE_PUBLIC(QQuickAnimationController) public: - QDeclarativeAnimationControllerPrivate() + QQuickAnimationControllerPrivate() : progress(0.0), animation(0), animationInstance(0), finalized(false) {} qreal progress; - QDeclarativeAbstractAnimation *animation; + QQuickAbstractAnimation *animation; QAbstractAnimationJob *animationInstance; bool finalized:1; }; /*! - \qmlclass AnimationController QDeclarativeAnimationController + \qmlclass AnimationController QQuickAnimationController \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \brief The AnimationController element allows you to control animations manually. @@ -71,14 +71,14 @@ public: */ -QDeclarativeAnimationController::QDeclarativeAnimationController(QObject *parent) -: QObject(*(new QDeclarativeAnimationControllerPrivate), parent) +QQuickAnimationController::QQuickAnimationController(QObject *parent) +: QObject(*(new QQuickAnimationControllerPrivate), parent) { } -QDeclarativeAnimationController::~QDeclarativeAnimationController() +QQuickAnimationController::~QQuickAnimationController() { - Q_D(QDeclarativeAnimationController); + Q_D(QQuickAnimationController); delete d->animationInstance; } @@ -89,15 +89,15 @@ QDeclarativeAnimationController::~QDeclarativeAnimationController() The valid \c progress value is 0.0 to 1.0, setting values less than 0 will be converted to 0, setting values great than 1 will be converted to 1. */ -qreal QDeclarativeAnimationController::progress() const +qreal QQuickAnimationController::progress() const { - Q_D(const QDeclarativeAnimationController); + Q_D(const QQuickAnimationController); return d->progress; } -void QDeclarativeAnimationController::setProgress(qreal progress) +void QQuickAnimationController::setProgress(qreal progress) { - Q_D(QDeclarativeAnimationController); + Q_D(QQuickAnimationController); progress = qBound(qreal(0), progress, qreal(1)); if (progress != d->progress) { @@ -117,27 +117,27 @@ void QDeclarativeAnimationController::setProgress(qreal progress) \c running and \c paused properties set to true. It can not be manually started or stopped (much like an animation in a Behavior can not be manually started or stopped). */ -QDeclarativeAbstractAnimation *QDeclarativeAnimationController::animation() const +QQuickAbstractAnimation *QQuickAnimationController::animation() const { - Q_D(const QDeclarativeAnimationController); + Q_D(const QQuickAnimationController); return d->animation; } -void QDeclarativeAnimationController::classBegin() +void QQuickAnimationController::classBegin() { - QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this)); + QQmlEnginePrivate *engPriv = QQmlEnginePrivate::get(qmlEngine(this)); engPriv->registerFinalizeCallback(this, this->metaObject()->indexOfSlot("componentFinalized()")); } -void QDeclarativeAnimationController::setAnimation(QDeclarativeAbstractAnimation *animation) +void QQuickAnimationController::setAnimation(QQuickAbstractAnimation *animation) { - Q_D(QDeclarativeAnimationController); + Q_D(QQuickAnimationController); if (animation != d->animation) { if (animation) { if (animation->userControlDisabled()) { - qmlInfo(this) << "QDeclarativeAnimationController::setAnimation: the animation is controlled by others, can't be used in AnimationController."; + qmlInfo(this) << "QQuickAnimationController::setAnimation: the animation is controlled by others, can't be used in AnimationController."; return; } animation->setDisableUserControl(); @@ -158,19 +158,19 @@ void QDeclarativeAnimationController::setAnimation(QDeclarativeAbstractAnimation If the animation properties changed, calling this method to reload the animation definations. */ -void QDeclarativeAnimationController::reload() +void QQuickAnimationController::reload() { - Q_D(QDeclarativeAnimationController); + Q_D(QQuickAnimationController); if (!d->finalized) return; if (!d->animation) { d->animationInstance = 0; } else { - QDeclarativeStateActions actions; - QDeclarativeProperties properties; + QQuickStateActions actions; + QQmlProperties properties; QAbstractAnimationJob *oldInstance = d->animationInstance; - d->animationInstance = d->animation->transition(actions, properties, QDeclarativeAbstractAnimation::Forward); + d->animationInstance = d->animation->transition(actions, properties, QQuickAbstractAnimation::Forward); if (oldInstance && oldInstance != d->animationInstance) delete oldInstance; d->animationInstance->setLoopCount(1); @@ -180,20 +180,20 @@ void QDeclarativeAnimationController::reload() } } -void QDeclarativeAnimationController::updateProgress() +void QQuickAnimationController::updateProgress() { - Q_D(QDeclarativeAnimationController); + Q_D(QQuickAnimationController); if (!d->animationInstance) return; d->animationInstance->start(); - QDeclarativeAnimationTimer::unregisterAnimation(d->animationInstance); + QQmlAnimationTimer::unregisterAnimation(d->animationInstance); d->animationInstance->setCurrentTime(d->progress * d->animationInstance->duration()); } -void QDeclarativeAnimationController::componentFinalized() +void QQuickAnimationController::componentFinalized() { - Q_D(QDeclarativeAnimationController); + Q_D(QQuickAnimationController); d->finalized = true; reload(); } diff --git a/src/quick/util/qdeclarativeanimationcontroller_p.h b/src/quick/util/qquickanimationcontroller_p.h index 4a064f6808..24b0b4e2f8 100644 --- a/src/quick/util/qdeclarativeanimationcontroller_p.h +++ b/src/quick/util/qquickanimationcontroller_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEANIMATIONCONTROLLER_H -#define QDECLARATIVEANIMATIONCONTROLLER_H +#ifndef QQUICKANIMATIONCONTROLLER_H +#define QQUICKANIMATIONCONTROLLER_H -#include <qdeclarative.h> -#include "qdeclarativeanimation_p.h" +#include <qqml.h> +#include "qquickanimation_p.h" QT_BEGIN_HEADER @@ -51,27 +51,27 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QDeclarativeAnimationControllerPrivate; -class Q_AUTOTEST_EXPORT QDeclarativeAnimationController : public QObject, public QDeclarativeParserStatus +class QQuickAnimationControllerPrivate; +class Q_AUTOTEST_EXPORT QQuickAnimationController : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) - Q_DECLARE_PRIVATE(QDeclarativeAnimationController) + Q_DECLARE_PRIVATE(QQuickAnimationController) Q_CLASSINFO("DefaultProperty", "animation") Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged) - Q_PROPERTY(QDeclarativeAbstractAnimation *animation READ animation WRITE setAnimation NOTIFY animationChanged) + Q_PROPERTY(QQuickAbstractAnimation *animation READ animation WRITE setAnimation NOTIFY animationChanged) public: - QDeclarativeAnimationController(QObject *parent=0); - ~QDeclarativeAnimationController(); + QQuickAnimationController(QObject *parent=0); + ~QQuickAnimationController(); qreal progress() const; void setProgress(qreal progress); - QDeclarativeAbstractAnimation *animation() const; - void setAnimation(QDeclarativeAbstractAnimation *animation); + QQuickAbstractAnimation *animation() const; + void setAnimation(QQuickAbstractAnimation *animation); void classBegin(); void componentComplete() {} @@ -87,8 +87,8 @@ private Q_SLOTS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeAnimationController) +QML_DECLARE_TYPE(QQuickAnimationController) QT_END_HEADER -#endif // QDECLARATIVEANIMATIONCONTROLLER_H +#endif // QQUICKANIMATIONCONTROLLER_H diff --git a/src/quick/util/qdeclarativebehavior.cpp b/src/quick/util/qquickbehavior.cpp index 6cf372ece9..78d83371d3 100644 --- a/src/quick/util/qdeclarativebehavior.cpp +++ b/src/quick/util/qquickbehavior.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,33 +39,33 @@ ** ****************************************************************************/ -#include "qdeclarativebehavior_p.h" +#include "qquickbehavior_p.h" -#include "qdeclarativeanimation_p.h" -#include <qdeclarativecontext.h> -#include <qdeclarativeinfo.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativeguard_p.h> -#include <private/qdeclarativeengine_p.h> +#include "qquickanimation_p.h" +#include <qqmlcontext.h> +#include <qqmlinfo.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlguard_p.h> +#include <private/qqmlengine_p.h> #include <private/qabstractanimationjob_p.h> -#include <private/qdeclarativetransition_p.h> +#include <private/qquicktransition_p.h> #include <private/qobject_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeBehaviorPrivate : public QObjectPrivate, public QAnimationJobChangeListener +class QQuickBehaviorPrivate : public QObjectPrivate, public QAnimationJobChangeListener { - Q_DECLARE_PUBLIC(QDeclarativeBehavior) + Q_DECLARE_PUBLIC(QQuickBehavior) public: - QDeclarativeBehaviorPrivate() : animation(0), animationInstance(0), enabled(true), finalized(false) + QQuickBehaviorPrivate() : animation(0), animationInstance(0), enabled(true), finalized(false) , blockRunningChanged(false) {} virtual void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState); - QDeclarativeProperty property; + QQmlProperty property; QVariant targetValue; - QDeclarativeGuard<QDeclarativeAbstractAnimation> animation; + QQmlGuard<QQuickAbstractAnimation> animation; QAbstractAnimationJob *animationInstance; bool enabled; bool finalized; @@ -73,7 +73,7 @@ public: }; /*! - \qmlclass Behavior QDeclarativeBehavior + \qmlclass Behavior QQuickBehavior \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \brief The Behavior element allows you to specify a default animation for a property change. @@ -85,7 +85,7 @@ public: whenever the \l Rectangle's \c width value changes. When the MouseArea is clicked, the \c width is changed, triggering the behavior's animation: - \snippet doc/src/snippets/declarative/behavior.qml 0 + \snippet doc/src/snippets/qml/behavior.qml 0 Note that a property cannot have more than one assigned Behavior. To provide multiple animations within a Behavior, use ParallelAnimation or @@ -96,18 +96,18 @@ public: state change. For general advice on using Behaviors to animate state changes, see \l{Using QML Behaviors with States}. - \sa {QML Animation and Transitions}, {declarative/animation/behaviors}{Behavior example}, QtDeclarative + \sa {QML Animation and Transitions}, {declarative/animation/behaviors}{Behavior example}, QtQml */ -QDeclarativeBehavior::QDeclarativeBehavior(QObject *parent) - : QObject(*(new QDeclarativeBehaviorPrivate), parent) +QQuickBehavior::QQuickBehavior(QObject *parent) + : QObject(*(new QQuickBehaviorPrivate), parent) { } -QDeclarativeBehavior::~QDeclarativeBehavior() +QQuickBehavior::~QQuickBehavior() { - Q_D(QDeclarativeBehavior); + Q_D(QQuickBehavior); delete d->animationInstance; } @@ -118,15 +118,15 @@ QDeclarativeBehavior::~QDeclarativeBehavior() This property holds the animation to run when the behavior is triggered. */ -QDeclarativeAbstractAnimation *QDeclarativeBehavior::animation() +QQuickAbstractAnimation *QQuickBehavior::animation() { - Q_D(QDeclarativeBehavior); + Q_D(QQuickBehavior); return d->animation; } -void QDeclarativeBehavior::setAnimation(QDeclarativeAbstractAnimation *animation) +void QQuickBehavior::setAnimation(QQuickAbstractAnimation *animation) { - Q_D(QDeclarativeBehavior); + Q_D(QQuickBehavior); if (d->animation) { qmlInfo(this) << tr("Cannot change the animation assigned to a Behavior."); return; @@ -140,7 +140,7 @@ void QDeclarativeBehavior::setAnimation(QDeclarativeAbstractAnimation *animation } -void QDeclarativeBehaviorPrivate::animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState,QAbstractAnimationJob::State) +void QQuickBehaviorPrivate::animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState,QAbstractAnimationJob::State) { if (!blockRunningChanged) animation->notifyRunningChanged(newState == QAbstractAnimationJob::Running); @@ -155,29 +155,29 @@ void QDeclarativeBehaviorPrivate::animationStateChanged(QAbstractAnimationJob *, By default a Behavior is enabled. */ -bool QDeclarativeBehavior::enabled() const +bool QQuickBehavior::enabled() const { - Q_D(const QDeclarativeBehavior); + Q_D(const QQuickBehavior); return d->enabled; } -void QDeclarativeBehavior::setEnabled(bool enabled) +void QQuickBehavior::setEnabled(bool enabled) { - Q_D(QDeclarativeBehavior); + Q_D(QQuickBehavior); if (d->enabled == enabled) return; d->enabled = enabled; emit enabledChanged(); } -void QDeclarativeBehavior::write(const QVariant &value) +void QQuickBehavior::write(const QVariant &value) { - Q_D(QDeclarativeBehavior); + Q_D(QQuickBehavior); bool bypass = !d->enabled || !d->finalized; if (!bypass) qmlExecuteDeferred(this); if (!d->animation || bypass) { - QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(d->property, value, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); d->targetValue = value; return; } @@ -194,16 +194,16 @@ void QDeclarativeBehavior::write(const QVariant &value) d->animationInstance->stop(); } - QDeclarativeStateOperation::ActionList actions; - QDeclarativeAction action; + QQuickStateOperation::ActionList actions; + QQuickAction action; action.property = d->property; action.fromValue = currentValue; action.toValue = value; actions << action; - QList<QDeclarativeProperty> after; + QList<QQmlProperty> after; QAbstractAnimationJob *prev = d->animationInstance; - d->animationInstance = d->animation->transition(actions, after, QDeclarativeAbstractAnimation::Forward); + d->animationInstance = d->animation->transition(actions, after, QQuickAbstractAnimation::Forward); if (d->animationInstance != prev) { d->animationInstance->addAnimationChangeListener(d, QAbstractAnimationJob::StateChange); if (prev) @@ -212,26 +212,26 @@ void QDeclarativeBehavior::write(const QVariant &value) d->animationInstance->start(); d->blockRunningChanged = false; if (!after.contains(d->property)) - QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(d->property, value, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } -void QDeclarativeBehavior::setTarget(const QDeclarativeProperty &property) +void QQuickBehavior::setTarget(const QQmlProperty &property) { - Q_D(QDeclarativeBehavior); + Q_D(QQuickBehavior); d->property = property; if (d->animation) d->animation->setDefaultTarget(property); - QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this)); + QQmlEnginePrivate *engPriv = QQmlEnginePrivate::get(qmlEngine(this)); static int finalizedIdx = -1; if (finalizedIdx < 0) finalizedIdx = metaObject()->indexOfSlot("componentFinalized()"); engPriv->registerFinalizeCallback(this, finalizedIdx); } -void QDeclarativeBehavior::componentFinalized() +void QQuickBehavior::componentFinalized() { - Q_D(QDeclarativeBehavior); + Q_D(QQuickBehavior); d->finalized = true; } diff --git a/src/quick/util/qdeclarativebehavior_p.h b/src/quick/util/qquickbehavior_p.h index c95304dce7..1c258767d3 100644 --- a/src/quick/util/qdeclarativebehavior_p.h +++ b/src/quick/util/qquickbehavior_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,40 +39,40 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEBEHAVIOR_H -#define QDECLARATIVEBEHAVIOR_H +#ifndef QQUICKBEHAVIOR_H +#define QQUICKBEHAVIOR_H #include <private/qtquickglobal_p.h> -#include <private/qdeclarativepropertyvalueinterceptor_p.h> -#include <qdeclarative.h> +#include <private/qqmlpropertyvalueinterceptor_p.h> +#include <qqml.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeAbstractAnimation; -class QDeclarativeBehaviorPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeBehavior : public QObject, public QDeclarativePropertyValueInterceptor +class QQuickAbstractAnimation; +class QQuickBehaviorPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickBehavior : public QObject, public QQmlPropertyValueInterceptor { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeBehavior) + Q_DECLARE_PRIVATE(QQuickBehavior) - Q_INTERFACES(QDeclarativePropertyValueInterceptor) + Q_INTERFACES(QQmlPropertyValueInterceptor) Q_CLASSINFO("DefaultProperty", "animation") - Q_PROPERTY(QDeclarativeAbstractAnimation *animation READ animation WRITE setAnimation) + Q_PROPERTY(QQuickAbstractAnimation *animation READ animation WRITE setAnimation) Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) Q_CLASSINFO("DeferredPropertyNames", "animation") public: - QDeclarativeBehavior(QObject *parent=0); - ~QDeclarativeBehavior(); + QQuickBehavior(QObject *parent=0); + ~QQuickBehavior(); - virtual void setTarget(const QDeclarativeProperty &); + virtual void setTarget(const QQmlProperty &); virtual void write(const QVariant &value); - QDeclarativeAbstractAnimation *animation(); - void setAnimation(QDeclarativeAbstractAnimation *); + QQuickAbstractAnimation *animation(); + void setAnimation(QQuickAbstractAnimation *); bool enabled() const; void setEnabled(bool enabled); @@ -86,8 +86,8 @@ private Q_SLOTS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeBehavior) +QML_DECLARE_TYPE(QQuickBehavior) QT_END_HEADER -#endif // QDECLARATIVEBEHAVIOR_H +#endif // QQUICKBEHAVIOR_H diff --git a/src/quick/util/qdeclarativebind.cpp b/src/quick/util/qquickbind.cpp index 05d3b1e6b0..a3fba06359 100644 --- a/src/quick/util/qdeclarativebind.cpp +++ b/src/quick/util/qquickbind.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativebind_p.h" +#include "qquickbind_p.h" -#include <private/qdeclarativenullablevalue_p_p.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlnullablevalue_p_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlbinding_p.h> +#include <private/qqmlguard_p.h> -#include <qdeclarativeengine.h> -#include <qdeclarativecontext.h> -#include <qdeclarativeproperty.h> -#include <qdeclarativeinfo.h> +#include <qqmlengine.h> +#include <qqmlcontext.h> +#include <qqmlproperty.h> +#include <qqmlinfo.h> #include <QtCore/qfile.h> #include <QtCore/qdebug.h> @@ -58,24 +58,24 @@ QT_BEGIN_NAMESPACE -class QDeclarativeBindPrivate : public QObjectPrivate +class QQuickBindPrivate : public QObjectPrivate { public: - QDeclarativeBindPrivate() : componentComplete(true), obj(0), prevBind(0) {} - ~QDeclarativeBindPrivate() { if (prevBind) prevBind->destroy(); } + QQuickBindPrivate() : componentComplete(true), obj(0), prevBind(0) {} + ~QQuickBindPrivate() { if (prevBind) prevBind->destroy(); } - QDeclarativeNullableValue<bool> when; + QQmlNullableValue<bool> when; bool componentComplete; - QDeclarativeGuard<QObject> obj; + QQmlGuard<QObject> obj; QString propName; - QDeclarativeNullableValue<QVariant> value; - QDeclarativeProperty prop; - QDeclarativeAbstractBinding *prevBind; + QQmlNullableValue<QVariant> value; + QQmlProperty prop; + QQmlAbstractBinding *prevBind; }; /*! - \qmlclass Binding QDeclarativeBind + \qmlclass Binding QQuickBind \inqmlmodule QtQuick 2 \ingroup qml-working-with-data \brief The Binding element allows arbitrary property bindings to be created. @@ -138,14 +138,14 @@ public: If the binding target or binding property is changed, the bound value is immediately pushed onto the new target. - \sa QtDeclarative + \sa QtQml */ -QDeclarativeBind::QDeclarativeBind(QObject *parent) - : QObject(*(new QDeclarativeBindPrivate), parent) +QQuickBind::QQuickBind(QObject *parent) + : QObject(*(new QQuickBindPrivate), parent) { } -QDeclarativeBind::~QDeclarativeBind() +QQuickBind::~QQuickBind() { } @@ -165,15 +165,15 @@ QDeclarativeBind::~QDeclarativeBind() When the binding becomes inactive again, any direct bindings that were previously set on the property will be restored. */ -bool QDeclarativeBind::when() const +bool QQuickBind::when() const { - Q_D(const QDeclarativeBind); + Q_D(const QQuickBind); return d->when; } -void QDeclarativeBind::setWhen(bool v) +void QQuickBind::setWhen(bool v) { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); if (!d->when.isNull && d->when == v) return; @@ -186,15 +186,15 @@ void QDeclarativeBind::setWhen(bool v) The object to be updated. */ -QObject *QDeclarativeBind::object() +QObject *QQuickBind::object() { - Q_D(const QDeclarativeBind); + Q_D(const QQuickBind); return d->obj; } -void QDeclarativeBind::setObject(QObject *obj) +void QQuickBind::setObject(QObject *obj) { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); if (d->obj && d->when.isValid() && d->when) { /* if we switch the object at runtime, we need to restore the previous binding on the old object before continuing */ @@ -204,7 +204,7 @@ void QDeclarativeBind::setObject(QObject *obj) } d->obj = obj; if (d->componentComplete) - d->prop = QDeclarativeProperty(d->obj, d->propName); + d->prop = QQmlProperty(d->obj, d->propName); eval(); } @@ -213,15 +213,15 @@ void QDeclarativeBind::setObject(QObject *obj) The property to be updated. */ -QString QDeclarativeBind::property() const +QString QQuickBind::property() const { - Q_D(const QDeclarativeBind); + Q_D(const QQuickBind); return d->propName; } -void QDeclarativeBind::setProperty(const QString &p) +void QQuickBind::setProperty(const QString &p) { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); if (!d->propName.isEmpty() && d->when.isValid() && d->when) { /* if we switch the property name at runtime, we need to restore the previous binding on the old object before continuing */ @@ -231,7 +231,7 @@ void QDeclarativeBind::setProperty(const QString &p) } d->propName = p; if (d->componentComplete) - d->prop = QDeclarativeProperty(d->obj, d->propName); + d->prop = QQmlProperty(d->obj, d->propName); eval(); } @@ -241,43 +241,43 @@ void QDeclarativeBind::setProperty(const QString &p) The value to be set on the target object and property. This can be a constant (which isn't very useful), or a bound expression. */ -QVariant QDeclarativeBind::value() const +QVariant QQuickBind::value() const { - Q_D(const QDeclarativeBind); + Q_D(const QQuickBind); return d->value.value; } -void QDeclarativeBind::setValue(const QVariant &v) +void QQuickBind::setValue(const QVariant &v) { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); d->value = v; eval(); } -void QDeclarativeBind::setTarget(const QDeclarativeProperty &p) +void QQuickBind::setTarget(const QQmlProperty &p) { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); d->prop = p; } -void QDeclarativeBind::classBegin() +void QQuickBind::classBegin() { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); d->componentComplete = false; } -void QDeclarativeBind::componentComplete() +void QQuickBind::componentComplete() { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); d->componentComplete = true; if (!d->prop.isValid()) - d->prop = QDeclarativeProperty(d->obj, d->propName); + d->prop = QQmlProperty(d->obj, d->propName); eval(); } -void QDeclarativeBind::eval() +void QQuickBind::eval() { - Q_D(QDeclarativeBind); + Q_D(QQuickBind); if (!d->prop.isValid() || d->value.isNull || !d->componentComplete) return; @@ -285,9 +285,9 @@ void QDeclarativeBind::eval() if (!d->when) { //restore any previous binding if (d->prevBind) { - QDeclarativeAbstractBinding *tmp = d->prevBind; + QQmlAbstractBinding *tmp = d->prevBind; d->prevBind = 0; - tmp = QDeclarativePropertyPrivate::setBinding(d->prop, tmp); + tmp = QQmlPropertyPrivate::setBinding(d->prop, tmp); if (tmp) //should this ever be true? tmp->destroy(); } @@ -295,8 +295,8 @@ void QDeclarativeBind::eval() } //save any set binding for restoration - QDeclarativeAbstractBinding *tmp; - tmp = QDeclarativePropertyPrivate::setBinding(d->prop, 0); + QQmlAbstractBinding *tmp; + tmp = QQmlPropertyPrivate::setBinding(d->prop, 0); if (tmp && d->prevBind) d->prevBind->destroy(); else if (!d->prevBind) diff --git a/src/quick/util/qdeclarativebind_p.h b/src/quick/util/qquickbind_p.h index a06ca222d1..5236fac171 100644 --- a/src/quick/util/qdeclarativebind_p.h +++ b/src/quick/util/qquickbind_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEBIND_H -#define QDECLARATIVEBIND_H +#ifndef QQUICKBIND_H +#define QQUICKBIND_H -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/qobject.h> @@ -50,21 +50,21 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeBindPrivate; -class Q_AUTOTEST_EXPORT QDeclarativeBind : public QObject, public QDeclarativePropertyValueSource, public QDeclarativeParserStatus +class QQuickBindPrivate; +class Q_AUTOTEST_EXPORT QQuickBind : public QObject, public QQmlPropertyValueSource, public QQmlParserStatus { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeBind) - Q_INTERFACES(QDeclarativeParserStatus) - Q_INTERFACES(QDeclarativePropertyValueSource) + Q_DECLARE_PRIVATE(QQuickBind) + Q_INTERFACES(QQmlParserStatus) + Q_INTERFACES(QQmlPropertyValueSource) Q_PROPERTY(QObject *target READ object WRITE setObject) Q_PROPERTY(QString property READ property WRITE setProperty) Q_PROPERTY(QVariant value READ value WRITE setValue) Q_PROPERTY(bool when READ when WRITE setWhen) public: - QDeclarativeBind(QObject *parent=0); - ~QDeclarativeBind(); + QQuickBind(QObject *parent=0); + ~QQuickBind(); bool when() const; void setWhen(bool); @@ -79,7 +79,7 @@ public: void setValue(const QVariant &); protected: - virtual void setTarget(const QDeclarativeProperty &); + virtual void setTarget(const QQmlProperty &); virtual void classBegin(); virtual void componentComplete(); @@ -89,7 +89,7 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeBind) +QML_DECLARE_TYPE(QQuickBind) QT_END_HEADER diff --git a/src/quick/util/qdeclarativechangeset.cpp b/src/quick/util/qquickchangeset.cpp index 74328a603e..b6b5adb60c 100644 --- a/src/quick/util/qdeclarativechangeset.cpp +++ b/src/quick/util/qquickchangeset.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativechangeset_p.h" +#include "qquickchangeset_p.h" QT_BEGIN_NAMESPACE -QDeclarativeChangeSet::QDeclarativeChangeSet() +QQuickChangeSet::QQuickChangeSet() : m_moveCounter(0) , m_difference(0) { } -QDeclarativeChangeSet::QDeclarativeChangeSet(const QDeclarativeChangeSet &changeSet) +QQuickChangeSet::QQuickChangeSet(const QQuickChangeSet &changeSet) : m_removes(changeSet.m_removes) , m_inserts(changeSet.m_inserts) , m_changes(changeSet.m_changes) @@ -58,11 +58,11 @@ QDeclarativeChangeSet::QDeclarativeChangeSet(const QDeclarativeChangeSet &change { } -QDeclarativeChangeSet::~QDeclarativeChangeSet() +QQuickChangeSet::~QQuickChangeSet() { } -QDeclarativeChangeSet &QDeclarativeChangeSet::operator =(const QDeclarativeChangeSet &changeSet) +QQuickChangeSet &QQuickChangeSet::operator =(const QQuickChangeSet &changeSet) { m_removes = changeSet.m_removes; m_inserts = changeSet.m_inserts; @@ -72,52 +72,52 @@ QDeclarativeChangeSet &QDeclarativeChangeSet::operator =(const QDeclarativeChang return *this; } -void QDeclarativeChangeSet::insert(int index, int count) +void QQuickChangeSet::insert(int index, int count) { applyInsertions(QVector<Insert>() << Insert(index, count)); } -void QDeclarativeChangeSet::remove(int index, int count) +void QQuickChangeSet::remove(int index, int count) { QVector<Insert> i; applyRemovals(QVector<Remove>() << Remove(index, count), i); } -void QDeclarativeChangeSet::move(int from, int to, int count) +void QQuickChangeSet::move(int from, int to, int count) { apply(QVector<Remove>() << Remove(from, count, -2), QVector<Insert>() << Insert(to, count, -2)); } -void QDeclarativeChangeSet::change(int index, int count) +void QQuickChangeSet::change(int index, int count) { applyChanges(QVector<Change>() << Change(index, count)); } -void QDeclarativeChangeSet::apply(const QDeclarativeChangeSet &changeSet) +void QQuickChangeSet::apply(const QQuickChangeSet &changeSet) { apply(changeSet.m_removes, changeSet.m_inserts, changeSet.m_changes); } -void QDeclarativeChangeSet::apply(const QVector<Remove> &removals) +void QQuickChangeSet::apply(const QVector<Remove> &removals) { QVector<Remove> r = removals; QVector<Insert> i; applyRemovals(r, i); } -void QDeclarativeChangeSet::apply(const QVector<Insert> &insertions) +void QQuickChangeSet::apply(const QVector<Insert> &insertions) { QVector<Insert> i = insertions; applyInsertions(i); } -void QDeclarativeChangeSet::apply(const QVector<Change> &changes) +void QQuickChangeSet::apply(const QVector<Change> &changes) { QVector<Change> c = changes; applyChanges(c); } -void QDeclarativeChangeSet::apply(const QVector<Remove> &removals, const QVector<Insert> &insertions, const QVector<Change> &changes) +void QQuickChangeSet::apply(const QVector<Remove> &removals, const QVector<Insert> &insertions, const QVector<Change> &changes) { QVector<Remove> r = removals; QVector<Insert> i = insertions; @@ -127,7 +127,7 @@ void QDeclarativeChangeSet::apply(const QVector<Remove> &removals, const QVector applyChanges(c); } -void QDeclarativeChangeSet::applyRemovals(QVector<Remove> &removals, QVector<Insert> &insertions) +void QQuickChangeSet::applyRemovals(QVector<Remove> &removals, QVector<Insert> &insertions) { int removeCount = 0; int insertCount = 0; @@ -336,7 +336,7 @@ void QDeclarativeChangeSet::applyRemovals(QVector<Remove> &removals, QVector<Ins m_difference -= removeCount; } -void QDeclarativeChangeSet::applyInsertions(QVector<Insert> &insertions) +void QQuickChangeSet::applyInsertions(QVector<Insert> &insertions) { int insertCount = 0; QVector<Insert>::iterator insert = m_inserts.begin(); @@ -403,7 +403,7 @@ void QDeclarativeChangeSet::applyInsertions(QVector<Insert> &insertions) m_difference += insertCount; } -void QDeclarativeChangeSet::applyChanges(QVector<Change> &changes) +void QQuickChangeSet::applyChanges(QVector<Change> &changes) { QVector<Insert>::iterator insert = m_inserts.begin(); QVector<Change>::iterator change = m_changes.begin(); @@ -451,26 +451,26 @@ void QDeclarativeChangeSet::applyChanges(QVector<Change> &changes) } } -QDebug operator <<(QDebug debug, const QDeclarativeChangeSet &set) +QDebug operator <<(QDebug debug, const QQuickChangeSet &set) { - debug.nospace() << "QDeclarativeChangeSet("; - foreach (const QDeclarativeChangeSet::Remove &remove, set.removes()) debug << remove; - foreach (const QDeclarativeChangeSet::Insert &insert, set.inserts()) debug << insert; - foreach (const QDeclarativeChangeSet::Change &change, set.changes()) debug << change; + debug.nospace() << "QQuickChangeSet("; + foreach (const QQuickChangeSet::Remove &remove, set.removes()) debug << remove; + foreach (const QQuickChangeSet::Insert &insert, set.inserts()) debug << insert; + foreach (const QQuickChangeSet::Change &change, set.changes()) debug << change; return debug.nospace() << ")"; } -QDebug operator <<(QDebug debug, const QDeclarativeChangeSet::Remove &remove) +QDebug operator <<(QDebug debug, const QQuickChangeSet::Remove &remove) { return (debug.nospace() << "Remove(" << remove.index << "," << remove.count << "," << remove.moveId << ")").space(); } -QDebug operator <<(QDebug debug, const QDeclarativeChangeSet::Insert &insert) +QDebug operator <<(QDebug debug, const QQuickChangeSet::Insert &insert) { return (debug.nospace() << "Insert(" << insert.index << "," << insert.count << "," << insert.moveId << ")").space(); } -QDebug operator <<(QDebug debug, const QDeclarativeChangeSet::Change &change) +QDebug operator <<(QDebug debug, const QQuickChangeSet::Change &change) { return (debug.nospace() << "Change(" << change.index << "," << change.count << ")").space(); } diff --git a/src/quick/util/qdeclarativechangeset_p.h b/src/quick/util/qquickchangeset_p.h index 6e26337149..64179666c7 100644 --- a/src/quick/util/qdeclarativechangeset_p.h +++ b/src/quick/util/qquickchangeset_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECHANGESET_P_H -#define QDECLARATIVECHANGESET_P_H +#ifndef QQUICKCHANGESET_P_H +#define QQUICKCHANGESET_P_H // // W A R N I N G @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE -class Q_AUTOTEST_EXPORT QDeclarativeChangeSet +class Q_AUTOTEST_EXPORT QQuickChangeSet { public: struct MoveKey @@ -102,11 +102,11 @@ public: Remove(int index, int count, int moveId) : Change(index, count, moveId) {} }; - QDeclarativeChangeSet(); - QDeclarativeChangeSet(const QDeclarativeChangeSet &changeSet); - ~QDeclarativeChangeSet(); + QQuickChangeSet(); + QQuickChangeSet(const QQuickChangeSet &changeSet); + ~QQuickChangeSet(); - QDeclarativeChangeSet &operator =(const QDeclarativeChangeSet &changeSet); + QQuickChangeSet &operator =(const QQuickChangeSet &changeSet); const QVector<Remove> &removes() const { return m_removes; } const QVector<Insert> &inserts() const { return m_inserts; } @@ -117,7 +117,7 @@ public: void move(int from, int to, int count); void change(int index, int count); - void apply(const QDeclarativeChangeSet &changeSet); + void apply(const QQuickChangeSet &changeSet); void apply(const QVector<Remove> &removals); void apply(const QVector<Insert> &insertions); void apply(const QVector<Change> &changes); @@ -152,14 +152,14 @@ private: int m_difference; }; -inline uint qHash(const QDeclarativeChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); } -inline bool operator ==(const QDeclarativeChangeSet::MoveKey &l, const QDeclarativeChangeSet::MoveKey &r) { +inline uint qHash(const QQuickChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); } +inline bool operator ==(const QQuickChangeSet::MoveKey &l, const QQuickChangeSet::MoveKey &r) { return l.moveId == r.moveId && l.offset == r.offset; } -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeChangeSet &change); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeChangeSet::Remove &remove); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeChangeSet::Insert &insert); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeChangeSet::Change &change); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickChangeSet &change); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickChangeSet::Remove &remove); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickChangeSet::Insert &insert); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickChangeSet::Change &change); QT_END_NAMESPACE diff --git a/src/quick/util/qdeclarativeconnections.cpp b/src/quick/util/qquickconnections.cpp index c98c87abfa..6e176fde3d 100644 --- a/src/quick/util/qdeclarativeconnections.cpp +++ b/src/quick/util/qquickconnections.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#include "qdeclarativeconnections_p.h" +#include "qquickconnections_p.h" -#include <private/qdeclarativeexpression_p.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativeboundsignal_p.h> -#include <qdeclarativecontext.h> -#include <private/qdeclarativecontext_p.h> -#include <qdeclarativeinfo.h> +#include <private/qqmlexpression_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlboundsignal_p.h> +#include <qqmlcontext.h> +#include <private/qqmlcontext_p.h> +#include <qqmlinfo.h> #include <QtCore/qdebug.h> #include <QtCore/qstringlist.h> @@ -55,12 +55,12 @@ QT_BEGIN_NAMESPACE -class QDeclarativeConnectionsPrivate : public QObjectPrivate +class QQuickConnectionsPrivate : public QObjectPrivate { public: - QDeclarativeConnectionsPrivate() : target(0), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {} + QQuickConnectionsPrivate() : target(0), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {} - QList<QDeclarativeBoundSignal*> boundsignals; + QList<QQmlBoundSignal*> boundsignals; QObject *target; bool targetSet; @@ -71,7 +71,7 @@ public: }; /*! - \qmlclass Connections QDeclarativeConnections + \qmlclass Connections QQuickConnections \inqmlmodule QtQuick 2 \ingroup qml-utility-elements \brief A Connections element describes generalized connections to signals. @@ -125,14 +125,14 @@ public: } \endqml - \sa QtDeclarative + \sa QtQml */ -QDeclarativeConnections::QDeclarativeConnections(QObject *parent) : - QObject(*(new QDeclarativeConnectionsPrivate), parent) +QQuickConnections::QQuickConnections(QObject *parent) : + QObject(*(new QQuickConnectionsPrivate), parent) { } -QDeclarativeConnections::~QDeclarativeConnections() +QQuickConnections::~QQuickConnections() { } @@ -145,19 +145,19 @@ QDeclarativeConnections::~QDeclarativeConnections() If set to null, no connection is made and any signal handlers are ignored until the target is not null. */ -QObject *QDeclarativeConnections::target() const +QObject *QQuickConnections::target() const { - Q_D(const QDeclarativeConnections); + Q_D(const QQuickConnections); return d->targetSet ? d->target : parent(); } -void QDeclarativeConnections::setTarget(QObject *obj) +void QQuickConnections::setTarget(QObject *obj) { - Q_D(QDeclarativeConnections); + Q_D(QQuickConnections); d->targetSet = true; // even if setting to 0, it is *set* if (d->target == obj) return; - foreach (QDeclarativeBoundSignal *s, d->boundsignals) { + foreach (QQmlBoundSignal *s, d->boundsignals) { // It is possible that target is being changed due to one of our signal // handlers -> use deleteLater(). if (s->isEvaluating()) @@ -180,22 +180,22 @@ void QDeclarativeConnections::setTarget(QObject *obj) This is useful if you intend to connect to different types of objects, handling a different set of signals for each object. */ -bool QDeclarativeConnections::ignoreUnknownSignals() const +bool QQuickConnections::ignoreUnknownSignals() const { - Q_D(const QDeclarativeConnections); + Q_D(const QQuickConnections); return d->ignoreUnknownSignals; } -void QDeclarativeConnections::setIgnoreUnknownSignals(bool ignore) +void QQuickConnections::setIgnoreUnknownSignals(bool ignore) { - Q_D(QDeclarativeConnections); + Q_D(QQuickConnections); d->ignoreUnknownSignals = ignore; } QByteArray -QDeclarativeConnectionsParser::compile(const QList<QDeclarativeCustomParserProperty> &props) +QQmlConnectionsParser::compile(const QList<QQmlCustomParserProperty> &props) { QByteArray rv; QDataStream ds(&rv, QIODevice::WriteOnly); @@ -207,7 +207,7 @@ QDeclarativeConnectionsParser::compile(const QList<QDeclarativeCustomParserPrope int propColumn = props.at(ii).location().column; if (!propName.startsWith(QLatin1String("on")) || !propName.at(2).isUpper()) { - error(props.at(ii), QDeclarativeConnections::tr("Cannot assign to non-existent property \"%1\"").arg(propName)); + error(props.at(ii), QQuickConnections::tr("Cannot assign to non-existent property \"%1\"").arg(propName)); return QByteArray(); } @@ -216,21 +216,21 @@ QDeclarativeConnectionsParser::compile(const QList<QDeclarativeCustomParserPrope for (int i = 0; i < values.count(); ++i) { const QVariant &value = values.at(i); - if (value.userType() == qMetaTypeId<QDeclarativeCustomParserNode>()) { - error(props.at(ii), QDeclarativeConnections::tr("Connections: nested objects not allowed")); + if (value.userType() == qMetaTypeId<QQmlCustomParserNode>()) { + error(props.at(ii), QQuickConnections::tr("Connections: nested objects not allowed")); return QByteArray(); - } else if (value.userType() == qMetaTypeId<QDeclarativeCustomParserProperty>()) { - error(props.at(ii), QDeclarativeConnections::tr("Connections: syntax error")); + } else if (value.userType() == qMetaTypeId<QQmlCustomParserProperty>()) { + error(props.at(ii), QQuickConnections::tr("Connections: syntax error")); return QByteArray(); } else { - QDeclarativeScript::Variant v = qvariant_cast<QDeclarativeScript::Variant>(value); + QQmlScript::Variant v = qvariant_cast<QQmlScript::Variant>(value); if (v.isScript()) { ds << propName; ds << rewriteSignalHandler(v, propName); ds << propLine; ds << propColumn; } else { - error(props.at(ii), QDeclarativeConnections::tr("Connections: script expected")); + error(props.at(ii), QQuickConnections::tr("Connections: script expected")); return QByteArray(); } } @@ -240,18 +240,18 @@ QDeclarativeConnectionsParser::compile(const QList<QDeclarativeCustomParserPrope return rv; } -void QDeclarativeConnectionsParser::setCustomData(QObject *object, +void QQmlConnectionsParser::setCustomData(QObject *object, const QByteArray &data) { - QDeclarativeConnectionsPrivate *p = - static_cast<QDeclarativeConnectionsPrivate *>(QObjectPrivate::get(object)); + QQuickConnectionsPrivate *p = + static_cast<QQuickConnectionsPrivate *>(QObjectPrivate::get(object)); p->data = data; } -void QDeclarativeConnections::connectSignals() +void QQuickConnections::connectSignals() { - Q_D(QDeclarativeConnections); + Q_D(QQuickConnections); if (!d->componentcomplete || (d->targetSet && !target())) return; @@ -266,22 +266,22 @@ void QDeclarativeConnections::connectSignals() int column; ds >> column; - QDeclarativeProperty prop(target(), propName); - if (prop.isValid() && (prop.type() & QDeclarativeProperty::SignalProperty)) { - QDeclarativeBoundSignal *signal = - new QDeclarativeBoundSignal(target(), prop.method(), this); + QQmlProperty prop(target(), propName); + if (prop.isValid() && (prop.type() & QQmlProperty::SignalProperty)) { + QQmlBoundSignal *signal = + new QQmlBoundSignal(target(), prop.method(), this); QString location; - QDeclarativeContextData *ctxtdata = 0; - QDeclarativeData *ddata = QDeclarativeData::get(this); + QQmlContextData *ctxtdata = 0; + QQmlData *ddata = QQmlData::get(this); if (ddata) { ctxtdata = ddata->outerContext; if (ctxtdata && !ctxtdata->url.isEmpty()) location = ddata->outerContext->urlString; } - QDeclarativeExpression *expression = ctxtdata ? - QDeclarativeExpressionPrivate::create(ctxtdata, 0, script, true, location, line, column) : 0; + QQmlExpression *expression = ctxtdata ? + QQmlExpressionPrivate::create(ctxtdata, 0, script, true, location, line, column) : 0; signal->setExpression(expression); d->boundsignals += signal; } else { @@ -291,15 +291,15 @@ void QDeclarativeConnections::connectSignals() } } -void QDeclarativeConnections::classBegin() +void QQuickConnections::classBegin() { - Q_D(QDeclarativeConnections); + Q_D(QQuickConnections); d->componentcomplete=false; } -void QDeclarativeConnections::componentComplete() +void QQuickConnections::componentComplete() { - Q_D(QDeclarativeConnections); + Q_D(QQuickConnections); d->componentcomplete=true; connectSignals(); } diff --git a/src/quick/util/qdeclarativeconnections_p.h b/src/quick/util/qquickconnections_p.h index fcfbcaf5d2..8184697e88 100644 --- a/src/quick/util/qdeclarativeconnections_p.h +++ b/src/quick/util/qquickconnections_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVECONNECTIONS_H -#define QDECLARATIVECONNECTIONS_H +#ifndef QQUICKCONNECTIONS_H +#define QQUICKCONNECTIONS_H -#include <qdeclarative.h> -#include <private/qdeclarativecustomparser_p.h> +#include <qqml.h> +#include <private/qqmlcustomparser_p.h> #include <QtCore/qobject.h> #include <QtCore/qstring.h> @@ -52,21 +52,21 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeBoundSignal; -class QDeclarativeContext; -class QDeclarativeConnectionsPrivate; -class Q_AUTOTEST_EXPORT QDeclarativeConnections : public QObject, public QDeclarativeParserStatus +class QQmlBoundSignal; +class QQmlContext; +class QQuickConnectionsPrivate; +class Q_AUTOTEST_EXPORT QQuickConnections : public QObject, public QQmlParserStatus { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeConnections) + Q_DECLARE_PRIVATE(QQuickConnections) - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals) public: - QDeclarativeConnections(QObject *parent=0); - ~QDeclarativeConnections(); + QQuickConnections(QObject *parent=0); + ~QQuickConnections(); QObject *target() const; void setTarget(QObject *); @@ -83,17 +83,17 @@ private: void componentComplete(); }; -class QDeclarativeConnectionsParser : public QDeclarativeCustomParser +class QQmlConnectionsParser : public QQmlCustomParser { public: - virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &); + virtual QByteArray compile(const QList<QQmlCustomParserProperty> &); virtual void setCustomData(QObject *, const QByteArray &); }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeConnections) +QML_DECLARE_TYPE(QQuickConnections) QT_END_HEADER diff --git a/src/quick/util/qdeclarativefontloader.cpp b/src/quick/util/qquickfontloader.cpp index 441ecf60dd..438d00bd1b 100644 --- a/src/quick/util/qdeclarativefontloader.cpp +++ b/src/quick/util/qquickfontloader.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include "qdeclarativefontloader_p.h" +#include "qquickfontloader_p.h" -#include <qdeclarativecontext.h> -#include <qdeclarativeengine.h> +#include <qqmlcontext.h> +#include <qqmlengine.h> #include <QStringList> #include <QUrl> @@ -52,24 +52,24 @@ #include <QFontDatabase> #include <private/qobject_p.h> -#include <private/qdeclarativeengine_p.h> -#include <qdeclarativeinfo.h> +#include <private/qqmlengine_p.h> +#include <qqmlinfo.h> QT_BEGIN_NAMESPACE #define FONTLOADER_MAXIMUM_REDIRECT_RECURSION 16 -class QDeclarativeFontObject : public QObject +class QQuickFontObject : public QObject { Q_OBJECT public: - explicit QDeclarativeFontObject(int _id = -1); + explicit QQuickFontObject(int _id = -1); void download(const QUrl &url, QNetworkAccessManager *manager); Q_SIGNALS: - void fontDownloaded(const QString&, QDeclarativeFontLoader::Status); + void fontDownloaded(const QString&, QQuickFontLoader::Status); private Q_SLOTS: void replyFinished(); @@ -81,14 +81,14 @@ private: QNetworkReply *reply; int redirectCount; - Q_DISABLE_COPY(QDeclarativeFontObject) + Q_DISABLE_COPY(QQuickFontObject) }; -QDeclarativeFontObject::QDeclarativeFontObject(int _id) +QQuickFontObject::QQuickFontObject(int _id) : QObject(0), id(_id), reply(0), redirectCount(0) {} -void QDeclarativeFontObject::download(const QUrl &url, QNetworkAccessManager *manager) +void QQuickFontObject::download(const QUrl &url, QNetworkAccessManager *manager) { QNetworkRequest req(url); req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); @@ -96,7 +96,7 @@ void QDeclarativeFontObject::download(const QUrl &url, QNetworkAccessManager *ma QObject::connect(reply, SIGNAL(finished()), this, SLOT(replyFinished())); } -void QDeclarativeFontObject::replyFinished() +void QQuickFontObject::replyFinished() { if (reply) { redirectCount++; @@ -116,11 +116,11 @@ void QDeclarativeFontObject::replyFinished() if (!reply->error()) { id = QFontDatabase::addApplicationFontFromData(reply->readAll()); if (id != -1) - emit fontDownloaded(QFontDatabase::applicationFontFamilies(id).at(0), QDeclarativeFontLoader::Ready); + emit fontDownloaded(QFontDatabase::applicationFontFamilies(id).at(0), QQuickFontLoader::Ready); else - emit fontDownloaded(QString(), QDeclarativeFontLoader::Error); + emit fontDownloaded(QString(), QQuickFontLoader::Error); } else { - emit fontDownloaded(QString(), QDeclarativeFontLoader::Error); + emit fontDownloaded(QString(), QQuickFontLoader::Error); } reply->deleteLater(); reply = 0; @@ -128,23 +128,23 @@ void QDeclarativeFontObject::replyFinished() } -class QDeclarativeFontLoaderPrivate : public QObjectPrivate +class QQuickFontLoaderPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeFontLoader) + Q_DECLARE_PUBLIC(QQuickFontLoader) public: - QDeclarativeFontLoaderPrivate() : status(QDeclarativeFontLoader::Null) {} + QQuickFontLoaderPrivate() : status(QQuickFontLoader::Null) {} QUrl url; QString name; - QDeclarativeFontLoader::Status status; - static QHash<QUrl, QDeclarativeFontObject*> fonts; + QQuickFontLoader::Status status; + static QHash<QUrl, QQuickFontObject*> fonts; }; -QHash<QUrl, QDeclarativeFontObject*> QDeclarativeFontLoaderPrivate::fonts; +QHash<QUrl, QQuickFontObject*> QQuickFontLoaderPrivate::fonts; /*! - \qmlclass FontLoader QDeclarativeFontLoader + \qmlclass FontLoader QQuickFontLoader \inqmlmodule QtQuick 2 \ingroup qml-utility-elements \brief The FontLoader element allows fonts to be loaded by name or URL. @@ -169,12 +169,12 @@ QHash<QUrl, QDeclarativeFontObject*> QDeclarativeFontLoaderPrivate::fonts; \sa {declarative/text/fonts}{Fonts example} */ -QDeclarativeFontLoader::QDeclarativeFontLoader(QObject *parent) - : QObject(*(new QDeclarativeFontLoaderPrivate), parent) +QQuickFontLoader::QQuickFontLoader(QObject *parent) + : QObject(*(new QQuickFontLoaderPrivate), parent) { } -QDeclarativeFontLoader::~QDeclarativeFontLoader() +QQuickFontLoader::~QQuickFontLoader() { } @@ -182,27 +182,27 @@ QDeclarativeFontLoader::~QDeclarativeFontLoader() \qmlproperty url QtQuick2::FontLoader::source The url of the font to load. */ -QUrl QDeclarativeFontLoader::source() const +QUrl QQuickFontLoader::source() const { - Q_D(const QDeclarativeFontLoader); + Q_D(const QQuickFontLoader); return d->url; } -void QDeclarativeFontLoader::setSource(const QUrl &url) +void QQuickFontLoader::setSource(const QUrl &url) { - Q_D(QDeclarativeFontLoader); + Q_D(QQuickFontLoader); if (url == d->url) return; d->url = url; emit sourceChanged(); - QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url); + QString localFile = QQmlEnginePrivate::urlToLocalFileOrQrc(d->url); if (!localFile.isEmpty()) { if (!d->fonts.contains(d->url)) { int id = QFontDatabase::addApplicationFont(localFile); if (id != -1) { updateFontInfo(QFontDatabase::applicationFontFamilies(id).at(0), Ready); - QDeclarativeFontObject *fo = new QDeclarativeFontObject(id); + QQuickFontObject *fo = new QQuickFontObject(id); d->fonts[d->url] = fo; } else { updateFontInfo(QString(), Error); @@ -212,20 +212,20 @@ void QDeclarativeFontLoader::setSource(const QUrl &url) } } else { if (!d->fonts.contains(d->url)) { - QDeclarativeFontObject *fo = new QDeclarativeFontObject; + QQuickFontObject *fo = new QQuickFontObject; d->fonts[d->url] = fo; fo->download(d->url, qmlEngine(this)->networkAccessManager()); d->status = Loading; emit statusChanged(); - QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)), - this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status))); + QObject::connect(fo, SIGNAL(fontDownloaded(QString,QQuickFontLoader::Status)), + this, SLOT(updateFontInfo(QString,QQuickFontLoader::Status))); } else { - QDeclarativeFontObject *fo = d->fonts[d->url]; + QQuickFontObject *fo = d->fonts[d->url]; if (fo->id == -1) { d->status = Loading; emit statusChanged(); - QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)), - this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status))); + QObject::connect(fo, SIGNAL(fontDownloaded(QString,QQuickFontLoader::Status)), + this, SLOT(updateFontInfo(QString,QQuickFontLoader::Status))); } else updateFontInfo(QFontDatabase::applicationFontFamilies(fo->id).at(0), Ready); @@ -233,9 +233,9 @@ void QDeclarativeFontLoader::setSource(const QUrl &url) } } -void QDeclarativeFontLoader::updateFontInfo(const QString& name, QDeclarativeFontLoader::Status status) +void QQuickFontLoader::updateFontInfo(const QString& name, QQuickFontLoader::Status status) { - Q_D(QDeclarativeFontLoader); + Q_D(QQuickFontLoader); if (name != d->name) { d->name = name; @@ -273,15 +273,15 @@ void QDeclarativeFontLoader::updateFontInfo(const QString& name, QDeclarativeFon } \endqml */ -QString QDeclarativeFontLoader::name() const +QString QQuickFontLoader::name() const { - Q_D(const QDeclarativeFontLoader); + Q_D(const QQuickFontLoader); return d->name; } -void QDeclarativeFontLoader::setName(const QString &name) +void QQuickFontLoader::setName(const QString &name) { - Q_D(QDeclarativeFontLoader); + Q_D(QQuickFontLoader); if (d->name == name) return; d->name = name; @@ -324,12 +324,12 @@ void QDeclarativeFontLoader::setName(const QString &name) \endqml \endlist */ -QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const +QQuickFontLoader::Status QQuickFontLoader::status() const { - Q_D(const QDeclarativeFontLoader); + Q_D(const QQuickFontLoader); return d->status; } QT_END_NAMESPACE -#include <qdeclarativefontloader.moc> +#include <qquickfontloader.moc> diff --git a/src/quick/util/qdeclarativefontloader_p.h b/src/quick/util/qquickfontloader_p.h index 3cd75e1a46..191388df95 100644 --- a/src/quick/util/qdeclarativefontloader_p.h +++ b/src/quick/util/qquickfontloader_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEFONTLOADER_H -#define QDECLARATIVEFONTLOADER_H +#ifndef QQUICKFONTLOADER_H +#define QQUICKFONTLOADER_H -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/qobject.h> #include <QtCore/qurl.h> @@ -51,11 +51,11 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeFontLoaderPrivate; -class Q_AUTOTEST_EXPORT QDeclarativeFontLoader : public QObject +class QQuickFontLoaderPrivate; +class Q_AUTOTEST_EXPORT QQuickFontLoader : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeFontLoader) + Q_DECLARE_PRIVATE(QQuickFontLoader) Q_ENUMS(Status) Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) @@ -65,8 +65,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeFontLoader : public QObject public: enum Status { Null = 0, Ready, Loading, Error }; - QDeclarativeFontLoader(QObject *parent = 0); - ~QDeclarativeFontLoader(); + QQuickFontLoader(QObject *parent = 0); + ~QQuickFontLoader(); QUrl source() const; void setSource(const QUrl &url); @@ -77,7 +77,7 @@ public: Status status() const; private Q_SLOTS: - void updateFontInfo(const QString&, QDeclarativeFontLoader::Status); + void updateFontInfo(const QString&, QQuickFontLoader::Status); Q_SIGNALS: void sourceChanged(); @@ -87,9 +87,9 @@ Q_SIGNALS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeFontLoader) +QML_DECLARE_TYPE(QQuickFontLoader) QT_END_HEADER -#endif // QDECLARATIVEFONTLOADER_H +#endif // QQUICKFONTLOADER_H diff --git a/src/quick/util/qdeclarativelistaccessor.cpp b/src/quick/util/qquicklistaccessor.cpp index ae60640328..532882a2f9 100644 --- a/src/quick/util/qdeclarativelistaccessor.cpp +++ b/src/quick/util/qquicklistaccessor.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,37 +39,37 @@ ** ****************************************************************************/ -#include "qdeclarativelistaccessor_p.h" +#include "qquicklistaccessor_p.h" -#include <private/qdeclarativemetatype_p.h> +#include <private/qqmlmetatype_p.h> #include <QtCore/qstringlist.h> #include <QtCore/qdebug.h> // ### Remove me -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlengine_p.h> QT_BEGIN_NAMESPACE -QDeclarativeListAccessor::QDeclarativeListAccessor() +QQuickListAccessor::QQuickListAccessor() : m_type(Invalid) { } -QDeclarativeListAccessor::~QDeclarativeListAccessor() +QQuickListAccessor::~QQuickListAccessor() { } -QVariant QDeclarativeListAccessor::list() const +QVariant QQuickListAccessor::list() const { return d; } -void QDeclarativeListAccessor::setList(const QVariant &v, QDeclarativeEngine *engine) +void QQuickListAccessor::setList(const QVariant &v, QQmlEngine *engine) { d = v; - QDeclarativeEnginePrivate *enginePrivate = engine?QDeclarativeEnginePrivate::get(engine):0; + QQmlEnginePrivate *enginePrivate = engine?QQmlEnginePrivate::get(engine):0; if (!d.isValid()) { m_type = Invalid; @@ -79,19 +79,19 @@ void QDeclarativeListAccessor::setList(const QVariant &v, QDeclarativeEngine *en m_type = VariantList; } else if (d.canConvert(QVariant::Int)) { m_type = Integer; - } else if ((!enginePrivate && QDeclarativeMetaType::isQObject(d.userType())) || + } else if ((!enginePrivate && QQmlMetaType::isQObject(d.userType())) || (enginePrivate && enginePrivate->isQObject(d.userType()))) { - QObject *data = enginePrivate?enginePrivate->toQObject(v):QDeclarativeMetaType::toQObject(v); + QObject *data = enginePrivate?enginePrivate->toQObject(v):QQmlMetaType::toQObject(v); d = QVariant::fromValue(data); m_type = Instance; - } else if (d.userType() == qMetaTypeId<QDeclarativeListReference>()) { + } else if (d.userType() == qMetaTypeId<QQmlListReference>()) { m_type = ListProperty; } else { m_type = Instance; } } -int QDeclarativeListAccessor::count() const +int QQuickListAccessor::count() const { switch(m_type) { case StringList: @@ -99,7 +99,7 @@ int QDeclarativeListAccessor::count() const case VariantList: return qvariant_cast<QVariantList>(d).count(); case ListProperty: - return ((QDeclarativeListReference *)d.constData())->count(); + return ((QQmlListReference *)d.constData())->count(); case Instance: return 1; case Integer: @@ -110,7 +110,7 @@ int QDeclarativeListAccessor::count() const } } -QVariant QDeclarativeListAccessor::at(int idx) const +QVariant QQuickListAccessor::at(int idx) const { Q_ASSERT(idx >= 0 && idx < count()); switch(m_type) { @@ -119,7 +119,7 @@ QVariant QDeclarativeListAccessor::at(int idx) const case VariantList: return qvariant_cast<QVariantList>(d).at(idx); case ListProperty: - return QVariant::fromValue(((QDeclarativeListReference *)d.constData())->at(idx)); + return QVariant::fromValue(((QQmlListReference *)d.constData())->at(idx)); case Instance: return d; case Integer: @@ -130,7 +130,7 @@ QVariant QDeclarativeListAccessor::at(int idx) const } } -bool QDeclarativeListAccessor::isValid() const +bool QQuickListAccessor::isValid() const { return m_type != Invalid; } diff --git a/src/quick/util/qdeclarativelistaccessor_p.h b/src/quick/util/qquicklistaccessor_p.h index 6fc589dec4..2b54c686bf 100644 --- a/src/quick/util/qdeclarativelistaccessor_p.h +++ b/src/quick/util/qquicklistaccessor_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELISTACCESSOR_H -#define QDECLARATIVELISTACCESSOR_H +#ifndef QQUICKLISTACCESSOR_H +#define QQUICKLISTACCESSOR_H #include <QtCore/QVariant> @@ -48,15 +48,15 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class Q_AUTOTEST_EXPORT QDeclarativeListAccessor +class QQmlEngine; +class Q_AUTOTEST_EXPORT QQuickListAccessor { public: - QDeclarativeListAccessor(); - ~QDeclarativeListAccessor(); + QQuickListAccessor(); + ~QQuickListAccessor(); QVariant list() const; - void setList(const QVariant &, QDeclarativeEngine * = 0); + void setList(const QVariant &, QQmlEngine * = 0); bool isValid() const; @@ -75,4 +75,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVELISTACCESSOR_H +#endif // QQUICKLISTACCESSOR_H diff --git a/src/quick/util/qdeclarativelistcompositor.cpp b/src/quick/util/qquicklistcompositor.cpp index 6011d6bc5d..d60fe5fb79 100644 --- a/src/quick/util/qdeclarativelistcompositor.cpp +++ b/src/quick/util/qquicklistcompositor.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,27 +39,27 @@ ** ****************************************************************************/ -#include "qdeclarativelistcompositor_p.h" +#include "qquicklistcompositor_p.h" #include <QtCore/qvarlengtharray.h> -//#define QT_DECLARATIVE_VERIFY_MINIMAL -//#define QT_DECLARATIVE_VERIFY_INTEGRITY +//#define QT_QML_VERIFY_MINIMAL +//#define QT_QML_VERIFY_INTEGRITY QT_BEGIN_NAMESPACE -#ifdef QT_DECLARATIVE_VERIFY_MINIMAL -#define QT_DECLARATIVE_VERIFY_INTEGRITY +#ifdef QT_QML_VERIFY_MINIMAL +#define QT_QML_VERIFY_INTEGRITY static bool qt_verifyMinimal( - const QDeclarativeListCompositor::iterator &begin, - const QDeclarativeListCompositor::iterator &end) + const QQuickListCompositor::iterator &begin, + const QQuickListCompositor::iterator &end) { bool minimal = true; int index = 0; - for (const QDeclarativeListCompositor::Range *range = begin->next; range != *end; range = range->next, ++index) { + for (const QQuickListCompositor::Range *range = begin->next; range != *end; range = range->next, ++index) { if (range->previous->list == range->list - && range->previous->flags == (range->flags & ~QDeclarativeListCompositor::AppendFlag) + && range->previous->flags == (range->flags & ~QQuickListCompositor::AppendFlag) && range->previous->end() == range->index) { qWarning() << index << "Consecutive ranges"; qWarning() << *range->previous; @@ -73,22 +73,22 @@ static bool qt_verifyMinimal( #endif -#ifdef QT_DECLARATIVE_VERIFY_INTEGRITY -static bool qt_printInfo(const QDeclarativeListCompositor &compositor) +#ifdef QT_QML_VERIFY_INTEGRITY +static bool qt_printInfo(const QQuickListCompositor &compositor) { qWarning() << compositor; return true; } static bool qt_verifyIntegrity( - const QDeclarativeListCompositor::iterator &begin, - const QDeclarativeListCompositor::iterator &end, - const QDeclarativeListCompositor::iterator &cachedIt) + const QQuickListCompositor::iterator &begin, + const QQuickListCompositor::iterator &end, + const QQuickListCompositor::iterator &cachedIt) { bool valid = true; int index = 0; - QDeclarativeListCompositor::iterator it; + QQuickListCompositor::iterator it; for (it = begin; *it != *end; *it = it->next) { if (it->count == 0 && !it->append()) { qWarning() << index << "Empty non-append range"; @@ -98,7 +98,7 @@ static bool qt_verifyIntegrity( qWarning() << index << "Negative count"; valid = false; } - if (it->list && it->flags != QDeclarativeListCompositor::CacheFlag && it->index < 0) { + if (it->list && it->flags != QQuickListCompositor::CacheFlag && it->index < 0) { qWarning() << index <<"Negative index"; valid = false; } @@ -118,7 +118,7 @@ static bool qt_verifyIntegrity( if (groupIndex != cachedIt.index[i]) { qWarning() << index << "invalid cached index" - << QDeclarativeListCompositor::Group(i) + << QQuickListCompositor::Group(i) << "Expected:" << groupIndex << "Actual" @@ -142,21 +142,21 @@ static bool qt_verifyIntegrity( } #endif -#if defined(QT_DECLARATIVE_VERIFY_MINIMAL) -# define QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR Q_ASSERT(!(!(qt_verifyIntegrity(iterator(m_ranges.next, 0, Default, m_groupCount), m_end, m_cacheIt) \ +#if defined(QT_QML_VERIFY_MINIMAL) +# define QT_QML_VERIFY_LISTCOMPOSITOR Q_ASSERT(!(!(qt_verifyIntegrity(iterator(m_ranges.next, 0, Default, m_groupCount), m_end, m_cacheIt) \ && qt_verifyMinimal(iterator(m_ranges.next, 0, Default, m_groupCount), m_end)) \ && qt_printInfo(*this))); -#elif defined(QT_DECLARATIVE_VERIFY_INTEGRITY) -# define QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR Q_ASSERT(!(!qt_verifyIntegrity(iterator(m_ranges.next, 0, Default, m_groupCount), m_end, m_cacheIt) \ +#elif defined(QT_QML_VERIFY_INTEGRITY) +# define QT_QML_VERIFY_LISTCOMPOSITOR Q_ASSERT(!(!qt_verifyIntegrity(iterator(m_ranges.next, 0, Default, m_groupCount), m_end, m_cacheIt) \ && qt_printInfo(*this))); #else -# define QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR +# define QT_QML_VERIFY_LISTCOMPOSITOR #endif -//#define QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(args) qDebug() << m_end.index[1] << m_end.index[0] << Q_FUNC_INFO args; -#define QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(args) +//#define QT_QML_TRACE_LISTCOMPOSITOR(args) qDebug() << m_end.index[1] << m_end.index[0] << Q_FUNC_INFO args; +#define QT_QML_TRACE_LISTCOMPOSITOR(args) -QDeclarativeListCompositor::iterator &QDeclarativeListCompositor::iterator::operator +=(int difference) +QQuickListCompositor::iterator &QQuickListCompositor::iterator::operator +=(int difference) { Q_ASSERT(difference >= 0); while (!(range->flags & groupFlag)) { @@ -176,7 +176,7 @@ QDeclarativeListCompositor::iterator &QDeclarativeListCompositor::iterator::oper return *this; } -QDeclarativeListCompositor::iterator &QDeclarativeListCompositor::iterator::operator -=(int difference) +QQuickListCompositor::iterator &QQuickListCompositor::iterator::operator -=(int difference) { Q_ASSERT(difference >= 0); while (!(range->flags & groupFlag)) { @@ -196,7 +196,7 @@ QDeclarativeListCompositor::iterator &QDeclarativeListCompositor::iterator::oper return *this; } -QDeclarativeListCompositor::insert_iterator &QDeclarativeListCompositor::insert_iterator::operator +=(int difference) +QQuickListCompositor::insert_iterator &QQuickListCompositor::insert_iterator::operator +=(int difference) { Q_ASSERT(difference >= 0); while (!(range->flags & groupFlag)) { @@ -219,7 +219,7 @@ QDeclarativeListCompositor::insert_iterator &QDeclarativeListCompositor::insert_ return *this; } -QDeclarativeListCompositor::insert_iterator &QDeclarativeListCompositor::insert_iterator::operator -=(int difference) +QQuickListCompositor::insert_iterator &QQuickListCompositor::insert_iterator::operator -=(int difference) { Q_ASSERT(difference >= 0); while (!(range->flags & groupFlag) && range->previous->flags) { @@ -248,7 +248,7 @@ QDeclarativeListCompositor::insert_iterator &QDeclarativeListCompositor::insert_ return *this; } -QDeclarativeListCompositor::QDeclarativeListCompositor() +QQuickListCompositor::QQuickListCompositor() : m_end(m_ranges.next, 0, Default, 2) , m_cacheIt(m_end) , m_groupCount(2) @@ -257,7 +257,7 @@ QDeclarativeListCompositor::QDeclarativeListCompositor() { } -QDeclarativeListCompositor::~QDeclarativeListCompositor() +QQuickListCompositor::~QQuickListCompositor() { for (Range *next, *range = m_ranges.next; range != &m_ranges; range = next) { next = range->next; @@ -265,13 +265,13 @@ QDeclarativeListCompositor::~QDeclarativeListCompositor() } } -inline QDeclarativeListCompositor::Range *QDeclarativeListCompositor::insert( +inline QQuickListCompositor::Range *QQuickListCompositor::insert( Range *before, void *list, int index, int count, uint flags) { return new Range(before, list, index, count, flags); } -inline QDeclarativeListCompositor::Range *QDeclarativeListCompositor::erase( +inline QQuickListCompositor::Range *QQuickListCompositor::erase( Range *range) { Range *next = range->next; @@ -281,21 +281,21 @@ inline QDeclarativeListCompositor::Range *QDeclarativeListCompositor::erase( return next; } -void QDeclarativeListCompositor::setGroupCount(int count) +void QQuickListCompositor::setGroupCount(int count) { m_groupCount = count; m_end = iterator(&m_ranges, 0, Default, m_groupCount); m_cacheIt = m_end; } -int QDeclarativeListCompositor::count(Group group) const +int QQuickListCompositor::count(Group group) const { return m_end.index[group]; } -QDeclarativeListCompositor::iterator QDeclarativeListCompositor::find(Group group, int index) +QQuickListCompositor::iterator QQuickListCompositor::find(Group group, int index) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< group << index) + QT_QML_TRACE_LISTCOMPOSITOR(<< group << index) Q_ASSERT(index >=0 && index < count(group)); if (m_cacheIt == m_end) { m_cacheIt = iterator(m_ranges.next, 0, group, m_groupCount); @@ -314,18 +314,18 @@ QDeclarativeListCompositor::iterator QDeclarativeListCompositor::find(Group grou } Q_ASSERT(m_cacheIt.index[group] == index); Q_ASSERT(m_cacheIt->inGroup(group)); - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR return m_cacheIt; } -QDeclarativeListCompositor::iterator QDeclarativeListCompositor::find(Group group, int index) const +QQuickListCompositor::iterator QQuickListCompositor::find(Group group, int index) const { - return const_cast<QDeclarativeListCompositor *>(this)->find(group, index); + return const_cast<QQuickListCompositor *>(this)->find(group, index); } -QDeclarativeListCompositor::insert_iterator QDeclarativeListCompositor::findInsertPosition(Group group, int index) +QQuickListCompositor::insert_iterator QQuickListCompositor::findInsertPosition(Group group, int index) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< group << index) + QT_QML_TRACE_LISTCOMPOSITOR(<< group << index) Q_ASSERT(index >=0 && index <= count(group)); insert_iterator it; if (m_cacheIt == m_end) { @@ -348,32 +348,32 @@ QDeclarativeListCompositor::insert_iterator QDeclarativeListCompositor::findInse return it; } -QDeclarativeListCompositor::iterator QDeclarativeListCompositor::begin(Group group) +QQuickListCompositor::iterator QQuickListCompositor::begin(Group group) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< group) + QT_QML_TRACE_LISTCOMPOSITOR(<< group) m_cacheIt = iterator(m_ranges.next, 0, group, m_groupCount); m_cacheIt += 0; return m_cacheIt; } -void QDeclarativeListCompositor::append( +void QQuickListCompositor::append( void *list, int index, int count, uint flags, QVector<Insert> *inserts) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << index << count << flags) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count << flags) insert(m_end, list, index, count, flags, inserts); } -void QDeclarativeListCompositor::insert( +void QQuickListCompositor::insert( Group group, int before, void *list, int index, int count, uint flags, QVector<Insert> *inserts) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< group << before << list << index << count << flags) + QT_QML_TRACE_LISTCOMPOSITOR(<< group << before << list << index << count << flags) insert(findInsertPosition(group, before), list, index, count, flags, inserts); } -QDeclarativeListCompositor::iterator QDeclarativeListCompositor::insert( +QQuickListCompositor::iterator QQuickListCompositor::insert( iterator before, void *list, int index, int count, uint flags, QVector<Insert> *inserts) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< before << list << index << count << flags) + QT_QML_TRACE_LISTCOMPOSITOR(<< before << list << index << count << flags) if (inserts) { inserts->append(Insert(before, count, flags & GroupMask)); } @@ -407,21 +407,21 @@ QDeclarativeListCompositor::iterator QDeclarativeListCompositor::insert( m_end.incrementIndexes(count, flags); m_cacheIt = before; - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR return before; } -void QDeclarativeListCompositor::setFlags( +void QQuickListCompositor::setFlags( Group fromGroup, int from, int count, Group group, int flags, QVector<Insert> *inserts) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< group << index << count << flags) + QT_QML_TRACE_LISTCOMPOSITOR(<< group << index << count << flags) setFlags(find(fromGroup, from), count, group, flags, inserts); } -void QDeclarativeListCompositor::setFlags( +void QQuickListCompositor::setFlags( iterator from, int count, Group group, uint flags, QVector<Insert> *inserts) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< from << count << flags) + QT_QML_TRACE_LISTCOMPOSITOR(<< from << count << flags) if (!flags || !count) return; @@ -490,20 +490,20 @@ void QDeclarativeListCompositor::setFlags( *from = erase(*from)->previous; } m_cacheIt = from; - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR } -void QDeclarativeListCompositor::clearFlags( +void QQuickListCompositor::clearFlags( Group fromGroup, int from, int count, Group group, uint flags, QVector<Remove> *removes) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< group << index << count << flags) + QT_QML_TRACE_LISTCOMPOSITOR(<< group << index << count << flags) clearFlags(find(fromGroup, from), count, group, flags, removes); } -void QDeclarativeListCompositor::clearFlags( +void QQuickListCompositor::clearFlags( iterator from, int count, Group group, uint flags, QVector<Remove> *removes) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< from << count << flags) + QT_QML_TRACE_LISTCOMPOSITOR(<< from << count << flags) if (!flags || !count) return; @@ -577,12 +577,12 @@ void QDeclarativeListCompositor::clearFlags( *from = erase(*from)->previous; } m_cacheIt = from; - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR } -void QDeclarativeListCompositor::removeList(void *list, QVector<Remove> *removes, bool destroyed) +void QQuickListCompositor::removeList(void *list, QVector<Remove> *removes, bool destroyed) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << destroyed) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << destroyed) for (iterator it(m_ranges.next, 0, Default, m_groupCount); *it != &m_ranges; *it = it->next) { if (it->list == list) { const int flags = it->flags & (GroupMask | CacheFlag); @@ -603,10 +603,10 @@ void QDeclarativeListCompositor::removeList(void *list, QVector<Remove> *removes } } m_cacheIt = m_end; - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR } -bool QDeclarativeListCompositor::verifyMoveTo( +bool QQuickListCompositor::verifyMoveTo( Group fromGroup, int from, Group toGroup, int to, int count, Group group) const { if (group != toGroup) { @@ -631,7 +631,7 @@ bool QDeclarativeListCompositor::verifyMoveTo( return to >= 0 && to + count <= m_end.index[toGroup]; } -void QDeclarativeListCompositor::move( +void QQuickListCompositor::move( Group fromGroup, int from, Group toGroup, @@ -641,7 +641,7 @@ void QDeclarativeListCompositor::move( QVector<Remove> *removes, QVector<Insert> *inserts) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< fromGroup << from << toGroup << to << count) + QT_QML_TRACE_LISTCOMPOSITOR(<< fromGroup << from << toGroup << to << count) Q_ASSERT(count != 0); Q_ASSERT(from >=0 && from + count <= m_end.index[toGroup]); Q_ASSERT(verifyMoveTo(fromGroup, from, toGroup, to, count, group)); @@ -774,24 +774,24 @@ void QDeclarativeListCompositor::move( } m_cacheIt = toIt; - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR } -void QDeclarativeListCompositor::clear() +void QQuickListCompositor::clear() { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR( ) + QT_QML_TRACE_LISTCOMPOSITOR( ) for (Range *range = m_ranges.next; range != &m_ranges; range = erase(range)) {} m_end = iterator(m_ranges.next, 0, Default, m_groupCount); m_cacheIt = m_end; } -void QDeclarativeListCompositor::listItemsInserted( +void QQuickListCompositor::listItemsInserted( QVector<Insert> *translatedInsertions, void *list, - const QVector<QDeclarativeChangeSet::Insert> &insertions, + const QVector<QQuickChangeSet::Insert> &insertions, const QVector<MovedFlags> *movedFlags) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << insertions) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << insertions) for (iterator it(m_ranges.next, 0, Default, m_groupCount); *it != &m_ranges; *it = it->next) { if (it->list != list || it->flags == CacheFlag) { it.incrementIndexes(it->count); @@ -801,7 +801,7 @@ void QDeclarativeListCompositor::listItemsInserted( it.incrementIndexes(it->count); continue; } - foreach (const QDeclarativeChangeSet::Insert &insertion, insertions) { + foreach (const QQuickChangeSet::Insert &insertion, insertions) { int offset = insertion.index - it->index; if ((offset > 0 && offset < it->count) || (offset == 0 && it->prepend()) @@ -862,29 +862,29 @@ void QDeclarativeListCompositor::listItemsInserted( it.incrementIndexes(it->count); } m_cacheIt = m_end; - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR } -void QDeclarativeListCompositor::listItemsInserted( +void QQuickListCompositor::listItemsInserted( void *list, int index, int count, QVector<Insert> *translatedInsertions) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << index << count) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count) Q_ASSERT(count > 0); - QVector<QDeclarativeChangeSet::Insert> insertions; - insertions.append(QDeclarativeChangeSet::Insert(index, count)); + QVector<QQuickChangeSet::Insert> insertions; + insertions.append(QQuickChangeSet::Insert(index, count)); listItemsInserted(translatedInsertions, list, insertions); } -void QDeclarativeListCompositor::listItemsRemoved( +void QQuickListCompositor::listItemsRemoved( QVector<Remove> *translatedRemovals, void *list, - QVector<QDeclarativeChangeSet::Remove> *removals, - QVector<QDeclarativeChangeSet::Insert> *insertions, + QVector<QQuickChangeSet::Remove> *removals, + QVector<QQuickChangeSet::Insert> *insertions, QVector<MovedFlags> *movedFlags, int moveId) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << *removals) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << *removals) for (iterator it(m_ranges.next, 0, Default, m_groupCount); *it != &m_ranges; *it = it->next) { if (it->list != list || it->flags == CacheFlag) { @@ -892,7 +892,7 @@ void QDeclarativeListCompositor::listItemsRemoved( continue; } bool removed = false; - for (QVector<QDeclarativeChangeSet::Remove>::iterator removal = removals->begin(); + for (QVector<QQuickChangeSet::Remove>::iterator removal = removals->begin(); !removed && removal != removals->end(); ++removal) { int relativeIndex = removal->index - it->index; @@ -908,7 +908,7 @@ void QDeclarativeListCompositor::listItemsRemoved( translatedRemoval.index[i] += offset; } if (removal->isMove()) { - QVector<QDeclarativeChangeSet::Insert>::iterator insertion = insertions->begin(); + QVector<QQuickChangeSet::Insert>::iterator insertion = insertions->begin(); for (; insertion != insertions->end() && insertion->moveId != removal->moveId; ++insertion) {} Q_ASSERT(insertion != insertions->end()); @@ -916,11 +916,11 @@ void QDeclarativeListCompositor::listItemsRemoved( if (relativeIndex < 0) { int splitMoveId = ++moveId; - removal = removals->insert(removal, QDeclarativeChangeSet::Remove( + removal = removals->insert(removal, QQuickChangeSet::Remove( removal->index, -relativeIndex, splitMoveId)); ++removal; removal->count -= -relativeIndex; - insertion = insertions->insert(insertion, QDeclarativeChangeSet::Insert( + insertion = insertions->insert(insertion, QQuickChangeSet::Insert( insertion->index, -relativeIndex, splitMoveId)); ++insertion; insertion->index += -relativeIndex; @@ -933,10 +933,10 @@ void QDeclarativeListCompositor::listItemsRemoved( movedFlags->append(MovedFlags(moveId, it->flags & ~AppendFlag)); if (removeCount < removal->count) { - removal = removals->insert(removal, QDeclarativeChangeSet::Remove( + removal = removals->insert(removal, QQuickChangeSet::Remove( removal->index, removeCount, translatedRemoval.moveId)); ++removal; - insertion = insertions->insert(insertion, QDeclarativeChangeSet::Insert( + insertion = insertions->insert(insertion, QQuickChangeSet::Insert( insertion->index, removeCount, translatedRemoval.moveId)); ++insertion; @@ -1013,21 +1013,21 @@ void QDeclarativeListCompositor::listItemsRemoved( } } m_cacheIt = m_end; - QT_DECLARATIVE_VERIFY_LISTCOMPOSITOR + QT_QML_VERIFY_LISTCOMPOSITOR } -void QDeclarativeListCompositor::listItemsRemoved( +void QQuickListCompositor::listItemsRemoved( void *list, int index, int count, QVector<Remove> *translatedRemovals) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << index << count) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count) Q_ASSERT(count >= 0); - QVector<QDeclarativeChangeSet::Remove> removals; - removals.append(QDeclarativeChangeSet::Remove(index, count)); + QVector<QQuickChangeSet::Remove> removals; + removals.append(QQuickChangeSet::Remove(index, count)); listItemsRemoved(translatedRemovals, list, &removals, 0, 0, 0); } -void QDeclarativeListCompositor::listItemsMoved( +void QQuickListCompositor::listItemsMoved( void *list, int from, int to, @@ -1035,25 +1035,25 @@ void QDeclarativeListCompositor::listItemsMoved( QVector<Remove> *translatedRemovals, QVector<Insert> *translatedInsertions) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << from << to << count) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << from << to << count) Q_ASSERT(count >= 0); - QVector<QDeclarativeChangeSet::Remove> removals; - QVector<QDeclarativeChangeSet::Insert> insertions; + QVector<QQuickChangeSet::Remove> removals; + QVector<QQuickChangeSet::Insert> insertions; QVector<MovedFlags> movedFlags; - removals.append(QDeclarativeChangeSet::Remove(from, count, 0)); - insertions.append(QDeclarativeChangeSet::Insert(to, count, 0)); + removals.append(QQuickChangeSet::Remove(from, count, 0)); + insertions.append(QQuickChangeSet::Insert(to, count, 0)); listItemsRemoved(translatedRemovals, list, &removals, &insertions, &movedFlags, 0); listItemsInserted(translatedInsertions, list, insertions, &movedFlags); } -void QDeclarativeListCompositor::listItemsChanged( +void QQuickListCompositor::listItemsChanged( QVector<Change> *translatedChanges, void *list, - const QVector<QDeclarativeChangeSet::Change> &changes) + const QVector<QQuickChangeSet::Change> &changes) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << changes) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << changes) for (iterator it(m_ranges.next, 0, Default, m_groupCount); *it != &m_ranges; *it = it->next) { if (it->list != list || it->flags == CacheFlag) { it.incrementIndexes(it->count); @@ -1061,7 +1061,7 @@ void QDeclarativeListCompositor::listItemsChanged( } else if (!it->inGroup()) { continue; } - foreach (const QDeclarativeChangeSet::Change &change, changes) { + foreach (const QQuickChangeSet::Change &change, changes) { const int offset = change.index - it->index; if (offset + change.count > 0 && offset < it->count) { const int changeOffset = qMax(0, offset); @@ -1079,60 +1079,60 @@ void QDeclarativeListCompositor::listItemsChanged( } } -void QDeclarativeListCompositor::listItemsChanged( +void QQuickListCompositor::listItemsChanged( void *list, int index, int count, QVector<Change> *translatedChanges) { - QT_DECLARATIVE_TRACE_LISTCOMPOSITOR(<< list << index << count) + QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count) Q_ASSERT(count >= 0); - QVector<QDeclarativeChangeSet::Change> changes; - changes.append(QDeclarativeChangeSet::Change(index, count)); + QVector<QQuickChangeSet::Change> changes; + changes.append(QQuickChangeSet::Change(index, count)); listItemsChanged(translatedChanges, list, changes); } -void QDeclarativeListCompositor::listChanged( +void QQuickListCompositor::listChanged( void *list, - const QDeclarativeChangeSet &changeSet, + const QQuickChangeSet &changeSet, QVector<Remove> *translatedRemovals, QVector<Insert> *translatedInsertions, QVector<Change> *translatedChanges) { - QVector<QDeclarativeChangeSet::Remove> removals = changeSet.removes(); - QVector<QDeclarativeChangeSet::Insert> insertions = changeSet.inserts(); + QVector<QQuickChangeSet::Remove> removals = changeSet.removes(); + QVector<QQuickChangeSet::Insert> insertions = changeSet.inserts(); QVector<MovedFlags> movedFlags; listItemsRemoved(translatedRemovals, list, &removals, &insertions, &movedFlags, changeSet.moveCounter()); listItemsInserted(translatedInsertions, list, insertions, &movedFlags); listItemsChanged(translatedChanges, list, changeSet.changes()); } -void QDeclarativeListCompositor::transition( +void QQuickListCompositor::transition( Group from, Group to, - QVector<QDeclarativeChangeSet::Remove> *removes, - QVector<QDeclarativeChangeSet::Insert> *inserts) + QVector<QQuickChangeSet::Remove> *removes, + QVector<QQuickChangeSet::Insert> *inserts) { int removeCount = 0; for (iterator it(m_ranges.next, 0, Default, m_groupCount); *it != &m_ranges; *it = it->next) { if (it == from && it != to) { - removes->append(QDeclarativeChangeSet::Remove(it.index[from]- removeCount, it->count)); + removes->append(QQuickChangeSet::Remove(it.index[from]- removeCount, it->count)); removeCount += it->count; } else if (it != from && it == to) { - inserts->append(QDeclarativeChangeSet::Insert(it.index[to], it->count)); + inserts->append(QQuickChangeSet::Insert(it.index[to], it->count)); } it.incrementIndexes(it->count); } } -QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Group &group) +QDebug operator <<(QDebug debug, const QQuickListCompositor::Group &group) { switch (group) { - case QDeclarativeListCompositor::Cache: return debug << "Cache"; - case QDeclarativeListCompositor::Default: return debug << "Default"; + case QQuickListCompositor::Cache: return debug << "Cache"; + case QQuickListCompositor::Default: return debug << "Default"; default: return (debug.nospace() << "Group" << int(group)).space(); } } -QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Range &range) +QDebug operator <<(QDebug debug, const QQuickListCompositor::Range &range) { (debug.nospace() << "Range(" @@ -1142,11 +1142,11 @@ QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Range &range) << (range.isUnresolved() ? "U" : "0") << (range.append() ? "A" : "0") << (range.prepend() ? "P" : "0"); - for (int i = QDeclarativeListCompositor::MaximumGroupCount - 1; i >= 2; --i) + for (int i = QQuickListCompositor::MaximumGroupCount - 1; i >= 2; --i) debug << (range.inGroup(i) ? "1" : "0"); return (debug - << (range.inGroup(QDeclarativeListCompositor::Default) ? "D" : "0") - << (range.inGroup(QDeclarativeListCompositor::Cache) ? "C" : "0")); + << (range.inGroup(QQuickListCompositor::Default) ? "D" : "0") + << (range.inGroup(QQuickListCompositor::Cache) ? "C" : "0")); } static void qt_print_indexes(QDebug &debug, int count, const int *indexes) @@ -1155,50 +1155,50 @@ static void qt_print_indexes(QDebug &debug, int count, const int *indexes) debug << indexes[i]; } -QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::iterator &it) +QDebug operator <<(QDebug debug, const QQuickListCompositor::iterator &it) { (debug.nospace() << "iterator(" << it.group).space() << "offset:" << it.offset; qt_print_indexes(debug, it.groupCount, it.index); return ((debug << **it).nospace() << ")").space(); } -static QDebug qt_print_change(QDebug debug, const char *name, const QDeclarativeListCompositor::Change &change) +static QDebug qt_print_change(QDebug debug, const char *name, const QQuickListCompositor::Change &change) { debug.nospace() << name << "(" << change.moveId << " " << change.count << " "; - for (int i = QDeclarativeListCompositor::MaximumGroupCount - 1; i >= 2; --i) + for (int i = QQuickListCompositor::MaximumGroupCount - 1; i >= 2; --i) debug << (change.inGroup(i) ? "1" : "0"); - debug << (change.inGroup(QDeclarativeListCompositor::Default) ? "D" : "0") - << (change.inGroup(QDeclarativeListCompositor::Cache) ? "C" : "0"); - int i = QDeclarativeListCompositor::MaximumGroupCount - 1; + debug << (change.inGroup(QQuickListCompositor::Default) ? "D" : "0") + << (change.inGroup(QQuickListCompositor::Cache) ? "C" : "0"); + int i = QQuickListCompositor::MaximumGroupCount - 1; for (; i >= 0 && !change.inGroup(i); --i) {} for (; i >= 0; --i) debug << " " << change.index[i]; return (debug << ")").maybeSpace(); } -QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Change &change) +QDebug operator <<(QDebug debug, const QQuickListCompositor::Change &change) { return qt_print_change(debug, "Change", change); } -QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Remove &remove) +QDebug operator <<(QDebug debug, const QQuickListCompositor::Remove &remove) { return qt_print_change(debug, "Remove", remove); } -QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Insert &insert) +QDebug operator <<(QDebug debug, const QQuickListCompositor::Insert &insert) { return qt_print_change(debug, "Insert", insert); } -QDebug operator <<(QDebug debug, const QDeclarativeListCompositor &list) +QDebug operator <<(QDebug debug, const QQuickListCompositor &list) { - int indexes[QDeclarativeListCompositor::MaximumGroupCount]; - for (int i = 0; i < QDeclarativeListCompositor::MaximumGroupCount; ++i) + int indexes[QQuickListCompositor::MaximumGroupCount]; + for (int i = 0; i < QQuickListCompositor::MaximumGroupCount; ++i) indexes[i] = 0; - debug.nospace() << "QDeclarativeListCompositor("; + debug.nospace() << "QQuickListCompositor("; qt_print_indexes(debug, list.m_groupCount, list.m_end.index); - for (QDeclarativeListCompositor::Range *range = list.m_ranges.next; range != &list.m_ranges; range = range->next) { + for (QQuickListCompositor::Range *range = list.m_ranges.next; range != &list.m_ranges; range = range->next) { (debug << "\n").space(); qt_print_indexes(debug, list.m_groupCount, indexes); debug << " " << *range; diff --git a/src/quick/util/qdeclarativelistcompositor_p.h b/src/quick/util/qquicklistcompositor_p.h index 4bee0dab69..b12ee8025f 100644 --- a/src/quick/util/qdeclarativelistcompositor_p.h +++ b/src/quick/util/qquicklistcompositor_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVELISTCOMPOSITOR_P_H -#define QDECLARATIVELISTCOMPOSITOR_P_H +#ifndef QQUICKLISTCOMPOSITOR_P_H +#define QQUICKLISTCOMPOSITOR_P_H // // W A R N I N G @@ -56,13 +56,13 @@ #include <QtCore/qglobal.h> #include <QtCore/qvector.h> -#include <private/qdeclarativechangeset_p.h> +#include <private/qquickchangeset_p.h> #include <QtCore/qdebug.h> QT_BEGIN_NAMESPACE -class Q_AUTOTEST_EXPORT QDeclarativeListCompositor +class Q_AUTOTEST_EXPORT QQuickListCompositor { public: enum { MinimumGroupCount = 3, MaximumGroupCount = 11 }; @@ -209,8 +209,8 @@ public: : Change(it, count, flags, moveId) {} }; - QDeclarativeListCompositor(); - ~QDeclarativeListCompositor(); + QQuickListCompositor(); + ~QQuickListCompositor(); int defaultGroups() const { return m_defaultFlags & ~PrependFlag; } void setDefaultGroups(int groups) { m_defaultFlags = groups | PrependFlag; } @@ -266,7 +266,7 @@ public: void listItemsChanged(void *list, int index, int count, QVector<Change> *changes); void listChanged( void *list, - const QDeclarativeChangeSet &changeSet, + const QQuickChangeSet &changeSet, QVector<Remove> *removals, QVector<Insert> *inserts, QVector<Change> *changes); @@ -274,8 +274,8 @@ public: void transition( Group from, Group to, - QVector<QDeclarativeChangeSet::Remove> *removes, - QVector<QDeclarativeChangeSet::Insert> *inserts); + QVector<QQuickChangeSet::Remove> *removes, + QVector<QQuickChangeSet::Insert> *inserts); private: Range m_ranges; @@ -300,26 +300,26 @@ private: void listItemsRemoved( QVector<Remove> *translatedRemovals, void *list, - QVector<QDeclarativeChangeSet::Remove> *removals, - QVector<QDeclarativeChangeSet::Insert> *insertions = 0, + QVector<QQuickChangeSet::Remove> *removals, + QVector<QQuickChangeSet::Insert> *insertions = 0, QVector<MovedFlags> *movedFlags = 0, int moveId = 0); void listItemsInserted( QVector<Insert> *translatedInsertions, void *list, - const QVector<QDeclarativeChangeSet::Insert> &insertions, + const QVector<QQuickChangeSet::Insert> &insertions, const QVector<MovedFlags> *movedFlags = 0); void listItemsChanged( QVector<Change> *translatedChanges, void *list, - const QVector<QDeclarativeChangeSet::Change> &changes); + const QVector<QQuickChangeSet::Change> &changes); - friend Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor &list); + friend Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor &list); }; -inline QDeclarativeListCompositor::iterator::iterator() +inline QQuickListCompositor::iterator::iterator() : range(0), offset(0), group(Default), groupCount(0) {} -inline QDeclarativeListCompositor::iterator::iterator(const iterator &it) +inline QQuickListCompositor::iterator::iterator(const iterator &it) : range(it.range) , offset(it.offset) , group(it.group) @@ -330,7 +330,7 @@ inline QDeclarativeListCompositor::iterator::iterator(const iterator &it) index[i] = it.index[i]; } -inline QDeclarativeListCompositor::iterator::iterator( +inline QQuickListCompositor::iterator::iterator( Range *range, int offset, Group group, int groupCount) : range(range) , offset(offset) @@ -342,7 +342,7 @@ inline QDeclarativeListCompositor::iterator::iterator( index[i] = 0; } -inline void QDeclarativeListCompositor::iterator::incrementIndexes(int difference, uint flags) +inline void QQuickListCompositor::iterator::incrementIndexes(int difference, uint flags) { for (int i = 0; i < groupCount; ++i) { if (flags & (1 << i)) @@ -350,7 +350,7 @@ inline void QDeclarativeListCompositor::iterator::incrementIndexes(int differenc } } -inline void QDeclarativeListCompositor::iterator::decrementIndexes(int difference, uint flags) +inline void QQuickListCompositor::iterator::decrementIndexes(int difference, uint flags) { for (int i = 0; i < groupCount; ++i) { if (flags & (1 << i)) @@ -358,24 +358,24 @@ inline void QDeclarativeListCompositor::iterator::decrementIndexes(int differenc } } -inline QDeclarativeListCompositor::insert_iterator::insert_iterator( +inline QQuickListCompositor::insert_iterator::insert_iterator( Range *range, int offset, Group group, int groupCount) : iterator(range, offset, group, groupCount) {} -inline QDeclarativeListCompositor::Change::Change(iterator it, int count, uint flags, int moveId) +inline QQuickListCompositor::Change::Change(iterator it, int count, uint flags, int moveId) : count(count), flags(flags), moveId(moveId) { for (int i = 0; i < MaximumGroupCount; ++i) index[i] = it.index[i]; } -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Group &group); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Range &range); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::iterator &it); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Change &change); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Remove &remove); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor::Insert &insert); -Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QDeclarativeListCompositor &list); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor::Group &group); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor::Range &range); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor::iterator &it); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor::Change &change); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor::Remove &remove); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor::Insert &insert); +Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor &list); QT_END_NAMESPACE diff --git a/src/quick/util/qdeclarativepackage.cpp b/src/quick/util/qquickpackage.cpp index c6504ffea4..1939de62e1 100644 --- a/src/quick/util/qdeclarativepackage.cpp +++ b/src/quick/util/qquickpackage.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qdeclarativepackage_p.h" +#include "qquickpackage_p.h" #include <private/qobject_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlguard_p.h> QT_BEGIN_NAMESPACE /*! - \qmlclass Package QDeclarativePackage + \qmlclass Package QQuickPackage \inqmlmodule QtQuick 2 \ingroup qml-working-with-data \brief Package provides a collection of named items. @@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE \snippet examples/declarative/modelviews/package/view.qml 0 - \sa {declarative/modelviews/package}{Package example}, {declarative/photoviewer}{Photo Viewer example}, QtDeclarative + \sa {declarative/modelviews/package}{Package example}, {declarative/photoviewer}{Photo Viewer example}, QtQml */ /*! @@ -81,14 +81,14 @@ QT_BEGIN_NAMESPACE */ -class QDeclarativePackagePrivate : public QObjectPrivate +class QQuickPackagePrivate : public QObjectPrivate { public: - QDeclarativePackagePrivate() {} + QQuickPackagePrivate() {} - struct DataGuard : public QDeclarativeGuard<QObject> + struct DataGuard : public QQmlGuard<QObject> { - DataGuard(QObject *obj, QList<DataGuard> *l) : list(l) { (QDeclarativeGuard<QObject>&)*this = obj; } + DataGuard(QObject *obj, QList<DataGuard> *l) : list(l) { (QQmlGuard<QObject>&)*this = obj; } QList<DataGuard> *list; void objectDestroyed(QObject *) { // we assume priv will always be destroyed after objectDestroyed calls @@ -97,91 +97,91 @@ public: }; QList<DataGuard> dataList; - static void data_append(QDeclarativeListProperty<QObject> *prop, QObject *o) { + static void data_append(QQmlListProperty<QObject> *prop, QObject *o) { QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); list->append(DataGuard(o, list)); } - static void data_clear(QDeclarativeListProperty<QObject> *prop) { + static void data_clear(QQmlListProperty<QObject> *prop) { QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); list->clear(); } - static QObject *data_at(QDeclarativeListProperty<QObject> *prop, int index) { + static QObject *data_at(QQmlListProperty<QObject> *prop, int index) { QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); return list->at(index); } - static int data_count(QDeclarativeListProperty<QObject> *prop) { + static int data_count(QQmlListProperty<QObject> *prop) { QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); return list->count(); } }; -QHash<QObject *, QDeclarativePackageAttached *> QDeclarativePackageAttached::attached; +QHash<QObject *, QQuickPackageAttached *> QQuickPackageAttached::attached; -QDeclarativePackageAttached::QDeclarativePackageAttached(QObject *parent) +QQuickPackageAttached::QQuickPackageAttached(QObject *parent) : QObject(parent) { attached.insert(parent, this); } -QDeclarativePackageAttached::~QDeclarativePackageAttached() +QQuickPackageAttached::~QQuickPackageAttached() { attached.remove(parent()); } -QString QDeclarativePackageAttached::name() const +QString QQuickPackageAttached::name() const { return _name; } -void QDeclarativePackageAttached::setName(const QString &n) +void QQuickPackageAttached::setName(const QString &n) { _name = n; } -QDeclarativePackage::QDeclarativePackage(QObject *parent) - : QObject(*(new QDeclarativePackagePrivate), parent) +QQuickPackage::QQuickPackage(QObject *parent) + : QObject(*(new QQuickPackagePrivate), parent) { } -QDeclarativePackage::~QDeclarativePackage() +QQuickPackage::~QQuickPackage() { - Q_D(QDeclarativePackage); + Q_D(QQuickPackage); for (int ii = 0; ii < d->dataList.count(); ++ii) { QObject *obj = d->dataList.at(ii); obj->setParent(this); } } -QDeclarativeListProperty<QObject> QDeclarativePackage::data() +QQmlListProperty<QObject> QQuickPackage::data() { - Q_D(QDeclarativePackage); - return QDeclarativeListProperty<QObject>(this, &d->dataList, QDeclarativePackagePrivate::data_append, - QDeclarativePackagePrivate::data_count, - QDeclarativePackagePrivate::data_at, - QDeclarativePackagePrivate::data_clear); + Q_D(QQuickPackage); + return QQmlListProperty<QObject>(this, &d->dataList, QQuickPackagePrivate::data_append, + QQuickPackagePrivate::data_count, + QQuickPackagePrivate::data_at, + QQuickPackagePrivate::data_clear); } -bool QDeclarativePackage::hasPart(const QString &name) +bool QQuickPackage::hasPart(const QString &name) { - Q_D(QDeclarativePackage); + Q_D(QQuickPackage); for (int ii = 0; ii < d->dataList.count(); ++ii) { QObject *obj = d->dataList.at(ii); - QDeclarativePackageAttached *a = QDeclarativePackageAttached::attached.value(obj); + QQuickPackageAttached *a = QQuickPackageAttached::attached.value(obj); if (a && a->name() == name) return true; } return false; } -QObject *QDeclarativePackage::part(const QString &name) +QObject *QQuickPackage::part(const QString &name) { - Q_D(QDeclarativePackage); + Q_D(QQuickPackage); if (name.isEmpty() && !d->dataList.isEmpty()) return d->dataList.at(0); for (int ii = 0; ii < d->dataList.count(); ++ii) { QObject *obj = d->dataList.at(ii); - QDeclarativePackageAttached *a = QDeclarativePackageAttached::attached.value(obj); + QQuickPackageAttached *a = QQuickPackageAttached::attached.value(obj); if (a && a->name() == name) return obj; } @@ -192,9 +192,9 @@ QObject *QDeclarativePackage::part(const QString &name) return 0; } -QDeclarativePackageAttached *QDeclarativePackage::qmlAttachedProperties(QObject *o) +QQuickPackageAttached *QQuickPackage::qmlAttachedProperties(QObject *o) { - return new QDeclarativePackageAttached(o); + return new QQuickPackageAttached(o); } diff --git a/src/quick/util/qdeclarativepackage_p.h b/src/quick/util/qquickpackage_p.h index ad164bc329..9f16521763 100644 --- a/src/quick/util/qdeclarativepackage_p.h +++ b/src/quick/util/qquickpackage_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,58 +39,58 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPACKAGE_H -#define QDECLARATIVEPACKAGE_H +#ifndef QQUICKPACKAGE_H +#define QQUICKPACKAGE_H -#include <qdeclarative.h> +#include <qqml.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativePackagePrivate; -class QDeclarativePackageAttached; -class Q_AUTOTEST_EXPORT QDeclarativePackage : public QObject +class QQuickPackagePrivate; +class QQuickPackageAttached; +class Q_AUTOTEST_EXPORT QQuickPackage : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePackage) + Q_DECLARE_PRIVATE(QQuickPackage) Q_CLASSINFO("DefaultProperty", "data") - Q_PROPERTY(QDeclarativeListProperty<QObject> data READ data) + Q_PROPERTY(QQmlListProperty<QObject> data READ data) public: - QDeclarativePackage(QObject *parent=0); - virtual ~QDeclarativePackage(); + QQuickPackage(QObject *parent=0); + virtual ~QQuickPackage(); - QDeclarativeListProperty<QObject> data(); + QQmlListProperty<QObject> data(); QObject *part(const QString & = QString()); bool hasPart(const QString &); - static QDeclarativePackageAttached *qmlAttachedProperties(QObject *); + static QQuickPackageAttached *qmlAttachedProperties(QObject *); }; -class QDeclarativePackageAttached : public QObject +class QQuickPackageAttached : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName) public: - QDeclarativePackageAttached(QObject *parent); - virtual ~QDeclarativePackageAttached(); + QQuickPackageAttached(QObject *parent); + virtual ~QQuickPackageAttached(); QString name() const; void setName(const QString &n); - static QHash<QObject *, QDeclarativePackageAttached *> attached; + static QHash<QObject *, QQuickPackageAttached *> attached; private: QString _name; }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativePackage) -QML_DECLARE_TYPEINFO(QDeclarativePackage, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(QQuickPackage) +QML_DECLARE_TYPEINFO(QQuickPackage, QML_HAS_ATTACHED_PROPERTIES) QT_END_HEADER -#endif // QDECLARATIVEPACKAGE_H +#endif // QQUICKPACKAGE_H diff --git a/src/quick/util/qdeclarativepath.cpp b/src/quick/util/qquickpath.cpp index 2ee534880c..b6a01bfe3e 100644 --- a/src/quick/util/qdeclarativepath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qdeclarativepath_p.h" -#include "qdeclarativepath_p_p.h" -#include "qdeclarativesvgparser_p.h" +#include "qquickpath_p.h" +#include "qquickpath_p_p.h" +#include "qquicksvgparser_p.h" #include <QSet> #include <QTime> @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! - \qmlclass PathElement QDeclarativePathElement + \qmlclass PathElement QQuickPathElement \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief PathElement is the base path type. @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE */ /*! - \qmlclass Path QDeclarativePath + \qmlclass Path QQuickPath \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief A Path object defines a path for use by \l PathView. @@ -81,12 +81,12 @@ QT_BEGIN_NAMESPACE \sa PathView, PathAttribute, PathPercent, PathLine, PathQuad, PathCubic, PathArc, PathCurve, PathSvg */ -QDeclarativePath::QDeclarativePath(QObject *parent) - : QObject(*(new QDeclarativePathPrivate), parent) +QQuickPath::QQuickPath(QObject *parent) + : QObject(*(new QQuickPathPrivate), parent) { } -QDeclarativePath::~QDeclarativePath() +QQuickPath::~QQuickPath() { } @@ -95,15 +95,15 @@ QDeclarativePath::~QDeclarativePath() \qmlproperty real QtQuick2::Path::startY These properties hold the starting position of the path. */ -qreal QDeclarativePath::startX() const +qreal QQuickPath::startX() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); return d->startX.isNull ? 0 : d->startX.value; } -void QDeclarativePath::setStartX(qreal x) +void QQuickPath::setStartX(qreal x) { - Q_D(QDeclarativePath); + Q_D(QQuickPath); if (d->startX.isValid() && qFuzzyCompare(x, d->startX)) return; d->startX = x; @@ -111,21 +111,21 @@ void QDeclarativePath::setStartX(qreal x) processPath(); } -bool QDeclarativePath::hasStartX() const +bool QQuickPath::hasStartX() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); return d->startX.isValid(); } -qreal QDeclarativePath::startY() const +qreal QQuickPath::startY() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); return d->startY.isNull ? 0 : d->startY.value; } -void QDeclarativePath::setStartY(qreal y) +void QQuickPath::setStartY(qreal y) { - Q_D(QDeclarativePath); + Q_D(QQuickPath); if (d->startY.isValid() && qFuzzyCompare(y, d->startY)) return; d->startY = y; @@ -133,9 +133,9 @@ void QDeclarativePath::setStartY(qreal y) processPath(); } -bool QDeclarativePath::hasStartY() const +bool QQuickPath::hasStartY() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); return d->startY.isValid(); } @@ -143,17 +143,17 @@ bool QDeclarativePath::hasStartY() const \qmlproperty bool QtQuick2::Path::closed This property holds whether the start and end of the path are identical. */ -bool QDeclarativePath::isClosed() const +bool QQuickPath::isClosed() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); return d->closed; } -bool QDeclarativePath::hasEnd() const +bool QQuickPath::hasEnd() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); for (int i = d->_pathElements.count() - 1; i > -1; --i) { - if (QDeclarativeCurve *curve = qobject_cast<QDeclarativeCurve *>(d->_pathElements.at(i))) { + if (QQuickCurve *curve = qobject_cast<QQuickCurve *>(d->_pathElements.at(i))) { if ((!curve->hasX() && !curve->hasRelativeX()) || (!curve->hasY() && !curve->hasRelativeY())) return false; else @@ -181,22 +181,22 @@ bool QDeclarativePath::hasEnd() const \i \l PathPercent - a way to spread out items along various segments of the path. \endlist - \snippet doc/src/snippets/declarative/pathview/pathattributes.qml 2 + \snippet doc/src/snippets/qml/pathview/pathattributes.qml 2 */ -QDeclarativeListProperty<QDeclarativePathElement> QDeclarativePath::pathElements() +QQmlListProperty<QQuickPathElement> QQuickPath::pathElements() { - Q_D(QDeclarativePath); - return QDeclarativeListProperty<QDeclarativePathElement>(this, d->_pathElements); + Q_D(QQuickPath); + return QQmlListProperty<QQuickPathElement>(this, d->_pathElements); } -void QDeclarativePath::interpolate(int idx, const QString &name, qreal value) +void QQuickPath::interpolate(int idx, const QString &name, qreal value) { - Q_D(QDeclarativePath); + Q_D(QQuickPath); interpolate(d->_attributePoints, idx, name, value); } -void QDeclarativePath::interpolate(QList<AttributePoint> &attributePoints, int idx, const QString &name, qreal value) +void QQuickPath::interpolate(QList<AttributePoint> &attributePoints, int idx, const QString &name, qreal value) { if (!idx) return; @@ -226,9 +226,9 @@ void QDeclarativePath::interpolate(QList<AttributePoint> &attributePoints, int i } } -void QDeclarativePath::endpoint(const QString &name) +void QQuickPath::endpoint(const QString &name) { - Q_D(QDeclarativePath); + Q_D(QQuickPath); const AttributePoint &first = d->_attributePoints.first(); qreal val = first.values.value(name); for (int ii = d->_attributePoints.count() - 1; ii >= 0; ii--) { @@ -243,7 +243,7 @@ void QDeclarativePath::endpoint(const QString &name) } } -void QDeclarativePath::endpoint(QList<AttributePoint> &attributePoints, const QString &name) +void QQuickPath::endpoint(QList<AttributePoint> &attributePoints, const QString &name) { const AttributePoint &first = attributePoints.first(); qreal val = first.values.value(name); @@ -261,9 +261,9 @@ void QDeclarativePath::endpoint(QList<AttributePoint> &attributePoints, const QS static QString percentString(QLatin1String("_qfx_percent")); -void QDeclarativePath::processPath() +void QQuickPath::processPath() { - Q_D(QDeclarativePath); + Q_D(QQuickPath); if (!d->componentComplete) return; @@ -276,9 +276,9 @@ void QDeclarativePath::processPath() emit changed(); } -QPainterPath QDeclarativePath::createPath(const QPointF &startPoint, const QPointF &endPoint, const QStringList &attributes, qreal &pathLength, QList<AttributePoint> &attributePoints, bool *closed) +QPainterPath QQuickPath::createPath(const QPointF &startPoint, const QPointF &endPoint, const QStringList &attributes, qreal &pathLength, QList<AttributePoint> &attributePoints, bool *closed) { - Q_D(QDeclarativePath); + Q_D(QQuickPath); pathLength = 0; attributePoints.clear(); @@ -299,9 +299,9 @@ QPainterPath QDeclarativePath::createPath(const QPointF &startPoint, const QPoin bool usesPercent = false; int index = 0; - foreach (QDeclarativePathElement *pathElement, d->_pathElements) { - if (QDeclarativeCurve *curve = qobject_cast<QDeclarativeCurve *>(pathElement)) { - QDeclarativePathData data; + foreach (QQuickPathElement *pathElement, d->_pathElements) { + if (QQuickCurve *curve = qobject_cast<QQuickCurve *>(pathElement)) { + QQuickPathData data; data.index = index; data.endPoint = endPoint; data.curves = d->_pathCurves; @@ -310,11 +310,11 @@ QPainterPath QDeclarativePath::createPath(const QPointF &startPoint, const QPoin p.origpercent = path.length(); attributePoints << p; ++index; - } else if (QDeclarativePathAttribute *attribute = qobject_cast<QDeclarativePathAttribute *>(pathElement)) { + } else if (QQuickPathAttribute *attribute = qobject_cast<QQuickPathAttribute *>(pathElement)) { AttributePoint &point = attributePoints.last(); point.values[attribute->name()] = attribute->value(); interpolate(attributePoints, attributePoints.count() - 1, attribute->name(), attribute->value()); - } else if (QDeclarativePathPercent *percent = qobject_cast<QDeclarativePathPercent *>(pathElement)) { + } else if (QQuickPathPercent *percent = qobject_cast<QQuickPathPercent *>(pathElement)) { AttributePoint &point = attributePoints.last(); point.values[percentString] = percent->value(); interpolate(attributePoints, attributePoints.count() - 1, percentString, percent->value()); @@ -340,7 +340,7 @@ QPainterPath QDeclarativePath::createPath(const QPointF &startPoint, const QPoin qreal prevorigpercent = 0; for (int ii = 0; ii < attributePoints.count(); ++ii) { const AttributePoint &point = attributePoints.at(ii); - if (point.values.contains(percentString)) { //special string for QDeclarativePathPercent + if (point.values.contains(percentString)) { //special string for QQuickPathPercent if ( ii > 0) { qreal scale = (attributePoints[ii].origpercent/length - prevorigpercent) / (point.values.value(percentString)-prevpercent); @@ -365,51 +365,51 @@ QPainterPath QDeclarativePath::createPath(const QPointF &startPoint, const QPoin return path; } -void QDeclarativePath::classBegin() +void QQuickPath::classBegin() { - Q_D(QDeclarativePath); + Q_D(QQuickPath); d->componentComplete = false; } -void QDeclarativePath::componentComplete() +void QQuickPath::componentComplete() { - Q_D(QDeclarativePath); + Q_D(QQuickPath); QSet<QString> attrs; d->componentComplete = true; // First gather up all the attributes - foreach (QDeclarativePathElement *pathElement, d->_pathElements) { - if (QDeclarativeCurve *curve = - qobject_cast<QDeclarativeCurve *>(pathElement)) + foreach (QQuickPathElement *pathElement, d->_pathElements) { + if (QQuickCurve *curve = + qobject_cast<QQuickCurve *>(pathElement)) d->_pathCurves.append(curve); - else if (QDeclarativePathAttribute *attribute = - qobject_cast<QDeclarativePathAttribute *>(pathElement)) + else if (QQuickPathAttribute *attribute = + qobject_cast<QQuickPathAttribute *>(pathElement)) attrs.insert(attribute->name()); } d->_attributes = attrs.toList(); processPath(); - foreach (QDeclarativePathElement *pathElement, d->_pathElements) + foreach (QQuickPathElement *pathElement, d->_pathElements) connect(pathElement, SIGNAL(changed()), this, SLOT(processPath())); } -QPainterPath QDeclarativePath::path() const +QPainterPath QQuickPath::path() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); return d->_path; } -QStringList QDeclarativePath::attributes() const +QStringList QQuickPath::attributes() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); if (!d->componentComplete) { QSet<QString> attrs; // First gather up all the attributes - foreach (QDeclarativePathElement *pathElement, d->_pathElements) { - if (QDeclarativePathAttribute *attribute = - qobject_cast<QDeclarativePathAttribute *>(pathElement)) + foreach (QQuickPathElement *pathElement, d->_pathElements) { + if (QQuickPathAttribute *attribute = + qobject_cast<QQuickPathAttribute *>(pathElement)) attrs.insert(attribute->name()); } return attrs.toList(); @@ -461,9 +461,9 @@ static inline qreal slopeAt(qreal t, qreal a, qreal b, qreal c, qreal d) return 3*t*t*(d - 3*c + 3*b - a) + 6*t*(c - 2*b + a) + 3*(b - a); } -void QDeclarativePath::createPointCache() const +void QQuickPath::createPointCache() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); qreal pathLength = d->pathLength; if (pathLength <= 0 || qIsNaN(pathLength)) return; @@ -513,19 +513,19 @@ void QDeclarativePath::createPointCache() const } } -void QDeclarativePath::invalidateSequentialHistory() const +void QQuickPath::invalidateSequentialHistory() const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); d->prevBez.isValid = false; } -QPointF QDeclarativePath::sequentialPointAt(qreal p, qreal *angle) const +QPointF QQuickPath::sequentialPointAt(qreal p, qreal *angle) const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); return sequentialPointAt(d->_path, d->pathLength, d->_attributePoints, d->prevBez, p, angle); } -QPointF QDeclarativePath::sequentialPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QDeclarativeCachedBezier &prevBez, qreal p, qreal *angle) +QPointF QQuickPath::sequentialPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QQuickCachedBezier &prevBez, qreal p, qreal *angle) { if (!prevBez.isValid) return p > .5 ? backwardsPointAt(path, pathLength, attributePoints, prevBez, p, angle) : @@ -535,7 +535,7 @@ QPointF QDeclarativePath::sequentialPointAt(const QPainterPath &path, const qrea forwardsPointAt(path, pathLength, attributePoints, prevBez, p, angle); } -QPointF QDeclarativePath::forwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QDeclarativeCachedBezier &prevBez, qreal p, qreal *angle) +QPointF QQuickPath::forwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QQuickCachedBezier &prevBez, qreal p, qreal *angle) { if (pathLength <= 0 || qIsNaN(pathLength)) return path.pointAtPercent(0); //expensive? @@ -591,7 +591,7 @@ QPointF QDeclarativePath::forwardsPointAt(const QPainterPath &path, const qreal } //ideally this should be merged with forwardsPointAt -QPointF QDeclarativePath::backwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QDeclarativeCachedBezier &prevBez, qreal p, qreal *angle) +QPointF QQuickPath::backwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QQuickCachedBezier &prevBez, qreal p, qreal *angle) { if (pathLength <= 0 || qIsNaN(pathLength)) return path.pointAtPercent(0); @@ -646,9 +646,9 @@ QPointF QDeclarativePath::backwardsPointAt(const QPainterPath &path, const qreal return QPointF(0,0); } -QPointF QDeclarativePath::pointAt(qreal p) const +QPointF QQuickPath::pointAt(qreal p) const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); if (d->_pointCache.isEmpty()) { createPointCache(); if (d->_pointCache.isEmpty()) @@ -681,9 +681,9 @@ QPointF QDeclarativePath::pointAt(qreal p) const return pos; } -qreal QDeclarativePath::attributeAt(const QString &name, qreal percent) const +qreal QQuickPath::attributeAt(const QString &name, qreal percent) const { - Q_D(const QDeclarativePath); + Q_D(const QQuickPath); if (percent < 0 || percent > 1) return 0; @@ -709,12 +709,12 @@ qreal QDeclarativePath::attributeAt(const QString &name, qreal percent) const /****************************************************************************/ -qreal QDeclarativeCurve::x() const +qreal QQuickCurve::x() const { return _x.isNull ? 0 : _x.value; } -void QDeclarativeCurve::setX(qreal x) +void QQuickCurve::setX(qreal x) { if (_x.isNull || _x != x) { _x = x; @@ -723,17 +723,17 @@ void QDeclarativeCurve::setX(qreal x) } } -bool QDeclarativeCurve::hasX() +bool QQuickCurve::hasX() { return _x.isValid(); } -qreal QDeclarativeCurve::y() const +qreal QQuickCurve::y() const { return _y.isNull ? 0 : _y.value; } -void QDeclarativeCurve::setY(qreal y) +void QQuickCurve::setY(qreal y) { if (_y.isNull || _y != y) { _y = y; @@ -742,17 +742,17 @@ void QDeclarativeCurve::setY(qreal y) } } -bool QDeclarativeCurve::hasY() +bool QQuickCurve::hasY() { return _y.isValid(); } -qreal QDeclarativeCurve::relativeX() const +qreal QQuickCurve::relativeX() const { return _relativeX; } -void QDeclarativeCurve::setRelativeX(qreal x) +void QQuickCurve::setRelativeX(qreal x) { if (_relativeX.isNull || _relativeX != x) { _relativeX = x; @@ -761,17 +761,17 @@ void QDeclarativeCurve::setRelativeX(qreal x) } } -bool QDeclarativeCurve::hasRelativeX() +bool QQuickCurve::hasRelativeX() { return _relativeX.isValid(); } -qreal QDeclarativeCurve::relativeY() const +qreal QQuickCurve::relativeY() const { return _relativeY; } -void QDeclarativeCurve::setRelativeY(qreal y) +void QQuickCurve::setRelativeY(qreal y) { if (_relativeY.isNull || _relativeY != y) { _relativeY = y; @@ -780,7 +780,7 @@ void QDeclarativeCurve::setRelativeY(qreal y) } } -bool QDeclarativeCurve::hasRelativeY() +bool QQuickCurve::hasRelativeY() { return _relativeY.isValid(); } @@ -788,7 +788,7 @@ bool QDeclarativeCurve::hasRelativeY() /****************************************************************************/ /*! - \qmlclass PathAttribute QDeclarativePathAttribute + \qmlclass PathAttribute QQuickPathAttribute \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathAttribute allows setting an attribute at a given position in a Path. @@ -810,7 +810,7 @@ bool QDeclarativeCurve::hasRelativeY() \row \o \image declarative-pathattribute.png \o - \snippet doc/src/snippets/declarative/pathview/pathattributes.qml 0 + \snippet doc/src/snippets/qml/pathview/pathattributes.qml 0 (see the PathView documentation for the specification of ContactModel.qml used for ContactModel above.) \endtable @@ -835,12 +835,12 @@ bool QDeclarativeCurve::hasRelativeY() the name of the attribute to change. */ -QString QDeclarativePathAttribute::name() const +QString QQuickPathAttribute::name() const { return _name; } -void QDeclarativePathAttribute::setName(const QString &name) +void QQuickPathAttribute::setName(const QString &name) { if (_name == name) return; @@ -887,12 +887,12 @@ void QDeclarativePathAttribute::setName(const QString &name) /*! the new value of the attribute. */ -qreal QDeclarativePathAttribute::value() const +qreal QQuickPathAttribute::value() const { return _value; } -void QDeclarativePathAttribute::setValue(qreal value) +void QQuickPathAttribute::setValue(qreal value) { if (_value != value) { _value = value; @@ -904,7 +904,7 @@ void QDeclarativePathAttribute::setValue(qreal value) /****************************************************************************/ /*! - \qmlclass PathLine QDeclarativePathLine + \qmlclass PathLine QQuickPathLine \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathLine defines a straight line. @@ -946,15 +946,15 @@ void QDeclarativePathAttribute::setValue(qreal value) \sa x, y */ -inline QPointF positionForCurve(const QDeclarativePathData &data, const QPointF &prevPoint) +inline QPointF positionForCurve(const QQuickPathData &data, const QPointF &prevPoint) { - QDeclarativeCurve *curve = data.curves.at(data.index); + QQuickCurve *curve = data.curves.at(data.index); bool isEnd = data.index == data.curves.size() - 1; return QPointF(curve->hasRelativeX() ? prevPoint.x() + curve->relativeX() : !isEnd || curve->hasX() ? curve->x() : data.endPoint.x(), curve->hasRelativeY() ? prevPoint.y() + curve->relativeY() : !isEnd || curve->hasY() ? curve->y() : data.endPoint.y()); } -void QDeclarativePathLine::addToPath(QPainterPath &path, const QDeclarativePathData &data) +void QQuickPathLine::addToPath(QPainterPath &path, const QQuickPathData &data) { path.lineTo(positionForCurve(data, path.currentPosition())); } @@ -962,7 +962,7 @@ void QDeclarativePathLine::addToPath(QPainterPath &path, const QDeclarativePathD /****************************************************************************/ /*! - \qmlclass PathQuad QDeclarativePathQuad + \qmlclass PathQuad QQuickPathQuad \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathQuad defines a quadratic Bezier curve with a control point. @@ -1017,12 +1017,12 @@ void QDeclarativePathLine::addToPath(QPainterPath &path, const QDeclarativePathD /*! the x position of the control point. */ -qreal QDeclarativePathQuad::controlX() const +qreal QQuickPathQuad::controlX() const { return _controlX; } -void QDeclarativePathQuad::setControlX(qreal x) +void QQuickPathQuad::setControlX(qreal x) { if (_controlX != x) { _controlX = x; @@ -1035,12 +1035,12 @@ void QDeclarativePathQuad::setControlX(qreal x) /*! the y position of the control point. */ -qreal QDeclarativePathQuad::controlY() const +qreal QQuickPathQuad::controlY() const { return _controlY; } -void QDeclarativePathQuad::setControlY(qreal y) +void QQuickPathQuad::setControlY(qreal y) { if (_controlY != y) { _controlY = y; @@ -1064,12 +1064,12 @@ void QDeclarativePathQuad::setControlY(qreal y) \sa controlX, controlY */ -qreal QDeclarativePathQuad::relativeControlX() const +qreal QQuickPathQuad::relativeControlX() const { return _relativeControlX; } -void QDeclarativePathQuad::setRelativeControlX(qreal x) +void QQuickPathQuad::setRelativeControlX(qreal x) { if (_relativeControlX.isNull || _relativeControlX != x) { _relativeControlX = x; @@ -1078,17 +1078,17 @@ void QDeclarativePathQuad::setRelativeControlX(qreal x) } } -bool QDeclarativePathQuad::hasRelativeControlX() +bool QQuickPathQuad::hasRelativeControlX() { return _relativeControlX.isValid(); } -qreal QDeclarativePathQuad::relativeControlY() const +qreal QQuickPathQuad::relativeControlY() const { return _relativeControlY; } -void QDeclarativePathQuad::setRelativeControlY(qreal y) +void QQuickPathQuad::setRelativeControlY(qreal y) { if (_relativeControlY.isNull || _relativeControlY != y) { _relativeControlY = y; @@ -1097,12 +1097,12 @@ void QDeclarativePathQuad::setRelativeControlY(qreal y) } } -bool QDeclarativePathQuad::hasRelativeControlY() +bool QQuickPathQuad::hasRelativeControlY() { return _relativeControlY.isValid(); } -void QDeclarativePathQuad::addToPath(QPainterPath &path, const QDeclarativePathData &data) +void QQuickPathQuad::addToPath(QPainterPath &path, const QQuickPathData &data) { const QPointF &prevPoint = path.currentPosition(); QPointF controlPoint(hasRelativeControlX() ? prevPoint.x() + relativeControlX() : controlX(), @@ -1113,7 +1113,7 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path, const QDeclarativePathD /****************************************************************************/ /*! - \qmlclass PathCubic QDeclarativePathCubic + \qmlclass PathCubic QQuickPathCubic \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathCubic defines a cubic Bezier curve with two control points. @@ -1168,12 +1168,12 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path, const QDeclarativePathD Defines the position of the first control point. */ -qreal QDeclarativePathCubic::control1X() const +qreal QQuickPathCubic::control1X() const { return _control1X; } -void QDeclarativePathCubic::setControl1X(qreal x) +void QQuickPathCubic::setControl1X(qreal x) { if (_control1X != x) { _control1X = x; @@ -1182,12 +1182,12 @@ void QDeclarativePathCubic::setControl1X(qreal x) } } -qreal QDeclarativePathCubic::control1Y() const +qreal QQuickPathCubic::control1Y() const { return _control1Y; } -void QDeclarativePathCubic::setControl1Y(qreal y) +void QQuickPathCubic::setControl1Y(qreal y) { if (_control1Y != y) { _control1Y = y; @@ -1202,12 +1202,12 @@ void QDeclarativePathCubic::setControl1Y(qreal y) Defines the position of the second control point. */ -qreal QDeclarativePathCubic::control2X() const +qreal QQuickPathCubic::control2X() const { return _control2X; } -void QDeclarativePathCubic::setControl2X(qreal x) +void QQuickPathCubic::setControl2X(qreal x) { if (_control2X != x) { _control2X = x; @@ -1216,12 +1216,12 @@ void QDeclarativePathCubic::setControl2X(qreal x) } } -qreal QDeclarativePathCubic::control2Y() const +qreal QQuickPathCubic::control2Y() const { return _control2Y; } -void QDeclarativePathCubic::setControl2Y(qreal y) +void QQuickPathCubic::setControl2Y(qreal y) { if (_control2Y != y) { _control2Y = y; @@ -1247,12 +1247,12 @@ void QDeclarativePathCubic::setControl2Y(qreal y) \sa control1X, control1Y, control2X, control2Y */ -qreal QDeclarativePathCubic::relativeControl1X() const +qreal QQuickPathCubic::relativeControl1X() const { return _relativeControl1X; } -void QDeclarativePathCubic::setRelativeControl1X(qreal x) +void QQuickPathCubic::setRelativeControl1X(qreal x) { if (_relativeControl1X.isNull || _relativeControl1X != x) { _relativeControl1X = x; @@ -1261,17 +1261,17 @@ void QDeclarativePathCubic::setRelativeControl1X(qreal x) } } -bool QDeclarativePathCubic::hasRelativeControl1X() +bool QQuickPathCubic::hasRelativeControl1X() { return _relativeControl1X.isValid(); } -qreal QDeclarativePathCubic::relativeControl1Y() const +qreal QQuickPathCubic::relativeControl1Y() const { return _relativeControl1Y; } -void QDeclarativePathCubic::setRelativeControl1Y(qreal y) +void QQuickPathCubic::setRelativeControl1Y(qreal y) { if (_relativeControl1Y.isNull || _relativeControl1Y != y) { _relativeControl1Y = y; @@ -1280,17 +1280,17 @@ void QDeclarativePathCubic::setRelativeControl1Y(qreal y) } } -bool QDeclarativePathCubic::hasRelativeControl1Y() +bool QQuickPathCubic::hasRelativeControl1Y() { return _relativeControl1Y.isValid(); } -qreal QDeclarativePathCubic::relativeControl2X() const +qreal QQuickPathCubic::relativeControl2X() const { return _relativeControl2X; } -void QDeclarativePathCubic::setRelativeControl2X(qreal x) +void QQuickPathCubic::setRelativeControl2X(qreal x) { if (_relativeControl2X.isNull || _relativeControl2X != x) { _relativeControl2X = x; @@ -1299,17 +1299,17 @@ void QDeclarativePathCubic::setRelativeControl2X(qreal x) } } -bool QDeclarativePathCubic::hasRelativeControl2X() +bool QQuickPathCubic::hasRelativeControl2X() { return _relativeControl2X.isValid(); } -qreal QDeclarativePathCubic::relativeControl2Y() const +qreal QQuickPathCubic::relativeControl2Y() const { return _relativeControl2Y; } -void QDeclarativePathCubic::setRelativeControl2Y(qreal y) +void QQuickPathCubic::setRelativeControl2Y(qreal y) { if (_relativeControl2Y.isNull || _relativeControl2Y != y) { _relativeControl2Y = y; @@ -1318,12 +1318,12 @@ void QDeclarativePathCubic::setRelativeControl2Y(qreal y) } } -bool QDeclarativePathCubic::hasRelativeControl2Y() +bool QQuickPathCubic::hasRelativeControl2Y() { return _relativeControl2Y.isValid(); } -void QDeclarativePathCubic::addToPath(QPainterPath &path, const QDeclarativePathData &data) +void QQuickPathCubic::addToPath(QPainterPath &path, const QQuickPathData &data) { const QPointF &prevPoint = path.currentPosition(); QPointF controlPoint1(hasRelativeControl1X() ? prevPoint.x() + relativeControl1X() : control1X(), @@ -1336,7 +1336,7 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path, const QDeclarativePath /****************************************************************************/ /*! - \qmlclass PathCurve QDeclarativePathCurve + \qmlclass PathCurve QQuickPathCurve \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathCurve defines a point on a Catmull-Rom curve. @@ -1344,7 +1344,7 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path, const QDeclarativePath PathCurve provides an easy way to specify a curve passing directly through a set of points. Typically multiple PathCurves are used in a series, as the following example demonstrates: - \snippet doc/src/snippets/declarative/path/basiccurve.qml 0 + \snippet doc/src/snippets/qml/path/basiccurve.qml 0 This example produces the following path (with the starting point and PathCurve points highlighted in red): @@ -1388,7 +1388,7 @@ inline QPointF previousPathPosition(const QPainterPath &path) return index > -1 ? QPointF(path.elementAt(index)) : path.pointAtPercent(0); } -void QDeclarativePathCatmullRomCurve::addToPath(QPainterPath &path, const QDeclarativePathData &data) +void QQuickPathCatmullRomCurve::addToPath(QPainterPath &path, const QQuickPathData &data) { //here we convert catmull-rom spline to bezier for use in QPainterPath. //basic conversion algorithm: @@ -1400,18 +1400,18 @@ void QDeclarativePathCatmullRomCurve::addToPath(QPainterPath &path, const QDecla //get previous points int index = data.index - 1; - QDeclarativeCurve *curve = index == -1 ? 0 : data.curves.at(index); - if (qobject_cast<QDeclarativePathCatmullRomCurve*>(curve)) { + QQuickCurve *curve = index == -1 ? 0 : data.curves.at(index); + if (qobject_cast<QQuickPathCatmullRomCurve*>(curve)) { prev = path.currentPosition(); prevFar = previousPathPosition(path); } else { prev = path.currentPosition(); bool prevFarSet = false; if (index == -1 && data.curves.count() > 1) { - if (qobject_cast<QDeclarativePathCatmullRomCurve*>(data.curves.at(data.curves.count()-1))) { + if (qobject_cast<QQuickPathCatmullRomCurve*>(data.curves.at(data.curves.count()-1))) { //TODO: profile and optimize QPointF pos = prev; - QDeclarativePathData loopData; + QQuickPathData loopData; loopData.endPoint = data.endPoint; loopData.curves = data.curves; for (int i = data.index; i < data.curves.count(); ++i) { @@ -1436,14 +1436,14 @@ void QDeclarativePathCatmullRomCurve::addToPath(QPainterPath &path, const QDecla //get next point index = data.index + 1; - if (index < data.curves.count() && qobject_cast<QDeclarativePathCatmullRomCurve*>(data.curves.at(index))) { - QDeclarativePathData nextData; + if (index < data.curves.count() && qobject_cast<QQuickPathCatmullRomCurve*>(data.curves.at(index))) { + QQuickPathData nextData; nextData.index = index; nextData.endPoint = data.endPoint; nextData.curves = data.curves; next = positionForCurve(nextData, point); } else { - if (point == QPointF(path.elementAt(0)) && qobject_cast<QDeclarativePathCatmullRomCurve*>(data.curves.at(0))) { + if (point == QPointF(path.elementAt(0)) && qobject_cast<QQuickPathCatmullRomCurve*>(data.curves.at(0))) { //this is a closed path starting and ending with catmull-rom segments. //we try to smooth the join point next = QPointF(path.elementAt(3)); //the first catmull-rom point @@ -1481,7 +1481,7 @@ void QDeclarativePathCatmullRomCurve::addToPath(QPainterPath &path, const QDecla /****************************************************************************/ /*! - \qmlclass PathArc QDeclarativePathArc + \qmlclass PathArc QQuickPathArc \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathArc defines an arc with the given radius. @@ -1493,7 +1493,7 @@ void QDeclarativePathCatmullRomCurve::addToPath(QPainterPath &path, const QDecla \table \row \o \image declarative-patharc.png - \o \snippet doc/src/snippets/declarative/path/basicarc.qml 0 + \o \snippet doc/src/snippets/qml/path/basicarc.qml 0 \endtable Note that a single PathArc cannot be used to specify a circle. Instead, you can @@ -1537,16 +1537,16 @@ void QDeclarativePathCatmullRomCurve::addToPath(QPainterPath &path, const QDecla \table \row \o \image declarative-arcradius.png - \o \snippet doc/src/snippets/declarative/path/arcradius.qml 0 + \o \snippet doc/src/snippets/qml/path/arcradius.qml 0 \endtable */ -qreal QDeclarativePathArc::radiusX() const +qreal QQuickPathArc::radiusX() const { return _radiusX; } -void QDeclarativePathArc::setRadiusX(qreal radius) +void QQuickPathArc::setRadiusX(qreal radius) { if (_radiusX == radius) return; @@ -1555,12 +1555,12 @@ void QDeclarativePathArc::setRadiusX(qreal radius) emit radiusXChanged(); } -qreal QDeclarativePathArc::radiusY() const +qreal QQuickPathArc::radiusY() const { return _radiusY; } -void QDeclarativePathArc::setRadiusY(qreal radius) +void QQuickPathArc::setRadiusY(qreal radius) { if (_radiusY == radius) return; @@ -1582,18 +1582,18 @@ void QDeclarativePathArc::setRadiusY(qreal radius) \table \row \o \image declarative-largearc.png - \o \snippet doc/src/snippets/declarative/path/largearc.qml 0 + \o \snippet doc/src/snippets/qml/path/largearc.qml 0 \endtable The default value is false. */ -bool QDeclarativePathArc::useLargeArc() const +bool QQuickPathArc::useLargeArc() const { return _useLargeArc; } -void QDeclarativePathArc::setUseLargeArc(bool largeArc) +void QQuickPathArc::setUseLargeArc(bool largeArc) { if (_useLargeArc == largeArc) return; @@ -1613,18 +1613,18 @@ void QDeclarativePathArc::setUseLargeArc(bool largeArc) \table \row \o \image declarative-arcdirection.png - \o \snippet doc/src/snippets/declarative/path/arcdirection.qml 0 + \o \snippet doc/src/snippets/qml/path/arcdirection.qml 0 \endtable \sa useLargeArc */ -QDeclarativePathArc::ArcDirection QDeclarativePathArc::direction() const +QQuickPathArc::ArcDirection QQuickPathArc::direction() const { return _direction; } -void QDeclarativePathArc::setDirection(ArcDirection direction) +void QQuickPathArc::setDirection(ArcDirection direction) { if (_direction == direction) return; @@ -1633,11 +1633,11 @@ void QDeclarativePathArc::setDirection(ArcDirection direction) emit directionChanged(); } -void QDeclarativePathArc::addToPath(QPainterPath &path, const QDeclarativePathData &data) +void QQuickPathArc::addToPath(QPainterPath &path, const QQuickPathData &data) { const QPointF &startPoint = path.currentPosition(); const QPointF &endPoint = positionForCurve(data, startPoint); - QDeclarativeSvgParser::pathArc(path, + QQuickSvgParser::pathArc(path, _radiusX, _radiusY, 0, //xAxisRotation @@ -1651,7 +1651,7 @@ void QDeclarativePathArc::addToPath(QPainterPath &path, const QDeclarativePathDa /****************************************************************************/ /*! - \qmlclass PathSvg QDeclarativePathSvg + \qmlclass PathSvg QQuickPathSvg \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathSvg defines a path using an SVG path data string. @@ -1681,12 +1681,12 @@ void QDeclarativePathArc::addToPath(QPainterPath &path, const QDeclarativePathDa for more details on this format. */ -QString QDeclarativePathSvg::path() const +QString QQuickPathSvg::path() const { return _path; } -void QDeclarativePathSvg::setPath(const QString &path) +void QQuickPathSvg::setPath(const QString &path) { if (_path == path) return; @@ -1695,15 +1695,15 @@ void QDeclarativePathSvg::setPath(const QString &path) emit pathChanged(); } -void QDeclarativePathSvg::addToPath(QPainterPath &path, const QDeclarativePathData &) +void QQuickPathSvg::addToPath(QPainterPath &path, const QQuickPathData &) { - QDeclarativeSvgParser::parsePathDataFast(_path, path); + QQuickSvgParser::parsePathDataFast(_path, path); } /****************************************************************************/ /*! - \qmlclass PathPercent QDeclarativePathPercent + \qmlclass PathPercent QQuickPathPercent \inqmlmodule QtQuick 2 \ingroup qml-view-elements \brief The PathPercent manipulates the way a path is interpreted. @@ -1782,12 +1782,12 @@ void QDeclarativePathSvg::addToPath(QPainterPath &path, const QDeclarativePathDa \endqml */ -qreal QDeclarativePathPercent::value() const +qreal QQuickPathPercent::value() const { return _value; } -void QDeclarativePathPercent::setValue(qreal value) +void QQuickPathPercent::setValue(qreal value) { if (_value != value) { _value = value; diff --git a/src/quick/util/qdeclarativepath_p.h b/src/quick/util/qquickpath_p.h index 7dc2c47990..3ffcf3eaa6 100644 --- a/src/quick/util/qdeclarativepath_p.h +++ b/src/quick/util/qquickpath_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPATH_H -#define QDECLARATIVEPATH_H +#ifndef QQUICKPATH_H +#define QQUICKPATH_H -#include <qdeclarative.h> +#include <qqml.h> -#include <private/qdeclarativenullablevalue_p_p.h> +#include <private/qqmlnullablevalue_p_p.h> #include <private/qbezier_p.h> #include <QtCore/QObject> @@ -54,31 +54,31 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeCurve; -struct QDeclarativePathData +class QQuickCurve; +struct QQuickPathData { int index; QPointF endPoint; - QList<QDeclarativeCurve*> curves; + QList<QQuickCurve*> curves; }; -class Q_AUTOTEST_EXPORT QDeclarativePathElement : public QObject +class Q_AUTOTEST_EXPORT QQuickPathElement : public QObject { Q_OBJECT public: - QDeclarativePathElement(QObject *parent=0) : QObject(parent) {} + QQuickPathElement(QObject *parent=0) : QObject(parent) {} Q_SIGNALS: void changed(); }; -class Q_AUTOTEST_EXPORT QDeclarativePathAttribute : public QDeclarativePathElement +class Q_AUTOTEST_EXPORT QQuickPathAttribute : public QQuickPathElement { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged) public: - QDeclarativePathAttribute(QObject *parent=0) : QDeclarativePathElement(parent), _value(0) {} + QQuickPathAttribute(QObject *parent=0) : QQuickPathElement(parent), _value(0) {} QString name() const; @@ -96,7 +96,7 @@ private: qreal _value; }; -class Q_AUTOTEST_EXPORT QDeclarativeCurve : public QDeclarativePathElement +class Q_AUTOTEST_EXPORT QQuickCurve : public QQuickPathElement { Q_OBJECT @@ -105,7 +105,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeCurve : public QDeclarativePathElement Q_PROPERTY(qreal relativeX READ relativeX WRITE setRelativeX NOTIFY relativeXChanged) Q_PROPERTY(qreal relativeY READ relativeY WRITE setRelativeY NOTIFY relativeYChanged) public: - QDeclarativeCurve(QObject *parent=0) : QDeclarativePathElement(parent) {} + QQuickCurve(QObject *parent=0) : QQuickPathElement(parent) {} qreal x() const; void setX(qreal x); @@ -123,7 +123,7 @@ public: void setRelativeY(qreal y); bool hasRelativeY(); - virtual void addToPath(QPainterPath &, const QDeclarativePathData &) {} + virtual void addToPath(QPainterPath &, const QQuickPathData &) {} Q_SIGNALS: void xChanged(); @@ -132,22 +132,22 @@ Q_SIGNALS: void relativeYChanged(); private: - QDeclarativeNullableValue<qreal> _x; - QDeclarativeNullableValue<qreal> _y; - QDeclarativeNullableValue<qreal> _relativeX; - QDeclarativeNullableValue<qreal> _relativeY; + QQmlNullableValue<qreal> _x; + QQmlNullableValue<qreal> _y; + QQmlNullableValue<qreal> _relativeX; + QQmlNullableValue<qreal> _relativeY; }; -class Q_AUTOTEST_EXPORT QDeclarativePathLine : public QDeclarativeCurve +class Q_AUTOTEST_EXPORT QQuickPathLine : public QQuickCurve { Q_OBJECT public: - QDeclarativePathLine(QObject *parent=0) : QDeclarativeCurve(parent) {} + QQuickPathLine(QObject *parent=0) : QQuickCurve(parent) {} - void addToPath(QPainterPath &path, const QDeclarativePathData &); + void addToPath(QPainterPath &path, const QQuickPathData &); }; -class Q_AUTOTEST_EXPORT QDeclarativePathQuad : public QDeclarativeCurve +class Q_AUTOTEST_EXPORT QQuickPathQuad : public QQuickCurve { Q_OBJECT @@ -156,7 +156,7 @@ class Q_AUTOTEST_EXPORT QDeclarativePathQuad : public QDeclarativeCurve Q_PROPERTY(qreal relativeControlX READ relativeControlX WRITE setRelativeControlX NOTIFY relativeControlXChanged) Q_PROPERTY(qreal relativeControlY READ relativeControlY WRITE setRelativeControlY NOTIFY relativeControlYChanged) public: - QDeclarativePathQuad(QObject *parent=0) : QDeclarativeCurve(parent), _controlX(0), _controlY(0) {} + QQuickPathQuad(QObject *parent=0) : QQuickCurve(parent), _controlX(0), _controlY(0) {} qreal controlX() const; void setControlX(qreal x); @@ -172,7 +172,7 @@ public: void setRelativeControlY(qreal y); bool hasRelativeControlY(); - void addToPath(QPainterPath &path, const QDeclarativePathData &); + void addToPath(QPainterPath &path, const QQuickPathData &); Q_SIGNALS: void controlXChanged(); @@ -183,11 +183,11 @@ Q_SIGNALS: private: qreal _controlX; qreal _controlY; - QDeclarativeNullableValue<qreal> _relativeControlX; - QDeclarativeNullableValue<qreal> _relativeControlY; + QQmlNullableValue<qreal> _relativeControlX; + QQmlNullableValue<qreal> _relativeControlY; }; -class Q_AUTOTEST_EXPORT QDeclarativePathCubic : public QDeclarativeCurve +class Q_AUTOTEST_EXPORT QQuickPathCubic : public QQuickCurve { Q_OBJECT @@ -200,7 +200,7 @@ class Q_AUTOTEST_EXPORT QDeclarativePathCubic : public QDeclarativeCurve Q_PROPERTY(qreal relativeControl2X READ relativeControl2X WRITE setRelativeControl2X NOTIFY relativeControl2XChanged) Q_PROPERTY(qreal relativeControl2Y READ relativeControl2Y WRITE setRelativeControl2Y NOTIFY relativeControl2YChanged) public: - QDeclarativePathCubic(QObject *parent=0) : QDeclarativeCurve(parent), _control1X(0), _control1Y(0), _control2X(0), _control2Y(0) {} + QQuickPathCubic(QObject *parent=0) : QQuickCurve(parent), _control1X(0), _control1Y(0), _control2X(0), _control2Y(0) {} qreal control1X() const; void setControl1X(qreal x); @@ -230,7 +230,7 @@ public: void setRelativeControl2Y(qreal y); bool hasRelativeControl2Y(); - void addToPath(QPainterPath &path, const QDeclarativePathData &); + void addToPath(QPainterPath &path, const QQuickPathData &); Q_SIGNALS: void control1XChanged(); @@ -247,22 +247,22 @@ private: qreal _control1Y; qreal _control2X; qreal _control2Y; - QDeclarativeNullableValue<qreal> _relativeControl1X; - QDeclarativeNullableValue<qreal> _relativeControl1Y; - QDeclarativeNullableValue<qreal> _relativeControl2X; - QDeclarativeNullableValue<qreal> _relativeControl2Y; + QQmlNullableValue<qreal> _relativeControl1X; + QQmlNullableValue<qreal> _relativeControl1Y; + QQmlNullableValue<qreal> _relativeControl2X; + QQmlNullableValue<qreal> _relativeControl2Y; }; -class Q_AUTOTEST_EXPORT QDeclarativePathCatmullRomCurve : public QDeclarativeCurve +class Q_AUTOTEST_EXPORT QQuickPathCatmullRomCurve : public QQuickCurve { Q_OBJECT public: - QDeclarativePathCatmullRomCurve(QObject *parent=0) : QDeclarativeCurve(parent) {} + QQuickPathCatmullRomCurve(QObject *parent=0) : QQuickCurve(parent) {} - void addToPath(QPainterPath &path, const QDeclarativePathData &); + void addToPath(QPainterPath &path, const QQuickPathData &); }; -class Q_AUTOTEST_EXPORT QDeclarativePathArc : public QDeclarativeCurve +class Q_AUTOTEST_EXPORT QQuickPathArc : public QQuickCurve { Q_OBJECT Q_PROPERTY(qreal radiusX READ radiusX WRITE setRadiusX NOTIFY radiusXChanged) @@ -271,8 +271,8 @@ class Q_AUTOTEST_EXPORT QDeclarativePathArc : public QDeclarativeCurve Q_PROPERTY(ArcDirection direction READ direction WRITE setDirection NOTIFY directionChanged) public: - QDeclarativePathArc(QObject *parent=0) - : QDeclarativeCurve(parent), _radiusX(0), _radiusY(0), _useLargeArc(false), _direction(Clockwise) {} + QQuickPathArc(QObject *parent=0) + : QQuickCurve(parent), _radiusX(0), _radiusY(0), _useLargeArc(false), _direction(Clockwise) {} enum ArcDirection { Clockwise, Counterclockwise }; Q_ENUMS(ArcDirection) @@ -289,7 +289,7 @@ public: ArcDirection direction() const; void setDirection(ArcDirection direction); - void addToPath(QPainterPath &path, const QDeclarativePathData &); + void addToPath(QPainterPath &path, const QQuickPathData &); Q_SIGNALS: void radiusXChanged(); @@ -304,17 +304,17 @@ private: ArcDirection _direction; }; -class Q_AUTOTEST_EXPORT QDeclarativePathSvg : public QDeclarativeCurve +class Q_AUTOTEST_EXPORT QQuickPathSvg : public QQuickCurve { Q_OBJECT Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged) public: - QDeclarativePathSvg(QObject *parent=0) : QDeclarativeCurve(parent) {} + QQuickPathSvg(QObject *parent=0) : QQuickCurve(parent) {} QString path() const; void setPath(const QString &path); - void addToPath(QPainterPath &path, const QDeclarativePathData &); + void addToPath(QPainterPath &path, const QQuickPathData &); Q_SIGNALS: void pathChanged(); @@ -323,12 +323,12 @@ private: QString _path; }; -class Q_AUTOTEST_EXPORT QDeclarativePathPercent : public QDeclarativePathElement +class Q_AUTOTEST_EXPORT QQuickPathPercent : public QQuickPathElement { Q_OBJECT Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged) public: - QDeclarativePathPercent(QObject *parent=0) : QDeclarativePathElement(parent) {} + QQuickPathPercent(QObject *parent=0) : QQuickPathElement(parent) {} qreal value() const; void setValue(qreal value); @@ -340,9 +340,9 @@ private: qreal _value; }; -struct QDeclarativeCachedBezier +struct QQuickCachedBezier { - QDeclarativeCachedBezier() : isValid(false) {} + QQuickCachedBezier() : isValid(false) {} QBezier bezier; int element; qreal bezLength; @@ -351,23 +351,23 @@ struct QDeclarativeCachedBezier bool isValid; }; -class QDeclarativePathPrivate; -class Q_AUTOTEST_EXPORT QDeclarativePath : public QObject, public QDeclarativeParserStatus +class QQuickPathPrivate; +class Q_AUTOTEST_EXPORT QQuickPath : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativePathElement> pathElements READ pathElements) + Q_INTERFACES(QQmlParserStatus) + Q_PROPERTY(QQmlListProperty<QQuickPathElement> pathElements READ pathElements) Q_PROPERTY(qreal startX READ startX WRITE setStartX NOTIFY startXChanged) Q_PROPERTY(qreal startY READ startY WRITE setStartY NOTIFY startYChanged) Q_PROPERTY(bool closed READ isClosed NOTIFY changed) Q_CLASSINFO("DefaultProperty", "pathElements") - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: - QDeclarativePath(QObject *parent=0); - ~QDeclarativePath(); + QQuickPath(QObject *parent=0); + ~QQuickPath(); - QDeclarativeListProperty<QDeclarativePathElement> pathElements(); + QQmlListProperty<QQuickPathElement> pathElements(); qreal startX() const; void setStartX(qreal x); @@ -419,33 +419,33 @@ private: static void interpolate(QList<AttributePoint> &points, int idx, const QString &name, qreal value); static void endpoint(QList<AttributePoint> &attributePoints, const QString &name); - static QPointF forwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QDeclarativeCachedBezier &prevBez, qreal p, qreal *angle = 0); - static QPointF backwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QDeclarativeCachedBezier &prevBez, qreal p, qreal *angle = 0); + static QPointF forwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QQuickCachedBezier &prevBez, qreal p, qreal *angle = 0); + static QPointF backwardsPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QQuickCachedBezier &prevBez, qreal p, qreal *angle = 0); private: - Q_DISABLE_COPY(QDeclarativePath) - Q_DECLARE_PRIVATE(QDeclarativePath) + Q_DISABLE_COPY(QQuickPath) + Q_DECLARE_PRIVATE(QQuickPath) friend class QQuickPathAnimationUpdater; public: QPainterPath createPath(const QPointF &startPoint, const QPointF &endPoint, const QStringList &attributes, qreal &pathLength, QList<AttributePoint> &attributePoints, bool *closed = 0); - static QPointF sequentialPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QDeclarativeCachedBezier &prevBez, qreal p, qreal *angle = 0); + static QPointF sequentialPointAt(const QPainterPath &path, const qreal &pathLength, const QList<AttributePoint> &attributePoints, QQuickCachedBezier &prevBez, qreal p, qreal *angle = 0); }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativePathElement) -QML_DECLARE_TYPE(QDeclarativePathAttribute) -QML_DECLARE_TYPE(QDeclarativeCurve) -QML_DECLARE_TYPE(QDeclarativePathLine) -QML_DECLARE_TYPE(QDeclarativePathQuad) -QML_DECLARE_TYPE(QDeclarativePathCubic) -QML_DECLARE_TYPE(QDeclarativePathCatmullRomCurve) -QML_DECLARE_TYPE(QDeclarativePathArc) -QML_DECLARE_TYPE(QDeclarativePathSvg) -QML_DECLARE_TYPE(QDeclarativePathPercent) -QML_DECLARE_TYPE(QDeclarativePath) +QML_DECLARE_TYPE(QQuickPathElement) +QML_DECLARE_TYPE(QQuickPathAttribute) +QML_DECLARE_TYPE(QQuickCurve) +QML_DECLARE_TYPE(QQuickPathLine) +QML_DECLARE_TYPE(QQuickPathQuad) +QML_DECLARE_TYPE(QQuickPathCubic) +QML_DECLARE_TYPE(QQuickPathCatmullRomCurve) +QML_DECLARE_TYPE(QQuickPathArc) +QML_DECLARE_TYPE(QQuickPathSvg) +QML_DECLARE_TYPE(QQuickPathPercent) +QML_DECLARE_TYPE(QQuickPath) QT_END_HEADER -#endif // QDECLARATIVEPATH_H +#endif // QQUICKPATH_H diff --git a/src/quick/util/qdeclarativepath_p_p.h b/src/quick/util/qquickpath_p_p.h index f02ab79e19..a7be68c964 100644 --- a/src/quick/util/qdeclarativepath_p_p.h +++ b/src/quick/util/qquickpath_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPATH_P_H -#define QDECLARATIVEPATH_P_H +#ifndef QQUICKPATH_P_H +#define QQUICKPATH_P_H // // W A R N I N G @@ -53,31 +53,31 @@ // We mean it. // -#include "qdeclarativepath_p.h" +#include "qquickpath_p.h" -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/QStringList> #include <private/qobject_p.h> QT_BEGIN_NAMESPACE -class QDeclarativePathPrivate : public QObjectPrivate +class QQuickPathPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativePath) + Q_DECLARE_PUBLIC(QQuickPath) public: - QDeclarativePathPrivate() : pathLength(0), closed(false), componentComplete(true) { } + QQuickPathPrivate() : pathLength(0), closed(false), componentComplete(true) { } QPainterPath _path; - QList<QDeclarativePathElement*> _pathElements; + QList<QQuickPathElement*> _pathElements; mutable QVector<QPointF> _pointCache; - QList<QDeclarativePath::AttributePoint> _attributePoints; + QList<QQuickPath::AttributePoint> _attributePoints; QStringList _attributes; - QList<QDeclarativeCurve*> _pathCurves; - mutable QDeclarativeCachedBezier prevBez; - QDeclarativeNullableValue<qreal> startX; - QDeclarativeNullableValue<qreal> startY; + QList<QQuickCurve*> _pathCurves; + mutable QQuickCachedBezier prevBez; + QQmlNullableValue<qreal> startX; + QQmlNullableValue<qreal> startY; qreal pathLength; bool closed; bool componentComplete; diff --git a/src/quick/util/qdeclarativepathinterpolator.cpp b/src/quick/util/qquickpathinterpolator.cpp index 7550d54159..2b5fb62872 100644 --- a/src/quick/util/qdeclarativepathinterpolator.cpp +++ b/src/quick/util/qquickpathinterpolator.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qdeclarativepathinterpolator_p.h" +#include "qquickpathinterpolator_p.h" -#include "qdeclarativepath_p.h" +#include "qquickpath_p.h" QT_BEGIN_NAMESPACE @@ -55,10 +55,10 @@ QT_BEGIN_NAMESPACE In the following example, we animate a green rectangle along a bezier path. - \snippet doc/src/snippets/declarative/pathinterpolator.qml 0 + \snippet doc/src/snippets/qml/pathinterpolator.qml 0 */ -QDeclarativePathInterpolator::QDeclarativePathInterpolator(QObject *parent) : +QQuickPathInterpolator::QQuickPathInterpolator(QObject *parent) : QObject(parent), _path(0), _x(0), _y(0), _angle(0), _progress(0) { } @@ -69,12 +69,12 @@ QDeclarativePathInterpolator::QDeclarativePathInterpolator(QObject *parent) : For more information on defining a path see the \l Path documentation. */ -QDeclarativePath *QDeclarativePathInterpolator::path() const +QQuickPath *QQuickPathInterpolator::path() const { return _path; } -void QDeclarativePathInterpolator::setPath(QDeclarativePath *path) +void QQuickPathInterpolator::setPath(QQuickPath *path) { if (_path == path) return; @@ -95,12 +95,12 @@ void QDeclarativePathInterpolator::setPath(QDeclarativePath *path) Progress ranges from 0.0 to 1.0. */ -qreal QDeclarativePathInterpolator::progress() const +qreal QQuickPathInterpolator::progress() const { return _progress; } -void QDeclarativePathInterpolator::setProgress(qreal progress) +void QQuickPathInterpolator::setProgress(qreal progress) { if (progress == _progress) return; @@ -115,12 +115,12 @@ void QDeclarativePathInterpolator::setProgress(qreal progress) These properties hold the position of the path at \l progress. */ -qreal QDeclarativePathInterpolator::x() const +qreal QQuickPathInterpolator::x() const { return _x; } -qreal QDeclarativePathInterpolator::y() const +qreal QQuickPathInterpolator::y() const { return _y; } @@ -132,12 +132,12 @@ qreal QDeclarativePathInterpolator::y() const Angles are reported clockwise, with zero degrees at the 3 o'clock position. */ -qreal QDeclarativePathInterpolator::angle() const +qreal QQuickPathInterpolator::angle() const { return _angle; } -void QDeclarativePathInterpolator::_q_pathUpdated() +void QQuickPathInterpolator::_q_pathUpdated() { if (! _path) return; diff --git a/src/quick/util/qdeclarativepathinterpolator_p.h b/src/quick/util/qquickpathinterpolator_p.h index 24b58e6a3c..b018ce337a 100644 --- a/src/quick/util/qdeclarativepathinterpolator_p.h +++ b/src/quick/util/qquickpathinterpolator_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,30 +39,30 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPATHINTERPOLATOR_P_H -#define QDECLARATIVEPATHINTERPOLATOR_P_H +#ifndef QQUICKPATHINTERPOLATOR_P_H +#define QQUICKPATHINTERPOLATOR_P_H -#include <qdeclarative.h> +#include <qqml.h> #include <QObject> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativePath; -class Q_AUTOTEST_EXPORT QDeclarativePathInterpolator : public QObject +class QQuickPath; +class Q_AUTOTEST_EXPORT QQuickPathInterpolator : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativePath *path READ path WRITE setPath NOTIFY pathChanged) + Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged) Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged) Q_PROPERTY(qreal x READ x NOTIFY xChanged) Q_PROPERTY(qreal y READ y NOTIFY yChanged) Q_PROPERTY(qreal angle READ angle NOTIFY angleChanged) public: - explicit QDeclarativePathInterpolator(QObject *parent = 0); + explicit QQuickPathInterpolator(QObject *parent = 0); - QDeclarativePath *path() const; - void setPath(QDeclarativePath *path); + QQuickPath *path() const; + void setPath(QQuickPath *path); qreal progress() const; void setProgress(qreal progress); @@ -82,7 +82,7 @@ private Q_SLOTS: void _q_pathUpdated(); private: - QDeclarativePath *_path; + QQuickPath *_path; qreal _x; qreal _y; qreal _angle; @@ -91,8 +91,8 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativePathInterpolator) +QML_DECLARE_TYPE(QQuickPathInterpolator) QT_END_HEADER -#endif // QDECLARATIVEPATHINTERPOLATOR_P_H +#endif // QQUICKPATHINTERPOLATOR_P_H diff --git a/src/quick/util/qdeclarativepixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 95cbd361b8..85e155f081 100644 --- a/src/quick/util/qdeclarativepixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "qdeclarativepixmapcache_p.h" -#include <qdeclarativenetworkaccessmanagerfactory.h> -#include <qdeclarativeimageprovider.h> +#include "qquickpixmapcache_p.h" +#include <qqmlnetworkaccessmanagerfactory.h> +#include <qqmlimageprovider.h> -#include <qdeclarativeengine.h> -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativeengine_p.h> +#include <qqmlengine.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlengine_p.h> #include <QtQuick/private/qsgtexture_p.h> #include <QtQuick/private/qsgcontext_p.h> @@ -76,26 +76,26 @@ QT_BEGIN_NAMESPACE // The cache limit describes the maximum "junk" in the cache. static int cache_limit = 2048 * 1024; // 2048 KB cache limit for embedded in qpixmapcache.cpp -QSGTexture *QDeclarativeDefaultTextureFactory::createTexture(QQuickCanvas *) const +QSGTexture *QQuickDefaultTextureFactory::createTexture(QQuickCanvas *) const { QSGPlainTexture *t = new QSGPlainTexture(); t->setImage(im); return t; } -class QDeclarativePixmapReader; -class QDeclarativePixmapData; -class QDeclarativePixmapReply : public QObject +class QQuickPixmapReader; +class QQuickPixmapData; +class QQuickPixmapReply : public QObject { Q_OBJECT public: enum ReadError { NoError, Loading, Decoding }; - QDeclarativePixmapReply(QDeclarativePixmapData *); - ~QDeclarativePixmapReply(); + QQuickPixmapReply(QQuickPixmapData *); + ~QQuickPixmapReply(); - QDeclarativePixmapData *data; - QDeclarativeEngine *engineForReader; // always access reader inside readerMutex + QQuickPixmapData *data; + QQmlEngine *engineForReader; // always access reader inside readerMutex QSize requestSize; QUrl url; @@ -104,16 +104,16 @@ public: class Event : public QEvent { public: - Event(ReadError, const QString &, const QSize &, QDeclarativeTextureFactory *factory, const QImage &image); + Event(ReadError, const QString &, const QSize &, QQuickTextureFactory *factory, const QImage &image); ReadError error; QString errorString; QSize implicitSize; QImage image; - QDeclarativeTextureFactory *textureFactory; + QQuickTextureFactory *textureFactory; }; void postReply(ReadError, const QString &, const QSize &, const QImage &image); - void postReply(ReadError, const QString &, const QSize &, QDeclarativeTextureFactory *factory, const QImage &image); + void postReply(ReadError, const QString &, const QSize &, QQuickTextureFactory *factory, const QImage &image); Q_SIGNALS: @@ -124,118 +124,118 @@ protected: bool event(QEvent *event); private: - Q_DISABLE_COPY(QDeclarativePixmapReply) + Q_DISABLE_COPY(QQuickPixmapReply) public: static int finishedIndex; static int downloadProgressIndex; }; -class QDeclarativePixmapReaderThreadObject : public QObject { +class QQuickPixmapReaderThreadObject : public QObject { Q_OBJECT public: - QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *); + QQuickPixmapReaderThreadObject(QQuickPixmapReader *); void processJobs(); virtual bool event(QEvent *e); private slots: void networkRequestDone(); private: - QDeclarativePixmapReader *reader; + QQuickPixmapReader *reader; }; -class QDeclarativePixmapData; -class QDeclarativePixmapReader : public QThread +class QQuickPixmapData; +class QQuickPixmapReader : public QThread { Q_OBJECT public: - QDeclarativePixmapReader(QDeclarativeEngine *eng); - ~QDeclarativePixmapReader(); + QQuickPixmapReader(QQmlEngine *eng); + ~QQuickPixmapReader(); - QDeclarativePixmapReply *getImage(QDeclarativePixmapData *); - void cancel(QDeclarativePixmapReply *rep); + QQuickPixmapReply *getImage(QQuickPixmapData *); + void cancel(QQuickPixmapReply *rep); - static QDeclarativePixmapReader *instance(QDeclarativeEngine *engine); - static QDeclarativePixmapReader *existingInstance(QDeclarativeEngine *engine); + static QQuickPixmapReader *instance(QQmlEngine *engine); + static QQuickPixmapReader *existingInstance(QQmlEngine *engine); protected: void run(); private: - friend class QDeclarativePixmapReaderThreadObject; + friend class QQuickPixmapReaderThreadObject; void processJobs(); - void processJob(QDeclarativePixmapReply *, const QUrl &, const QSize &); + void processJob(QQuickPixmapReply *, const QUrl &, const QSize &); void networkRequestDone(QNetworkReply *); - QList<QDeclarativePixmapReply*> jobs; - QList<QDeclarativePixmapReply*> cancelled; - QDeclarativeEngine *engine; + QList<QQuickPixmapReply*> jobs; + QList<QQuickPixmapReply*> cancelled; + QQmlEngine *engine; QObject *eventLoopQuitHack; QMutex mutex; - QDeclarativePixmapReaderThreadObject *threadObject; + QQuickPixmapReaderThreadObject *threadObject; QWaitCondition waitCondition; QNetworkAccessManager *networkAccessManager(); QNetworkAccessManager *accessManager; - QHash<QNetworkReply*,QDeclarativePixmapReply*> replies; + QHash<QNetworkReply*,QQuickPixmapReply*> replies; static int replyDownloadProgress; static int replyFinished; static int downloadProgress; static int threadNetworkRequestDone; - static QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> readers; + static QHash<QQmlEngine *,QQuickPixmapReader*> readers; public: static QMutex readerMutex; }; -class QDeclarativePixmapData +class QQuickPixmapData { public: - QDeclarativePixmapData(QDeclarativePixmap *pixmap, const QUrl &u, const QSize &s, const QString &e) - : refCount(1), inCache(false), pixmapStatus(QDeclarativePixmap::Error), + QQuickPixmapData(QQuickPixmap *pixmap, const QUrl &u, const QSize &s, const QString &e) + : refCount(1), inCache(false), pixmapStatus(QQuickPixmap::Error), url(u), errorString(e), requestSize(s), textureFactory(0), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0), nextUnreferenced(0) { declarativePixmaps.insert(pixmap); } - QDeclarativePixmapData(QDeclarativePixmap *pixmap, const QUrl &u, const QSize &r) - : refCount(1), inCache(false), pixmapStatus(QDeclarativePixmap::Loading), + QQuickPixmapData(QQuickPixmap *pixmap, const QUrl &u, const QSize &r) + : refCount(1), inCache(false), pixmapStatus(QQuickPixmap::Loading), url(u), requestSize(r), textureFactory(0), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0), nextUnreferenced(0) { declarativePixmaps.insert(pixmap); } - QDeclarativePixmapData(QDeclarativePixmap *pixmap, const QUrl &u, const QImage &p, const QSize &s, const QSize &r) - : refCount(1), inCache(false), privatePixmap(false), pixmapStatus(QDeclarativePixmap::Ready), - url(u), image(p), implicitSize(s), requestSize(r), textureFactory(new QDeclarativeDefaultTextureFactory(p)), reply(0), prevUnreferenced(0), + QQuickPixmapData(QQuickPixmap *pixmap, const QUrl &u, const QImage &p, const QSize &s, const QSize &r) + : refCount(1), inCache(false), privatePixmap(false), pixmapStatus(QQuickPixmap::Ready), + url(u), image(p), implicitSize(s), requestSize(r), textureFactory(new QQuickDefaultTextureFactory(p)), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0), nextUnreferenced(0) { declarativePixmaps.insert(pixmap); } - QDeclarativePixmapData(QDeclarativePixmap *pixmap, const QUrl &u, QDeclarativeTextureFactory *factory, const QImage &p, const QSize &s, const QSize &r) - : refCount(1), inCache(false), privatePixmap(false), pixmapStatus(QDeclarativePixmap::Ready), + QQuickPixmapData(QQuickPixmap *pixmap, const QUrl &u, QQuickTextureFactory *factory, const QImage &p, const QSize &s, const QSize &r) + : refCount(1), inCache(false), privatePixmap(false), pixmapStatus(QQuickPixmap::Ready), url(u), image(p), implicitSize(s), requestSize(r), textureFactory(factory), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0), nextUnreferenced(0) { declarativePixmaps.insert(pixmap); } - QDeclarativePixmapData(QDeclarativePixmap *pixmap, const QImage &p) - : refCount(1), inCache(false), privatePixmap(true), pixmapStatus(QDeclarativePixmap::Ready), - image(p), implicitSize(p.size()), requestSize(p.size()), textureFactory(new QDeclarativeDefaultTextureFactory(p)), reply(0), prevUnreferenced(0), + QQuickPixmapData(QQuickPixmap *pixmap, const QImage &p) + : refCount(1), inCache(false), privatePixmap(true), pixmapStatus(QQuickPixmap::Ready), + image(p), implicitSize(p.size()), requestSize(p.size()), textureFactory(new QQuickDefaultTextureFactory(p)), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0), nextUnreferenced(0) { declarativePixmaps.insert(pixmap); } - ~QDeclarativePixmapData() + ~QQuickPixmapData() { while (!declarativePixmaps.isEmpty()) { - QDeclarativePixmap *referencer = declarativePixmaps.first(); + QQuickPixmap *referencer = declarativePixmaps.first(); declarativePixmaps.remove(referencer); referencer->d = 0; } @@ -253,61 +253,61 @@ public: bool inCache:1; bool privatePixmap:1; - QDeclarativePixmap::Status pixmapStatus; + QQuickPixmap::Status pixmapStatus; QUrl url; QString errorString; QImage image; QSize implicitSize; QSize requestSize; - QDeclarativeTextureFactory *textureFactory; + QQuickTextureFactory *textureFactory; - QIntrusiveList<QDeclarativePixmap, &QDeclarativePixmap::dataListNode> declarativePixmaps; - QDeclarativePixmapReply *reply; + QIntrusiveList<QQuickPixmap, &QQuickPixmap::dataListNode> declarativePixmaps; + QQuickPixmapReply *reply; - QDeclarativePixmapData *prevUnreferenced; - QDeclarativePixmapData**prevUnreferencedPtr; - QDeclarativePixmapData *nextUnreferenced; + QQuickPixmapData *prevUnreferenced; + QQuickPixmapData**prevUnreferencedPtr; + QQuickPixmapData *nextUnreferenced; }; -int QDeclarativePixmapReply::finishedIndex = -1; -int QDeclarativePixmapReply::downloadProgressIndex = -1; +int QQuickPixmapReply::finishedIndex = -1; +int QQuickPixmapReply::downloadProgressIndex = -1; // XXX -QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> QDeclarativePixmapReader::readers; -QMutex QDeclarativePixmapReader::readerMutex; +QHash<QQmlEngine *,QQuickPixmapReader*> QQuickPixmapReader::readers; +QMutex QQuickPixmapReader::readerMutex; -int QDeclarativePixmapReader::replyDownloadProgress = -1; -int QDeclarativePixmapReader::replyFinished = -1; -int QDeclarativePixmapReader::downloadProgress = -1; -int QDeclarativePixmapReader::threadNetworkRequestDone = -1; +int QQuickPixmapReader::replyDownloadProgress = -1; +int QQuickPixmapReader::replyFinished = -1; +int QQuickPixmapReader::downloadProgress = -1; +int QQuickPixmapReader::threadNetworkRequestDone = -1; -void QDeclarativePixmapReply::postReply(ReadError error, const QString &errorString, +void QQuickPixmapReply::postReply(ReadError error, const QString &errorString, const QSize &implicitSize, const QImage &image) { loading = false; - QCoreApplication::postEvent(this, new Event(error, errorString, implicitSize, new QDeclarativeDefaultTextureFactory(image), image)); + QCoreApplication::postEvent(this, new Event(error, errorString, implicitSize, new QQuickDefaultTextureFactory(image), image)); } -void QDeclarativePixmapReply::postReply(ReadError error, const QString &errorString, - const QSize &implicitSize, QDeclarativeTextureFactory *factory, +void QQuickPixmapReply::postReply(ReadError error, const QString &errorString, + const QSize &implicitSize, QQuickTextureFactory *factory, const QImage &image) { loading = false; QCoreApplication::postEvent(this, new Event(error, errorString, implicitSize, factory, image)); } -QDeclarativePixmapReply::Event::Event(ReadError e, const QString &s, const QSize &iSize, QDeclarativeTextureFactory *factory, const QImage &i) +QQuickPixmapReply::Event::Event(ReadError e, const QString &s, const QSize &iSize, QQuickTextureFactory *factory, const QImage &i) : QEvent(QEvent::User), error(e), errorString(s), implicitSize(iSize), image(i), textureFactory(factory) { } -QNetworkAccessManager *QDeclarativePixmapReader::networkAccessManager() +QNetworkAccessManager *QQuickPixmapReader::networkAccessManager() { if (!accessManager) { Q_ASSERT(threadObject); - accessManager = QDeclarativeEnginePrivate::get(engine)->createNetworkAccessManager(threadObject); + accessManager = QQmlEnginePrivate::get(engine)->createNetworkAccessManager(threadObject); } return accessManager; } @@ -350,13 +350,13 @@ static bool readImage(const QUrl& url, QIODevice *dev, QImage *image, QString *e return true; } else { if (errorString) - *errorString = QDeclarativePixmap::tr("Error decoding: %1: %2").arg(url.toString()) + *errorString = QQuickPixmap::tr("Error decoding: %1: %2").arg(url.toString()) .arg(imgio.errorString()); return false; } } -QDeclarativePixmapReader::QDeclarativePixmapReader(QDeclarativeEngine *eng) +QQuickPixmapReader::QQuickPixmapReader(QQmlEngine *eng) : QThread(eng), engine(eng), threadObject(0), accessManager(0) { eventLoopQuitHack = new QObject; @@ -365,7 +365,7 @@ QDeclarativePixmapReader::QDeclarativePixmapReader(QDeclarativeEngine *eng) start(QThread::LowestPriority); } -QDeclarativePixmapReader::~QDeclarativePixmapReader() +QQuickPixmapReader::~QQuickPixmapReader() { readerMutex.lock(); readers.remove(engine); @@ -373,12 +373,12 @@ QDeclarativePixmapReader::~QDeclarativePixmapReader() mutex.lock(); // manually cancel all outstanding jobs. - foreach (QDeclarativePixmapReply *reply, jobs) { + foreach (QQuickPixmapReply *reply, jobs) { delete reply; } jobs.clear(); - QList<QDeclarativePixmapReply*> activeJobs = replies.values(); - foreach (QDeclarativePixmapReply *reply, activeJobs) { + QList<QQuickPixmapReply*> activeJobs = replies.values(); + foreach (QQuickPixmapReply *reply, activeJobs) { if (reply->loading) { cancelled.append(reply); reply->data = 0; @@ -391,9 +391,9 @@ QDeclarativePixmapReader::~QDeclarativePixmapReader() wait(); } -void QDeclarativePixmapReader::networkRequestDone(QNetworkReply *reply) +void QQuickPixmapReader::networkRequestDone(QNetworkReply *reply) { - QDeclarativePixmapReply *job = replies.take(reply); + QQuickPixmapReply *job = replies.take(reply); if (job) { job->redirectCount++; @@ -416,23 +416,23 @@ void QDeclarativePixmapReader::networkRequestDone(QNetworkReply *reply) } QImage image; - QDeclarativePixmapReply::ReadError error = QDeclarativePixmapReply::NoError; + QQuickPixmapReply::ReadError error = QQuickPixmapReply::NoError; QString errorString; QSize readSize; if (reply->error()) { - error = QDeclarativePixmapReply::Loading; + error = QQuickPixmapReply::Loading; errorString = reply->errorString(); } else { QByteArray all = reply->readAll(); QBuffer buff(&all); buff.open(QIODevice::ReadOnly); if (!readImage(reply->url(), &buff, &image, &errorString, &readSize, job->requestSize)) - error = QDeclarativePixmapReply::Decoding; + error = QQuickPixmapReply::Decoding; } - // send completion event to the QDeclarativePixmapReply + // send completion event to the QQuickPixmapReply mutex.lock(); if (!cancelled.contains(job)) { - QDeclarativeTextureFactory *factory = QSGContext::createTextureFactoryFromImage(image); + QQuickTextureFactory *factory = QSGContext::createTextureFactoryFromImage(image); if (factory) job->postReply(error, errorString, readSize, factory, image); else @@ -446,17 +446,17 @@ void QDeclarativePixmapReader::networkRequestDone(QNetworkReply *reply) threadObject->processJobs(); } -QDeclarativePixmapReaderThreadObject::QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *i) +QQuickPixmapReaderThreadObject::QQuickPixmapReaderThreadObject(QQuickPixmapReader *i) : reader(i) { } -void QDeclarativePixmapReaderThreadObject::processJobs() +void QQuickPixmapReaderThreadObject::processJobs() { QCoreApplication::postEvent(this, new QEvent(QEvent::User)); } -bool QDeclarativePixmapReaderThreadObject::event(QEvent *e) +bool QQuickPixmapReaderThreadObject::event(QEvent *e) { if (e->type() == QEvent::User) { reader->processJobs(); @@ -466,13 +466,13 @@ bool QDeclarativePixmapReaderThreadObject::event(QEvent *e) } } -void QDeclarativePixmapReaderThreadObject::networkRequestDone() +void QQuickPixmapReaderThreadObject::networkRequestDone() { QNetworkReply *reply = static_cast<QNetworkReply *>(sender()); reader->networkRequestDone(reply); } -void QDeclarativePixmapReader::processJobs() +void QQuickPixmapReader::processJobs() { QMutexLocker locker(&mutex); @@ -483,7 +483,7 @@ void QDeclarativePixmapReader::processJobs() // Clean cancelled jobs if (cancelled.count()) { for (int i = 0; i < cancelled.count(); ++i) { - QDeclarativePixmapReply *job = cancelled.at(i); + QQuickPixmapReply *job = cancelled.at(i); QNetworkReply *reply = replies.key(job, 0); if (reply && reply->isRunning()) { // cancel any jobs already started @@ -497,7 +497,7 @@ void QDeclarativePixmapReader::processJobs() } if (!jobs.isEmpty() && replies.count() < IMAGEREQUEST_MAX_REQUEST_COUNT) { - QDeclarativePixmapReply *runningJob = jobs.takeLast(); + QQuickPixmapReply *runningJob = jobs.takeLast(); runningJob->loading = true; QUrl url = runningJob->url; @@ -509,34 +509,34 @@ void QDeclarativePixmapReader::processJobs() } } -void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, const QUrl &url, +void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &url, const QSize &requestSize) { // fetch if (url.scheme() == QLatin1String("image")) { // Use QmlImageProvider QSize readSize; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); - QDeclarativeImageProvider::ImageType imageType = ep->getImageProviderType(url); - if (imageType == QDeclarativeImageProvider::Invalid) { - QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::Loading; - QString errorStr = QDeclarativePixmap::tr("Invalid image provider: %1").arg(url.toString()); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); + QQmlImageProvider::ImageType imageType = ep->getImageProviderType(url); + if (imageType == QQmlImageProvider::Invalid) { + QQuickPixmapReply::ReadError errorCode = QQuickPixmapReply::Loading; + QString errorStr = QQuickPixmap::tr("Invalid image provider: %1").arg(url.toString()); QImage image; mutex.lock(); if (!cancelled.contains(runningJob)) runningJob->postReply(errorCode, errorStr, readSize, image); mutex.unlock(); - } else if (imageType == QDeclarativeImageProvider::Image) { + } else if (imageType == QQmlImageProvider::Image) { QImage image = ep->getImageFromProvider(url, &readSize, requestSize); - QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::NoError; + QQuickPixmapReply::ReadError errorCode = QQuickPixmapReply::NoError; QString errorStr; if (image.isNull()) { - errorCode = QDeclarativePixmapReply::Loading; - errorStr = QDeclarativePixmap::tr("Failed to get image from provider: %1").arg(url.toString()); + errorCode = QQuickPixmapReply::Loading; + errorStr = QQuickPixmap::tr("Failed to get image from provider: %1").arg(url.toString()); } mutex.lock(); if (!cancelled.contains(runningJob)) { - QDeclarativeTextureFactory *factory = QSGContext::createTextureFactoryFromImage(image); + QQuickTextureFactory *factory = QSGContext::createTextureFactoryFromImage(image); if (factory) runningJob->postReply(errorCode, errorStr, readSize, factory, image); else @@ -545,12 +545,12 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c mutex.unlock(); } else { - QDeclarativeTextureFactory *t = ep->getTextureFromProvider(url, &readSize, requestSize); - QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::NoError; + QQuickTextureFactory *t = ep->getTextureFromProvider(url, &readSize, requestSize); + QQuickPixmapReply::ReadError errorCode = QQuickPixmapReply::NoError; QString errorStr; if (!t) { - errorCode = QDeclarativePixmapReply::Loading; - errorStr = QDeclarativePixmap::tr("Failed to get texture from provider: %1").arg(url.toString()); + errorCode = QQuickPixmapReply::Loading; + errorStr = QQuickPixmap::tr("Failed to get texture from provider: %1").arg(url.toString()); } mutex.lock(); if (!cancelled.contains(runningJob)) @@ -560,24 +560,24 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c } } else { - QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); + QString lf = QQmlEnginePrivate::urlToLocalFileOrQrc(url); if (!lf.isEmpty()) { // Image is local - load/decode immediately QImage image; - QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::NoError; + QQuickPixmapReply::ReadError errorCode = QQuickPixmapReply::NoError; QString errorStr; QFile f(lf); QSize readSize; if (f.open(QIODevice::ReadOnly)) { if (!readImage(url, &f, &image, &errorStr, &readSize, requestSize)) - errorCode = QDeclarativePixmapReply::Loading; + errorCode = QQuickPixmapReply::Loading; } else { - errorStr = QDeclarativePixmap::tr("Cannot open: %1").arg(url.toString()); - errorCode = QDeclarativePixmapReply::Loading; + errorStr = QQuickPixmap::tr("Cannot open: %1").arg(url.toString()); + errorCode = QQuickPixmapReply::Loading; } mutex.lock(); if (!cancelled.contains(runningJob)) { - QDeclarativeTextureFactory *factory = QSGContext::createTextureFactoryFromImage(image); + QQuickTextureFactory *factory = QSGContext::createTextureFactoryFromImage(image); if (factory) runningJob->postReply(errorCode, errorStr, readSize, factory, image); else @@ -598,28 +598,28 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c } } -QDeclarativePixmapReader *QDeclarativePixmapReader::instance(QDeclarativeEngine *engine) +QQuickPixmapReader *QQuickPixmapReader::instance(QQmlEngine *engine) { // XXX NOTE: must be called within readerMutex locking. - QDeclarativePixmapReader *reader = readers.value(engine); + QQuickPixmapReader *reader = readers.value(engine); if (!reader) { - reader = new QDeclarativePixmapReader(engine); + reader = new QQuickPixmapReader(engine); readers.insert(engine, reader); } return reader; } -QDeclarativePixmapReader *QDeclarativePixmapReader::existingInstance(QDeclarativeEngine *engine) +QQuickPixmapReader *QQuickPixmapReader::existingInstance(QQmlEngine *engine) { // XXX NOTE: must be called within readerMutex locking. return readers.value(engine, 0); } -QDeclarativePixmapReply *QDeclarativePixmapReader::getImage(QDeclarativePixmapData *data) +QQuickPixmapReply *QQuickPixmapReader::getImage(QQuickPixmapData *data) { mutex.lock(); - QDeclarativePixmapReply *reply = new QDeclarativePixmapReply(data); + QQuickPixmapReply *reply = new QQuickPixmapReply(data); reply->engineForReader = engine; jobs.append(reply); // XXX @@ -628,7 +628,7 @@ QDeclarativePixmapReply *QDeclarativePixmapReader::getImage(QDeclarativePixmapDa return reply; } -void QDeclarativePixmapReader::cancel(QDeclarativePixmapReply *reply) +void QQuickPixmapReader::cancel(QQuickPixmapReply *reply) { mutex.lock(); if (reply->loading) { @@ -643,12 +643,12 @@ void QDeclarativePixmapReader::cancel(QDeclarativePixmapReply *reply) mutex.unlock(); } -void QDeclarativePixmapReader::run() +void QQuickPixmapReader::run() { if (replyDownloadProgress == -1) { const QMetaObject *nr = &QNetworkReply::staticMetaObject; - const QMetaObject *pr = &QDeclarativePixmapReply::staticMetaObject; - const QMetaObject *ir = &QDeclarativePixmapReaderThreadObject::staticMetaObject; + const QMetaObject *pr = &QQuickPixmapReply::staticMetaObject; + const QMetaObject *ir = &QQuickPixmapReaderThreadObject::staticMetaObject; replyDownloadProgress = nr->indexOfSignal("downloadProgress(qint64,qint64)"); replyFinished = nr->indexOfSignal("finished()"); downloadProgress = pr->indexOfSignal("downloadProgress(qint64,qint64)"); @@ -656,7 +656,7 @@ void QDeclarativePixmapReader::run() } mutex.lock(); - threadObject = new QDeclarativePixmapReaderThreadObject(this); + threadObject = new QQuickPixmapReaderThreadObject(this); mutex.unlock(); processJobs(); @@ -666,34 +666,34 @@ void QDeclarativePixmapReader::run() threadObject = 0; } -class QDeclarativePixmapKey +class QQuickPixmapKey { public: const QUrl *url; const QSize *size; }; -inline bool operator==(const QDeclarativePixmapKey &lhs, const QDeclarativePixmapKey &rhs) +inline bool operator==(const QQuickPixmapKey &lhs, const QQuickPixmapKey &rhs) { return *lhs.size == *rhs.size && *lhs.url == *rhs.url; } -inline uint qHash(const QDeclarativePixmapKey &key) +inline uint qHash(const QQuickPixmapKey &key) { return qHash(*key.url) ^ key.size->width() ^ key.size->height(); } class QSGContext; -class QDeclarativePixmapStore : public QObject +class QQuickPixmapStore : public QObject { Q_OBJECT public: - QDeclarativePixmapStore(); - ~QDeclarativePixmapStore(); + QQuickPixmapStore(); + ~QQuickPixmapStore(); - void unreferencePixmap(QDeclarativePixmapData *); - void referencePixmap(QDeclarativePixmapData *); + void unreferencePixmap(QQuickPixmapData *); + void referencePixmap(QQuickPixmapData *); void purgeCache(); @@ -701,32 +701,32 @@ protected: virtual void timerEvent(QTimerEvent *); public: - QHash<QDeclarativePixmapKey, QDeclarativePixmapData *> m_cache; + QHash<QQuickPixmapKey, QQuickPixmapData *> m_cache; private: void shrinkCache(int remove); - QDeclarativePixmapData *m_unreferencedPixmaps; - QDeclarativePixmapData *m_lastUnreferencedPixmap; + QQuickPixmapData *m_unreferencedPixmaps; + QQuickPixmapData *m_lastUnreferencedPixmap; int m_unreferencedCost; int m_timerId; bool m_destroying; }; -Q_GLOBAL_STATIC(QDeclarativePixmapStore, pixmapStore); +Q_GLOBAL_STATIC(QQuickPixmapStore, pixmapStore); -QDeclarativePixmapStore::QDeclarativePixmapStore() +QQuickPixmapStore::QQuickPixmapStore() : m_unreferencedPixmaps(0), m_lastUnreferencedPixmap(0), m_unreferencedCost(0), m_timerId(-1), m_destroying(false) { } -QDeclarativePixmapStore::~QDeclarativePixmapStore() +QQuickPixmapStore::~QQuickPixmapStore() { m_destroying = true; int leakedPixmaps = 0; - QList<QDeclarativePixmapData*> cachedData = m_cache.values(); + QList<QQuickPixmapData*> cachedData = m_cache.values(); // Prevent unreferencePixmap() from assuming it needs to kick // off the cache expiry timer, as we're shrinking the cache @@ -734,7 +734,7 @@ QDeclarativePixmapStore::~QDeclarativePixmapStore() m_timerId = -2; // unreference all (leaked) pixmaps - foreach (QDeclarativePixmapData* pixmap, cachedData) { + foreach (QQuickPixmapData* pixmap, cachedData) { int currRefCount = pixmap->refCount; if (currRefCount) { leakedPixmaps++; @@ -754,7 +754,7 @@ QDeclarativePixmapStore::~QDeclarativePixmapStore() qDebug("Number of leaked pixmaps: %i", leakedPixmaps); } -void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data) +void QQuickPixmapStore::unreferencePixmap(QQuickPixmapData *data) { Q_ASSERT(data->prevUnreferenced == 0); Q_ASSERT(data->prevUnreferencedPtr == 0); @@ -780,7 +780,7 @@ void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data) m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000); } -void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data) +void QQuickPixmapStore::referencePixmap(QQuickPixmapData *data) { Q_ASSERT(data->prevUnreferencedPtr); @@ -799,10 +799,10 @@ void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data) m_unreferencedCost -= data->cost(); } -void QDeclarativePixmapStore::shrinkCache(int remove) +void QQuickPixmapStore::shrinkCache(int remove) { while ((remove > 0 || m_unreferencedCost > cache_limit) && m_lastUnreferencedPixmap) { - QDeclarativePixmapData *data = m_lastUnreferencedPixmap; + QQuickPixmapData *data = m_lastUnreferencedPixmap; Q_ASSERT(data->nextUnreferenced == 0); *data->prevUnreferencedPtr = 0; @@ -817,7 +817,7 @@ void QDeclarativePixmapStore::shrinkCache(int remove) } } -void QDeclarativePixmapStore::timerEvent(QTimerEvent *) +void QQuickPixmapStore::timerEvent(QTimerEvent *) { int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION; @@ -829,38 +829,38 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *) } } -void QDeclarativePixmapStore::purgeCache() +void QQuickPixmapStore::purgeCache() { shrinkCache(m_unreferencedCost); } -void QDeclarativePixmap::purgeCache() +void QQuickPixmap::purgeCache() { pixmapStore()->purgeCache(); } -QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d) +QQuickPixmapReply::QQuickPixmapReply(QQuickPixmapData *d) : data(d), engineForReader(0), requestSize(d->requestSize), url(d->url), loading(false), redirectCount(0) { if (finishedIndex == -1) { - finishedIndex = QDeclarativePixmapReply::staticMetaObject.indexOfSignal("finished()"); - downloadProgressIndex = QDeclarativePixmapReply::staticMetaObject.indexOfSignal("downloadProgress(qint64,qint64)"); + finishedIndex = QQuickPixmapReply::staticMetaObject.indexOfSignal("finished()"); + downloadProgressIndex = QQuickPixmapReply::staticMetaObject.indexOfSignal("downloadProgress(qint64,qint64)"); } } -QDeclarativePixmapReply::~QDeclarativePixmapReply() +QQuickPixmapReply::~QQuickPixmapReply() { } -bool QDeclarativePixmapReply::event(QEvent *event) +bool QQuickPixmapReply::event(QEvent *event) { if (event->type() == QEvent::User) { if (data) { Event *de = static_cast<Event *>(event); - data->pixmapStatus = (de->error == NoError) ? QDeclarativePixmap::Ready : QDeclarativePixmap::Error; + data->pixmapStatus = (de->error == NoError) ? QQuickPixmap::Ready : QQuickPixmap::Error; - if (data->pixmapStatus == QDeclarativePixmap::Ready) { + if (data->pixmapStatus == QQuickPixmap::Ready) { if (de->textureFactory) { data->textureFactory = de->textureFactory; } @@ -882,37 +882,37 @@ bool QDeclarativePixmapReply::event(QEvent *event) } } -int QDeclarativePixmapData::cost() const +int QQuickPixmapData::cost() const { if (textureFactory) return textureFactory->textureByteCount(); return image.byteCount(); } -void QDeclarativePixmapData::addref() +void QQuickPixmapData::addref() { ++refCount; if (prevUnreferencedPtr) pixmapStore()->referencePixmap(this); } -void QDeclarativePixmapData::release() +void QQuickPixmapData::release() { Q_ASSERT(refCount > 0); --refCount; if (refCount == 0) { if (reply) { - QDeclarativePixmapReply *cancelReply = reply; + QQuickPixmapReply *cancelReply = reply; reply->data = 0; reply = 0; - QDeclarativePixmapReader::readerMutex.lock(); - QDeclarativePixmapReader *reader = QDeclarativePixmapReader::existingInstance(cancelReply->engineForReader); + QQuickPixmapReader::readerMutex.lock(); + QQuickPixmapReader *reader = QQuickPixmapReader::existingInstance(cancelReply->engineForReader); if (reader) reader->cancel(cancelReply); - QDeclarativePixmapReader::readerMutex.unlock(); + QQuickPixmapReader::readerMutex.unlock(); } - if (pixmapStatus == QDeclarativePixmap::Ready) { + if (pixmapStatus == QQuickPixmap::Ready) { pixmapStore()->unreferencePixmap(this); } else { removeFromCache(); @@ -921,68 +921,68 @@ void QDeclarativePixmapData::release() } } -void QDeclarativePixmapData::addToCache() +void QQuickPixmapData::addToCache() { if (!inCache) { - QDeclarativePixmapKey key = { &url, &requestSize }; + QQuickPixmapKey key = { &url, &requestSize }; pixmapStore()->m_cache.insert(key, this); inCache = true; } } -void QDeclarativePixmapData::removeFromCache() +void QQuickPixmapData::removeFromCache() { if (inCache) { - QDeclarativePixmapKey key = { &url, &requestSize }; + QQuickPixmapKey key = { &url, &requestSize }; pixmapStore()->m_cache.remove(key); inCache = false; } } -static QDeclarativePixmapData* createPixmapDataSync(QDeclarativePixmap *declarativePixmap, QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, bool *ok) +static QQuickPixmapData* createPixmapDataSync(QQuickPixmap *declarativePixmap, QQmlEngine *engine, const QUrl &url, const QSize &requestSize, bool *ok) { if (url.scheme() == QLatin1String("image")) { QSize readSize; - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); - QDeclarativeImageProvider::ImageType imageType = ep->getImageProviderType(url); + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); + QQmlImageProvider::ImageType imageType = ep->getImageProviderType(url); switch (imageType) { - case QDeclarativeImageProvider::Invalid: - return new QDeclarativePixmapData(declarativePixmap, url, requestSize, - QDeclarativePixmap::tr("Invalid image provider: %1").arg(url.toString())); - case QDeclarativeImageProvider::Texture: + case QQmlImageProvider::Invalid: + return new QQuickPixmapData(declarativePixmap, url, requestSize, + QQuickPixmap::tr("Invalid image provider: %1").arg(url.toString())); + case QQmlImageProvider::Texture: { - QDeclarativeTextureFactory *texture = ep->getTextureFromProvider(url, &readSize, requestSize); + QQuickTextureFactory *texture = ep->getTextureFromProvider(url, &readSize, requestSize); if (texture) { *ok = true; - return new QDeclarativePixmapData(declarativePixmap, url, texture, QImage(), readSize, requestSize); + return new QQuickPixmapData(declarativePixmap, url, texture, QImage(), readSize, requestSize); } } - case QDeclarativeImageProvider::Image: + case QQmlImageProvider::Image: { QImage image = ep->getImageFromProvider(url, &readSize, requestSize); if (!image.isNull()) { *ok = true; - return new QDeclarativePixmapData(declarativePixmap, url, image, readSize, requestSize); + return new QQuickPixmapData(declarativePixmap, url, image, readSize, requestSize); } } - case QDeclarativeImageProvider::Pixmap: + case QQmlImageProvider::Pixmap: { QPixmap pixmap = ep->getPixmapFromProvider(url, &readSize, requestSize); if (!pixmap.isNull()) { *ok = true; - return new QDeclarativePixmapData(declarativePixmap, url, pixmap.toImage(), readSize, requestSize); + return new QQuickPixmapData(declarativePixmap, url, pixmap.toImage(), readSize, requestSize); } } } // provider has bad image type, or provider returned null image - return new QDeclarativePixmapData(declarativePixmap, url, requestSize, - QDeclarativePixmap::tr("Failed to get image from provider: %1").arg(url.toString())); + return new QQuickPixmapData(declarativePixmap, url, requestSize, + QQuickPixmap::tr("Failed to get image from provider: %1").arg(url.toString())); } - QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); + QString localFile = QQmlEnginePrivate::urlToLocalFileOrQrc(url); if (localFile.isEmpty()) return 0; @@ -995,42 +995,42 @@ static QDeclarativePixmapData* createPixmapDataSync(QDeclarativePixmap *declarat if (readImage(url, &f, &image, &errorString, &readSize, requestSize)) { *ok = true; - return new QDeclarativePixmapData(declarativePixmap, url, image, readSize, requestSize); + return new QQuickPixmapData(declarativePixmap, url, image, readSize, requestSize); } - errorString = QDeclarativePixmap::tr("Invalid image data: %1").arg(url.toString()); + errorString = QQuickPixmap::tr("Invalid image data: %1").arg(url.toString()); } else { - errorString = QDeclarativePixmap::tr("Cannot open: %1").arg(url.toString()); + errorString = QQuickPixmap::tr("Cannot open: %1").arg(url.toString()); } - return new QDeclarativePixmapData(declarativePixmap, url, requestSize, errorString); + return new QQuickPixmapData(declarativePixmap, url, requestSize, errorString); } -struct QDeclarativePixmapNull { +struct QQuickPixmapNull { QUrl url; QImage image; QSize size; }; -Q_GLOBAL_STATIC(QDeclarativePixmapNull, nullPixmap); +Q_GLOBAL_STATIC(QQuickPixmapNull, nullPixmap); -QDeclarativePixmap::QDeclarativePixmap() +QQuickPixmap::QQuickPixmap() : d(0) { } -QDeclarativePixmap::QDeclarativePixmap(QDeclarativeEngine *engine, const QUrl &url) +QQuickPixmap::QQuickPixmap(QQmlEngine *engine, const QUrl &url) : d(0) { load(engine, url); } -QDeclarativePixmap::QDeclarativePixmap(QDeclarativeEngine *engine, const QUrl &url, const QSize &size) +QQuickPixmap::QQuickPixmap(QQmlEngine *engine, const QUrl &url, const QSize &size) : d(0) { load(engine, url, size); } -QDeclarativePixmap::~QDeclarativePixmap() +QQuickPixmap::~QQuickPixmap() { if (d) { d->declarativePixmaps.remove(this); @@ -1039,27 +1039,27 @@ QDeclarativePixmap::~QDeclarativePixmap() } } -bool QDeclarativePixmap::isNull() const +bool QQuickPixmap::isNull() const { return d == 0; } -bool QDeclarativePixmap::isReady() const +bool QQuickPixmap::isReady() const { return status() == Ready; } -bool QDeclarativePixmap::isError() const +bool QQuickPixmap::isError() const { return status() == Error; } -bool QDeclarativePixmap::isLoading() const +bool QQuickPixmap::isLoading() const { return status() == Loading; } -QString QDeclarativePixmap::error() const +QString QQuickPixmap::error() const { if (d) return d->errorString; @@ -1067,7 +1067,7 @@ QString QDeclarativePixmap::error() const return QString(); } -QDeclarativePixmap::Status QDeclarativePixmap::status() const +QQuickPixmap::Status QQuickPixmap::status() const { if (d) return d->pixmapStatus; @@ -1075,7 +1075,7 @@ QDeclarativePixmap::Status QDeclarativePixmap::status() const return Null; } -const QUrl &QDeclarativePixmap::url() const +const QUrl &QQuickPixmap::url() const { if (d) return d->url; @@ -1083,7 +1083,7 @@ const QUrl &QDeclarativePixmap::url() const return nullPixmap()->url; } -const QSize &QDeclarativePixmap::implicitSize() const +const QSize &QQuickPixmap::implicitSize() const { if (d) return d->implicitSize; @@ -1091,7 +1091,7 @@ const QSize &QDeclarativePixmap::implicitSize() const return nullPixmap()->size; } -const QSize &QDeclarativePixmap::requestSize() const +const QSize &QQuickPixmap::requestSize() const { if (d) return d->requestSize; @@ -1099,7 +1099,7 @@ const QSize &QDeclarativePixmap::requestSize() const return nullPixmap()->size; } -QDeclarativeTextureFactory *QDeclarativePixmap::textureFactory() const +QQuickTextureFactory *QQuickPixmap::textureFactory() const { if (d) return d->textureFactory; @@ -1107,7 +1107,7 @@ QDeclarativeTextureFactory *QDeclarativePixmap::textureFactory() const return 0; } -const QImage &QDeclarativePixmap::image() const +const QImage &QQuickPixmap::image() const { if (d) return d->image; @@ -1115,15 +1115,15 @@ const QImage &QDeclarativePixmap::image() const return nullPixmap()->image; } -void QDeclarativePixmap::setImage(const QImage &p) +void QQuickPixmap::setImage(const QImage &p) { clear(); if (!p.isNull()) - d = new QDeclarativePixmapData(this, p); + d = new QQuickPixmapData(this, p); } -int QDeclarativePixmap::width() const +int QQuickPixmap::width() const { if (d) return d->textureFactory ? d->textureFactory->textureSize().width() : d->image.width(); @@ -1131,7 +1131,7 @@ int QDeclarativePixmap::width() const return 0; } -int QDeclarativePixmap::height() const +int QQuickPixmap::height() const { if (d) return d->textureFactory ? d->textureFactory->textureSize().height() : d->image.height(); @@ -1139,7 +1139,7 @@ int QDeclarativePixmap::height() const return 0; } -QRect QDeclarativePixmap::rect() const +QRect QQuickPixmap::rect() const { if (d) return d->textureFactory ? QRect(QPoint(), d->textureFactory->textureSize()) : d->image.rect(); @@ -1147,22 +1147,22 @@ QRect QDeclarativePixmap::rect() const return QRect(); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url) +void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url) { - load(engine, url, QSize(), QDeclarativePixmap::Cache); + load(engine, url, QSize(), QQuickPixmap::Cache); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, QDeclarativePixmap::Options options) +void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, QQuickPixmap::Options options) { load(engine, url, QSize(), options); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &size) +void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &size) { - load(engine, url, size, QDeclarativePixmap::Cache); + load(engine, url, size, QQuickPixmap::Cache); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, QDeclarativePixmap::Options options) +void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &requestSize, QQuickPixmap::Options options) { if (d) { d->declarativePixmaps.remove(this); @@ -1170,25 +1170,25 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const d = 0; } - QDeclarativePixmapKey key = { &url, &requestSize }; - QDeclarativePixmapStore *store = pixmapStore(); + QQuickPixmapKey key = { &url, &requestSize }; + QQuickPixmapStore *store = pixmapStore(); - QHash<QDeclarativePixmapKey, QDeclarativePixmapData *>::Iterator iter = store->m_cache.find(key); + QHash<QQuickPixmapKey, QQuickPixmapData *>::Iterator iter = store->m_cache.find(key); if (iter == store->m_cache.end()) { - if (options & QDeclarativePixmap::Asynchronous) { + if (options & QQuickPixmap::Asynchronous) { // pixmaps can only be loaded synchronously if (url.scheme() == QLatin1String("image") - && QDeclarativeEnginePrivate::get(engine)->getImageProviderType(url) == QDeclarativeImageProvider::Pixmap) { - options &= ~QDeclarativePixmap::Asynchronous; + && QQmlEnginePrivate::get(engine)->getImageProviderType(url) == QQmlImageProvider::Pixmap) { + options &= ~QQuickPixmap::Asynchronous; } } - if (!(options & QDeclarativePixmap::Asynchronous)) { + if (!(options & QQuickPixmap::Asynchronous)) { bool ok = false; d = createPixmapDataSync(this, engine, url, requestSize, &ok); if (ok) { - if (options & QDeclarativePixmap::Cache) + if (options & QQuickPixmap::Cache) d->addToCache(); return; } @@ -1199,13 +1199,13 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const if (!engine) return; - d = new QDeclarativePixmapData(this, url, requestSize); - if (options & QDeclarativePixmap::Cache) + d = new QQuickPixmapData(this, url, requestSize); + if (options & QQuickPixmap::Cache) d->addToCache(); - QDeclarativePixmapReader::readerMutex.lock(); - d->reply = QDeclarativePixmapReader::instance(engine)->getImage(d); - QDeclarativePixmapReader::readerMutex.unlock(); + QQuickPixmapReader::readerMutex.lock(); + d->reply = QQuickPixmapReader::instance(engine)->getImage(d); + QQuickPixmapReader::readerMutex.unlock(); } else { d = *iter; d->addref(); @@ -1213,7 +1213,7 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const } } -void QDeclarativePixmap::clear() +void QQuickPixmap::clear() { if (d) { d->declarativePixmaps.remove(this); @@ -1222,7 +1222,7 @@ void QDeclarativePixmap::clear() } } -void QDeclarativePixmap::clear(QObject *obj) +void QQuickPixmap::clear(QObject *obj) { if (d) { if (d->reply) @@ -1233,46 +1233,46 @@ void QDeclarativePixmap::clear(QObject *obj) } } -bool QDeclarativePixmap::connectFinished(QObject *object, const char *method) +bool QQuickPixmap::connectFinished(QObject *object, const char *method) { if (!d || !d->reply) { - qWarning("QDeclarativePixmap: connectFinished() called when not loading."); + qWarning("QQuickPixmap: connectFinished() called when not loading."); return false; } return QObject::connect(d->reply, SIGNAL(finished()), object, method); } -bool QDeclarativePixmap::connectFinished(QObject *object, int method) +bool QQuickPixmap::connectFinished(QObject *object, int method) { if (!d || !d->reply) { - qWarning("QDeclarativePixmap: connectFinished() called when not loading."); + qWarning("QQuickPixmap: connectFinished() called when not loading."); return false; } - return QMetaObject::connect(d->reply, QDeclarativePixmapReply::finishedIndex, object, method); + return QMetaObject::connect(d->reply, QQuickPixmapReply::finishedIndex, object, method); } -bool QDeclarativePixmap::connectDownloadProgress(QObject *object, const char *method) +bool QQuickPixmap::connectDownloadProgress(QObject *object, const char *method) { if (!d || !d->reply) { - qWarning("QDeclarativePixmap: connectDownloadProgress() called when not loading."); + qWarning("QQuickPixmap: connectDownloadProgress() called when not loading."); return false; } return QObject::connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)), object, method); } -bool QDeclarativePixmap::connectDownloadProgress(QObject *object, int method) +bool QQuickPixmap::connectDownloadProgress(QObject *object, int method) { if (!d || !d->reply) { - qWarning("QDeclarativePixmap: connectDownloadProgress() called when not loading."); + qWarning("QQuickPixmap: connectDownloadProgress() called when not loading."); return false; } - return QMetaObject::connect(d->reply, QDeclarativePixmapReply::downloadProgressIndex, object, method); + return QMetaObject::connect(d->reply, QQuickPixmapReply::downloadProgressIndex, object, method); } QT_END_NAMESPACE -#include <qdeclarativepixmapcache.moc> +#include <qquickpixmapcache.moc> diff --git a/src/quick/util/qdeclarativepixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h index 69cd84c465..0b4c2fb473 100644 --- a/src/quick/util/qdeclarativepixmapcache_p.h +++ b/src/quick/util/qquickpixmapcache_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPIXMAPCACHE_H -#define QDECLARATIVEPIXMAPCACHE_H +#ifndef QQUICKPIXMAPCACHE_H +#define QQUICKPIXMAPCACHE_H #include <QtCore/qcoreapplication.h> #include <QtCore/qstring.h> @@ -49,21 +49,21 @@ #include <QtQuick/qtquickglobal.h> #include <private/qintrusivelist_p.h> -#include <qdeclarativeimageprovider.h> +#include <qqmlimageprovider.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativePixmapData; -class QDeclarativeTextureFactory; +class QQmlEngine; +class QQuickPixmapData; +class QQuickTextureFactory; -class QDeclarativeDefaultTextureFactory : public QDeclarativeTextureFactory +class QQuickDefaultTextureFactory : public QQuickTextureFactory { Q_OBJECT public: - QDeclarativeDefaultTextureFactory(const QImage &i) + QQuickDefaultTextureFactory(const QImage &i) : im(i) { } @@ -77,14 +77,14 @@ private: QImage im; }; -class Q_QUICK_EXPORT QDeclarativePixmap +class Q_QUICK_EXPORT QQuickPixmap { - Q_DECLARE_TR_FUNCTIONS(QDeclarativePixmap) + Q_DECLARE_TR_FUNCTIONS(QQuickPixmap) public: - QDeclarativePixmap(); - QDeclarativePixmap(QDeclarativeEngine *, const QUrl &); - QDeclarativePixmap(QDeclarativeEngine *, const QUrl &, const QSize &); - ~QDeclarativePixmap(); + QQuickPixmap(); + QQuickPixmap(QQmlEngine *, const QUrl &); + QQuickPixmap(QQmlEngine *, const QUrl &, const QSize &); + ~QQuickPixmap(); enum Status { Null, Ready, Error, Loading }; @@ -107,16 +107,16 @@ public: const QImage &image() const; void setImage(const QImage &); - QDeclarativeTextureFactory *textureFactory() const; + QQuickTextureFactory *textureFactory() const; QRect rect() const; int width() const; int height() const; - void load(QDeclarativeEngine *, const QUrl &); - void load(QDeclarativeEngine *, const QUrl &, QDeclarativePixmap::Options options); - void load(QDeclarativeEngine *, const QUrl &, const QSize &); - void load(QDeclarativeEngine *, const QUrl &, const QSize &, QDeclarativePixmap::Options options); + void load(QQmlEngine *, const QUrl &); + void load(QQmlEngine *, const QUrl &, QQuickPixmap::Options options); + void load(QQmlEngine *, const QUrl &, const QSize &); + void load(QQmlEngine *, const QUrl &, const QSize &, QQuickPixmap::Options options); void clear(); void clear(QObject *); @@ -129,16 +129,16 @@ public: static void purgeCache(); private: - Q_DISABLE_COPY(QDeclarativePixmap) - QDeclarativePixmapData *d; + Q_DISABLE_COPY(QQuickPixmap) + QQuickPixmapData *d; QIntrusiveListNode dataListNode; - friend class QDeclarativePixmapData; + friend class QQuickPixmapData; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePixmap::Options) +Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPixmap::Options) QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEPIXMAPCACHE_H +#endif // QQUICKPIXMAPCACHE_H diff --git a/src/quick/util/qdeclarativepropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index 350c84e737..83ddb2530e 100644 --- a/src/quick/util/qdeclarativepropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,22 +39,22 @@ ** ****************************************************************************/ -#include "qdeclarativepropertychanges_p.h" +#include "qquickpropertychanges_p.h" -#include <private/qdeclarativeopenmetaobject_p.h> -#include <private/qdeclarativerewrite_p.h> -#include <private/qdeclarativeengine_p.h> +#include <private/qqmlopenmetaobject_p.h> +#include <private/qqmlrewrite_p.h> +#include <private/qqmlengine_p.h> -#include <qdeclarativeinfo.h> -#include <private/qdeclarativecustomparser_p.h> -#include <private/qdeclarativescript_p.h> -#include <qdeclarativeexpression.h> -#include <private/qdeclarativebinding_p.h> -#include <qdeclarativecontext.h> -#include <private/qdeclarativeguard_p.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativecontext_p.h> -#include <private/qdeclarativestate_p_p.h> +#include <qqmlinfo.h> +#include <private/qqmlcustomparser_p.h> +#include <private/qqmlscript_p.h> +#include <qqmlexpression.h> +#include <private/qqmlbinding_p.h> +#include <qqmlcontext.h> +#include <private/qqmlguard_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlcontext_p.h> +#include <private/qquickstate_p_p.h> #include <QtCore/qdebug.h> @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE /*! - \qmlclass PropertyChanges QDeclarativePropertyChanges + \qmlclass PropertyChanges QQuickPropertyChanges \inqmlmodule QtQuick 2 \ingroup qml-state-elements \brief The PropertyChanges element describes new property bindings or values for a state. @@ -76,9 +76,9 @@ QT_BEGIN_NAMESPACE properties are to be modified, and define the new property values or bindings. For example: - \snippet doc/src/snippets/declarative/propertychanges.qml import + \snippet doc/src/snippets/qml/propertychanges.qml import \codeline - \snippet doc/src/snippets/declarative/propertychanges.qml 0 + \snippet doc/src/snippets/qml/propertychanges.qml 0 When the mouse is pressed, the \l Rectangle changes to the \e resized state. In this state, the PropertyChanges object sets the rectangle's @@ -112,7 +112,7 @@ QT_BEGIN_NAMESPACE state, its \c width property is reset, giving the text its natural width and displaying the whole string on a single line. - \snippet doc/src/snippets/declarative/propertychanges.qml reset + \snippet doc/src/snippets/qml/propertychanges.qml reset \section2 Immediate property changes in transitions @@ -127,7 +127,7 @@ QT_BEGIN_NAMESPACE See the PropertyAction documentation for more details. - \sa {declarative/animation/states}{states example}, {qmlstate}{States}, QtDeclarative + \sa {declarative/animation/states}{states example}, {qmlstate}{States}, QtQml */ /*! @@ -135,32 +135,32 @@ QT_BEGIN_NAMESPACE This property holds the object which contains the properties to be changed. */ -class QDeclarativeReplaceSignalHandler : public QDeclarativeActionEvent +class QQuickReplaceSignalHandler : public QQuickActionEvent { public: - QDeclarativeReplaceSignalHandler() : expression(0), reverseExpression(0), + QQuickReplaceSignalHandler() : expression(0), reverseExpression(0), rewindExpression(0), ownedExpression(0) {} - ~QDeclarativeReplaceSignalHandler() { + ~QQuickReplaceSignalHandler() { delete ownedExpression; } virtual EventType type() const { return SignalHandler; } - QDeclarativeProperty property; - QDeclarativeExpression *expression; - QDeclarativeExpression *reverseExpression; - QDeclarativeExpression *rewindExpression; - QDeclarativeGuard<QDeclarativeExpression> ownedExpression; + QQmlProperty property; + QQmlExpression *expression; + QQmlExpression *reverseExpression; + QQmlExpression *rewindExpression; + QQmlGuard<QQmlExpression> ownedExpression; virtual void execute(Reason) { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression); + ownedExpression = QQmlPropertyPrivate::setSignalExpression(property, expression); if (ownedExpression == expression) ownedExpression = 0; } virtual bool isReversable() { return true; } virtual void reverse(Reason) { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); + ownedExpression = QQmlPropertyPrivate::setSignalExpression(property, reverseExpression); if (ownedExpression == reverseExpression) ownedExpression = 0; } @@ -171,9 +171,9 @@ public: } virtual bool needsCopy() { return true; } - virtual void copyOriginals(QDeclarativeActionEvent *other) + virtual void copyOriginals(QQuickActionEvent *other) { - QDeclarativeReplaceSignalHandler *rsh = static_cast<QDeclarativeReplaceSignalHandler*>(other); + QQuickReplaceSignalHandler *rsh = static_cast<QQuickReplaceSignalHandler*>(other); saveCurrentValues(); if (rsh == this) return; @@ -185,34 +185,34 @@ public: } virtual void rewind() { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression); + ownedExpression = QQmlPropertyPrivate::setSignalExpression(property, rewindExpression); if (ownedExpression == rewindExpression) ownedExpression = 0; } virtual void saveCurrentValues() { - rewindExpression = QDeclarativePropertyPrivate::signalExpression(property); + rewindExpression = QQmlPropertyPrivate::signalExpression(property); } - virtual bool override(QDeclarativeActionEvent*other) { + virtual bool override(QQuickActionEvent*other) { if (other == this) return true; if (other->type() != type()) return false; - if (static_cast<QDeclarativeReplaceSignalHandler*>(other)->property == property) + if (static_cast<QQuickReplaceSignalHandler*>(other)->property == property) return true; return false; } }; -class QDeclarativePropertyChangesPrivate : public QDeclarativeStateOperationPrivate +class QQuickPropertyChangesPrivate : public QQuickStateOperationPrivate { - Q_DECLARE_PUBLIC(QDeclarativePropertyChanges) + Q_DECLARE_PUBLIC(QQuickPropertyChanges) public: - QDeclarativePropertyChangesPrivate() : decoded(true), restore(true), + QQuickPropertyChangesPrivate() : decoded(true), restore(true), isExplicit(false) {} - QDeclarativeGuard<QObject> object; + QQmlGuard<QObject> object; QByteArray data; bool decoded : 1; @@ -224,25 +224,25 @@ public: class ExpressionChange { public: ExpressionChange(const QString &_name, - QDeclarativeBinding::Identifier _id, - QDeclarativeExpression *_expr) + QQmlBinding::Identifier _id, + QQmlExpression *_expr) : name(_name), id(_id), expression(_expr) {} QString name; - QDeclarativeBinding::Identifier id; - QDeclarativeExpression *expression; + QQmlBinding::Identifier id; + QQmlExpression *expression; }; QList<QPair<QString, QVariant> > properties; QList<ExpressionChange> expressions; - QList<QDeclarativeReplaceSignalHandler*> signalReplacements; + QList<QQuickReplaceSignalHandler*> signalReplacements; - QDeclarativeProperty property(const QString &); + QQmlProperty property(const QString &); }; void -QDeclarativePropertyChangesParser::compileList(QList<QPair<QString, QVariant> > &list, +QQuickPropertyChangesParser::compileList(QList<QPair<QString, QVariant> > &list, const QString &pre, - const QDeclarativeCustomParserProperty &prop) + const QQmlCustomParserProperty &prop) { QString propName = pre + prop.name(); @@ -250,14 +250,14 @@ QDeclarativePropertyChangesParser::compileList(QList<QPair<QString, QVariant> > for (int ii = 0; ii < values.count(); ++ii) { const QVariant &value = values.at(ii); - if (value.userType() == qMetaTypeId<QDeclarativeCustomParserNode>()) { - error(qvariant_cast<QDeclarativeCustomParserNode>(value), - QDeclarativePropertyChanges::tr("PropertyChanges does not support creating state-specific objects.")); + if (value.userType() == qMetaTypeId<QQmlCustomParserNode>()) { + error(qvariant_cast<QQmlCustomParserNode>(value), + QQuickPropertyChanges::tr("PropertyChanges does not support creating state-specific objects.")); continue; - } else if(value.userType() == qMetaTypeId<QDeclarativeCustomParserProperty>()) { + } else if(value.userType() == qMetaTypeId<QQmlCustomParserProperty>()) { - QDeclarativeCustomParserProperty prop = - qvariant_cast<QDeclarativeCustomParserProperty>(value); + QQmlCustomParserProperty prop = + qvariant_cast<QQmlCustomParserProperty>(value); QString pre = propName + QLatin1Char('.'); compileList(list, pre, prop); @@ -268,7 +268,7 @@ QDeclarativePropertyChangesParser::compileList(QList<QPair<QString, QVariant> > } QByteArray -QDeclarativePropertyChangesParser::compile(const QList<QDeclarativeCustomParserProperty> &props) +QQuickPropertyChangesParser::compile(const QList<QQmlCustomParserProperty> &props) { QList<QPair<QString, QVariant> > data; for(int ii = 0; ii < props.count(); ++ii) @@ -279,22 +279,22 @@ QDeclarativePropertyChangesParser::compile(const QList<QDeclarativeCustomParserP ds << data.count(); for(int ii = 0; ii < data.count(); ++ii) { - QDeclarativeScript::Variant v = qvariant_cast<QDeclarativeScript::Variant>(data.at(ii).second); + QQmlScript::Variant v = qvariant_cast<QQmlScript::Variant>(data.at(ii).second); QVariant var; bool isScript = v.isScript(); - QDeclarativeBinding::Identifier id = 0; + QQmlBinding::Identifier id = 0; switch(v.type()) { - case QDeclarativeScript::Variant::Boolean: + case QQmlScript::Variant::Boolean: var = QVariant(v.asBoolean()); break; - case QDeclarativeScript::Variant::Number: + case QQmlScript::Variant::Number: var = QVariant(v.asNumber()); break; - case QDeclarativeScript::Variant::String: + case QQmlScript::Variant::String: var = QVariant(v.asString()); break; - case QDeclarativeScript::Variant::Invalid: - case QDeclarativeScript::Variant::Script: + case QQmlScript::Variant::Invalid: + case QQmlScript::Variant::Script: var = QVariant(v.asScript()); { // Pre-rewrite the expression @@ -311,9 +311,9 @@ QDeclarativePropertyChangesParser::compile(const QList<QDeclarativeCustomParserP return rv; } -void QDeclarativePropertyChangesPrivate::decode() +void QQuickPropertyChangesPrivate::decode() { - Q_Q(QDeclarativePropertyChanges); + Q_Q(QQuickPropertyChanges); if (decoded) return; @@ -325,26 +325,26 @@ void QDeclarativePropertyChangesPrivate::decode() QString name; bool isScript; QVariant data; - QDeclarativeBinding::Identifier id = QDeclarativeBinding::Invalid; + QQmlBinding::Identifier id = QQmlBinding::Invalid; ds >> name; ds >> isScript; ds >> data; if (isScript) ds >> id; - QDeclarativeProperty prop = property(name); //### better way to check for signal property? - if (prop.type() & QDeclarativeProperty::SignalProperty) { - QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(q), object, data.toString()); - QDeclarativeData *ddata = QDeclarativeData::get(q); + QQmlProperty prop = property(name); //### better way to check for signal property? + if (prop.type() & QQmlProperty::SignalProperty) { + QQmlExpression *expression = new QQmlExpression(qmlContext(q), object, data.toString()); + QQmlData *ddata = QQmlData::get(q); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber, ddata->columnNumber); - QDeclarativeReplaceSignalHandler *handler = new QDeclarativeReplaceSignalHandler; + QQuickReplaceSignalHandler *handler = new QQuickReplaceSignalHandler; handler->property = prop; handler->expression = expression; signalReplacements << handler; } else if (isScript) { - QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(q), object, data.toString()); - QDeclarativeData *ddata = QDeclarativeData::get(q); + QQmlExpression *expression = new QQmlExpression(qmlContext(q), object, data.toString()); + QQmlData *ddata = QQmlData::get(q); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber, ddata->columnNumber); expressions << ExpressionChange(name, id, expression); @@ -357,38 +357,38 @@ void QDeclarativePropertyChangesPrivate::decode() data.clear(); } -void QDeclarativePropertyChangesParser::setCustomData(QObject *object, +void QQuickPropertyChangesParser::setCustomData(QObject *object, const QByteArray &data) { - QDeclarativePropertyChangesPrivate *p = - static_cast<QDeclarativePropertyChangesPrivate *>(QObjectPrivate::get(object)); + QQuickPropertyChangesPrivate *p = + static_cast<QQuickPropertyChangesPrivate *>(QObjectPrivate::get(object)); p->data = data; p->decoded = false; } -QDeclarativePropertyChanges::QDeclarativePropertyChanges() -: QDeclarativeStateOperation(*(new QDeclarativePropertyChangesPrivate)) +QQuickPropertyChanges::QQuickPropertyChanges() +: QQuickStateOperation(*(new QQuickPropertyChangesPrivate)) { } -QDeclarativePropertyChanges::~QDeclarativePropertyChanges() +QQuickPropertyChanges::~QQuickPropertyChanges() { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); for(int ii = 0; ii < d->expressions.count(); ++ii) delete d->expressions.at(ii).expression; for(int ii = 0; ii < d->signalReplacements.count(); ++ii) delete d->signalReplacements.at(ii); } -QObject *QDeclarativePropertyChanges::object() const +QObject *QQuickPropertyChanges::object() const { - Q_D(const QDeclarativePropertyChanges); + Q_D(const QQuickPropertyChanges); return d->object; } -void QDeclarativePropertyChanges::setObject(QObject *o) +void QQuickPropertyChanges::setObject(QObject *o) { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); d->object = o; } @@ -401,36 +401,36 @@ void QDeclarativePropertyChanges::setObject(QObject *o) The default value is \c true. Setting this value to \c false creates a temporary state that has permanent effects on property values. */ -bool QDeclarativePropertyChanges::restoreEntryValues() const +bool QQuickPropertyChanges::restoreEntryValues() const { - Q_D(const QDeclarativePropertyChanges); + Q_D(const QQuickPropertyChanges); return d->restore; } -void QDeclarativePropertyChanges::setRestoreEntryValues(bool v) +void QQuickPropertyChanges::setRestoreEntryValues(bool v) { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); d->restore = v; } -QDeclarativeProperty -QDeclarativePropertyChangesPrivate::property(const QString &property) +QQmlProperty +QQuickPropertyChangesPrivate::property(const QString &property) { - Q_Q(QDeclarativePropertyChanges); - QDeclarativeProperty prop(object, property, qmlContext(q)); + Q_Q(QQuickPropertyChanges); + QQmlProperty prop(object, property, qmlContext(q)); if (!prop.isValid()) { - qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(property); - return QDeclarativeProperty(); - } else if (!(prop.type() & QDeclarativeProperty::SignalProperty) && !prop.isWritable()) { - qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(property); - return QDeclarativeProperty(); + qmlInfo(q) << QQuickPropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(property); + return QQmlProperty(); + } else if (!(prop.type() & QQmlProperty::SignalProperty) && !prop.isWritable()) { + qmlInfo(q) << QQuickPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(property); + return QQmlProperty(); } return prop; } -QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() +QQuickPropertyChanges::ActionList QQuickPropertyChanges::actions() { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); d->decode(); @@ -438,7 +438,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() for (int ii = 0; ii < d->properties.count(); ++ii) { - QDeclarativeAction a(d->object, d->properties.at(ii).first, + QQuickAction a(d->object, d->properties.at(ii).first, qmlContext(this), d->properties.at(ii).second); if (a.property.isValid()) { @@ -449,10 +449,10 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() for (int ii = 0; ii < d->signalReplacements.count(); ++ii) { - QDeclarativeReplaceSignalHandler *handler = d->signalReplacements.at(ii); + QQuickReplaceSignalHandler *handler = d->signalReplacements.at(ii); if (handler->property.isValid()) { - QDeclarativeAction a; + QQuickAction a; a.event = handler; list << a; } @@ -461,10 +461,10 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() for (int ii = 0; ii < d->expressions.count(); ++ii) { const QString &property = d->expressions.at(ii).name; - QDeclarativeProperty prop = d->property(property); + QQmlProperty prop = d->property(property); if (prop.isValid()) { - QDeclarativeAction a; + QQuickAction a; a.restore = restoreEntryValues(); a.property = prop; a.fromValue = a.property.read(); @@ -474,12 +474,12 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() if (d->isExplicit) { a.toValue = d->expressions.at(ii).expression->evaluate(); } else { - QDeclarativeExpression *e = d->expressions.at(ii).expression; + QQmlExpression *e = d->expressions.at(ii).expression; - QDeclarativeBinding::Identifier id = d->expressions.at(ii).id; - QDeclarativeBinding *newBinding = id != QDeclarativeBinding::Invalid ? QDeclarativeBinding::createBinding(id, object(), qmlContext(this), e->sourceFile(), e->lineNumber()) : 0; + QQmlBinding::Identifier id = d->expressions.at(ii).id; + QQmlBinding *newBinding = id != QQmlBinding::Invalid ? QQmlBinding::createBinding(id, object(), qmlContext(this), e->sourceFile(), e->lineNumber()) : 0; if (!newBinding) { - newBinding = new QDeclarativeBinding(e->expression(), object(), qmlContext(this)); + newBinding = new QQmlBinding(e->expression(), object(), qmlContext(this)); newBinding->setSourceLocation(e->sourceFile(), e->lineNumber(), e->columnNumber()); } newBinding->setTarget(prop); @@ -513,21 +513,21 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() By default, explicit is false. */ -bool QDeclarativePropertyChanges::isExplicit() const +bool QQuickPropertyChanges::isExplicit() const { - Q_D(const QDeclarativePropertyChanges); + Q_D(const QQuickPropertyChanges); return d->isExplicit; } -void QDeclarativePropertyChanges::setIsExplicit(bool e) +void QQuickPropertyChanges::setIsExplicit(bool e) { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); d->isExplicit = e; } -bool QDeclarativePropertyChanges::containsValue(const QString &name) const +bool QQuickPropertyChanges::containsValue(const QString &name) const { - Q_D(const QDeclarativePropertyChanges); + Q_D(const QQuickPropertyChanges); typedef QPair<QString, QVariant> PropertyEntry; QListIterator<PropertyEntry> propertyIterator(d->properties); @@ -541,10 +541,10 @@ bool QDeclarativePropertyChanges::containsValue(const QString &name) const return false; } -bool QDeclarativePropertyChanges::containsExpression(const QString &name) const +bool QQuickPropertyChanges::containsExpression(const QString &name) const { - Q_D(const QDeclarativePropertyChanges); - typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; + Q_D(const QQuickPropertyChanges); + typedef QQuickPropertyChangesPrivate::ExpressionChange ExpressionEntry; QListIterator<ExpressionEntry> expressionIterator(d->expressions); while (expressionIterator.hasNext()) { @@ -557,16 +557,16 @@ bool QDeclarativePropertyChanges::containsExpression(const QString &name) const return false; } -bool QDeclarativePropertyChanges::containsProperty(const QString &name) const +bool QQuickPropertyChanges::containsProperty(const QString &name) const { return containsValue(name) || containsExpression(name); } -void QDeclarativePropertyChanges::changeValue(const QString &name, const QVariant &value) +void QQuickPropertyChanges::changeValue(const QString &name, const QVariant &value) { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); typedef QPair<QString, QVariant> PropertyEntry; - typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; + typedef QQuickPropertyChangesPrivate::ExpressionChange ExpressionEntry; QMutableListIterator<ExpressionEntry> expressionIterator(d->expressions); while (expressionIterator.hasNext()) { @@ -574,9 +574,9 @@ void QDeclarativePropertyChanges::changeValue(const QString &name, const QVarian if (entry.name == name) { expressionIterator.remove(); if (state() && state()->isStateActive()) { - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name)); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(d->property(name)); if (oldBinding) { - QDeclarativePropertyPrivate::setBinding(d->property(name), 0); + QQmlPropertyPrivate::setBinding(d->property(name), 0); oldBinding->destroy(); } d->property(name).write(value); @@ -598,7 +598,7 @@ void QDeclarativePropertyChanges::changeValue(const QString &name, const QVarian } } - QDeclarativeAction action; + QQuickAction action; action.restore = restoreEntryValues(); action.property = d->property(name); action.fromValue = action.property.read(); @@ -609,18 +609,18 @@ void QDeclarativePropertyChanges::changeValue(const QString &name, const QVarian propertyIterator.insert(PropertyEntry(name, value)); if (state() && state()->isStateActive()) { state()->addEntryToRevertList(action); - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(action.property); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(action.property); if (oldBinding) - oldBinding->setEnabled(false, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor); + oldBinding->setEnabled(false, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); d->property(name).write(value); } } -void QDeclarativePropertyChanges::changeExpression(const QString &name, const QString &expression) +void QQuickPropertyChanges::changeExpression(const QString &name, const QString &expression) { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); typedef QPair<QString, QVariant> PropertyEntry; - typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; + typedef QQuickPropertyChangesPrivate::ExpressionChange ExpressionEntry; bool hadValue = false; @@ -640,36 +640,36 @@ void QDeclarativePropertyChanges::changeExpression(const QString &name, const QS if (entry.name == name) { entry.expression->setExpression(expression); if (state() && state()->isStateActive()) { - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name)); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(d->property(name)); if (oldBinding) { - QDeclarativePropertyPrivate::setBinding(d->property(name), 0); + QQmlPropertyPrivate::setBinding(d->property(name), 0); oldBinding->destroy(); } - QDeclarativeBinding *newBinding = new QDeclarativeBinding(expression, object(), qmlContext(this)); + QQmlBinding *newBinding = new QQmlBinding(expression, object(), qmlContext(this)); newBinding->setTarget(d->property(name)); - QDeclarativePropertyPrivate::setBinding(d->property(name), newBinding, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor); + QQmlPropertyPrivate::setBinding(d->property(name), newBinding, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); } return; } } - QDeclarativeExpression *newExpression = new QDeclarativeExpression(qmlContext(this), d->object, expression); - expressionIterator.insert(ExpressionEntry(name, QDeclarativeBinding::Invalid, newExpression)); + QQmlExpression *newExpression = new QQmlExpression(qmlContext(this), d->object, expression); + expressionIterator.insert(ExpressionEntry(name, QQmlBinding::Invalid, newExpression)); if (state() && state()->isStateActive()) { if (hadValue) { - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name)); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(d->property(name)); if (oldBinding) { - oldBinding->setEnabled(false, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor); + oldBinding->setEnabled(false, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); state()->changeBindingInRevertList(object(), name, oldBinding); } - QDeclarativeBinding *newBinding = new QDeclarativeBinding(expression, object(), qmlContext(this)); + QQmlBinding *newBinding = new QQmlBinding(expression, object(), qmlContext(this)); newBinding->setTarget(d->property(name)); - QDeclarativePropertyPrivate::setBinding(d->property(name), newBinding, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor); + QQmlPropertyPrivate::setBinding(d->property(name), newBinding, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); } else { - QDeclarativeAction action; + QQuickAction action; action.restore = restoreEntryValues(); action.property = d->property(name); action.fromValue = action.property.read(); @@ -680,28 +680,28 @@ void QDeclarativePropertyChanges::changeExpression(const QString &name, const QS if (d->isExplicit) { action.toValue = newExpression->evaluate(); } else { - QDeclarativeBinding *newBinding = new QDeclarativeBinding(newExpression->expression(), object(), qmlContext(this)); + QQmlBinding *newBinding = new QQmlBinding(newExpression->expression(), object(), qmlContext(this)); newBinding->setTarget(d->property(name)); action.toBinding = newBinding; action.deletableToBinding = true; state()->addEntryToRevertList(action); - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(action.property); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(action.property); if (oldBinding) - oldBinding->setEnabled(false, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor); + oldBinding->setEnabled(false, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); - QDeclarativePropertyPrivate::setBinding(action.property, newBinding, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor); + QQmlPropertyPrivate::setBinding(action.property, newBinding, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); } } } // what about the signal handler? } -QVariant QDeclarativePropertyChanges::property(const QString &name) const +QVariant QQuickPropertyChanges::property(const QString &name) const { - Q_D(const QDeclarativePropertyChanges); + Q_D(const QQuickPropertyChanges); typedef QPair<QString, QVariant> PropertyEntry; - typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; + typedef QQuickPropertyChangesPrivate::ExpressionChange ExpressionEntry; QListIterator<PropertyEntry> propertyIterator(d->properties); while (propertyIterator.hasNext()) { @@ -722,11 +722,11 @@ QVariant QDeclarativePropertyChanges::property(const QString &name) const return QVariant(); } -void QDeclarativePropertyChanges::removeProperty(const QString &name) +void QQuickPropertyChanges::removeProperty(const QString &name) { - Q_D(QDeclarativePropertyChanges); + Q_D(QQuickPropertyChanges); typedef QPair<QString, QVariant> PropertyEntry; - typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; + typedef QQuickPropertyChangesPrivate::ExpressionChange ExpressionEntry; QMutableListIterator<ExpressionEntry> expressionIterator(d->expressions); while (expressionIterator.hasNext()) { @@ -749,9 +749,9 @@ void QDeclarativePropertyChanges::removeProperty(const QString &name) } } -QVariant QDeclarativePropertyChanges::value(const QString &name) const +QVariant QQuickPropertyChanges::value(const QString &name) const { - Q_D(const QDeclarativePropertyChanges); + Q_D(const QQuickPropertyChanges); typedef QPair<QString, QVariant> PropertyEntry; QListIterator<PropertyEntry> propertyIterator(d->properties); @@ -765,10 +765,10 @@ QVariant QDeclarativePropertyChanges::value(const QString &name) const return QVariant(); } -QString QDeclarativePropertyChanges::expression(const QString &name) const +QString QQuickPropertyChanges::expression(const QString &name) const { - Q_D(const QDeclarativePropertyChanges); - typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry; + Q_D(const QQuickPropertyChanges); + typedef QQuickPropertyChangesPrivate::ExpressionChange ExpressionEntry; QListIterator<ExpressionEntry> expressionIterator(d->expressions); while (expressionIterator.hasNext()) { @@ -781,13 +781,13 @@ QString QDeclarativePropertyChanges::expression(const QString &name) const return QString(); } -void QDeclarativePropertyChanges::detachFromState() +void QQuickPropertyChanges::detachFromState() { if (state()) state()->removeAllEntriesFromRevertList(object()); } -void QDeclarativePropertyChanges::attachToState() +void QQuickPropertyChanges::attachToState() { if (state()) state()->addEntriesToRevertList(actions()); diff --git a/src/quick/util/qdeclarativepropertychanges_p.h b/src/quick/util/qquickpropertychanges_p.h index 2d5838ddf4..313a781302 100644 --- a/src/quick/util/qdeclarativepropertychanges_p.h +++ b/src/quick/util/qquickpropertychanges_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,28 +39,28 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEPROPERTYCHANGES_H -#define QDECLARATIVEPROPERTYCHANGES_H +#ifndef QQUICKPROPERTYCHANGES_H +#define QQUICKPROPERTYCHANGES_H -#include "qdeclarativestateoperations_p.h" -#include <private/qdeclarativecustomparser_p.h> +#include "qquickstatechangescript_p.h" +#include <private/qqmlcustomparser_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativePropertyChangesPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativePropertyChanges : public QDeclarativeStateOperation +class QQuickPropertyChangesPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickPropertyChanges : public QQuickStateOperation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativePropertyChanges) + Q_DECLARE_PRIVATE(QQuickPropertyChanges) Q_PROPERTY(QObject *target READ object WRITE setObject) Q_PROPERTY(bool restoreEntryValues READ restoreEntryValues WRITE setRestoreEntryValues) Q_PROPERTY(bool explicit READ isExplicit WRITE setIsExplicit) public: - QDeclarativePropertyChanges(); - ~QDeclarativePropertyChanges(); + QQuickPropertyChanges(); + ~QQuickPropertyChanges(); QObject *object() const; void setObject(QObject *); @@ -88,23 +88,23 @@ public: QVariant property(const QString &name) const; }; -class QDeclarativePropertyChangesParser : public QDeclarativeCustomParser +class QQuickPropertyChangesParser : public QQmlCustomParser { public: - QDeclarativePropertyChangesParser() - : QDeclarativeCustomParser(AcceptsAttachedProperties) {} + QQuickPropertyChangesParser() + : QQmlCustomParser(AcceptsAttachedProperties) {} - void compileList(QList<QPair<QString, QVariant> > &list, const QString &pre, const QDeclarativeCustomParserProperty &prop); + void compileList(QList<QPair<QString, QVariant> > &list, const QString &pre, const QQmlCustomParserProperty &prop); - virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &); + virtual QByteArray compile(const QList<QQmlCustomParserProperty> &); virtual void setCustomData(QObject *, const QByteArray &); }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativePropertyChanges) +QML_DECLARE_TYPE(QQuickPropertyChanges) QT_END_HEADER -#endif // QDECLARATIVEPROPERTYCHANGES_H +#endif // QQUICKPROPERTYCHANGES_H diff --git a/src/quick/util/qdeclarativesmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index 4f2ed7dbe3..024728f1f5 100644 --- a/src/quick/util/qdeclarativesmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qdeclarativesmoothedanimation_p.h" -#include "qdeclarativesmoothedanimation_p_p.h" +#include "qquicksmoothedanimation_p.h" +#include "qquicksmoothedanimation_p_p.h" -#include "qdeclarativeanimation_p_p.h" +#include "qquickanimation_p_p.h" -#include <qdeclarativeproperty.h> -#include <private/qdeclarativeproperty_p.h> +#include <qqmlproperty.h> +#include <private/qqmlproperty_p.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlglobal_p.h> #include <QtCore/qdebug.h> @@ -74,9 +74,9 @@ void QSmoothedAnimationTimer::stopAnimation() m_animation->stop(); } -QSmoothedAnimation::QSmoothedAnimation(QDeclarativeSmoothedAnimationPrivate *priv) +QSmoothedAnimation::QSmoothedAnimation(QQuickSmoothedAnimationPrivate *priv) : QAbstractAnimationJob(), to(0), velocity(200), userDuration(-1), maximumEasingTime(-1), - reversingMode(QDeclarativeSmoothedAnimation::Eased), initialVelocity(0), + reversingMode(QQuickSmoothedAnimation::Eased), initialVelocity(0), trackVelocity(0), initialValue(0), invert(false), finalDuration(-1), lastTime(0), useDelta(false), delayedStopTimer(new QSmoothedAnimationTimer(this)), animationTemplate(priv) { @@ -89,13 +89,13 @@ QSmoothedAnimation::~QSmoothedAnimation() delete delayedStopTimer; if (animationTemplate) { if (target.object()) { - QHash<QDeclarativeProperty, QSmoothedAnimation* >::iterator it = + QHash<QQmlProperty, QSmoothedAnimation* >::iterator it = animationTemplate->activeAnimations.find(target); if (it != animationTemplate->activeAnimations.end() && it.value() == this) animationTemplate->activeAnimations.erase(it); } else { //target is no longer valid, need to search linearly - QHash<QDeclarativeProperty, QSmoothedAnimation* >::iterator it; + QHash<QQmlProperty, QSmoothedAnimation* >::iterator it; for (it = animationTemplate->activeAnimations.begin(); it != animationTemplate->activeAnimations.end(); ++it) { if (it.value() == this) { animationTemplate->activeAnimations.erase(it); @@ -242,15 +242,15 @@ qreal QSmoothedAnimation::easeFollow(qreal time_seconds) void QSmoothedAnimation::updateCurrentTime(int t) { - qreal time_seconds = useDelta ? qreal(QDeclarativeAnimationTimer::instance()->currentDelta()) / 1000. : qreal(t - lastTime) / 1000.; + qreal time_seconds = useDelta ? qreal(QQmlAnimationTimer::instance()->currentDelta()) / 1000. : qreal(t - lastTime) / 1000.; if (useDelta) useDelta = false; qreal value = easeFollow(time_seconds); value *= (invert? -1.0: 1.0); - QDeclarativePropertyPrivate::write(target, initialValue + value, - QDeclarativePropertyPrivate::BypassInterceptor - | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(target, initialValue + value, + QQmlPropertyPrivate::BypassInterceptor + | QQmlPropertyPrivate::DontRemoveBinding); } void QSmoothedAnimation::init() @@ -277,17 +277,17 @@ void QSmoothedAnimation::init() if (hasReversed) { switch (reversingMode) { default: - case QDeclarativeSmoothedAnimation::Eased: + case QQuickSmoothedAnimation::Eased: initialVelocity = -trackVelocity; break; - case QDeclarativeSmoothedAnimation::Sync: - QDeclarativePropertyPrivate::write(target, to, - QDeclarativePropertyPrivate::BypassInterceptor - | QDeclarativePropertyPrivate::DontRemoveBinding); + case QQuickSmoothedAnimation::Sync: + QQmlPropertyPrivate::write(target, to, + QQmlPropertyPrivate::BypassInterceptor + | QQmlPropertyPrivate::DontRemoveBinding); trackVelocity = 0; stop(); return; - case QDeclarativeSmoothedAnimation::Immediate: + case QQuickSmoothedAnimation::Immediate: initialVelocity = 0; break; } @@ -298,16 +298,16 @@ void QSmoothedAnimation::init() invert = (to < initialValue); if (!recalc()) { - QDeclarativePropertyPrivate::write(target, to, - QDeclarativePropertyPrivate::BypassInterceptor - | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(target, to, + QQmlPropertyPrivate::BypassInterceptor + | QQmlPropertyPrivate::DontRemoveBinding); stop(); return; } } /*! - \qmlclass SmoothedAnimation QDeclarativeSmoothedAnimation + \qmlclass SmoothedAnimation QQuickSmoothedAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits NumberAnimation @@ -324,7 +324,7 @@ void QSmoothedAnimation::init() bound to those of the red rectangle. Whenever these values change, the green rectangle smoothly animates to its new position: - \snippet doc/src/snippets/declarative/smoothedanimation.qml 0 + \snippet doc/src/snippets/qml/smoothedanimation.qml 0 A SmoothedAnimation can be configured by setting the \l velocity at which the animation should occur, or the \l duration that the animation should take. @@ -353,32 +353,32 @@ void QSmoothedAnimation::init() \sa SpringAnimation, NumberAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} */ -QDeclarativeSmoothedAnimation::QDeclarativeSmoothedAnimation(QObject *parent) -: QDeclarativeNumberAnimation(*(new QDeclarativeSmoothedAnimationPrivate), parent) +QQuickSmoothedAnimation::QQuickSmoothedAnimation(QObject *parent) +: QQuickNumberAnimation(*(new QQuickSmoothedAnimationPrivate), parent) { } -QDeclarativeSmoothedAnimation::~QDeclarativeSmoothedAnimation() +QQuickSmoothedAnimation::~QQuickSmoothedAnimation() { } -QDeclarativeSmoothedAnimationPrivate::QDeclarativeSmoothedAnimationPrivate() +QQuickSmoothedAnimationPrivate::QQuickSmoothedAnimationPrivate() : anim(0) { anim = new QSmoothedAnimation; } -QDeclarativeSmoothedAnimationPrivate::~QDeclarativeSmoothedAnimationPrivate() +QQuickSmoothedAnimationPrivate::~QQuickSmoothedAnimationPrivate() { delete anim; - QHash<QDeclarativeProperty, QSmoothedAnimation* >::iterator it; + QHash<QQmlProperty, QSmoothedAnimation* >::iterator it; for (it = activeAnimations.begin(); it != activeAnimations.end(); ++it) { it.value()->clearTemplate(); } } -void QDeclarativeSmoothedAnimationPrivate::updateRunningAnimations() +void QQuickSmoothedAnimationPrivate::updateRunningAnimations() { foreach(QSmoothedAnimation* ease, activeAnimations.values()){ ease->maximumEasingTime = anim->maximumEasingTime; @@ -389,15 +389,15 @@ void QDeclarativeSmoothedAnimationPrivate::updateRunningAnimations() } } -QAbstractAnimationJob* QDeclarativeSmoothedAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickSmoothedAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { Q_UNUSED(direction); - Q_D(QDeclarativeSmoothedAnimation); + Q_D(QQuickSmoothedAnimation); - QDeclarativeStateActions dataActions = QDeclarativePropertyAnimation::createTransitionActions(actions, modified, defaultTarget); + QQuickStateActions dataActions = QQuickPropertyAnimation::createTransitionActions(actions, modified, defaultTarget); QParallelAnimationGroupJob *wrapperGroup = new QParallelAnimationGroupJob(); @@ -455,15 +455,15 @@ QAbstractAnimationJob* QDeclarativeSmoothedAnimation::transition(QDeclarativeSta \o SmoothedAnimation.Sync - the property is immediately set to the target value \endlist */ -QDeclarativeSmoothedAnimation::ReversingMode QDeclarativeSmoothedAnimation::reversingMode() const +QQuickSmoothedAnimation::ReversingMode QQuickSmoothedAnimation::reversingMode() const { - Q_D(const QDeclarativeSmoothedAnimation); - return (QDeclarativeSmoothedAnimation::ReversingMode) d->anim->reversingMode; + Q_D(const QQuickSmoothedAnimation); + return (QQuickSmoothedAnimation::ReversingMode) d->anim->reversingMode; } -void QDeclarativeSmoothedAnimation::setReversingMode(ReversingMode m) +void QQuickSmoothedAnimation::setReversingMode(ReversingMode m) { - Q_D(QDeclarativeSmoothedAnimation); + Q_D(QQuickSmoothedAnimation); if (d->anim->reversingMode == m) return; @@ -482,26 +482,26 @@ void QDeclarativeSmoothedAnimation::setReversingMode(ReversingMode m) If the velocity value and the duration value are both enabled, then the animation will use whichever gives the shorter duration. */ -int QDeclarativeSmoothedAnimation::duration() const +int QQuickSmoothedAnimation::duration() const { - Q_D(const QDeclarativeSmoothedAnimation); + Q_D(const QQuickSmoothedAnimation); return d->anim->userDuration; } -void QDeclarativeSmoothedAnimation::setDuration(int duration) +void QQuickSmoothedAnimation::setDuration(int duration) { - Q_D(QDeclarativeSmoothedAnimation); + Q_D(QQuickSmoothedAnimation); if (duration != -1) - QDeclarativeNumberAnimation::setDuration(duration); + QQuickNumberAnimation::setDuration(duration); if(duration == d->anim->userDuration) return; d->anim->userDuration = duration; d->updateRunningAnimations(); } -qreal QDeclarativeSmoothedAnimation::velocity() const +qreal QQuickSmoothedAnimation::velocity() const { - Q_D(const QDeclarativeSmoothedAnimation); + Q_D(const QQuickSmoothedAnimation); return d->anim->velocity; } @@ -517,9 +517,9 @@ qreal QDeclarativeSmoothedAnimation::velocity() const If the velocity value and the duration value are both enabled, then the animation will use whichever gives the shorter duration. */ -void QDeclarativeSmoothedAnimation::setVelocity(qreal v) +void QQuickSmoothedAnimation::setVelocity(qreal v) { - Q_D(QDeclarativeSmoothedAnimation); + Q_D(QQuickSmoothedAnimation); if (d->anim->velocity == v) return; @@ -538,15 +538,15 @@ void QDeclarativeSmoothedAnimation::setVelocity(qreal v) The default value is -1. */ -int QDeclarativeSmoothedAnimation::maximumEasingTime() const +int QQuickSmoothedAnimation::maximumEasingTime() const { - Q_D(const QDeclarativeSmoothedAnimation); + Q_D(const QQuickSmoothedAnimation); return d->anim->maximumEasingTime; } -void QDeclarativeSmoothedAnimation::setMaximumEasingTime(int v) +void QQuickSmoothedAnimation::setMaximumEasingTime(int v) { - Q_D(QDeclarativeSmoothedAnimation); + Q_D(QQuickSmoothedAnimation); if(v == d->anim->maximumEasingTime) return; d->anim->maximumEasingTime = v; diff --git a/src/quick/util/qdeclarativesmoothedanimation_p.h b/src/quick/util/qquicksmoothedanimation_p.h index 9a0bc22216..8825a04a0e 100644 --- a/src/quick/util/qdeclarativesmoothedanimation_p.h +++ b/src/quick/util/qquicksmoothedanimation_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESMOOTHEDANIMATION_H -#define QDECLARATIVESMOOTHEDANIMATION_H +#ifndef QQUICKSMOOTHEDANIMATION_H +#define QQUICKSMOOTHEDANIMATION_H -#include <qdeclarative.h> -#include "qdeclarativeanimation_p.h" +#include <qqml.h> +#include "qquickanimation_p.h" #include <QtCore/qobject.h> @@ -51,12 +51,12 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeProperty; -class QDeclarativeSmoothedAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeSmoothedAnimation : public QDeclarativeNumberAnimation +class QQmlProperty; +class QQuickSmoothedAnimationPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickSmoothedAnimation : public QQuickNumberAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeSmoothedAnimation) + Q_DECLARE_PRIVATE(QQuickSmoothedAnimation) Q_ENUMS(ReversingMode) Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged) @@ -66,8 +66,8 @@ class Q_QUICK_PRIVATE_EXPORT QDeclarativeSmoothedAnimation : public QDeclarative public: enum ReversingMode { Eased, Immediate, Sync }; - QDeclarativeSmoothedAnimation(QObject *parent = 0); - ~QDeclarativeSmoothedAnimation(); + QQuickSmoothedAnimation(QObject *parent = 0); + ~QQuickSmoothedAnimation(); ReversingMode reversingMode() const; void setReversingMode(ReversingMode); @@ -81,8 +81,8 @@ public: int maximumEasingTime() const; void setMaximumEasingTime(int); - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); Q_SIGNALS: @@ -93,8 +93,8 @@ Q_SIGNALS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeSmoothedAnimation) +QML_DECLARE_TYPE(QQuickSmoothedAnimation) QT_END_HEADER -#endif // QDECLARATIVESMOOTHEDANIMATION_H +#endif // QQUICKSMOOTHEDANIMATION_H diff --git a/src/quick/util/qdeclarativesmoothedanimation_p_p.h b/src/quick/util/qquicksmoothedanimation_p_p.h index 9afb6506a7..8112aa2885 100644 --- a/src/quick/util/qdeclarativesmoothedanimation_p_p.h +++ b/src/quick/util/qquicksmoothedanimation_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESMOOTHEDANIMATION2_P_H -#define QDECLARATIVESMOOTHEDANIMATION2_P_H +#ifndef QQUICKSMOOTHEDANIMATION2_P_H +#define QQUICKSMOOTHEDANIMATION2_P_H // // W A R N I N G @@ -53,10 +53,10 @@ // We mean it. // -#include "qdeclarativesmoothedanimation_p.h" -#include "qdeclarativeanimation_p.h" +#include "qquicksmoothedanimation_p.h" +#include "qquickanimation_p.h" -#include "qdeclarativeanimation_p_p.h" +#include "qquickanimation_p_p.h" #include "private/qparallelanimationgroupjob_p.h" @@ -77,12 +77,12 @@ private: QSmoothedAnimation *m_animation; }; -class QDeclarativeSmoothedAnimationPrivate; +class QQuickSmoothedAnimationPrivate; class Q_AUTOTEST_EXPORT QSmoothedAnimation : public QAbstractAnimationJob { Q_DISABLE_COPY(QSmoothedAnimation) public: - QSmoothedAnimation(QDeclarativeSmoothedAnimationPrivate * = 0); + QSmoothedAnimation(QQuickSmoothedAnimationPrivate * = 0); ~QSmoothedAnimation(); qreal to; @@ -90,12 +90,12 @@ public: int userDuration; int maximumEasingTime; - QDeclarativeSmoothedAnimation::ReversingMode reversingMode; + QQuickSmoothedAnimation::ReversingMode reversingMode; qreal initialVelocity; qreal trackVelocity; - QDeclarativeProperty target; + QQmlProperty target; int duration() const; void restart(); @@ -134,21 +134,21 @@ private: bool recalc(); void delayedStop(); QSmoothedAnimationTimer *delayedStopTimer; - QDeclarativeSmoothedAnimationPrivate *animationTemplate; + QQuickSmoothedAnimationPrivate *animationTemplate; }; -class QDeclarativeSmoothedAnimationPrivate : public QDeclarativePropertyAnimationPrivate +class QQuickSmoothedAnimationPrivate : public QQuickPropertyAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativeSmoothedAnimation) + Q_DECLARE_PUBLIC(QQuickSmoothedAnimation) public: - QDeclarativeSmoothedAnimationPrivate(); - ~QDeclarativeSmoothedAnimationPrivate(); + QQuickSmoothedAnimationPrivate(); + ~QQuickSmoothedAnimationPrivate(); void updateRunningAnimations(); QSmoothedAnimation *anim; - QHash<QDeclarativeProperty, QSmoothedAnimation*> activeAnimations; + QHash<QQmlProperty, QSmoothedAnimation*> activeAnimations; }; QT_END_NAMESPACE -#endif // QDECLARATIVESMOOTHEDANIMATION2_P_H +#endif // QQUICKSMOOTHEDANIMATION2_P_H diff --git a/src/quick/util/qdeclarativespringanimation.cpp b/src/quick/util/qquickspringanimation.cpp index 3cc5f4dbc3..84de994452 100644 --- a/src/quick/util/qdeclarativespringanimation.cpp +++ b/src/quick/util/qquickspringanimation.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include "qdeclarativespringanimation_p.h" +#include "qquickspringanimation_p.h" -#include "qdeclarativeanimation_p_p.h" -#include <private/qdeclarativeproperty_p.h> +#include "qquickanimation_p_p.h" +#include <private/qqmlproperty_p.h> #include "private/qparallelanimationgroupjob_p.h" #include <QtCore/qdebug.h> @@ -56,12 +56,12 @@ QT_BEGIN_NAMESPACE -class QDeclarativeSpringAnimationPrivate; +class QQuickSpringAnimationPrivate; class Q_AUTOTEST_EXPORT QSpringAnimation : public QAbstractAnimationJob { Q_DISABLE_COPY(QSpringAnimation) public: - QSpringAnimation(QDeclarativeSpringAnimationPrivate * = 0); + QSpringAnimation(QQuickSpringAnimationPrivate * = 0); ~QSpringAnimation(); int duration() const; @@ -81,7 +81,7 @@ public: Spring }; Mode mode; - QDeclarativeProperty target; + QQmlProperty target; qreal velocityms; qreal maxVelocity; @@ -94,7 +94,7 @@ public: bool useMass : 1; bool haveModulus : 1; bool useDelta : 1; - typedef QHash<QDeclarativeProperty, QSpringAnimation*> ActiveAnimationHash; + typedef QHash<QQmlProperty, QSpringAnimation*> ActiveAnimationHash; void clearTemplate() { animationTemplate = 0; } @@ -103,15 +103,15 @@ protected: virtual void updateState(QAbstractAnimationJob::State, QAbstractAnimationJob::State); private: - QDeclarativeSpringAnimationPrivate *animationTemplate; + QQuickSpringAnimationPrivate *animationTemplate; }; -class QDeclarativeSpringAnimationPrivate : public QDeclarativePropertyAnimationPrivate +class QQuickSpringAnimationPrivate : public QQuickPropertyAnimationPrivate { - Q_DECLARE_PUBLIC(QDeclarativeSpringAnimation) + Q_DECLARE_PUBLIC(QQuickSpringAnimation) public: - QDeclarativeSpringAnimationPrivate() - : QDeclarativePropertyAnimationPrivate() + QQuickSpringAnimationPrivate() + : QQuickPropertyAnimationPrivate() , velocityms(0) , maxVelocity(0) , mass(1.0) @@ -141,7 +141,7 @@ public: QElapsedTimer elapsed; }; -QSpringAnimation::QSpringAnimation(QDeclarativeSpringAnimationPrivate *priv) +QSpringAnimation::QSpringAnimation(QQuickSpringAnimationPrivate *priv) : QAbstractAnimationJob() , currentValue(0) , to(0) @@ -216,7 +216,7 @@ void QSpringAnimation::updateCurrentTime(int time) return; } - int elapsed = useDelta ? QDeclarativeAnimationTimer::instance()->currentDelta() : time - lastTime; + int elapsed = useDelta ? QQmlAnimationTimer::instance()->currentDelta() : time - lastTime; if (useDelta) { startTime = time - elapsed; useDelta = false; @@ -303,9 +303,9 @@ void QSpringAnimation::updateCurrentTime(int time) qreal old_to = to; - QDeclarativePropertyPrivate::write(target, currentValue, - QDeclarativePropertyPrivate::BypassInterceptor | - QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(target, currentValue, + QQmlPropertyPrivate::BypassInterceptor | + QQmlPropertyPrivate::DontRemoveBinding); if (stopped && old_to == to) { // do not stop if we got restarted stopTime = animationTemplate->elapsed.elapsed(); @@ -319,7 +319,7 @@ void QSpringAnimation::updateState(QAbstractAnimationJob::State newState, QAbstr init(); } -void QDeclarativeSpringAnimationPrivate::updateMode() +void QQuickSpringAnimationPrivate::updateMode() { if (spring == 0. && maxVelocity == 0.) mode = QSpringAnimation::Track; @@ -340,7 +340,7 @@ void QDeclarativeSpringAnimationPrivate::updateMode() } /*! - \qmlclass SpringAnimation QDeclarativeSpringAnimation + \qmlclass SpringAnimation QQuickSpringAnimation \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \inherits NumberAnimation @@ -357,7 +357,7 @@ void QDeclarativeSpringAnimationPrivate::updateMode() on the \c x and \c y values indicates that whenever these values are changed, a SpringAnimation should be applied. - \snippet doc/src/snippets/declarative/springanimation.qml 0 + \snippet doc/src/snippets/qml/springanimation.qml 0 Like any other animation element, a SpringAnimation can be applied in a number of ways, including transitions, behaviors and property value @@ -367,14 +367,14 @@ void QDeclarativeSpringAnimationPrivate::updateMode() \sa SmoothedAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example} */ -QDeclarativeSpringAnimation::QDeclarativeSpringAnimation(QObject *parent) -: QDeclarativeNumberAnimation(*(new QDeclarativeSpringAnimationPrivate),parent) +QQuickSpringAnimation::QQuickSpringAnimation(QObject *parent) +: QQuickNumberAnimation(*(new QQuickSpringAnimationPrivate),parent) { } -QDeclarativeSpringAnimation::~QDeclarativeSpringAnimation() +QQuickSpringAnimation::~QQuickSpringAnimation() { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); QSpringAnimation::ActiveAnimationHash::iterator it; for (it = d->activeAnimations.begin(); it != d->activeAnimations.end(); ++it) { it.value()->clearTemplate(); @@ -389,15 +389,15 @@ QDeclarativeSpringAnimation::~QDeclarativeSpringAnimation() The default value is 0 (no maximum velocity). */ -qreal QDeclarativeSpringAnimation::velocity() const +qreal QQuickSpringAnimation::velocity() const { - Q_D(const QDeclarativeSpringAnimation); + Q_D(const QQuickSpringAnimation); return d->maxVelocity; } -void QDeclarativeSpringAnimation::setVelocity(qreal velocity) +void QQuickSpringAnimation::setVelocity(qreal velocity) { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); d->maxVelocity = velocity; d->velocityms = velocity / 1000.0; d->updateMode(); @@ -414,15 +414,15 @@ void QDeclarativeSpringAnimation::setVelocity(qreal velocity) When this property is set and the \l velocity value is greater than 0, the \l velocity limits the maximum speed. */ -qreal QDeclarativeSpringAnimation::spring() const +qreal QQuickSpringAnimation::spring() const { - Q_D(const QDeclarativeSpringAnimation); + Q_D(const QQuickSpringAnimation); return d->spring; } -void QDeclarativeSpringAnimation::setSpring(qreal spring) +void QQuickSpringAnimation::setSpring(qreal spring) { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); d->spring = spring; d->updateMode(); } @@ -437,15 +437,15 @@ void QDeclarativeSpringAnimation::setSpring(qreal spring) The useful value range is 0 - 1.0. The lower the value, the faster it comes to rest. */ -qreal QDeclarativeSpringAnimation::damping() const +qreal QQuickSpringAnimation::damping() const { - Q_D(const QDeclarativeSpringAnimation); + Q_D(const QQuickSpringAnimation); return d->damping; } -void QDeclarativeSpringAnimation::setDamping(qreal damping) +void QQuickSpringAnimation::setDamping(qreal damping) { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); if (damping > 1.) damping = 1.; @@ -463,15 +463,15 @@ void QDeclarativeSpringAnimation::setDamping(qreal damping) The default is 0.01. Tuning this value can provide small performance improvements. */ -qreal QDeclarativeSpringAnimation::epsilon() const +qreal QQuickSpringAnimation::epsilon() const { - Q_D(const QDeclarativeSpringAnimation); + Q_D(const QQuickSpringAnimation); return d->epsilon; } -void QDeclarativeSpringAnimation::setEpsilon(qreal epsilon) +void QQuickSpringAnimation::setEpsilon(qreal epsilon) { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); d->epsilon = epsilon; } @@ -482,15 +482,15 @@ void QDeclarativeSpringAnimation::setEpsilon(qreal epsilon) Setting a \a modulus forces the target value to "wrap around" at the modulus. For example, setting the modulus to 360 will cause a value of 370 to wrap around to 10. */ -qreal QDeclarativeSpringAnimation::modulus() const +qreal QQuickSpringAnimation::modulus() const { - Q_D(const QDeclarativeSpringAnimation); + Q_D(const QQuickSpringAnimation); return d->modulus; } -void QDeclarativeSpringAnimation::setModulus(qreal modulus) +void QQuickSpringAnimation::setModulus(qreal modulus) { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); if (d->modulus != modulus) { d->haveModulus = modulus != 0.0; d->modulus = modulus; @@ -508,15 +508,15 @@ void QDeclarativeSpringAnimation::setModulus(qreal modulus) A greater mass causes slower movement and a greater spring-like motion when an item comes to rest. */ -qreal QDeclarativeSpringAnimation::mass() const +qreal QQuickSpringAnimation::mass() const { - Q_D(const QDeclarativeSpringAnimation); + Q_D(const QQuickSpringAnimation); return d->mass; } -void QDeclarativeSpringAnimation::setMass(qreal mass) +void QQuickSpringAnimation::setMass(qreal mass) { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); if (d->mass != mass && mass > 0.0) { d->useMass = mass != 1.0; d->mass = mass; @@ -524,23 +524,23 @@ void QDeclarativeSpringAnimation::setMass(qreal mass) } } -QAbstractAnimationJob* QDeclarativeSpringAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, +QAbstractAnimationJob* QQuickSpringAnimation::transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget) { - Q_D(QDeclarativeSpringAnimation); + Q_D(QQuickSpringAnimation); Q_UNUSED(direction); QParallelAnimationGroupJob *wrapperGroup = new QParallelAnimationGroupJob(); - QDeclarativeStateActions dataActions = QDeclarativeNumberAnimation::createTransitionActions(actions, modified, defaultTarget); + QQuickStateActions dataActions = QQuickNumberAnimation::createTransitionActions(actions, modified, defaultTarget); if (!dataActions.isEmpty()) { QSet<QAbstractAnimationJob*> anims; for (int i = 0; i < dataActions.size(); ++i) { QSpringAnimation *animation; bool needsRestart = false; - const QDeclarativeProperty &property = dataActions.at(i).property; + const QQmlProperty &property = dataActions.at(i).property; if (d->activeAnimations.contains(property)) { animation = d->activeAnimations[property]; needsRestart = true; diff --git a/src/quick/util/qdeclarativespringanimation_p.h b/src/quick/util/qquickspringanimation_p.h index 2f28700208..03c586e687 100644 --- a/src/quick/util/qdeclarativespringanimation_p.h +++ b/src/quick/util/qquickspringanimation_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESPRINGANIMATION_H -#define QDECLARATIVESPRINGANIMATION_H +#ifndef QQUICKSPRINGANIMATION_H +#define QQUICKSPRINGANIMATION_H -#include <qdeclarative.h> -#include "qdeclarativeanimation_p.h" +#include <qqml.h> +#include "qquickanimation_p.h" #include <QtCore/qobject.h> @@ -51,12 +51,12 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeSpringAnimationPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeSpringAnimation : public QDeclarativeNumberAnimation +class QQuickSpringAnimationPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickSpringAnimation : public QQuickNumberAnimation { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeSpringAnimation) - Q_INTERFACES(QDeclarativePropertyValueSource) + Q_DECLARE_PRIVATE(QQuickSpringAnimation) + Q_INTERFACES(QQmlPropertyValueSource) Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity) Q_PROPERTY(qreal spring READ spring WRITE setSpring) @@ -66,8 +66,8 @@ class Q_QUICK_PRIVATE_EXPORT QDeclarativeSpringAnimation : public QDeclarativeNu Q_PROPERTY(qreal mass READ mass WRITE setMass NOTIFY massChanged) public: - QDeclarativeSpringAnimation(QObject *parent=0); - ~QDeclarativeSpringAnimation(); + QQuickSpringAnimation(QObject *parent=0); + ~QQuickSpringAnimation(); qreal velocity() const; void setVelocity(qreal velocity); @@ -87,8 +87,8 @@ public: qreal modulus() const; void setModulus(qreal modulus); - virtual QAbstractAnimationJob* transition(QDeclarativeStateActions &actions, - QDeclarativeProperties &modified, + virtual QAbstractAnimationJob* transition(QQuickStateActions &actions, + QQmlProperties &modified, TransitionDirection direction, QObject *defaultTarget = 0); @@ -100,8 +100,8 @@ Q_SIGNALS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeSpringAnimation) +QML_DECLARE_TYPE(QQuickSpringAnimation) QT_END_HEADER -#endif // QDECLARATIVESPRINGANIMATION_H +#endif // QQUICKSPRINGANIMATION_H diff --git a/src/quick/util/qdeclarativestate.cpp b/src/quick/util/qquickstate.cpp index f0795e92bc..53906a5651 100644 --- a/src/quick/util/qdeclarativestate.cpp +++ b/src/quick/util/qquickstate.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "qdeclarativestate_p_p.h" -#include "qdeclarativestate_p.h" +#include "qquickstate_p_p.h" +#include "qquickstate_p.h" -#include "qdeclarativestategroup_p.h" -#include "qdeclarativestateoperations_p.h" +#include "qquickstategroup_p.h" +#include "qquickstatechangescript_p.h" -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlglobal_p.h> #include <QtCore/qdebug.h> @@ -53,13 +53,13 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG); -QDeclarativeAction::QDeclarativeAction() +QQuickAction::QQuickAction() : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), fromBinding(0), event(0), specifiedObject(0) { } -QDeclarativeAction::QDeclarativeAction(QObject *target, const QString &propertyName, +QQuickAction::QQuickAction(QObject *target, const QString &propertyName, const QVariant &value) : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), property(target, propertyName, qmlEngine(target)), toValue(value), @@ -70,8 +70,8 @@ QDeclarativeAction::QDeclarativeAction(QObject *target, const QString &propertyN fromValue = property.read(); } -QDeclarativeAction::QDeclarativeAction(QObject *target, const QString &propertyName, - QDeclarativeContext *context, const QVariant &value) +QQuickAction::QQuickAction(QObject *target, const QString &propertyName, + QQmlContext *context, const QVariant &value) : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), property(target, propertyName, context), toValue(value), fromBinding(0), event(0), @@ -82,45 +82,45 @@ QDeclarativeAction::QDeclarativeAction(QObject *target, const QString &propertyN } -QDeclarativeActionEvent::~QDeclarativeActionEvent() +QQuickActionEvent::~QQuickActionEvent() { } -void QDeclarativeActionEvent::execute(Reason) +void QQuickActionEvent::execute(Reason) { } -bool QDeclarativeActionEvent::isReversable() +bool QQuickActionEvent::isReversable() { return false; } -void QDeclarativeActionEvent::reverse(Reason) +void QQuickActionEvent::reverse(Reason) { } -bool QDeclarativeActionEvent::changesBindings() +bool QQuickActionEvent::changesBindings() { return false; } -void QDeclarativeActionEvent::clearBindings() +void QQuickActionEvent::clearBindings() { } -bool QDeclarativeActionEvent::override(QDeclarativeActionEvent *other) +bool QQuickActionEvent::override(QQuickActionEvent *other) { Q_UNUSED(other); return false; } -QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObject *parent) +QQuickStateOperation::QQuickStateOperation(QObjectPrivate &dd, QObject *parent) : QObject(dd, parent) { } /*! - \qmlclass State QDeclarativeState + \qmlclass State QQuickState \inqmlmodule QtQuick 2 \ingroup qml-state-elements \brief The State element defines configurations of objects and properties. @@ -139,7 +139,7 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje between the default state and the "clicked" state, thus toggling the color of the rectangle between black and red. - \snippet doc/src/snippets/declarative/state.qml 0 + \snippet doc/src/snippets/qml/state.qml 0 Notice the default state is referred to using an empty string (""). @@ -150,18 +150,18 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje not allowed. \sa {declarative/animation/states}{states example}, {qmlstates}{States}, - {QML Animation and Transitions}{Transitions}, QtDeclarative + {QML Animation and Transitions}{Transitions}, QtQml */ -QDeclarativeState::QDeclarativeState(QObject *parent) -: QObject(*(new QDeclarativeStatePrivate), parent) +QQuickState::QQuickState(QObject *parent) +: QObject(*(new QQuickStatePrivate), parent) { - Q_D(QDeclarativeState); + Q_D(QQuickState); d->transitionManager.setState(this); } -QDeclarativeState::~QDeclarativeState() +QQuickState::~QQuickState() { - Q_D(QDeclarativeState); + Q_D(QQuickState); if (d->group) d->group->removeState(this); } @@ -172,28 +172,28 @@ QDeclarativeState::~QDeclarativeState() Each state should have a unique name within its item. */ -QString QDeclarativeState::name() const +QString QQuickState::name() const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->name; } -void QDeclarativeState::setName(const QString &n) +void QQuickState::setName(const QString &n) { - Q_D(QDeclarativeState); + Q_D(QQuickState); d->name = n; d->named = true; } -bool QDeclarativeState::isNamed() const +bool QQuickState::isNamed() const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->named; } -bool QDeclarativeState::isWhenKnown() const +bool QQuickState::isWhenKnown() const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->when != 0; } @@ -205,7 +205,7 @@ bool QDeclarativeState::isWhenKnown() const be applied. For example, the following \l Rectangle changes in and out of the "hidden" state when the \l MouseArea is pressed: - \snippet doc/src/snippets/declarative/state-when.qml 0 + \snippet doc/src/snippets/qml/state-when.qml 0 If multiple states in a group have \c when clauses that evaluate to \c true at the same time, the first matching state will be applied. For example, in @@ -221,15 +221,15 @@ bool QDeclarativeState::isWhenKnown() const } \endqml */ -QDeclarativeBinding *QDeclarativeState::when() const +QQmlBinding *QQuickState::when() const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->when; } -void QDeclarativeState::setWhen(QDeclarativeBinding *when) +void QQuickState::setWhen(QQmlBinding *when) { - Q_D(QDeclarativeState); + Q_D(QQuickState); d->when = when; if (d->group) d->group->updateAutoState(); @@ -244,15 +244,15 @@ void QDeclarativeState::setWhen(QDeclarativeBinding *when) The state being extended is treated as the base state in regards to the changes specified by the extending state. */ -QString QDeclarativeState::extends() const +QString QQuickState::extends() const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->extends; } -void QDeclarativeState::setExtends(const QString &extends) +void QQuickState::setExtends(const QString &extends) { - Q_D(QDeclarativeState); + Q_D(QQuickState); d->extends = extends; } @@ -265,41 +265,41 @@ void QDeclarativeState::setExtends(const QString &extends) extends another state, then the changes are applied against the state being extended. */ -QDeclarativeListProperty<QDeclarativeStateOperation> QDeclarativeState::changes() +QQmlListProperty<QQuickStateOperation> QQuickState::changes() { - Q_D(QDeclarativeState); - return QDeclarativeListProperty<QDeclarativeStateOperation>(this, &d->operations, QDeclarativeStatePrivate::operations_append, - QDeclarativeStatePrivate::operations_count, QDeclarativeStatePrivate::operations_at, - QDeclarativeStatePrivate::operations_clear); + Q_D(QQuickState); + return QQmlListProperty<QQuickStateOperation>(this, &d->operations, QQuickStatePrivate::operations_append, + QQuickStatePrivate::operations_count, QQuickStatePrivate::operations_at, + QQuickStatePrivate::operations_clear); } -int QDeclarativeState::operationCount() const +int QQuickState::operationCount() const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->operations.count(); } -QDeclarativeStateOperation *QDeclarativeState::operationAt(int index) const +QQuickStateOperation *QQuickState::operationAt(int index) const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->operations.at(index); } -QDeclarativeState &QDeclarativeState::operator<<(QDeclarativeStateOperation *op) +QQuickState &QQuickState::operator<<(QQuickStateOperation *op) { - Q_D(QDeclarativeState); - d->operations.append(QDeclarativeStatePrivate::OperationGuard(op, &d->operations)); + Q_D(QQuickState); + d->operations.append(QQuickStatePrivate::OperationGuard(op, &d->operations)); return *this; } -void QDeclarativeStatePrivate::complete() +void QQuickStatePrivate::complete() { - Q_Q(QDeclarativeState); + Q_Q(QQuickState); for (int ii = 0; ii < reverting.count(); ++ii) { for (int jj = 0; jj < revertList.count(); ++jj) { - const QDeclarativeRevertAction &revert = reverting.at(ii); - const QDeclarativeSimpleAction &simple = revertList.at(jj); + const QQuickRevertAction &revert = reverting.at(ii); + const QQuickSimpleAction &simple = revertList.at(jj); if ((revert.event && simple.event() == revert.event) || simple.property() == revert.property) { revertList.removeAt(jj); @@ -316,10 +316,10 @@ void QDeclarativeStatePrivate::complete() // Generate a list of actions for this state. This includes coelescing state // actions that this state "extends" -QDeclarativeStateOperation::ActionList -QDeclarativeStatePrivate::generateActionList() const +QQuickStateOperation::ActionList +QQuickStatePrivate::generateActionList() const { - QDeclarativeStateOperation::ActionList applyList; + QQuickStateOperation::ActionList applyList; if (inState) return applyList; @@ -327,57 +327,57 @@ QDeclarativeStatePrivate::generateActionList() const inState = true; if (!extends.isEmpty()) { - QList<QDeclarativeState *> states = group ? group->states() : QList<QDeclarativeState *>(); + QList<QQuickState *> states = group ? group->states() : QList<QQuickState *>(); for (int ii = 0; ii < states.count(); ++ii) if (states.at(ii)->name() == extends) { qmlExecuteDeferred(states.at(ii)); - applyList = static_cast<QDeclarativeStatePrivate*>(states.at(ii)->d_func())->generateActionList(); + applyList = static_cast<QQuickStatePrivate*>(states.at(ii)->d_func())->generateActionList(); } } - foreach(QDeclarativeStateOperation *op, operations) + foreach(QQuickStateOperation *op, operations) applyList << op->actions(); inState = false; return applyList; } -QDeclarativeStateGroup *QDeclarativeState::stateGroup() const +QQuickStateGroup *QQuickState::stateGroup() const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); return d->group; } -void QDeclarativeState::setStateGroup(QDeclarativeStateGroup *group) +void QQuickState::setStateGroup(QQuickStateGroup *group) { - Q_D(QDeclarativeState); + Q_D(QQuickState); d->group = group; } -void QDeclarativeState::cancel() +void QQuickState::cancel() { - Q_D(QDeclarativeState); + Q_D(QQuickState); d->transitionManager.cancel(); } -void QDeclarativeAction::deleteFromBinding() +void QQuickAction::deleteFromBinding() { if (fromBinding) { - QDeclarativePropertyPrivate::setBinding(property, 0); + QQmlPropertyPrivate::setBinding(property, 0); fromBinding->destroy(); fromBinding = 0; } } -bool QDeclarativeState::containsPropertyInRevertList(QObject *target, const QString &name) const +bool QQuickState::containsPropertyInRevertList(QObject *target, const QString &name) const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); if (isStateActive()) { - QListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList); + QListIterator<QQuickSimpleAction> revertListIterator(d->revertList); while (revertListIterator.hasNext()) { - const QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); + const QQuickSimpleAction &simpleAction = revertListIterator.next(); if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) return true; } @@ -386,15 +386,15 @@ bool QDeclarativeState::containsPropertyInRevertList(QObject *target, const QStr return false; } -bool QDeclarativeState::changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue) +bool QQuickState::changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue) { - Q_D(QDeclarativeState); + Q_D(QQuickState); if (isStateActive()) { - QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList); + QMutableListIterator<QQuickSimpleAction> revertListIterator(d->revertList); while (revertListIterator.hasNext()) { - QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); + QQuickSimpleAction &simpleAction = revertListIterator.next(); if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) { simpleAction.setValue(revertValue); return true; @@ -405,15 +405,15 @@ bool QDeclarativeState::changeValueInRevertList(QObject *target, const QString & return false; } -bool QDeclarativeState::changeBindingInRevertList(QObject *target, const QString &name, QDeclarativeAbstractBinding *binding) +bool QQuickState::changeBindingInRevertList(QObject *target, const QString &name, QQmlAbstractBinding *binding) { - Q_D(QDeclarativeState); + Q_D(QQuickState); if (isStateActive()) { - QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList); + QMutableListIterator<QQuickSimpleAction> revertListIterator(d->revertList); while (revertListIterator.hasNext()) { - QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); + QQuickSimpleAction &simpleAction = revertListIterator.next(); if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) { if (simpleAction.binding()) simpleAction.binding()->destroy(); @@ -427,25 +427,25 @@ bool QDeclarativeState::changeBindingInRevertList(QObject *target, const QString return false; } -bool QDeclarativeState::removeEntryFromRevertList(QObject *target, const QString &name) +bool QQuickState::removeEntryFromRevertList(QObject *target, const QString &name) { - Q_D(QDeclarativeState); + Q_D(QQuickState); if (isStateActive()) { - QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList); + QMutableListIterator<QQuickSimpleAction> revertListIterator(d->revertList); while (revertListIterator.hasNext()) { - QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); + QQuickSimpleAction &simpleAction = revertListIterator.next(); if (simpleAction.property().object() == target && simpleAction.property().name() == name) { - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property()); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(simpleAction.property()); if (oldBinding) { - QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0); + QQmlPropertyPrivate::setBinding(simpleAction.property(), 0); oldBinding->destroy(); } simpleAction.property().write(simpleAction.value()); if (simpleAction.binding()) - QDeclarativePropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding()); + QQmlPropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding()); revertListIterator.remove(); return true; @@ -456,34 +456,34 @@ bool QDeclarativeState::removeEntryFromRevertList(QObject *target, const QString return false; } -void QDeclarativeState::addEntryToRevertList(const QDeclarativeAction &action) +void QQuickState::addEntryToRevertList(const QQuickAction &action) { - Q_D(QDeclarativeState); + Q_D(QQuickState); - QDeclarativeSimpleAction simpleAction(action); + QQuickSimpleAction simpleAction(action); d->revertList.append(simpleAction); } -void QDeclarativeState::removeAllEntriesFromRevertList(QObject *target) +void QQuickState::removeAllEntriesFromRevertList(QObject *target) { - Q_D(QDeclarativeState); + Q_D(QQuickState); if (isStateActive()) { - QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList); + QMutableListIterator<QQuickSimpleAction> revertListIterator(d->revertList); while (revertListIterator.hasNext()) { - QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); + QQuickSimpleAction &simpleAction = revertListIterator.next(); if (simpleAction.property().object() == target) { - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property()); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(simpleAction.property()); if (oldBinding) { - QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0); + QQmlPropertyPrivate::setBinding(simpleAction.property(), 0); oldBinding->destroy(); } simpleAction.property().write(simpleAction.value()); if (simpleAction.binding()) - QDeclarativePropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding()); + QQmlPropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding()); revertListIterator.remove(); } @@ -491,22 +491,22 @@ void QDeclarativeState::removeAllEntriesFromRevertList(QObject *target) } } -void QDeclarativeState::addEntriesToRevertList(const QList<QDeclarativeAction> &actionList) +void QQuickState::addEntriesToRevertList(const QList<QQuickAction> &actionList) { - Q_D(QDeclarativeState); + Q_D(QQuickState); if (isStateActive()) { - QList<QDeclarativeSimpleAction> simpleActionList; + QList<QQuickSimpleAction> simpleActionList; - QListIterator<QDeclarativeAction> actionListIterator(actionList); + QListIterator<QQuickAction> actionListIterator(actionList); while(actionListIterator.hasNext()) { - const QDeclarativeAction &action = actionListIterator.next(); - QDeclarativeSimpleAction simpleAction(action); + const QQuickAction &action = actionListIterator.next(); + QQuickSimpleAction simpleAction(action); action.property.write(action.toValue); if (!action.toBinding.isNull()) { - QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property()); + QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(simpleAction.property()); if (oldBinding) - QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0); - QDeclarativePropertyPrivate::setBinding(simpleAction.property(), action.toBinding.data(), QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::setBinding(simpleAction.property(), 0); + QQmlPropertyPrivate::setBinding(simpleAction.property(), action.toBinding.data(), QQmlPropertyPrivate::DontRemoveBinding); } simpleActionList.append(simpleAction); @@ -516,15 +516,15 @@ void QDeclarativeState::addEntriesToRevertList(const QList<QDeclarativeAction> & } } -QVariant QDeclarativeState::valueInRevertList(QObject *target, const QString &name) const +QVariant QQuickState::valueInRevertList(QObject *target, const QString &name) const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); if (isStateActive()) { - QListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList); + QListIterator<QQuickSimpleAction> revertListIterator(d->revertList); while (revertListIterator.hasNext()) { - const QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); + const QQuickSimpleAction &simpleAction = revertListIterator.next(); if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) return simpleAction.value(); } @@ -533,15 +533,15 @@ QVariant QDeclarativeState::valueInRevertList(QObject *target, const QString &na return QVariant(); } -QDeclarativeAbstractBinding *QDeclarativeState::bindingInRevertList(QObject *target, const QString &name) const +QQmlAbstractBinding *QQuickState::bindingInRevertList(QObject *target, const QString &name) const { - Q_D(const QDeclarativeState); + Q_D(const QQuickState); if (isStateActive()) { - QListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList); + QListIterator<QQuickSimpleAction> revertListIterator(d->revertList); while (revertListIterator.hasNext()) { - const QDeclarativeSimpleAction &simpleAction = revertListIterator.next(); + const QQuickSimpleAction &simpleAction = revertListIterator.next(); if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) return simpleAction.binding(); } @@ -550,14 +550,14 @@ QDeclarativeAbstractBinding *QDeclarativeState::bindingInRevertList(QObject *tar return 0; } -bool QDeclarativeState::isStateActive() const +bool QQuickState::isStateActive() const { return stateGroup() && stateGroup()->state() == name(); } -void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState *revert) +void QQuickState::apply(QQuickTransition *trans, QQuickState *revert) { - Q_D(QDeclarativeState); + Q_D(QQuickState); qmlExecuteDeferred(this); @@ -568,27 +568,27 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * d->reverting.clear(); if (revert) { - QDeclarativeStatePrivate *revertPrivate = - static_cast<QDeclarativeStatePrivate*>(revert->d_func()); + QQuickStatePrivate *revertPrivate = + static_cast<QQuickStatePrivate*>(revert->d_func()); d->revertList = revertPrivate->revertList; revertPrivate->revertList.clear(); } // List of actions caused by this state - QDeclarativeStateOperation::ActionList applyList = d->generateActionList(); + QQuickStateOperation::ActionList applyList = d->generateActionList(); // List of actions that need to be reverted to roll back (just) this state - QDeclarativeStatePrivate::SimpleActionList additionalReverts; + QQuickStatePrivate::SimpleActionList additionalReverts; // First add the reverse of all the applyList actions for (int ii = 0; ii < applyList.count(); ++ii) { - QDeclarativeAction &action = applyList[ii]; + QQuickAction &action = applyList[ii]; if (action.event) { if (!action.event->isReversable()) continue; bool found = false; for (int jj = 0; jj < d->revertList.count(); ++jj) { - QDeclarativeActionEvent *event = d->revertList.at(jj).event(); + QQuickActionEvent *event = d->revertList.at(jj).event(); if (event && event->type() == action.event->type()) { if (action.event->override(event)) { found = true; @@ -596,7 +596,7 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * if (action.event != d->revertList.at(jj).event() && action.event->needsCopy()) { action.event->copyOriginals(d->revertList.at(jj).event()); - QDeclarativeSimpleAction r(action); + QQuickSimpleAction r(action); additionalReverts << r; d->revertList.removeAt(jj); --jj; @@ -611,12 +611,12 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * action.event->saveOriginals(); // Only need to revert the applyList action if the previous // state doesn't have a higher priority revert already - QDeclarativeSimpleAction r(action); + QQuickSimpleAction r(action); additionalReverts << r; } } else { bool found = false; - action.fromBinding = QDeclarativePropertyPrivate::binding(action.property); + action.fromBinding = QQmlPropertyPrivate::binding(action.property); for (int jj = 0; jj < d->revertList.count(); ++jj) { if (d->revertList.at(jj).property() == action.property) { @@ -634,7 +634,7 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * } else { // Only need to revert the applyList action if the previous // state doesn't have a higher priority revert already - QDeclarativeSimpleAction r(action); + QQuickSimpleAction r(action); additionalReverts << r; } } @@ -646,11 +646,11 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * for (int ii = 0; ii < d->revertList.count(); ++ii) { bool found = false; if (d->revertList.at(ii).event()) { - QDeclarativeActionEvent *event = d->revertList.at(ii).event(); + QQuickActionEvent *event = d->revertList.at(ii).event(); if (!event->isReversable()) continue; for (int jj = 0; !found && jj < applyList.count(); ++jj) { - const QDeclarativeAction &action = applyList.at(jj); + const QQuickAction &action = applyList.at(jj); if (action.event && action.event->type() == event->type()) { if (action.event->override(event)) found = true; @@ -658,23 +658,23 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * } } else { for (int jj = 0; !found && jj < applyList.count(); ++jj) { - const QDeclarativeAction &action = applyList.at(jj); + const QQuickAction &action = applyList.at(jj); if (action.property == d->revertList.at(ii).property()) found = true; } } if (!found) { QVariant cur = d->revertList.at(ii).property().read(); - QDeclarativeAbstractBinding *delBinding = - QDeclarativePropertyPrivate::setBinding(d->revertList.at(ii).property(), 0); + QQmlAbstractBinding *delBinding = + QQmlPropertyPrivate::setBinding(d->revertList.at(ii).property(), 0); if (delBinding) delBinding->destroy(); - QDeclarativeAction a; + QQuickAction a; a.property = d->revertList.at(ii).property(); a.fromValue = cur; a.toValue = d->revertList.at(ii).value(); - a.toBinding = QDeclarativeAbstractBinding::getPointer(d->revertList.at(ii).binding()); + a.toBinding = QQmlAbstractBinding::getPointer(d->revertList.at(ii).binding()); a.specifiedObject = d->revertList.at(ii).specifiedObject(); a.specifiedProperty = d->revertList.at(ii).specifiedProperty(); a.event = d->revertList.at(ii).event(); @@ -695,11 +695,11 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * #ifndef QT_NO_DEBUG_STREAM // Output for debugging if (stateChangeDebug()) { - foreach(const QDeclarativeAction &action, applyList) { + foreach(const QQuickAction &action, applyList) { if (action.event) - qWarning() << " QDeclarativeAction event:" << action.event->type(); + qWarning() << " QQuickAction event:" << action.event->type(); else - qWarning() << " QDeclarativeAction:" << action.property.object() + qWarning() << " QQuickAction:" << action.property.object() << action.property.name() << "From:" << action.fromValue << "To:" << action.toValue; } @@ -709,20 +709,20 @@ void QDeclarativeState::apply(QDeclarativeTransition *trans, QDeclarativeState * d->transitionManager.transition(applyList, trans); } -QDeclarativeStateOperation::ActionList QDeclarativeStateOperation::actions() +QQuickStateOperation::ActionList QQuickStateOperation::actions() { return ActionList(); } -QDeclarativeState *QDeclarativeStateOperation::state() const +QQuickState *QQuickStateOperation::state() const { - Q_D(const QDeclarativeStateOperation); + Q_D(const QQuickStateOperation); return d->m_state; } -void QDeclarativeStateOperation::setState(QDeclarativeState *state) +void QQuickStateOperation::setState(QQuickState *state) { - Q_D(QDeclarativeStateOperation); + Q_D(QQuickStateOperation); d->m_state = state; } diff --git a/src/quick/util/qdeclarativestate_p.h b/src/quick/util/qquickstate_p.h index 5c2606e7cd..7dfc1daa44 100644 --- a/src/quick/util/qdeclarativestate_p.h +++ b/src/quick/util/qquickstate_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESTATE_H -#define QDECLARATIVESTATE_H +#ifndef QQUICKSTATE_H +#define QQUICKSTATE_H -#include <qdeclarative.h> -#include <qdeclarativeproperty.h> +#include <qqml.h> +#include <qqmlproperty.h> #include <QtCore/qobject.h> #include <QtCore/qsharedpointer.h> #include <private/qtquickglobal_p.h> @@ -52,30 +52,30 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeActionEvent; -class QDeclarativeAbstractBinding; -class QDeclarativeBinding; -class QDeclarativeExpression; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeAction +class QQuickActionEvent; +class QQmlAbstractBinding; +class QQmlBinding; +class QQmlExpression; +class Q_QUICK_PRIVATE_EXPORT QQuickAction { public: - QDeclarativeAction(); - QDeclarativeAction(QObject *, const QString &, const QVariant &); - QDeclarativeAction(QObject *, const QString &, - QDeclarativeContext *, const QVariant &); + QQuickAction(); + QQuickAction(QObject *, const QString &, const QVariant &); + QQuickAction(QObject *, const QString &, + QQmlContext *, const QVariant &); bool restore:1; bool actionDone:1; bool reverseEvent:1; bool deletableToBinding:1; - QDeclarativeProperty property; + QQmlProperty property; QVariant fromValue; QVariant toValue; - QDeclarativeAbstractBinding *fromBinding; - QWeakPointer<QDeclarativeAbstractBinding> toBinding; - QDeclarativeActionEvent *event; + QQmlAbstractBinding *fromBinding; + QWeakPointer<QQmlAbstractBinding> toBinding; + QQuickActionEvent *event; //strictly for matching QObject *specifiedObject; @@ -84,10 +84,10 @@ public: void deleteFromBinding(); }; -class Q_AUTOTEST_EXPORT QDeclarativeActionEvent +class Q_AUTOTEST_EXPORT QQuickActionEvent { public: - virtual ~QDeclarativeActionEvent(); + virtual ~QQuickActionEvent(); enum EventType { Script, SignalHandler, ParentChange, AnchorChanges }; enum Reason { ActualChange, FastForward }; @@ -99,7 +99,7 @@ public: virtual void reverse(Reason reason = ActualChange); virtual void saveOriginals() {} virtual bool needsCopy() { return false; } - virtual void copyOriginals(QDeclarativeActionEvent *) {} + virtual void copyOriginals(QQuickActionEvent *) {} virtual bool isRewindable() { return isReversable(); } virtual void rewind() {} @@ -108,87 +108,87 @@ public: virtual bool changesBindings(); virtual void clearBindings(); - virtual bool override(QDeclarativeActionEvent*other); + virtual bool override(QQuickActionEvent*other); }; -//### rename to QDeclarativeStateChange? -class QDeclarativeStateGroup; -class QDeclarativeState; -class QDeclarativeStateOperationPrivate; -class Q_QUICK_EXPORT QDeclarativeStateOperation : public QObject +//### rename to QQuickStateChange? +class QQuickStateGroup; +class QQuickState; +class QQuickStateOperationPrivate; +class Q_QUICK_EXPORT QQuickStateOperation : public QObject { Q_OBJECT public: - QDeclarativeStateOperation(QObject *parent = 0) + QQuickStateOperation(QObject *parent = 0) : QObject(parent) {} - typedef QList<QDeclarativeAction> ActionList; + typedef QList<QQuickAction> ActionList; virtual ActionList actions(); - QDeclarativeState *state() const; - void setState(QDeclarativeState *state); + QQuickState *state() const; + void setState(QQuickState *state); protected: - QDeclarativeStateOperation(QObjectPrivate &dd, QObject *parent = 0); + QQuickStateOperation(QObjectPrivate &dd, QObject *parent = 0); private: - Q_DECLARE_PRIVATE(QDeclarativeStateOperation) - Q_DISABLE_COPY(QDeclarativeStateOperation) + Q_DECLARE_PRIVATE(QQuickStateOperation) + Q_DISABLE_COPY(QQuickStateOperation) }; -typedef QDeclarativeStateOperation::ActionList QDeclarativeStateActions; +typedef QQuickStateOperation::ActionList QQuickStateActions; -class QDeclarativeTransition; -class QDeclarativeStatePrivate; -class Q_QUICK_EXPORT QDeclarativeState : public QObject +class QQuickTransition; +class QQuickStatePrivate; +class Q_QUICK_EXPORT QQuickState : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(QDeclarativeBinding *when READ when WRITE setWhen) + Q_PROPERTY(QQmlBinding *when READ when WRITE setWhen) Q_PROPERTY(QString extend READ extends WRITE setExtends) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeStateOperation> changes READ changes) + Q_PROPERTY(QQmlListProperty<QQuickStateOperation> changes READ changes) Q_CLASSINFO("DefaultProperty", "changes") Q_CLASSINFO("DeferredPropertyNames", "changes") public: - QDeclarativeState(QObject *parent=0); - virtual ~QDeclarativeState(); + QQuickState(QObject *parent=0); + virtual ~QQuickState(); QString name() const; void setName(const QString &); bool isNamed() const; - /*'when' is a QDeclarativeBinding to limit state changes oscillation + /*'when' is a QQmlBinding to limit state changes oscillation due to the unpredictable order of evaluation of bound expressions*/ bool isWhenKnown() const; - QDeclarativeBinding *when() const; - void setWhen(QDeclarativeBinding *); + QQmlBinding *when() const; + void setWhen(QQmlBinding *); QString extends() const; void setExtends(const QString &); - QDeclarativeListProperty<QDeclarativeStateOperation> changes(); + QQmlListProperty<QQuickStateOperation> changes(); int operationCount() const; - QDeclarativeStateOperation *operationAt(int) const; + QQuickStateOperation *operationAt(int) const; - QDeclarativeState &operator<<(QDeclarativeStateOperation *); + QQuickState &operator<<(QQuickStateOperation *); - void apply(QDeclarativeTransition *, QDeclarativeState *revert); + void apply(QQuickTransition *, QQuickState *revert); void cancel(); - QDeclarativeStateGroup *stateGroup() const; - void setStateGroup(QDeclarativeStateGroup *); + QQuickStateGroup *stateGroup() const; + void setStateGroup(QQuickStateGroup *); bool containsPropertyInRevertList(QObject *target, const QString &name) const; bool changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue); - bool changeBindingInRevertList(QObject *target, const QString &name, QDeclarativeAbstractBinding *binding); + bool changeBindingInRevertList(QObject *target, const QString &name, QQmlAbstractBinding *binding); bool removeEntryFromRevertList(QObject *target, const QString &name); - void addEntryToRevertList(const QDeclarativeAction &action); + void addEntryToRevertList(const QQuickAction &action); void removeAllEntriesFromRevertList(QObject *target); - void addEntriesToRevertList(const QList<QDeclarativeAction> &actions); + void addEntriesToRevertList(const QList<QQuickAction> &actions); QVariant valueInRevertList(QObject *target, const QString &name) const; - QDeclarativeAbstractBinding *bindingInRevertList(QObject *target, const QString &name) const; + QQmlAbstractBinding *bindingInRevertList(QObject *target, const QString &name) const; bool isStateActive() const; @@ -196,15 +196,15 @@ Q_SIGNALS: void completed(); private: - Q_DECLARE_PRIVATE(QDeclarativeState) - Q_DISABLE_COPY(QDeclarativeState) + Q_DECLARE_PRIVATE(QQuickState) + Q_DISABLE_COPY(QQuickState) }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeStateOperation) -QML_DECLARE_TYPE(QDeclarativeState) +QML_DECLARE_TYPE(QQuickStateOperation) +QML_DECLARE_TYPE(QQuickState) QT_END_HEADER -#endif // QDECLARATIVESTATE_H +#endif // QQUICKSTATE_H diff --git a/src/quick/util/qdeclarativestate_p_p.h b/src/quick/util/qquickstate_p_p.h index 4cf2bf4561..e1cd85a00c 100644 --- a/src/quick/util/qdeclarativestate_p_p.h +++ b/src/quick/util/qquickstate_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESTATE_P_H -#define QDECLARATIVESTATE_P_H +#ifndef QQUICKSTATE_P_H +#define QQUICKSTATE_P_H // // W A R N I N G @@ -53,24 +53,24 @@ // We mean it. // -#include "qdeclarativestate_p.h" +#include "qquickstate_p.h" -#include "qdeclarativetransitionmanager_p_p.h" +#include "qquicktransitionmanager_p_p.h" -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativeguard_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlguard_p.h> -#include <private/qdeclarativebinding_p.h> +#include <private/qqmlbinding_p.h> #include <private/qobject_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeSimpleAction +class QQuickSimpleAction { public: enum State { StartState, EndState }; - QDeclarativeSimpleAction(const QDeclarativeAction &a, State state = StartState) + QQuickSimpleAction(const QQuickAction &a, State state = StartState) { m_property = a.property; m_specifiedObject = a.specifiedObject; @@ -78,8 +78,8 @@ public: m_event = a.event; if (state == StartState) { m_value = a.fromValue; - if (QDeclarativePropertyPrivate::binding(m_property)) { - m_binding = QDeclarativeAbstractBinding::getPointer(QDeclarativePropertyPrivate::binding(m_property)); + if (QQmlPropertyPrivate::binding(m_property)) { + m_binding = QQmlAbstractBinding::getPointer(QQmlPropertyPrivate::binding(m_property)); } m_reverseEvent = true; } else { @@ -89,14 +89,14 @@ public: } } - ~QDeclarativeSimpleAction() + ~QQuickSimpleAction() { } - QDeclarativeSimpleAction(const QDeclarativeSimpleAction &other) + QQuickSimpleAction(const QQuickSimpleAction &other) : m_property(other.m_property), m_value(other.m_value), - m_binding(QDeclarativeAbstractBinding::getPointer(other.binding())), + m_binding(QQmlAbstractBinding::getPointer(other.binding())), m_specifiedObject(other.m_specifiedObject), m_specifiedProperty(other.m_specifiedProperty), m_event(other.m_event), @@ -104,11 +104,11 @@ public: { } - QDeclarativeSimpleAction &operator =(const QDeclarativeSimpleAction &other) + QQuickSimpleAction &operator =(const QQuickSimpleAction &other) { m_property = other.m_property; m_value = other.m_value; - m_binding = QDeclarativeAbstractBinding::getPointer(other.binding()); + m_binding = QQmlAbstractBinding::getPointer(other.binding()); m_specifiedObject = other.m_specifiedObject; m_specifiedProperty = other.m_specifiedProperty; m_event = other.m_event; @@ -117,12 +117,12 @@ public: return *this; } - void setProperty(const QDeclarativeProperty &property) + void setProperty(const QQmlProperty &property) { m_property = property; } - const QDeclarativeProperty &property() const + const QQmlProperty &property() const { return m_property; } @@ -137,12 +137,12 @@ public: return m_value; } - void setBinding(QDeclarativeAbstractBinding *binding) + void setBinding(QQmlAbstractBinding *binding) { - m_binding = QDeclarativeAbstractBinding::getPointer(binding); + m_binding = QQmlAbstractBinding::getPointer(binding); } - QDeclarativeAbstractBinding *binding() const + QQmlAbstractBinding *binding() const { return m_binding.data(); } @@ -157,7 +157,7 @@ public: return m_specifiedProperty; } - QDeclarativeActionEvent *event() const + QQuickActionEvent *event() const { return m_event; } @@ -168,97 +168,97 @@ public: } private: - QDeclarativeProperty m_property; + QQmlProperty m_property; QVariant m_value; - QDeclarativeAbstractBinding::Pointer m_binding; + QQmlAbstractBinding::Pointer m_binding; QObject *m_specifiedObject; QString m_specifiedProperty; - QDeclarativeActionEvent *m_event; + QQuickActionEvent *m_event; bool m_reverseEvent; }; -class QDeclarativeRevertAction +class QQuickRevertAction { public: - QDeclarativeRevertAction() : event(0) {} - QDeclarativeRevertAction(const QDeclarativeProperty &prop) : property(prop), event(0) {} - QDeclarativeRevertAction(QDeclarativeActionEvent *e) : event(e) {} - QDeclarativeProperty property; - QDeclarativeActionEvent *event; + QQuickRevertAction() : event(0) {} + QQuickRevertAction(const QQmlProperty &prop) : property(prop), event(0) {} + QQuickRevertAction(QQuickActionEvent *e) : event(e) {} + QQmlProperty property; + QQuickActionEvent *event; }; -class QDeclarativeStateOperationPrivate : public QObjectPrivate +class QQuickStateOperationPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeStateOperation) + Q_DECLARE_PUBLIC(QQuickStateOperation) public: - QDeclarativeStateOperationPrivate() + QQuickStateOperationPrivate() : m_state(0) {} - QDeclarativeState *m_state; + QQuickState *m_state; }; -class QDeclarativeStatePrivate : public QObjectPrivate +class QQuickStatePrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeState) + Q_DECLARE_PUBLIC(QQuickState) public: - QDeclarativeStatePrivate() + QQuickStatePrivate() : when(0), named(false), inState(false), group(0) {} - typedef QList<QDeclarativeSimpleAction> SimpleActionList; + typedef QList<QQuickSimpleAction> SimpleActionList; QString name; - QDeclarativeBinding *when; + QQmlBinding *when; bool named; - struct OperationGuard : public QDeclarativeGuard<QDeclarativeStateOperation> + struct OperationGuard : public QQmlGuard<QQuickStateOperation> { OperationGuard(QObject *obj, QList<OperationGuard> *l) : list(l) { - setObject(static_cast<QDeclarativeStateOperation *>(obj)); + setObject(static_cast<QQuickStateOperation *>(obj)); } QList<OperationGuard> *list; - void objectDestroyed(QDeclarativeStateOperation *) { + void objectDestroyed(QQuickStateOperation *) { // we assume priv will always be destroyed after objectDestroyed calls list->removeOne(*this); } }; QList<OperationGuard> operations; - static void operations_append(QDeclarativeListProperty<QDeclarativeStateOperation> *prop, QDeclarativeStateOperation *op) { + static void operations_append(QQmlListProperty<QQuickStateOperation> *prop, QQuickStateOperation *op) { QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); - op->setState(qobject_cast<QDeclarativeState*>(prop->object)); + op->setState(qobject_cast<QQuickState*>(prop->object)); list->append(OperationGuard(op, list)); } - static void operations_clear(QDeclarativeListProperty<QDeclarativeStateOperation> *prop) { + static void operations_clear(QQmlListProperty<QQuickStateOperation> *prop) { QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); QMutableListIterator<OperationGuard> listIterator(*list); while(listIterator.hasNext()) listIterator.next()->setState(0); list->clear(); } - static int operations_count(QDeclarativeListProperty<QDeclarativeStateOperation> *prop) { + static int operations_count(QQmlListProperty<QQuickStateOperation> *prop) { QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); return list->count(); } - static QDeclarativeStateOperation *operations_at(QDeclarativeListProperty<QDeclarativeStateOperation> *prop, int index) { + static QQuickStateOperation *operations_at(QQmlListProperty<QQuickStateOperation> *prop, int index) { QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); return list->at(index); } - QDeclarativeTransitionManager transitionManager; + QQuickTransitionManager transitionManager; SimpleActionList revertList; - QList<QDeclarativeRevertAction> reverting; + QList<QQuickRevertAction> reverting; QString extends; mutable bool inState; - QDeclarativeStateGroup *group; + QQuickStateGroup *group; - QDeclarativeStateOperation::ActionList generateActionList() const; + QQuickStateOperation::ActionList generateActionList() const; void complete(); }; QT_END_NAMESPACE -#endif // QDECLARATIVESTATE_P_H +#endif // QQUICKSTATE_P_H diff --git a/src/quick/util/qdeclarativestateoperations.cpp b/src/quick/util/qquickstatechangescript.cpp index 3ecf4973d5..4dedbcc920 100644 --- a/src/quick/util/qdeclarativestateoperations.cpp +++ b/src/quick/util/qquickstatechangescript.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "qdeclarativestateoperations_p.h" +#include "qquickstatechangescript_p.h" -#include <qdeclarative.h> -#include <qdeclarativecontext.h> -#include <qdeclarativeexpression.h> -#include <qdeclarativeinfo.h> -#include <private/qdeclarativeguard_p.h> -#include <private/qdeclarativecontext_p.h> -#include <private/qdeclarativeproperty_p.h> -#include <private/qdeclarativebinding_p.h> -#include "qdeclarativestate_p_p.h" +#include <qqml.h> +#include <qqmlcontext.h> +#include <qqmlexpression.h> +#include <qqmlinfo.h> +#include <private/qqmlguard_p.h> +#include <private/qqmlcontext_p.h> +#include <private/qqmlproperty_p.h> +#include <private/qqmlbinding_p.h> +#include "qquickstate_p_p.h" #include <QtCore/qdebug.h> #include <QtCore/qmath.h> @@ -58,17 +58,17 @@ QT_BEGIN_NAMESPACE -class QDeclarativeStateChangeScriptPrivate : public QDeclarativeStateOperationPrivate +class QQuickStateChangeScriptPrivate : public QQuickStateOperationPrivate { public: - QDeclarativeStateChangeScriptPrivate() {} + QQuickStateChangeScriptPrivate() {} - QDeclarativeScriptString script; + QQmlScriptString script; QString name; }; /*! - \qmlclass StateChangeScript QDeclarativeStateChangeScript + \qmlclass StateChangeScript QQuickStateChangeScript \inqmlmodule QtQuick 2 \ingroup qml-state-elements \brief The StateChangeScript element allows you to run a script in a state. @@ -82,12 +82,12 @@ public: \sa ScriptAction */ -QDeclarativeStateChangeScript::QDeclarativeStateChangeScript(QObject *parent) -: QDeclarativeStateOperation(*(new QDeclarativeStateChangeScriptPrivate), parent) +QQuickStateChangeScript::QQuickStateChangeScript(QObject *parent) +: QQuickStateOperation(*(new QQuickStateChangeScriptPrivate), parent) { } -QDeclarativeStateChangeScript::~QDeclarativeStateChangeScript() +QQuickStateChangeScript::~QQuickStateChangeScript() { } @@ -95,15 +95,15 @@ QDeclarativeStateChangeScript::~QDeclarativeStateChangeScript() \qmlproperty script QtQuick2::StateChangeScript::script This property holds the script to run when the state is current. */ -QDeclarativeScriptString QDeclarativeStateChangeScript::script() const +QQmlScriptString QQuickStateChangeScript::script() const { - Q_D(const QDeclarativeStateChangeScript); + Q_D(const QQuickStateChangeScript); return d->script; } -void QDeclarativeStateChangeScript::setScript(const QDeclarativeScriptString &s) +void QQuickStateChangeScript::setScript(const QQmlScriptString &s) { - Q_D(QDeclarativeStateChangeScript); + Q_D(QQuickStateChangeScript); d->script = s; } @@ -114,44 +114,45 @@ void QDeclarativeStateChangeScript::setScript(const QDeclarativeScriptString &s) \sa ScriptAction::scriptName */ -QString QDeclarativeStateChangeScript::name() const +QString QQuickStateChangeScript::name() const { - Q_D(const QDeclarativeStateChangeScript); + Q_D(const QQuickStateChangeScript); return d->name; } -void QDeclarativeStateChangeScript::setName(const QString &n) +void QQuickStateChangeScript::setName(const QString &n) { - Q_D(QDeclarativeStateChangeScript); + Q_D(QQuickStateChangeScript); d->name = n; } -void QDeclarativeStateChangeScript::execute(Reason) +void QQuickStateChangeScript::execute(Reason) { - Q_D(QDeclarativeStateChangeScript); + Q_D(QQuickStateChangeScript); if (!d->script.script().isEmpty()) { - QDeclarativeExpression expr(d->script); + QQmlExpression expr(d->script); expr.evaluate(); if (expr.hasError()) qmlInfo(this, expr.error()); } } -QDeclarativeStateChangeScript::ActionList QDeclarativeStateChangeScript::actions() +QQuickStateChangeScript::ActionList QQuickStateChangeScript::actions() { ActionList rv; - QDeclarativeAction a; + QQuickAction a; a.event = this; rv << a; return rv; } -QDeclarativeActionEvent::EventType QDeclarativeStateChangeScript::type() const +QQuickActionEvent::EventType QQuickStateChangeScript::type() const { return Script; } -#include <moc_qdeclarativestateoperations_p.cpp> + +#include <moc_qquickstatechangescript_p.cpp> QT_END_NAMESPACE diff --git a/src/quick/util/qdeclarativestateoperations_p.h b/src/quick/util/qquickstatechangescript_p.h index a64a7e2972..444657d245 100644 --- a/src/quick/util/qdeclarativestateoperations_p.h +++ b/src/quick/util/qquickstatechangescript_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,35 +39,35 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESTATEOPERATIONS_H -#define QDECLARATIVESTATEOPERATIONS_H +#ifndef QQUICKSTATEOPERATIONS_H +#define QQUICKSTATEOPERATIONS_H -#include "qdeclarativestate_p.h" -#include <qdeclarativescriptstring.h> +#include "qquickstate_p.h" +#include <qqmlscriptstring.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeStateChangeScriptPrivate; -class Q_AUTOTEST_EXPORT QDeclarativeStateChangeScript : public QDeclarativeStateOperation, public QDeclarativeActionEvent +class QQuickStateChangeScriptPrivate; +class Q_AUTOTEST_EXPORT QQuickStateChangeScript : public QQuickStateOperation, public QQuickActionEvent { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeStateChangeScript) + Q_DECLARE_PRIVATE(QQuickStateChangeScript) - Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript) + Q_PROPERTY(QQmlScriptString script READ script WRITE setScript) Q_PROPERTY(QString name READ name WRITE setName) public: - QDeclarativeStateChangeScript(QObject *parent=0); - ~QDeclarativeStateChangeScript(); + QQuickStateChangeScript(QObject *parent=0); + ~QQuickStateChangeScript(); virtual ActionList actions(); virtual EventType type() const; - QDeclarativeScriptString script() const; - void setScript(const QDeclarativeScriptString &); + QQmlScriptString script() const; + void setScript(const QQmlScriptString &); QString name() const; void setName(const QString &); @@ -78,8 +78,8 @@ public: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeStateChangeScript) +QML_DECLARE_TYPE(QQuickStateChangeScript) QT_END_HEADER -#endif // QDECLARATIVESTATEOPERATIONS_H +#endif // QQUICKSTATEOPERATIONS_H diff --git a/src/quick/util/qdeclarativestategroup.cpp b/src/quick/util/qquickstategroup.cpp index 1ed3ffc582..3a3192716e 100644 --- a/src/quick/util/qdeclarativestategroup.cpp +++ b/src/quick/util/qquickstategroup.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,60 +39,60 @@ ** ****************************************************************************/ -#include "qdeclarativestategroup_p.h" +#include "qquickstategroup_p.h" -#include "qdeclarativetransition_p.h" +#include "qquicktransition_p.h" -#include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativeglobal_p.h> +#include <private/qqmlbinding_p.h> +#include <private/qqmlglobal_p.h> #include <QtCore/qstringbuilder.h> #include <QtCore/qstringlist.h> #include <QtCore/qdebug.h> #include <private/qobject_p.h> -#include <qdeclarativeinfo.h> +#include <qqmlinfo.h> QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG); -class QDeclarativeStateGroupPrivate : public QObjectPrivate +class QQuickStateGroupPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeStateGroup) + Q_DECLARE_PUBLIC(QQuickStateGroup) public: - QDeclarativeStateGroupPrivate() + QQuickStateGroupPrivate() : nullState(0), componentComplete(true), ignoreTrans(false), applyingState(false), unnamedCount(0) {} QString currentState; - QDeclarativeState *nullState; + QQuickState *nullState; - static void append_state(QDeclarativeListProperty<QDeclarativeState> *list, QDeclarativeState *state); - static int count_state(QDeclarativeListProperty<QDeclarativeState> *list); - static QDeclarativeState *at_state(QDeclarativeListProperty<QDeclarativeState> *list, int index); - static void clear_states(QDeclarativeListProperty<QDeclarativeState> *list); + static void append_state(QQmlListProperty<QQuickState> *list, QQuickState *state); + static int count_state(QQmlListProperty<QQuickState> *list); + static QQuickState *at_state(QQmlListProperty<QQuickState> *list, int index); + static void clear_states(QQmlListProperty<QQuickState> *list); - static void append_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, QDeclarativeTransition *state); - static int count_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list); - static QDeclarativeTransition *at_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, int index); - static void clear_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list); + static void append_transition(QQmlListProperty<QQuickTransition> *list, QQuickTransition *state); + static int count_transitions(QQmlListProperty<QQuickTransition> *list); + static QQuickTransition *at_transition(QQmlListProperty<QQuickTransition> *list, int index); + static void clear_transitions(QQmlListProperty<QQuickTransition> *list); - QList<QDeclarativeState *> states; - QList<QDeclarativeTransition *> transitions; + QList<QQuickState *> states; + QList<QQuickTransition *> transitions; bool componentComplete; bool ignoreTrans; bool applyingState; int unnamedCount; - QDeclarativeTransition *findTransition(const QString &from, const QString &to); + QQuickTransition *findTransition(const QString &from, const QString &to); void setCurrentStateInternal(const QString &state, bool = false); bool updateAutoState(); }; /*! - \qmlclass StateGroup QDeclarativeStateGroup + \qmlclass StateGroup QQuickStateGroup \inqmlmodule QtQuick 2 \ingroup qml-state-elements \brief The StateGroup element provides state support for non-Item elements. @@ -118,24 +118,24 @@ public: } \endqml - \sa {qmlstate}{States} {QML Animation and Transitions}{Transitions}, {QtDeclarative} + \sa {qmlstate}{States} {QML Animation and Transitions}{Transitions}, {QtQml} */ -QDeclarativeStateGroup::QDeclarativeStateGroup(QObject *parent) - : QObject(*(new QDeclarativeStateGroupPrivate), parent) +QQuickStateGroup::QQuickStateGroup(QObject *parent) + : QObject(*(new QQuickStateGroupPrivate), parent) { } -QDeclarativeStateGroup::~QDeclarativeStateGroup() +QQuickStateGroup::~QQuickStateGroup() { - Q_D(const QDeclarativeStateGroup); + Q_D(const QQuickStateGroup); for (int i = 0; i < d->states.count(); ++i) d->states.at(i)->setStateGroup(0); } -QList<QDeclarativeState *> QDeclarativeStateGroup::states() const +QList<QQuickState *> QQuickStateGroup::states() const { - Q_D(const QDeclarativeStateGroup); + Q_D(const QQuickStateGroup); return d->states; } @@ -159,18 +159,18 @@ QList<QDeclarativeState *> QDeclarativeStateGroup::states() const \sa {qmlstate}{States} */ -QDeclarativeListProperty<QDeclarativeState> QDeclarativeStateGroup::statesProperty() +QQmlListProperty<QQuickState> QQuickStateGroup::statesProperty() { - Q_D(QDeclarativeStateGroup); - return QDeclarativeListProperty<QDeclarativeState>(this, &d->states, &QDeclarativeStateGroupPrivate::append_state, - &QDeclarativeStateGroupPrivate::count_state, - &QDeclarativeStateGroupPrivate::at_state, - &QDeclarativeStateGroupPrivate::clear_states); + Q_D(QQuickStateGroup); + return QQmlListProperty<QQuickState>(this, &d->states, &QQuickStateGroupPrivate::append_state, + &QQuickStateGroupPrivate::count_state, + &QQuickStateGroupPrivate::at_state, + &QQuickStateGroupPrivate::clear_states); } -void QDeclarativeStateGroupPrivate::append_state(QDeclarativeListProperty<QDeclarativeState> *list, QDeclarativeState *state) +void QQuickStateGroupPrivate::append_state(QQmlListProperty<QQuickState> *list, QQuickState *state) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); if (state) { _this->d_func()->states.append(state); state->setStateGroup(_this); @@ -178,21 +178,21 @@ void QDeclarativeStateGroupPrivate::append_state(QDeclarativeListProperty<QDecla } -int QDeclarativeStateGroupPrivate::count_state(QDeclarativeListProperty<QDeclarativeState> *list) +int QQuickStateGroupPrivate::count_state(QQmlListProperty<QQuickState> *list) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->states.count(); } -QDeclarativeState *QDeclarativeStateGroupPrivate::at_state(QDeclarativeListProperty<QDeclarativeState> *list, int index) +QQuickState *QQuickStateGroupPrivate::at_state(QQmlListProperty<QQuickState> *list, int index) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->states.at(index); } -void QDeclarativeStateGroupPrivate::clear_states(QDeclarativeListProperty<QDeclarativeState> *list) +void QQuickStateGroupPrivate::clear_states(QQmlListProperty<QQuickState> *list) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); _this->d_func()->setCurrentStateInternal(QString(), true); for (int i = 0; i < _this->d_func()->states.count(); ++i) { _this->d_func()->states.at(i)->setStateGroup(0); @@ -220,37 +220,37 @@ void QDeclarativeStateGroupPrivate::clear_states(QDeclarativeListProperty<QDecla \sa {QML Animation and Transitions}{Transitions} */ -QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeStateGroup::transitionsProperty() +QQmlListProperty<QQuickTransition> QQuickStateGroup::transitionsProperty() { - Q_D(QDeclarativeStateGroup); - return QDeclarativeListProperty<QDeclarativeTransition>(this, &d->transitions, &QDeclarativeStateGroupPrivate::append_transition, - &QDeclarativeStateGroupPrivate::count_transitions, - &QDeclarativeStateGroupPrivate::at_transition, - &QDeclarativeStateGroupPrivate::clear_transitions); + Q_D(QQuickStateGroup); + return QQmlListProperty<QQuickTransition>(this, &d->transitions, &QQuickStateGroupPrivate::append_transition, + &QQuickStateGroupPrivate::count_transitions, + &QQuickStateGroupPrivate::at_transition, + &QQuickStateGroupPrivate::clear_transitions); } -void QDeclarativeStateGroupPrivate::append_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, QDeclarativeTransition *trans) +void QQuickStateGroupPrivate::append_transition(QQmlListProperty<QQuickTransition> *list, QQuickTransition *trans) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); if (trans) _this->d_func()->transitions.append(trans); } -int QDeclarativeStateGroupPrivate::count_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list) +int QQuickStateGroupPrivate::count_transitions(QQmlListProperty<QQuickTransition> *list) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->transitions.count(); } -QDeclarativeTransition *QDeclarativeStateGroupPrivate::at_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, int index) +QQuickTransition *QQuickStateGroupPrivate::at_transition(QQmlListProperty<QQuickTransition> *list, int index) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->transitions.at(index); } -void QDeclarativeStateGroupPrivate::clear_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list) +void QQuickStateGroupPrivate::clear_transitions(QQmlListProperty<QQuickTransition> *list) { - QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); _this->d_func()->transitions.clear(); } @@ -277,34 +277,34 @@ void QDeclarativeStateGroupPrivate::clear_transitions(QDeclarativeListProperty<Q \sa {qmlstates}{States} */ -QString QDeclarativeStateGroup::state() const +QString QQuickStateGroup::state() const { - Q_D(const QDeclarativeStateGroup); + Q_D(const QQuickStateGroup); return d->currentState; } -void QDeclarativeStateGroup::setState(const QString &state) +void QQuickStateGroup::setState(const QString &state) { - Q_D(QDeclarativeStateGroup); + Q_D(QQuickStateGroup); if (d->currentState == state) return; d->setCurrentStateInternal(state); } -void QDeclarativeStateGroup::classBegin() +void QQuickStateGroup::classBegin() { - Q_D(QDeclarativeStateGroup); + Q_D(QQuickStateGroup); d->componentComplete = false; } -void QDeclarativeStateGroup::componentComplete() +void QQuickStateGroup::componentComplete() { - Q_D(QDeclarativeStateGroup); + Q_D(QQuickStateGroup); d->componentComplete = true; for (int ii = 0; ii < d->states.count(); ++ii) { - QDeclarativeState *state = d->states.at(ii); + QQuickState *state = d->states.at(ii); if (!state->isNamed()) state->setName(QLatin1String("anonymousState") % QString::number(++d->unnamedCount)); } @@ -321,21 +321,21 @@ void QDeclarativeStateGroup::componentComplete() /*! Returns true if the state was changed, otherwise false. */ -bool QDeclarativeStateGroup::updateAutoState() +bool QQuickStateGroup::updateAutoState() { - Q_D(QDeclarativeStateGroup); + Q_D(QQuickStateGroup); return d->updateAutoState(); } -bool QDeclarativeStateGroupPrivate::updateAutoState() +bool QQuickStateGroupPrivate::updateAutoState() { - Q_Q(QDeclarativeStateGroup); + Q_Q(QQuickStateGroup); if (!componentComplete) return false; bool revert = false; for (int ii = 0; ii < states.count(); ++ii) { - QDeclarativeState *state = states.at(ii); + QQuickState *state = states.at(ii); if (state->isWhenKnown()) { if (state->isNamed()) { if (state->when() && state->when()->evaluate().toBool()) { @@ -363,15 +363,15 @@ bool QDeclarativeStateGroupPrivate::updateAutoState() } } -QDeclarativeTransition *QDeclarativeStateGroupPrivate::findTransition(const QString &from, const QString &to) +QQuickTransition *QQuickStateGroupPrivate::findTransition(const QString &from, const QString &to) { - QDeclarativeTransition *highest = 0; + QQuickTransition *highest = 0; int score = 0; bool reversed = false; bool done = false; for (int ii = 0; !done && ii < transitions.count(); ++ii) { - QDeclarativeTransition *t = transitions.at(ii); + QQuickTransition *t = transitions.at(ii); if (!t->enabled()) continue; for (int ii = 0; ii < 2; ++ii) @@ -428,10 +428,10 @@ QDeclarativeTransition *QDeclarativeStateGroupPrivate::findTransition(const QStr return highest; } -void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state, +void QQuickStateGroupPrivate::setCurrentStateInternal(const QString &state, bool ignoreTrans) { - Q_Q(QDeclarativeStateGroup); + Q_Q(QQuickStateGroup); if (!componentComplete) { currentState = state; return; @@ -444,7 +444,7 @@ void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state applyingState = true; - QDeclarativeTransition *transition = ignoreTrans ? 0 : findTransition(currentState, state); + QQuickTransition *transition = ignoreTrans ? 0 : findTransition(currentState, state); if (stateChangeDebug()) { qWarning() << this << "Changing state. From" << currentState << ". To" << state; if (transition) @@ -452,7 +452,7 @@ void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state << transition->toState(); } - QDeclarativeState *oldState = 0; + QQuickState *oldState = 0; if (!currentState.isEmpty()) { for (int ii = 0; ii < states.count(); ++ii) { if (states.at(ii)->name() == currentState) { @@ -465,7 +465,7 @@ void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state currentState = state; emit q->stateChanged(currentState); - QDeclarativeState *newState = 0; + QQuickState *newState = 0; for (int ii = 0; ii < states.count(); ++ii) { if (states.at(ii)->name() == currentState) { newState = states.at(ii); @@ -475,8 +475,8 @@ void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state if (oldState == 0 || newState == 0) { if (!nullState) { - nullState = new QDeclarativeState; - QDeclarative_setParent_noEvent(nullState, q); + nullState = new QQuickState; + QQml_setParent_noEvent(nullState, q); nullState->setStateGroup(q); } if (!oldState) oldState = nullState; @@ -487,11 +487,11 @@ void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state applyingState = false; //### consider removing this (don't allow state changes in transition) } -QDeclarativeState *QDeclarativeStateGroup::findState(const QString &name) const +QQuickState *QQuickStateGroup::findState(const QString &name) const { - Q_D(const QDeclarativeStateGroup); + Q_D(const QQuickStateGroup); for (int i = 0; i < d->states.count(); ++i) { - QDeclarativeState *state = d->states.at(i); + QQuickState *state = d->states.at(i); if (state->name() == name) return state; } @@ -499,15 +499,15 @@ QDeclarativeState *QDeclarativeStateGroup::findState(const QString &name) const return 0; } -void QDeclarativeStateGroup::removeState(QDeclarativeState *state) +void QQuickStateGroup::removeState(QQuickState *state) { - Q_D(QDeclarativeStateGroup); + Q_D(QQuickStateGroup); d->states.removeOne(state); } -void QDeclarativeStateGroup::stateAboutToComplete() +void QQuickStateGroup::stateAboutToComplete() { - Q_D(QDeclarativeStateGroup); + Q_D(QQuickStateGroup); d->applyingState = false; } diff --git a/src/quick/util/qdeclarativestategroup_p.h b/src/quick/util/qquickstategroup_p.h index d0dc599a63..07e3c0505a 100644 --- a/src/quick/util/qdeclarativestategroup_p.h +++ b/src/quick/util/qquickstategroup_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,40 +39,40 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESTATEGROUP_H -#define QDECLARATIVESTATEGROUP_H +#ifndef QQUICKSTATEGROUP_H +#define QQUICKSTATEGROUP_H -#include "qdeclarativestate_p.h" +#include "qquickstate_p.h" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeStateGroupPrivate; -class Q_QUICK_EXPORT QDeclarativeStateGroup : public QObject, public QDeclarativeParserStatus +class QQuickStateGroupPrivate; +class Q_QUICK_EXPORT QQuickStateGroup : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) - Q_DECLARE_PRIVATE(QDeclarativeStateGroup) + Q_INTERFACES(QQmlParserStatus) + Q_DECLARE_PRIVATE(QQuickStateGroup) Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeState> states READ statesProperty DESIGNABLE false) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitionsProperty DESIGNABLE false) + Q_PROPERTY(QQmlListProperty<QQuickState> states READ statesProperty DESIGNABLE false) + Q_PROPERTY(QQmlListProperty<QQuickTransition> transitions READ transitionsProperty DESIGNABLE false) public: - QDeclarativeStateGroup(QObject * = 0); - virtual ~QDeclarativeStateGroup(); + QQuickStateGroup(QObject * = 0); + virtual ~QQuickStateGroup(); QString state() const; void setState(const QString &); - QDeclarativeListProperty<QDeclarativeState> statesProperty(); - QList<QDeclarativeState *> states() const; + QQmlListProperty<QQuickState> statesProperty(); + QList<QQuickState *> states() const; - QDeclarativeListProperty<QDeclarativeTransition> transitionsProperty(); + QQmlListProperty<QQuickTransition> transitionsProperty(); - QDeclarativeState *findState(const QString &name) const; - void removeState(QDeclarativeState *state); + QQuickState *findState(const QString &name) const; + void removeState(QQuickState *state); virtual void classBegin(); virtual void componentComplete(); @@ -80,16 +80,16 @@ Q_SIGNALS: void stateChanged(const QString &); private: - friend class QDeclarativeState; - friend class QDeclarativeStatePrivate; + friend class QQuickState; + friend class QQuickStatePrivate; bool updateAutoState(); void stateAboutToComplete(); }; QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeStateGroup) +QML_DECLARE_TYPE(QQuickStateGroup) QT_END_HEADER -#endif // QDECLARATIVESTATEGROUP_H +#endif // QQUICKSTATEGROUP_H diff --git a/src/quick/util/qdeclarativestyledtext.cpp b/src/quick/util/qquickstyledtext.cpp index 164e33cec1..87d447169c 100644 --- a/src/quick/util/qdeclarativestyledtext.cpp +++ b/src/quick/util/qquickstyledtext.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,11 +45,11 @@ #include <QTextLayout> #include <QDebug> #include <qmath.h> -#include "qdeclarativestyledtext_p.h" -#include <QDeclarativeContext> +#include "qquickstyledtext_p.h" +#include <QQmlContext> /* - QDeclarativeStyledText supports few tags: + QQuickStyledText supports few tags: <b></b> - bold <strong></strong> - bold @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE -class QDeclarativeStyledTextPrivate +class QQuickStyledTextPrivate { public: enum ListType { Ordered, Unordered }; @@ -81,10 +81,10 @@ public: ListFormat format; }; - QDeclarativeStyledTextPrivate(const QString &t, QTextLayout &l, - QList<QDeclarativeStyledTextImgTag*> &imgTags, + QQuickStyledTextPrivate(const QString &t, QTextLayout &l, + QList<QQuickStyledTextImgTag*> &imgTags, const QUrl &baseUrl, - QDeclarativeContext *context, + QQmlContext *context, bool preloadImages) : text(t), layout(l), imgTags(&imgTags), baseFont(layout.font()), baseUrl(baseUrl), hasNewLine(false), nbImages(0), updateImagePositions(false) , preFormat(false), prependSpace(false), hasSpace(true), preloadImages(preloadImages), context(context) @@ -115,7 +115,7 @@ public: QString text; QTextLayout &layout; - QList<QDeclarativeStyledTextImgTag*> *imgTags; + QList<QQuickStyledTextImgTag*> *imgTags; QFont baseFont; QStack<List> listStack; QUrl baseUrl; @@ -126,7 +126,7 @@ public: bool prependSpace; bool hasSpace; bool preloadImages; - QDeclarativeContext *context; + QQmlContext *context; static const QChar lessThan; static const QChar greaterThan; @@ -143,46 +143,46 @@ public: static const int tabsize = 6; }; -const QChar QDeclarativeStyledTextPrivate::lessThan(QLatin1Char('<')); -const QChar QDeclarativeStyledTextPrivate::greaterThan(QLatin1Char('>')); -const QChar QDeclarativeStyledTextPrivate::equals(QLatin1Char('=')); -const QChar QDeclarativeStyledTextPrivate::singleQuote(QLatin1Char('\'')); -const QChar QDeclarativeStyledTextPrivate::doubleQuote(QLatin1Char('\"')); -const QChar QDeclarativeStyledTextPrivate::slash(QLatin1Char('/')); -const QChar QDeclarativeStyledTextPrivate::ampersand(QLatin1Char('&')); -const QChar QDeclarativeStyledTextPrivate::bullet(0x2022); -const QChar QDeclarativeStyledTextPrivate::disc(0x25e6); -const QChar QDeclarativeStyledTextPrivate::square(0x25a1); -const QChar QDeclarativeStyledTextPrivate::lineFeed(QLatin1Char('\n')); -const QChar QDeclarativeStyledTextPrivate::space(QLatin1Char(' ')); - -QDeclarativeStyledText::QDeclarativeStyledText(const QString &string, QTextLayout &layout, - QList<QDeclarativeStyledTextImgTag*> &imgTags, +const QChar QQuickStyledTextPrivate::lessThan(QLatin1Char('<')); +const QChar QQuickStyledTextPrivate::greaterThan(QLatin1Char('>')); +const QChar QQuickStyledTextPrivate::equals(QLatin1Char('=')); +const QChar QQuickStyledTextPrivate::singleQuote(QLatin1Char('\'')); +const QChar QQuickStyledTextPrivate::doubleQuote(QLatin1Char('\"')); +const QChar QQuickStyledTextPrivate::slash(QLatin1Char('/')); +const QChar QQuickStyledTextPrivate::ampersand(QLatin1Char('&')); +const QChar QQuickStyledTextPrivate::bullet(0x2022); +const QChar QQuickStyledTextPrivate::disc(0x25e6); +const QChar QQuickStyledTextPrivate::square(0x25a1); +const QChar QQuickStyledTextPrivate::lineFeed(QLatin1Char('\n')); +const QChar QQuickStyledTextPrivate::space(QLatin1Char(' ')); + +QQuickStyledText::QQuickStyledText(const QString &string, QTextLayout &layout, + QList<QQuickStyledTextImgTag*> &imgTags, const QUrl &baseUrl, - QDeclarativeContext *context, + QQmlContext *context, bool preloadImages) - : d(new QDeclarativeStyledTextPrivate(string, layout, imgTags, baseUrl, context, preloadImages)) + : d(new QQuickStyledTextPrivate(string, layout, imgTags, baseUrl, context, preloadImages)) { } -QDeclarativeStyledText::~QDeclarativeStyledText() +QQuickStyledText::~QQuickStyledText() { delete d; } -void QDeclarativeStyledText::parse(const QString &string, QTextLayout &layout, - QList<QDeclarativeStyledTextImgTag*> &imgTags, +void QQuickStyledText::parse(const QString &string, QTextLayout &layout, + QList<QQuickStyledTextImgTag*> &imgTags, const QUrl &baseUrl, - QDeclarativeContext *context, + QQmlContext *context, bool preloadImages) { if (string.isEmpty()) return; - QDeclarativeStyledText styledText(string, layout, imgTags, baseUrl, context, preloadImages); + QQuickStyledText styledText(string, layout, imgTags, baseUrl, context, preloadImages); styledText.d->parse(); } -void QDeclarativeStyledTextPrivate::parse() +void QQuickStyledTextPrivate::parse() { QList<QTextLayout::FormatRange> ranges; QStack<QTextCharFormat> formatStack; @@ -288,7 +288,7 @@ void QDeclarativeStyledTextPrivate::parse() layout.setAdditionalFormats(ranges); } -void QDeclarativeStyledTextPrivate::appendText(const QString &textIn, int start, int length, QString &textOut) +void QQuickStyledTextPrivate::appendText(const QString &textIn, int start, int length, QString &textOut) { if (prependSpace) textOut.append(space); @@ -298,7 +298,7 @@ void QDeclarativeStyledTextPrivate::appendText(const QString &textIn, int start, hasNewLine = false; } -bool QDeclarativeStyledTextPrivate::parseTag(const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format) +bool QQuickStyledTextPrivate::parseTag(const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format) { skipSpace(ch); @@ -438,7 +438,7 @@ bool QDeclarativeStyledTextPrivate::parseTag(const QChar *&ch, const QString &te return false; } -bool QDeclarativeStyledTextPrivate::parseCloseTag(const QChar *&ch, const QString &textIn, QString &textOut) +bool QQuickStyledTextPrivate::parseCloseTag(const QChar *&ch, const QString &textIn, QString &textOut) { skipSpace(ch); @@ -516,7 +516,7 @@ bool QDeclarativeStyledTextPrivate::parseCloseTag(const QChar *&ch, const QStrin return false; } -void QDeclarativeStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textIn, QString &textOut) +void QQuickStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textIn, QString &textOut) { int entityStart = ch - textIn.constData(); int entityLength = 0; @@ -536,7 +536,7 @@ void QDeclarativeStyledTextPrivate::parseEntity(const QChar *&ch, const QString } } -bool QDeclarativeStyledTextPrivate::parseFontAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format) +bool QQuickStyledTextPrivate::parseFontAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format) { bool valid = false; QPair<QStringRef,QStringRef> attr; @@ -560,7 +560,7 @@ bool QDeclarativeStyledTextPrivate::parseFontAttributes(const QChar *&ch, const return valid; } -bool QDeclarativeStyledTextPrivate::parseOrderedListAttributes(const QChar *&ch, const QString &textIn) +bool QQuickStyledTextPrivate::parseOrderedListAttributes(const QChar *&ch, const QString &textIn) { bool valid = false; @@ -589,7 +589,7 @@ bool QDeclarativeStyledTextPrivate::parseOrderedListAttributes(const QChar *&ch, return valid; } -bool QDeclarativeStyledTextPrivate::parseUnorderedListAttributes(const QChar *&ch, const QString &textIn) +bool QQuickStyledTextPrivate::parseUnorderedListAttributes(const QChar *&ch, const QString &textIn) { bool valid = false; @@ -614,7 +614,7 @@ bool QDeclarativeStyledTextPrivate::parseUnorderedListAttributes(const QChar *&c return valid; } -bool QDeclarativeStyledTextPrivate::parseAnchorAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format) +bool QQuickStyledTextPrivate::parseAnchorAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format) { bool valid = false; @@ -632,12 +632,12 @@ bool QDeclarativeStyledTextPrivate::parseAnchorAttributes(const QChar *&ch, cons return valid; } -void QDeclarativeStyledTextPrivate::parseImageAttributes(const QChar *&ch, const QString &textIn, QString &textOut) +void QQuickStyledTextPrivate::parseImageAttributes(const QChar *&ch, const QString &textIn, QString &textOut) { qreal imgWidth = 0.0; if (!updateImagePositions) { - QDeclarativeStyledTextImgTag *image = new QDeclarativeStyledTextImgTag; + QQuickStyledTextImgTag *image = new QQuickStyledTextImgTag; image->position = textOut.length() + 1; QPair<QStringRef,QStringRef> attr; @@ -651,9 +651,9 @@ void QDeclarativeStyledTextPrivate::parseImageAttributes(const QChar *&ch, const image->size.setHeight(attr.second.toString().toInt()); } else if (attr.first == QLatin1String("align")) { if (attr.second.toString() == QLatin1String("top")) { - image->align = QDeclarativeStyledTextImgTag::Top; + image->align = QQuickStyledTextImgTag::Top; } else if (attr.second.toString() == QLatin1String("middle")) { - image->align = QDeclarativeStyledTextImgTag::Middle; + image->align = QQuickStyledTextImgTag::Middle; } } } while (!ch->isNull() && !attr.first.isEmpty()); @@ -664,7 +664,7 @@ void QDeclarativeStyledTextPrivate::parseImageAttributes(const QChar *&ch, const // to avoid a relayout later on. QUrl url = baseUrl.resolved(image->url); if (url.isLocalFile()) { - QDeclarativePixmap *pix = new QDeclarativePixmap(context->engine(), url, image->size); + QQuickPixmap *pix = new QQuickPixmap(context->engine(), url, image->size); if (pix && pix->isReady()) { image->size = pix->implicitSize(); image->pix = pix; @@ -678,7 +678,7 @@ void QDeclarativeStyledTextPrivate::parseImageAttributes(const QChar *&ch, const } else { // if we already have a list of img tags for this text // we only want to update the positions of these tags. - QDeclarativeStyledTextImgTag *image = imgTags->value(nbImages); + QQuickStyledTextImgTag *image = imgTags->value(nbImages); image->position = textOut.length() + 1; imgWidth = image->size.width(); QPair<QStringRef,QStringRef> attr; @@ -695,7 +695,7 @@ void QDeclarativeStyledTextPrivate::parseImageAttributes(const QChar *&ch, const textOut += QLatin1Char(' '); } -QPair<QStringRef,QStringRef> QDeclarativeStyledTextPrivate::parseAttribute(const QChar *&ch, const QString &textIn) +QPair<QStringRef,QStringRef> QQuickStyledTextPrivate::parseAttribute(const QChar *&ch, const QString &textIn) { skipSpace(ch); @@ -728,7 +728,7 @@ QPair<QStringRef,QStringRef> QDeclarativeStyledTextPrivate::parseAttribute(const return QPair<QStringRef,QStringRef>(); } -QStringRef QDeclarativeStyledTextPrivate::parseValue(const QChar *&ch, const QString &textIn) +QStringRef QQuickStyledTextPrivate::parseValue(const QChar *&ch, const QString &textIn) { int valStart = ch - textIn.constData(); int valLength = 0; @@ -743,7 +743,7 @@ QStringRef QDeclarativeStyledTextPrivate::parseValue(const QChar *&ch, const QSt return QStringRef(&textIn, valStart, valLength); } -QString QDeclarativeStyledTextPrivate::toAlpha(int value, bool upper) +QString QQuickStyledTextPrivate::toAlpha(int value, bool upper) { const char baseChar = upper ? 'A' : 'a'; @@ -757,7 +757,7 @@ QString QDeclarativeStyledTextPrivate::toAlpha(int value, bool upper) return result; } -QString QDeclarativeStyledTextPrivate::toRoman(int value, bool upper) +QString QQuickStyledTextPrivate::toRoman(int value, bool upper) { QString result = QLatin1String("?"); // works for up to 4999 items diff --git a/src/quick/util/qdeclarativestyledtext_p.h b/src/quick/util/qquickstyledtext_p.h index aa6ae3f869..bfc7ffe7ed 100644 --- a/src/quick/util/qdeclarativestyledtext_p.h +++ b/src/quick/util/qquickstyledtext_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,30 +39,30 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESTYLEDTEXT_H -#define QDECLARATIVESTYLEDTEXT_H +#ifndef QQUICKSTYLEDTEXT_H +#define QQUICKSTYLEDTEXT_H #include <QSize> #include <QPointF> #include <QList> #include <QUrl> -#include <QtQuick/private/qdeclarativepixmapcache_p.h> +#include <QtQuick/private/qquickpixmapcache_p.h> QT_BEGIN_NAMESPACE -class QDeclarativeStyledTextImgTag; -class QDeclarativeStyledTextPrivate; +class QQuickStyledTextImgTag; +class QQuickStyledTextPrivate; class QString; -class QDeclarativeContext; +class QQmlContext; -class Q_AUTOTEST_EXPORT QDeclarativeStyledTextImgTag +class Q_AUTOTEST_EXPORT QQuickStyledTextImgTag { public: - QDeclarativeStyledTextImgTag() - : position(0), align(QDeclarativeStyledTextImgTag::Bottom), pix(0) + QQuickStyledTextImgTag() + : position(0), align(QQuickStyledTextImgTag::Bottom), pix(0) { } - ~QDeclarativeStyledTextImgTag() { delete pix; } + ~QQuickStyledTextImgTag() { delete pix; } enum Align { Bottom, @@ -75,27 +75,27 @@ public: QSize size; int position; Align align; - QDeclarativePixmap *pix; + QQuickPixmap *pix; }; -class Q_AUTOTEST_EXPORT QDeclarativeStyledText +class Q_AUTOTEST_EXPORT QQuickStyledText { public: static void parse(const QString &string, QTextLayout &layout, - QList<QDeclarativeStyledTextImgTag*> &imgTags, + QList<QQuickStyledTextImgTag*> &imgTags, const QUrl &baseUrl, - QDeclarativeContext *context, + QQmlContext *context, bool preloadImages); private: - QDeclarativeStyledText(const QString &string, QTextLayout &layout, - QList<QDeclarativeStyledTextImgTag*> &imgTags, + QQuickStyledText(const QString &string, QTextLayout &layout, + QList<QQuickStyledTextImgTag*> &imgTags, const QUrl &baseUrl, - QDeclarativeContext *context, + QQmlContext *context, bool preloadImages); - ~QDeclarativeStyledText(); + ~QQuickStyledText(); - QDeclarativeStyledTextPrivate *d; + QQuickStyledTextPrivate *d; }; QT_END_NAMESPACE diff --git a/src/quick/util/qdeclarativesvgparser.cpp b/src/quick/util/qquicksvgparser.cpp index 41f12150d6..6a1b743160 100644 --- a/src/quick/util/qdeclarativesvgparser.cpp +++ b/src/quick/util/qquicksvgparser.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativesvgparser_p.h" +#include "qquicksvgparser_p.h" #include <QtCore/qmath.h> #include <QtCore/qvarlengtharray.h> @@ -196,7 +196,7 @@ static void pathArcSegment(QPainterPath &path, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3); } -void QDeclarativeSvgParser::pathArc(QPainterPath &path, +void QQuickSvgParser::pathArc(QPainterPath &path, qreal rx, qreal ry, qreal x_axis_rotation, @@ -277,7 +277,7 @@ void QDeclarativeSvgParser::pathArc(QPainterPath &path, } -bool QDeclarativeSvgParser::parsePathDataFast(const QString &dataStr, QPainterPath &path) +bool QQuickSvgParser::parsePathDataFast(const QString &dataStr, QPainterPath &path) { qreal x0 = 0, y0 = 0; // starting point qreal x = 0, y = 0; // current point diff --git a/src/quick/util/qdeclarativesvgparser_p.h b/src/quick/util/qquicksvgparser_p.h index d1ecf2574c..ed8234dc0f 100644 --- a/src/quick/util/qdeclarativesvgparser_p.h +++ b/src/quick/util/qquicksvgparser_p.h @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESVGPARSER_P_H -#define QDECLARATIVESVGPARSER_P_H +#ifndef QQUICKSVGPARSER_P_H +#define QQUICKSVGPARSER_P_H #include <QtCore/qstring.h> #include <QtGui/qpainterpath.h> QT_BEGIN_NAMESPACE -namespace QDeclarativeSvgParser +namespace QQuickSvgParser { bool parsePathDataFast(const QString &dataStr, QPainterPath &path); void pathArc(QPainterPath &path, qreal rx, qreal ry, qreal x_axis_rotation, @@ -57,4 +57,4 @@ namespace QDeclarativeSvgParser QT_END_NAMESPACE -#endif // QDECLARATIVESVGPARSER_P_H +#endif // QQUICKSVGPARSER_P_H diff --git a/src/quick/util/qdeclarativesystempalette.cpp b/src/quick/util/qquicksystempalette.cpp index ab090e718e..735d18abf5 100644 --- a/src/quick/util/qdeclarativesystempalette.cpp +++ b/src/quick/util/qquicksystempalette.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativesystempalette_p.h" +#include "qquicksystempalette_p.h" #include <QGuiApplication> @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE -class QDeclarativeSystemPalettePrivate : public QObjectPrivate +class QQuickSystemPalettePrivate : public QObjectPrivate { public: QPalette palette; @@ -57,7 +57,7 @@ public: /*! - \qmlclass SystemPalette QDeclarativeSystemPalette + \qmlclass SystemPalette QQuickSystemPalette \inqmlmodule QtQuick 2 \ingroup qml-utility-elements \brief The SystemPalette element provides access to the Qt palettes. @@ -76,20 +76,20 @@ public: group and uses this to color the window and text items appropriately: - \snippet doc/src/snippets/declarative/systempalette.qml 0 + \snippet doc/src/snippets/qml/systempalette.qml 0 \sa QPalette */ -QDeclarativeSystemPalette::QDeclarativeSystemPalette(QObject *parent) - : QObject(*(new QDeclarativeSystemPalettePrivate), parent) +QQuickSystemPalette::QQuickSystemPalette(QObject *parent) + : QObject(*(new QQuickSystemPalettePrivate), parent) { - Q_D(QDeclarativeSystemPalette); + Q_D(QQuickSystemPalette); d->palette = QGuiApplication::palette(); d->group = QPalette::Active; qApp->installEventFilter(this); } -QDeclarativeSystemPalette::~QDeclarativeSystemPalette() +QQuickSystemPalette::~QQuickSystemPalette() { } @@ -99,9 +99,9 @@ QDeclarativeSystemPalette::~QDeclarativeSystemPalette() \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::window() const +QColor QQuickSystemPalette::window() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Window); } @@ -111,9 +111,9 @@ QColor QDeclarativeSystemPalette::window() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::windowText() const +QColor QQuickSystemPalette::windowText() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::WindowText); } @@ -123,9 +123,9 @@ QColor QDeclarativeSystemPalette::windowText() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::base() const +QColor QQuickSystemPalette::base() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Base); } @@ -135,9 +135,9 @@ QColor QDeclarativeSystemPalette::base() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::text() const +QColor QQuickSystemPalette::text() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Text); } @@ -147,9 +147,9 @@ QColor QDeclarativeSystemPalette::text() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::alternateBase() const +QColor QQuickSystemPalette::alternateBase() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::AlternateBase); } @@ -159,9 +159,9 @@ QColor QDeclarativeSystemPalette::alternateBase() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::button() const +QColor QQuickSystemPalette::button() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Button); } @@ -171,9 +171,9 @@ QColor QDeclarativeSystemPalette::button() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::buttonText() const +QColor QQuickSystemPalette::buttonText() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::ButtonText); } @@ -183,9 +183,9 @@ QColor QDeclarativeSystemPalette::buttonText() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::light() const +QColor QQuickSystemPalette::light() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Light); } @@ -195,9 +195,9 @@ QColor QDeclarativeSystemPalette::light() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::midlight() const +QColor QQuickSystemPalette::midlight() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Midlight); } @@ -207,9 +207,9 @@ QColor QDeclarativeSystemPalette::midlight() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::dark() const +QColor QQuickSystemPalette::dark() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Dark); } @@ -219,9 +219,9 @@ QColor QDeclarativeSystemPalette::dark() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::mid() const +QColor QQuickSystemPalette::mid() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Mid); } @@ -231,9 +231,9 @@ QColor QDeclarativeSystemPalette::mid() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::shadow() const +QColor QQuickSystemPalette::shadow() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Shadow); } @@ -243,9 +243,9 @@ QColor QDeclarativeSystemPalette::shadow() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::highlight() const +QColor QQuickSystemPalette::highlight() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::Highlight); } @@ -255,9 +255,9 @@ QColor QDeclarativeSystemPalette::highlight() const \sa QPalette::ColorRole */ -QColor QDeclarativeSystemPalette::highlightedText() const +QColor QQuickSystemPalette::highlightedText() const { - Q_D(const QDeclarativeSystemPalette); + Q_D(const QQuickSystemPalette); return d->palette.color(d->group, QPalette::HighlightedText); } @@ -274,20 +274,20 @@ QColor QDeclarativeSystemPalette::highlightedText() const \sa QPalette::ColorGroup */ -QDeclarativeSystemPalette::ColorGroup QDeclarativeSystemPalette::colorGroup() const +QQuickSystemPalette::ColorGroup QQuickSystemPalette::colorGroup() const { - Q_D(const QDeclarativeSystemPalette); - return (QDeclarativeSystemPalette::ColorGroup)d->group; + Q_D(const QQuickSystemPalette); + return (QQuickSystemPalette::ColorGroup)d->group; } -void QDeclarativeSystemPalette::setColorGroup(QDeclarativeSystemPalette::ColorGroup colorGroup) +void QQuickSystemPalette::setColorGroup(QQuickSystemPalette::ColorGroup colorGroup) { - Q_D(QDeclarativeSystemPalette); + Q_D(QQuickSystemPalette); d->group = (QPalette::ColorGroup)colorGroup; emit paletteChanged(); } -bool QDeclarativeSystemPalette::eventFilter(QObject *watched, QEvent *event) +bool QQuickSystemPalette::eventFilter(QObject *watched, QEvent *event) { if (watched == qApp) { if (event->type() == QEvent::ApplicationPaletteChange) { @@ -298,9 +298,9 @@ bool QDeclarativeSystemPalette::eventFilter(QObject *watched, QEvent *event) return QObject::eventFilter(watched, event); } -bool QDeclarativeSystemPalette::event(QEvent *event) +bool QQuickSystemPalette::event(QEvent *event) { - Q_D(QDeclarativeSystemPalette); + Q_D(QQuickSystemPalette); if (event->type() == QEvent::ApplicationPaletteChange) { d->palette = QGuiApplication::palette(); emit paletteChanged(); diff --git a/src/quick/util/qdeclarativesystempalette_p.h b/src/quick/util/qquicksystempalette_p.h index 84813e3030..e7b8f8a418 100644 --- a/src/quick/util/qdeclarativesystempalette_p.h +++ b/src/quick/util/qquicksystempalette_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVESYSTEMPALETTE_H -#define QDECLARATIVESYSTEMPALETTE_H +#ifndef QQUICKSYSTEMPALETTE_H +#define QQUICKSYSTEMPALETTE_H -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/qobject.h> #include <QPalette> @@ -51,14 +51,14 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeSystemPalettePrivate; -class Q_AUTOTEST_EXPORT QDeclarativeSystemPalette : public QObject +class QQuickSystemPalettePrivate; +class Q_AUTOTEST_EXPORT QQuickSystemPalette : public QObject { Q_OBJECT Q_ENUMS(ColorGroup) - Q_DECLARE_PRIVATE(QDeclarativeSystemPalette) + Q_DECLARE_PRIVATE(QQuickSystemPalette) - Q_PROPERTY(QDeclarativeSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) + Q_PROPERTY(QQuickSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged) Q_PROPERTY(QColor base READ base NOTIFY paletteChanged) @@ -75,8 +75,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeSystemPalette : public QObject Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged) public: - QDeclarativeSystemPalette(QObject *parent=0); - ~QDeclarativeSystemPalette(); + QQuickSystemPalette(QObject *parent=0); + ~QQuickSystemPalette(); enum ColorGroup { Active = QPalette::Active, Inactive = QPalette::Inactive, Disabled = QPalette::Disabled }; @@ -99,8 +99,8 @@ public: QColor highlight() const; QColor highlightedText() const; - QDeclarativeSystemPalette::ColorGroup colorGroup() const; - void setColorGroup(QDeclarativeSystemPalette::ColorGroup); + QQuickSystemPalette::ColorGroup colorGroup() const; + void setColorGroup(QQuickSystemPalette::ColorGroup); Q_SIGNALS: void paletteChanged(); @@ -113,8 +113,8 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeSystemPalette) +QML_DECLARE_TYPE(QQuickSystemPalette) QT_END_HEADER -#endif // QDECLARATIVESYSTEMPALETTE_H +#endif // QQUICKSYSTEMPALETTE_H diff --git a/src/quick/util/qdeclarativetimeline.cpp b/src/quick/util/qquicktimeline.cpp index a33fdd5104..3e8b36714a 100644 --- a/src/quick/util/qdeclarativetimeline.cpp +++ b/src/quick/util/qquicktimeline.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativetimeline_p_p.h" +#include "qquicktimeline_p_p.h" #include <QDebug> #include <QMutex> @@ -53,19 +53,19 @@ QT_BEGIN_NAMESPACE struct Update { - Update(QDeclarativeTimeLineValue *_g, qreal _v) + Update(QQuickTimeLineValue *_g, qreal _v) : g(_g), v(_v) {} - Update(const QDeclarativeTimeLineCallback &_e) + Update(const QQuickTimeLineCallback &_e) : g(0), v(0), e(_e) {} - QDeclarativeTimeLineValue *g; + QQuickTimeLineValue *g; qreal v; - QDeclarativeTimeLineCallback e; + QQuickTimeLineCallback e; }; -struct QDeclarativeTimeLinePrivate +struct QQuickTimeLinePrivate { - QDeclarativeTimeLinePrivate(QDeclarativeTimeLine *); + QQuickTimeLinePrivate(QQuickTimeLine *); struct Op { enum Type { @@ -79,7 +79,7 @@ struct QDeclarativeTimeLinePrivate }; Op() {} Op(Type t, int l, qreal v, qreal v2, int o, - const QDeclarativeTimeLineCallback &ev = QDeclarativeTimeLineCallback(), const QEasingCurve &es = QEasingCurve()) + const QQuickTimeLineCallback &ev = QQuickTimeLineCallback(), const QEasingCurve &es = QEasingCurve()) : type(t), length(l), value(v), value2(v2), order(o), event(ev), easing(es) {} Op(const Op &o) @@ -98,7 +98,7 @@ struct QDeclarativeTimeLinePrivate qreal value2; int order; - QDeclarativeTimeLineCallback event; + QQuickTimeLineCallback event; QEasingCurve easing; }; struct TimeLine @@ -112,11 +112,11 @@ struct QDeclarativeTimeLinePrivate int length; int syncPoint; - typedef QHash<QDeclarativeTimeLineObject *, TimeLine> Ops; + typedef QHash<QQuickTimeLineObject *, TimeLine> Ops; Ops ops; - QDeclarativeTimeLine *q; + QQuickTimeLine *q; - void add(QDeclarativeTimeLineObject &, const Op &); + void add(QQuickTimeLineObject &, const Op &); qreal value(const Op &op, int time, qreal base, bool *) const; int advance(int); @@ -126,20 +126,20 @@ struct QDeclarativeTimeLinePrivate int order; - QDeclarativeTimeLine::SyncMode syncMode; + QQuickTimeLine::SyncMode syncMode; int syncAdj; QList<QPair<int, Update> > *updateQueue; }; -QDeclarativeTimeLinePrivate::QDeclarativeTimeLinePrivate(QDeclarativeTimeLine *parent) -: length(0), syncPoint(0), q(parent), clockRunning(false), prevTime(0), order(0), syncMode(QDeclarativeTimeLine::LocalSync), syncAdj(0), updateQueue(0) +QQuickTimeLinePrivate::QQuickTimeLinePrivate(QQuickTimeLine *parent) +: length(0), syncPoint(0), q(parent), clockRunning(false), prevTime(0), order(0), syncMode(QQuickTimeLine::LocalSync), syncAdj(0), updateQueue(0) { } -void QDeclarativeTimeLinePrivate::add(QDeclarativeTimeLineObject &g, const Op &o) +void QQuickTimeLinePrivate::add(QQuickTimeLineObject &g, const Op &o) { if (g._t && g._t != q) { - qWarning() << "QDeclarativeTimeLine: Cannot modify a QDeclarativeTimeLineValue owned by" + qWarning() << "QQuickTimeLine: Cannot modify a QQuickTimeLineValue owned by" << "another timeline."; return; } @@ -169,14 +169,14 @@ void QDeclarativeTimeLinePrivate::add(QDeclarativeTimeLineObject &g, const Op &o prevTime = 0; clockRunning = true; - if (syncMode == QDeclarativeTimeLine::LocalSync) { + if (syncMode == QQuickTimeLine::LocalSync) { syncAdj = -1; } else { syncAdj = 0; } q->start(); /* q->tick(0); - if (syncMode == QDeclarativeTimeLine::LocalSync) { + if (syncMode == QQuickTimeLine::LocalSync) { syncAdj = -1; } else { syncAdj = 0; @@ -185,7 +185,7 @@ void QDeclarativeTimeLinePrivate::add(QDeclarativeTimeLineObject &g, const Op &o } } -qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, bool *changed) const +qreal QQuickTimeLinePrivate::value(const Op &op, int time, qreal base, bool *changed) const { Q_ASSERT(time >= 0); Q_ASSERT(time <= op.length); @@ -254,27 +254,27 @@ qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, boo /*! \internal - \class QDeclarativeTimeLine - \brief The QDeclarativeTimeLine class provides a timeline for controlling animations. + \class QQuickTimeLine + \brief The QQuickTimeLine class provides a timeline for controlling animations. - QDeclarativeTimeLine is similar to QTimeLine except: + QQuickTimeLine is similar to QTimeLine except: \list - \i It updates QDeclarativeTimeLineValue instances directly, rather than maintaining a single + \i It updates QQuickTimeLineValue instances directly, rather than maintaining a single current value. For example, the following animates a simple value over 200 milliseconds: \code - QDeclarativeTimeLineValue v(<starting value>); - QDeclarativeTimeLine tl; + QQuickTimeLineValue v(<starting value>); + QQuickTimeLine tl; tl.move(v, 100., 200); tl.start() \endcode If your program needs to know when values are changed, it can either - connect to the QDeclarativeTimeLine's updated() signal, or inherit from QDeclarativeTimeLineValue - and reimplement the QDeclarativeTimeLineValue::setValue() method. + connect to the QQuickTimeLine's updated() signal, or inherit from QQuickTimeLineValue + and reimplement the QQuickTimeLineValue::setValue() method. - \i Supports multiple QDeclarativeTimeLineValue, arbitrary start and end values and allows + \i Supports multiple QQuickTimeLineValue, arbitrary start and end values and allows animations to be strung together for more complex effects. For example, the following animation moves the x and y coordinates of @@ -283,10 +283,10 @@ qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, boo milliseconds: \code - QDeclarativeTimeLineValue x(<starting value>); - QDeclarativeTimeLineValue y(<starting value>); + QQuickTimeLineValue x(<starting value>); + QQuickTimeLineValue y(<starting value>); - QDeclarativeTimeLine tl; + QQuickTimeLine tl; tl.start(); tl.move(x, 100., 50); @@ -294,12 +294,12 @@ qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, boo tl.move(y, 200., 50); \endcode - \i All QDeclarativeTimeLine instances share a single, synchronized clock. + \i All QQuickTimeLine instances share a single, synchronized clock. Actions scheduled within the same event loop tick are scheduled synchronously against each other, regardless of the wall time between the scheduling. Synchronized scheduling applies both to within the same - QDeclarativeTimeLine and across separate QDeclarativeTimeLine's within the same process. + QQuickTimeLine and across separate QQuickTimeLine's within the same process. \endlist @@ -308,21 +308,21 @@ qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, boo /*! - Construct a new QDeclarativeTimeLine with the specified \a parent. + Construct a new QQuickTimeLine with the specified \a parent. */ -QDeclarativeTimeLine::QDeclarativeTimeLine(QObject *parent) +QQuickTimeLine::QQuickTimeLine(QObject *parent) : QObject(parent) { - d = new QDeclarativeTimeLinePrivate(this); + d = new QQuickTimeLinePrivate(this); } /*! Destroys the time line. Any inprogress animations are canceled, but not completed. */ -QDeclarativeTimeLine::~QDeclarativeTimeLine() +QQuickTimeLine::~QQuickTimeLine() { - for (QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.begin(); + for (QQuickTimeLinePrivate::Ops::Iterator iter = d->ops.begin(); iter != d->ops.end(); ++iter) iter.key()->_t = 0; @@ -331,13 +331,13 @@ QDeclarativeTimeLine::~QDeclarativeTimeLine() } /*! - \enum QDeclarativeTimeLine::SyncMode + \enum QQuickTimeLine::SyncMode */ /*! Return the timeline's synchronization mode. */ -QDeclarativeTimeLine::SyncMode QDeclarativeTimeLine::syncMode() const +QQuickTimeLine::SyncMode QQuickTimeLine::syncMode() const { return d->syncMode; } @@ -345,7 +345,7 @@ QDeclarativeTimeLine::SyncMode QDeclarativeTimeLine::syncMode() const /*! Set the timeline's synchronization mode to \a syncMode. */ -void QDeclarativeTimeLine::setSyncMode(SyncMode syncMode) +void QQuickTimeLine::setSyncMode(SyncMode syncMode) { d->syncMode = syncMode; } @@ -353,38 +353,38 @@ void QDeclarativeTimeLine::setSyncMode(SyncMode syncMode) /*! Pause \a obj for \a time milliseconds. */ -void QDeclarativeTimeLine::pause(QDeclarativeTimeLineObject &obj, int time) +void QQuickTimeLine::pause(QQuickTimeLineObject &obj, int time) { if (time <= 0) return; - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Pause, time, 0., 0., d->order++); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Pause, time, 0., 0., d->order++); d->add(obj, op); } /*! Execute the \a event. */ -void QDeclarativeTimeLine::callback(const QDeclarativeTimeLineCallback &callback) +void QQuickTimeLine::callback(const QQuickTimeLineCallback &callback) { - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Execute, 0, 0, 0., d->order++, callback); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Execute, 0, 0, 0., d->order++, callback); d->add(*callback.callbackObject(), op); } /*! Set the \a value of \a timeLineValue. */ -void QDeclarativeTimeLine::set(QDeclarativeTimeLineValue &timeLineValue, qreal value) +void QQuickTimeLine::set(QQuickTimeLineValue &timeLineValue, qreal value) { - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Set, 0, value, 0., d->order++); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Set, 0, value, 0., d->order++); d->add(timeLineValue, op); } /*! Decelerate \a timeLineValue from the starting \a velocity to zero at the given \a acceleration rate. Although the \a acceleration is technically - a deceleration, it should always be positive. The QDeclarativeTimeLine will ensure + a deceleration, it should always be positive. The QQuickTimeLine will ensure that the deceleration is in the opposite direction to the initial velocity. */ -int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration) +int QQuickTimeLine::accel(QQuickTimeLineValue &timeLineValue, qreal velocity, qreal acceleration) { if (acceleration == 0.0f) return -1; @@ -394,7 +394,7 @@ int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal int time = static_cast<int>(-1000 * velocity / acceleration); - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++); d->add(timeLineValue, op); return time; @@ -406,11 +406,11 @@ int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal Decelerate \a timeLineValue from the starting \a velocity to zero at the given \a acceleration rate over a maximum distance of maxDistance. - If necessary, QDeclarativeTimeLine will reduce the acceleration to ensure that the + If necessary, QQuickTimeLine will reduce the acceleration to ensure that the entire operation does not require a move of more than \a maxDistance. \a maxDistance should always be positive. */ -int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration, qreal maxDistance) +int QQuickTimeLine::accel(QQuickTimeLineValue &timeLineValue, qreal velocity, qreal acceleration, qreal maxDistance) { if (maxDistance == 0.0f || acceleration == 0.0f) return -1; @@ -426,7 +426,7 @@ int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal int time = static_cast<int>(-1000 * velocity / acceleration); - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++); d->add(timeLineValue, op); return time; @@ -434,12 +434,12 @@ int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal /*! Decelerate \a timeLineValue from the starting \a velocity to zero over the given - \a distance. This is like accel(), but the QDeclarativeTimeLine calculates the exact + \a distance. This is like accel(), but the QQuickTimeLine calculates the exact deceleration to use. \a distance should be positive. */ -int QDeclarativeTimeLine::accelDistance(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal distance) +int QQuickTimeLine::accelDistance(QQuickTimeLineValue &timeLineValue, qreal velocity, qreal distance) { if (distance == 0.0f || velocity == 0.0f) return -1; @@ -448,7 +448,7 @@ int QDeclarativeTimeLine::accelDistance(QDeclarativeTimeLineValue &timeLineValue int time = static_cast<int>(1000 * (2.0f * distance) / velocity); - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::AccelDistance, time, velocity, distance, d->order++); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::AccelDistance, time, velocity, distance, d->order++); d->add(timeLineValue, op); return time; @@ -458,10 +458,10 @@ int QDeclarativeTimeLine::accelDistance(QDeclarativeTimeLineValue &timeLineValue Linearly change the \a timeLineValue from its current value to the given \a destination value over \a time milliseconds. */ -void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal destination, int time) +void QQuickTimeLine::move(QQuickTimeLineValue &timeLineValue, qreal destination, int time) { if (time <= 0) return; - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Move, time, destination, 0.0f, d->order++); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Move, time, destination, 0.0f, d->order++); d->add(timeLineValue, op); } @@ -469,10 +469,10 @@ void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal Change the \a timeLineValue from its current value to the given \a destination value over \a time milliseconds using the \a easing curve. */ -void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal destination, const QEasingCurve &easing, int time) +void QQuickTimeLine::move(QQuickTimeLineValue &timeLineValue, qreal destination, const QEasingCurve &easing, int time) { if (time <= 0) return; - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Move, time, destination, 0.0f, d->order++, QDeclarativeTimeLineCallback(), easing); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Move, time, destination, 0.0f, d->order++, QQuickTimeLineCallback(), easing); d->add(timeLineValue, op); } @@ -480,10 +480,10 @@ void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal Linearly change the \a timeLineValue from its current value by the \a change amount over \a time milliseconds. */ -void QDeclarativeTimeLine::moveBy(QDeclarativeTimeLineValue &timeLineValue, qreal change, int time) +void QQuickTimeLine::moveBy(QQuickTimeLineValue &timeLineValue, qreal change, int time) { if (time <= 0) return; - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::MoveBy, time, change, 0.0f, d->order++); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::MoveBy, time, change, 0.0f, d->order++); d->add(timeLineValue, op); } @@ -491,29 +491,29 @@ void QDeclarativeTimeLine::moveBy(QDeclarativeTimeLineValue &timeLineValue, qrea Change the \a timeLineValue from its current value by the \a change amount over \a time milliseconds using the \a easing curve. */ -void QDeclarativeTimeLine::moveBy(QDeclarativeTimeLineValue &timeLineValue, qreal change, const QEasingCurve &easing, int time) +void QQuickTimeLine::moveBy(QQuickTimeLineValue &timeLineValue, qreal change, const QEasingCurve &easing, int time) { if (time <= 0) return; - QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::MoveBy, time, change, 0.0f, d->order++, QDeclarativeTimeLineCallback(), easing); + QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::MoveBy, time, change, 0.0f, d->order++, QQuickTimeLineCallback(), easing); d->add(timeLineValue, op); } /*! Cancel (but don't complete) all scheduled actions for \a timeLineValue. */ -void QDeclarativeTimeLine::reset(QDeclarativeTimeLineValue &timeLineValue) +void QQuickTimeLine::reset(QQuickTimeLineValue &timeLineValue) { if (!timeLineValue._t) return; if (timeLineValue._t != this) { - qWarning() << "QDeclarativeTimeLine: Cannot reset a QDeclarativeTimeLineValue owned by another timeline."; + qWarning() << "QQuickTimeLine: Cannot reset a QQuickTimeLineValue owned by another timeline."; return; } remove(&timeLineValue); timeLineValue._t = 0; } -int QDeclarativeTimeLine::duration() const +int QQuickTimeLine::duration() const { return -1; } @@ -526,12 +526,12 @@ int QDeclarativeTimeLine::duration() const all the currently scheduled actions on \a syncTo are complete. In pseudo-code this is equivalent to: \code - QDeclarativeTimeLine::pause(timeLineValue, min(0, length_of(syncTo) - length_of(timeLineValue))) + QQuickTimeLine::pause(timeLineValue, min(0, length_of(syncTo) - length_of(timeLineValue))) \endcode */ -void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue, QDeclarativeTimeLineValue &syncTo) +void QQuickTimeLine::sync(QQuickTimeLineValue &timeLineValue, QQuickTimeLineValue &syncTo) { - QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.find(&syncTo); + QQuickTimeLinePrivate::Ops::Iterator iter = d->ops.find(&syncTo); if (iter == d->ops.end()) return; int length = iter->length; @@ -551,12 +551,12 @@ void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue, QDecla In pseudo-code, this is equivalent to: \code - QDeclarativeTimeLine::pause(timeLineValue, length_of(timeline) - length_of(timeLineValue)) + QQuickTimeLine::pause(timeLineValue, length_of(timeline) - length_of(timeLineValue)) \endcode */ -void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue) +void QQuickTimeLine::sync(QQuickTimeLineValue &timeLineValue) { - QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.find(&timeLineValue); + QQuickTimeLinePrivate::Ops::Iterator iter = d->ops.find(&timeLineValue); if (iter == d->ops.end()) { pause(timeLineValue, d->length); } else { @@ -573,7 +573,7 @@ void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue) value1->setValue(0.); value2->setValue(0.); value3->setValue(0.); - QDeclarativeTimeLine tl; + QQuickTimeLine tl; ... tl.move(value1, 10, 200); tl.move(value2, 10, 100); @@ -592,9 +592,9 @@ void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue) \endtable */ -/*void QDeclarativeTimeLine::sync() +/*void QQuickTimeLine::sync() { - for (QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.begin(); + for (QQuickTimeLinePrivate::Ops::Iterator iter = d->ops.begin(); iter != d->ops.end(); ++iter) pause(*iter.key(), d->length - iter->length); @@ -606,7 +606,7 @@ void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue) Temporary hack. */ -void QDeclarativeTimeLine::setSyncPoint(int sp) +void QQuickTimeLine::setSyncPoint(int sp) { d->syncPoint = sp; } @@ -616,16 +616,16 @@ void QDeclarativeTimeLine::setSyncPoint(int sp) Temporary hack. */ -int QDeclarativeTimeLine::syncPoint() const +int QQuickTimeLine::syncPoint() const { return d->syncPoint; } /*! Returns true if the timeline is active. An active timeline is one where - QDeclarativeTimeLineValue actions are still pending. + QQuickTimeLineValue actions are still pending. */ -bool QDeclarativeTimeLine::isActive() const +bool QQuickTimeLine::isActive() const { return !d->ops.isEmpty(); } @@ -633,8 +633,8 @@ bool QDeclarativeTimeLine::isActive() const /*! Completes the timeline. All queued actions are played to completion, and then discarded. For example, \code - QDeclarativeTimeLineValue v(0.); - QDeclarativeTimeLine tl; + QQuickTimeLineValue v(0.); + QQuickTimeLine tl; tl.move(v, 100., 1000.); // 500 ms passes // v.value() == 50. @@ -642,16 +642,16 @@ bool QDeclarativeTimeLine::isActive() const // v.value() == 100. \endcode */ -void QDeclarativeTimeLine::complete() +void QQuickTimeLine::complete() { d->advance(d->length); } /*! - Resets the timeline. All queued actions are discarded and QDeclarativeTimeLineValue's retain their current value. For example, + Resets the timeline. All queued actions are discarded and QQuickTimeLineValue's retain their current value. For example, \code - QDeclarativeTimeLineValue v(0.); - QDeclarativeTimeLine tl; + QQuickTimeLineValue v(0.); + QQuickTimeLine tl; tl.move(v, 100., 1000.); // 500 ms passes // v.value() == 50. @@ -659,9 +659,9 @@ void QDeclarativeTimeLine::complete() // v.value() == 50. \endcode */ -void QDeclarativeTimeLine::clear() +void QQuickTimeLine::clear() { - for (QDeclarativeTimeLinePrivate::Ops::ConstIterator iter = d->ops.begin(); iter != d->ops.end(); ++iter) + for (QQuickTimeLinePrivate::Ops::ConstIterator iter = d->ops.begin(); iter != d->ops.end(); ++iter) iter.key()->_t = 0; d->ops.clear(); d->length = 0; @@ -669,19 +669,19 @@ void QDeclarativeTimeLine::clear() //XXX need stop here? } -int QDeclarativeTimeLine::time() const +int QQuickTimeLine::time() const { return d->prevTime; } /*! - \fn void QDeclarativeTimeLine::updated() + \fn void QQuickTimeLine::updated() - Emitted each time the timeline modifies QDeclarativeTimeLineValues. Even if multiple - QDeclarativeTimeLineValues are changed, this signal is only emitted once for each clock tick. + Emitted each time the timeline modifies QQuickTimeLineValues. Even if multiple + QQuickTimeLineValues are changed, this signal is only emitted once for each clock tick. */ -void QDeclarativeTimeLine::updateCurrentTime(int v) +void QQuickTimeLine::updateCurrentTime(int v) { if (d->syncAdj == -1) d->syncAdj = v; @@ -723,7 +723,7 @@ bool operator<(const QPair<int, Update> &lhs, return lhs.first < rhs.first; } -int QDeclarativeTimeLinePrivate::advance(int t) +int QQuickTimeLinePrivate::advance(int t) { int pauseTime = -1; @@ -750,7 +750,7 @@ int QDeclarativeTimeLinePrivate::advance(int t) QList<QPair<int, Update> > updates; for (Ops::Iterator iter = ops.begin(); iter != ops.end(); ) { - QDeclarativeTimeLineValue *v = static_cast<QDeclarativeTimeLineValue *>(iter.key()); + QQuickTimeLineValue *v = static_cast<QQuickTimeLineValue *>(iter.key()); TimeLine &tl = *iter; Q_ASSERT(!tl.ops.isEmpty()); @@ -823,9 +823,9 @@ int QDeclarativeTimeLinePrivate::advance(int t) return pauseTime; } -void QDeclarativeTimeLine::remove(QDeclarativeTimeLineObject *v) +void QQuickTimeLine::remove(QQuickTimeLineObject *v) { - QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.find(v); + QQuickTimeLinePrivate::Ops::Iterator iter = d->ops.find(v); Q_ASSERT(iter != d->ops.end()); int len = iter->length; @@ -833,7 +833,7 @@ void QDeclarativeTimeLine::remove(QDeclarativeTimeLineObject *v) if (len == d->length) { // We need to recalculate the length d->length = 0; - for (QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.begin(); + for (QQuickTimeLinePrivate::Ops::Iterator iter = d->ops.begin(); iter != d->ops.end(); ++iter) { @@ -850,7 +850,7 @@ void QDeclarativeTimeLine::remove(QDeclarativeTimeLineObject *v) d->prevTime = 0; d->clockRunning = true; - if (d->syncMode == QDeclarativeTimeLine::LocalSync) { + if (d->syncMode == QQuickTimeLine::LocalSync) { d->syncAdj = -1; } else { d->syncAdj = 0; @@ -873,42 +873,42 @@ void QDeclarativeTimeLine::remove(QDeclarativeTimeLineObject *v) /*! \internal - \class QDeclarativeTimeLineValue - \brief The QDeclarativeTimeLineValue class provides a value that can be modified by QDeclarativeTimeLine. + \class QQuickTimeLineValue + \brief The QQuickTimeLineValue class provides a value that can be modified by QQuickTimeLine. */ /*! - \fn QDeclarativeTimeLineValue::QDeclarativeTimeLineValue(qreal value = 0) + \fn QQuickTimeLineValue::QQuickTimeLineValue(qreal value = 0) - Construct a new QDeclarativeTimeLineValue with an initial \a value. + Construct a new QQuickTimeLineValue with an initial \a value. */ /*! - \fn qreal QDeclarativeTimeLineValue::value() const + \fn qreal QQuickTimeLineValue::value() const Return the current value. */ /*! - \fn void QDeclarativeTimeLineValue::setValue(qreal value) + \fn void QQuickTimeLineValue::setValue(qreal value) Set the current \a value. */ /*! - \fn QDeclarativeTimeLine *QDeclarativeTimeLineValue::timeLine() const + \fn QQuickTimeLine *QQuickTimeLineValue::timeLine() const - If a QDeclarativeTimeLine is operating on this value, return a pointer to it, + If a QQuickTimeLine is operating on this value, return a pointer to it, otherwise return null. */ -QDeclarativeTimeLineObject::QDeclarativeTimeLineObject() +QQuickTimeLineObject::QQuickTimeLineObject() : _t(0) { } -QDeclarativeTimeLineObject::~QDeclarativeTimeLineObject() +QQuickTimeLineObject::~QQuickTimeLineObject() { if (_t) { _t->remove(this); @@ -916,22 +916,22 @@ QDeclarativeTimeLineObject::~QDeclarativeTimeLineObject() } } -QDeclarativeTimeLineCallback::QDeclarativeTimeLineCallback() +QQuickTimeLineCallback::QQuickTimeLineCallback() : d0(0), d1(0), d2(0) { } -QDeclarativeTimeLineCallback::QDeclarativeTimeLineCallback(QDeclarativeTimeLineObject *b, Callback f, void *d) +QQuickTimeLineCallback::QQuickTimeLineCallback(QQuickTimeLineObject *b, Callback f, void *d) : d0(f), d1(d), d2(b) { } -QDeclarativeTimeLineCallback::QDeclarativeTimeLineCallback(const QDeclarativeTimeLineCallback &o) +QQuickTimeLineCallback::QQuickTimeLineCallback(const QQuickTimeLineCallback &o) : d0(o.d0), d1(o.d1), d2(o.d2) { } -QDeclarativeTimeLineCallback &QDeclarativeTimeLineCallback::operator=(const QDeclarativeTimeLineCallback &o) +QQuickTimeLineCallback &QQuickTimeLineCallback::operator=(const QQuickTimeLineCallback &o) { d0 = o.d0; d1 = o.d1; @@ -939,7 +939,7 @@ QDeclarativeTimeLineCallback &QDeclarativeTimeLineCallback::operator=(const QDec return *this; } -QDeclarativeTimeLineObject *QDeclarativeTimeLineCallback::callbackObject() const +QQuickTimeLineObject *QQuickTimeLineCallback::callbackObject() const { return d2; } diff --git a/src/quick/util/qdeclarativetimeline_p_p.h b/src/quick/util/qquicktimeline_p_p.h index 421e2e5976..88ee3dafd2 100644 --- a/src/quick/util/qdeclarativetimeline_p_p.h +++ b/src/quick/util/qquicktimeline_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETIMELINE_H -#define QDECLARATIVETIMELINE_H +#ifndef QQUICKTIMELINE_H +#define QQUICKTIMELINE_H // // W A R N I N G @@ -59,42 +59,42 @@ QT_BEGIN_NAMESPACE class QEasingCurve; -class QDeclarativeTimeLineValue; -class QDeclarativeTimeLineCallback; -struct QDeclarativeTimeLinePrivate; -class QDeclarativeTimeLineObject; -class Q_AUTOTEST_EXPORT QDeclarativeTimeLine : public QObject, QAbstractAnimationJob +class QQuickTimeLineValue; +class QQuickTimeLineCallback; +struct QQuickTimeLinePrivate; +class QQuickTimeLineObject; +class Q_AUTOTEST_EXPORT QQuickTimeLine : public QObject, QAbstractAnimationJob { Q_OBJECT public: - QDeclarativeTimeLine(QObject *parent = 0); - ~QDeclarativeTimeLine(); + QQuickTimeLine(QObject *parent = 0); + ~QQuickTimeLine(); enum SyncMode { LocalSync, GlobalSync }; SyncMode syncMode() const; void setSyncMode(SyncMode); - void pause(QDeclarativeTimeLineObject &, int); - void callback(const QDeclarativeTimeLineCallback &); - void set(QDeclarativeTimeLineValue &, qreal); + void pause(QQuickTimeLineObject &, int); + void callback(const QQuickTimeLineCallback &); + void set(QQuickTimeLineValue &, qreal); - int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel); - int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel, qreal maxDistance); - int accelDistance(QDeclarativeTimeLineValue &, qreal velocity, qreal distance); + int accel(QQuickTimeLineValue &, qreal velocity, qreal accel); + int accel(QQuickTimeLineValue &, qreal velocity, qreal accel, qreal maxDistance); + int accelDistance(QQuickTimeLineValue &, qreal velocity, qreal distance); - void move(QDeclarativeTimeLineValue &, qreal destination, int time = 500); - void move(QDeclarativeTimeLineValue &, qreal destination, const QEasingCurve &, int time = 500); - void moveBy(QDeclarativeTimeLineValue &, qreal change, int time = 500); - void moveBy(QDeclarativeTimeLineValue &, qreal change, const QEasingCurve &, int time = 500); + void move(QQuickTimeLineValue &, qreal destination, int time = 500); + void move(QQuickTimeLineValue &, qreal destination, const QEasingCurve &, int time = 500); + void moveBy(QQuickTimeLineValue &, qreal change, int time = 500); + void moveBy(QQuickTimeLineValue &, qreal change, const QEasingCurve &, int time = 500); void sync(); void setSyncPoint(int); int syncPoint() const; - void sync(QDeclarativeTimeLineValue &); - void sync(QDeclarativeTimeLineValue &, QDeclarativeTimeLineValue &); + void sync(QQuickTimeLineValue &); + void sync(QQuickTimeLineValue &, QQuickTimeLineValue &); - void reset(QDeclarativeTimeLineValue &); + void reset(QQuickTimeLineValue &); void complete(); void clear(); @@ -111,80 +111,80 @@ protected: virtual void updateCurrentTime(int); private: - void remove(QDeclarativeTimeLineObject *); - friend class QDeclarativeTimeLineObject; - friend struct QDeclarativeTimeLinePrivate; - QDeclarativeTimeLinePrivate *d; + void remove(QQuickTimeLineObject *); + friend class QQuickTimeLineObject; + friend struct QQuickTimeLinePrivate; + QQuickTimeLinePrivate *d; }; -class Q_AUTOTEST_EXPORT QDeclarativeTimeLineObject +class Q_AUTOTEST_EXPORT QQuickTimeLineObject { public: - QDeclarativeTimeLineObject(); - virtual ~QDeclarativeTimeLineObject(); + QQuickTimeLineObject(); + virtual ~QQuickTimeLineObject(); protected: - friend class QDeclarativeTimeLine; - friend struct QDeclarativeTimeLinePrivate; - QDeclarativeTimeLine *_t; + friend class QQuickTimeLine; + friend struct QQuickTimeLinePrivate; + QQuickTimeLine *_t; }; -class Q_AUTOTEST_EXPORT QDeclarativeTimeLineValue : public QDeclarativeTimeLineObject +class Q_AUTOTEST_EXPORT QQuickTimeLineValue : public QQuickTimeLineObject { public: - QDeclarativeTimeLineValue(qreal v = 0.) : _v(v) {} + QQuickTimeLineValue(qreal v = 0.) : _v(v) {} virtual qreal value() const { return _v; } virtual void setValue(qreal v) { _v = v; } - QDeclarativeTimeLine *timeLine() const { return _t; } + QQuickTimeLine *timeLine() const { return _t; } operator qreal() const { return _v; } - QDeclarativeTimeLineValue &operator=(qreal v) { setValue(v); return *this; } + QQuickTimeLineValue &operator=(qreal v) { setValue(v); return *this; } private: - friend class QDeclarativeTimeLine; - friend struct QDeclarativeTimeLinePrivate; + friend class QQuickTimeLine; + friend struct QQuickTimeLinePrivate; qreal _v; }; -class Q_AUTOTEST_EXPORT QDeclarativeTimeLineCallback +class Q_AUTOTEST_EXPORT QQuickTimeLineCallback { public: typedef void (*Callback)(void *); - QDeclarativeTimeLineCallback(); - QDeclarativeTimeLineCallback(QDeclarativeTimeLineObject *b, Callback, void * = 0); - QDeclarativeTimeLineCallback(const QDeclarativeTimeLineCallback &o); + QQuickTimeLineCallback(); + QQuickTimeLineCallback(QQuickTimeLineObject *b, Callback, void * = 0); + QQuickTimeLineCallback(const QQuickTimeLineCallback &o); - QDeclarativeTimeLineCallback &operator=(const QDeclarativeTimeLineCallback &o); - QDeclarativeTimeLineObject *callbackObject() const; + QQuickTimeLineCallback &operator=(const QQuickTimeLineCallback &o); + QQuickTimeLineObject *callbackObject() const; private: - friend struct QDeclarativeTimeLinePrivate; + friend struct QQuickTimeLinePrivate; Callback d0; void *d1; - QDeclarativeTimeLineObject *d2; + QQuickTimeLineObject *d2; }; template<class T> -class QDeclarativeTimeLineValueProxy : public QDeclarativeTimeLineValue +class QQuickTimeLineValueProxy : public QQuickTimeLineValue { public: - QDeclarativeTimeLineValueProxy(T *cls, void (T::*func)(qreal), qreal v = 0.) - : QDeclarativeTimeLineValue(v), _class(cls), _setFunctionReal(func), _setFunctionInt(0) + QQuickTimeLineValueProxy(T *cls, void (T::*func)(qreal), qreal v = 0.) + : QQuickTimeLineValue(v), _class(cls), _setFunctionReal(func), _setFunctionInt(0) { Q_ASSERT(_class); } - QDeclarativeTimeLineValueProxy(T *cls, void (T::*func)(int), qreal v = 0.) - : QDeclarativeTimeLineValue(v), _class(cls), _setFunctionReal(0), _setFunctionInt(func) + QQuickTimeLineValueProxy(T *cls, void (T::*func)(int), qreal v = 0.) + : QQuickTimeLineValue(v), _class(cls), _setFunctionReal(0), _setFunctionInt(func) { Q_ASSERT(_class); } virtual void setValue(qreal v) { - QDeclarativeTimeLineValue::setValue(v); + QQuickTimeLineValue::setValue(v); if (_setFunctionReal) (_class->*_setFunctionReal)(v); else if (_setFunctionInt) (_class->*_setFunctionInt)((int)v); } diff --git a/src/quick/util/qdeclarativetimer.cpp b/src/quick/util/qquicktimer.cpp index 3c57f22c58..151f1f8b48 100644 --- a/src/quick/util/qdeclarativetimer.cpp +++ b/src/quick/util/qquicktimer.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativetimer_p.h" +#include "qquicktimer_p.h" #include <QtCore/qcoreapplication.h> #include "private/qpauseanimationjob_p.h" @@ -51,16 +51,16 @@ QT_BEGIN_NAMESPACE -class QDeclarativeTimerPrivate : public QObjectPrivate, public QAnimationJobChangeListener +class QQuickTimerPrivate : public QObjectPrivate, public QAnimationJobChangeListener { - Q_DECLARE_PUBLIC(QDeclarativeTimer) + Q_DECLARE_PUBLIC(QQuickTimer) public: - QDeclarativeTimerPrivate() + QQuickTimerPrivate() : interval(1000), running(false), repeating(false), triggeredOnStart(false) , classBegun(false), componentComplete(false), firstTick(true) {} virtual void animationFinished(QAbstractAnimationJob *); - virtual void animationCurrentLoopChanged(QAbstractAnimationJob *) { Q_Q(QDeclarativeTimer); q->ticked(); } + virtual void animationCurrentLoopChanged(QAbstractAnimationJob *) { Q_Q(QQuickTimer); q->ticked(); } int interval; QPauseAnimationJob pause; @@ -73,7 +73,7 @@ public: }; /*! - \qmlclass Timer QDeclarativeTimer + \qmlclass Timer QQuickTimer \inqmlmodule QtQuick 2 \ingroup qml-utility-elements \brief The Timer item triggers a handler at a specified interval. @@ -111,10 +111,10 @@ public: \sa {declarative/toys/clocks}{Clocks example} */ -QDeclarativeTimer::QDeclarativeTimer(QObject *parent) - : QObject(*(new QDeclarativeTimerPrivate), parent) +QQuickTimer::QQuickTimer(QObject *parent) + : QObject(*(new QQuickTimerPrivate), parent) { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); d->pause.addAnimationChangeListener(d, QAbstractAnimationJob::Completion | QAbstractAnimationJob::CurrentLoop); d->pause.setLoopCount(1); d->pause.setDuration(d->interval); @@ -127,9 +127,9 @@ QDeclarativeTimer::QDeclarativeTimer(QObject *parent) The default interval is 1000 milliseconds. */ -void QDeclarativeTimer::setInterval(int interval) +void QQuickTimer::setInterval(int interval) { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); if (interval != d->interval) { d->interval = interval; update(); @@ -137,9 +137,9 @@ void QDeclarativeTimer::setInterval(int interval) } } -int QDeclarativeTimer::interval() const +int QQuickTimer::interval() const { - Q_D(const QDeclarativeTimer); + Q_D(const QQuickTimer); return d->interval; } @@ -154,15 +154,15 @@ int QDeclarativeTimer::interval() const \sa repeat */ -bool QDeclarativeTimer::isRunning() const +bool QQuickTimer::isRunning() const { - Q_D(const QDeclarativeTimer); + Q_D(const QQuickTimer); return d->running; } -void QDeclarativeTimer::setRunning(bool running) +void QQuickTimer::setRunning(bool running) { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); if (d->running != running) { d->running = running; d->firstTick = true; @@ -182,15 +182,15 @@ void QDeclarativeTimer::setRunning(bool running) \sa running */ -bool QDeclarativeTimer::isRepeating() const +bool QQuickTimer::isRepeating() const { - Q_D(const QDeclarativeTimer); + Q_D(const QQuickTimer); return d->repeating; } -void QDeclarativeTimer::setRepeating(bool repeating) +void QQuickTimer::setRepeating(bool repeating) { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); if (repeating != d->repeating) { d->repeating = repeating; update(); @@ -215,15 +215,15 @@ void QDeclarativeTimer::setRepeating(bool repeating) \sa running */ -bool QDeclarativeTimer::triggeredOnStart() const +bool QQuickTimer::triggeredOnStart() const { - Q_D(const QDeclarativeTimer); + Q_D(const QQuickTimer); return d->triggeredOnStart; } -void QDeclarativeTimer::setTriggeredOnStart(bool triggeredOnStart) +void QQuickTimer::setTriggeredOnStart(bool triggeredOnStart) { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); if (d->triggeredOnStart != triggeredOnStart) { d->triggeredOnStart = triggeredOnStart; update(); @@ -238,7 +238,7 @@ void QDeclarativeTimer::setTriggeredOnStart(bool triggeredOnStart) If the timer is already running, calling this method has no effect. The \c running property will be true following a call to \c start(). */ -void QDeclarativeTimer::start() +void QQuickTimer::start() { setRunning(true); } @@ -250,7 +250,7 @@ void QDeclarativeTimer::start() If the timer is not running, calling this method has no effect. The \c running property will be false following a call to \c stop(). */ -void QDeclarativeTimer::stop() +void QQuickTimer::stop() { setRunning(false); } @@ -263,15 +263,15 @@ void QDeclarativeTimer::stop() stopped, reset to initial state and started. The \c running property will be true following a call to \c restart(). */ -void QDeclarativeTimer::restart() +void QQuickTimer::restart() { setRunning(false); setRunning(true); } -void QDeclarativeTimer::update() +void QQuickTimer::update() { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); if (d->classBegun && !d->componentComplete) return; d->pause.stop(); @@ -287,15 +287,15 @@ void QDeclarativeTimer::update() } } -void QDeclarativeTimer::classBegin() +void QQuickTimer::classBegin() { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); d->classBegun = true; } -void QDeclarativeTimer::componentComplete() +void QQuickTimer::componentComplete() { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); d->componentComplete = true; update(); } @@ -305,17 +305,17 @@ void QDeclarativeTimer::componentComplete() This handler is called when the Timer is triggered. */ -void QDeclarativeTimer::ticked() +void QQuickTimer::ticked() { - Q_D(QDeclarativeTimer); + Q_D(QQuickTimer); if (d->running && (d->pause.currentTime() > 0 || (d->triggeredOnStart && d->firstTick))) emit triggered(); d->firstTick = false; } -void QDeclarativeTimerPrivate::animationFinished(QAbstractAnimationJob *) +void QQuickTimerPrivate::animationFinished(QAbstractAnimationJob *) { - Q_Q(QDeclarativeTimer); + Q_Q(QQuickTimer); if (repeating || !running) return; running = false; diff --git a/src/quick/util/qdeclarativetimer_p.h b/src/quick/util/qquicktimer_p.h index e400b3dda3..b0354e4874 100644 --- a/src/quick/util/qdeclarativetimer_p.h +++ b/src/quick/util/qquicktimer_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETIMER_H -#define QDECLARATIVETIMER_H +#ifndef QQUICKTIMER_H +#define QQUICKTIMER_H -#include <qdeclarative.h> +#include <qqml.h> #include <QtCore/qobject.h> @@ -52,12 +52,12 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeTimerPrivate; -class Q_QUICK_PRIVATE_EXPORT QDeclarativeTimer : public QObject, public QDeclarativeParserStatus +class QQuickTimerPrivate; +class Q_QUICK_PRIVATE_EXPORT QQuickTimer : public QObject, public QQmlParserStatus { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeTimer) - Q_INTERFACES(QDeclarativeParserStatus) + Q_DECLARE_PRIVATE(QQuickTimer) + Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged) Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating NOTIFY repeatChanged) @@ -65,7 +65,7 @@ class Q_QUICK_PRIVATE_EXPORT QDeclarativeTimer : public QObject, public QDeclara Q_PROPERTY(QObject *parent READ parent CONSTANT) public: - QDeclarativeTimer(QObject *parent=0); + QQuickTimer(QObject *parent=0); void setInterval(int interval); int interval() const; @@ -104,7 +104,7 @@ private Q_SLOTS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeTimer) +QML_DECLARE_TYPE(QQuickTimer) QT_END_HEADER diff --git a/src/quick/util/qdeclarativetransition.cpp b/src/quick/util/qquicktransition.cpp index 96e870df82..5d9a2880d2 100644 --- a/src/quick/util/qdeclarativetransition.cpp +++ b/src/quick/util/qquicktransition.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,21 +39,21 @@ ** ****************************************************************************/ -#include "qdeclarativetransition_p.h" +#include "qquicktransition_p.h" -#include "qdeclarativestate_p.h" -#include "qdeclarativestate_p_p.h" -#include "qdeclarativestateoperations_p.h" -#include "qdeclarativeanimation_p.h" -#include "qdeclarativeanimation_p_p.h" -#include "qdeclarativetransitionmanager_p_p.h" +#include "qquickstate_p.h" +#include "qquickstate_p_p.h" +#include "qquickstatechangescript_p.h" +#include "qquickanimation_p.h" +#include "qquickanimation_p_p.h" +#include "qquicktransitionmanager_p_p.h" #include "private/qparallelanimationgroupjob_p.h" QT_BEGIN_NAMESPACE /*! - \qmlclass Transition QDeclarativeTransition + \qmlclass Transition QQuickTransition \inqmlmodule QtQuick 2 \ingroup qml-animation-transition \brief The Transition element defines animated transitions that occur on state changes. @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE changes between the default and the "moved" state, any changes to the \c x and \c y properties should be animated, using an \c Easing.InOutQuad. - \snippet doc/src/snippets/declarative/transition.qml 0 + \snippet doc/src/snippets/qml/transition.qml 0 Notice the example does not require \l{PropertyAnimation::}{to} and \l{PropertyAnimation::}{from} values for the NumberAnimation. As a convenience, @@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE To define multiple transitions, specify \l Item::transitions as a list: - \snippet doc/src/snippets/declarative/transitions-list.qml list of transitions + \snippet doc/src/snippets/qml/transitions-list.qml list of transitions If multiple Transitions are specified, only a single (best-matching) Transition will be applied for any particular state change. In the example above, when changing to \c state1, the first transition will be used, rather @@ -93,32 +93,32 @@ QT_BEGIN_NAMESPACE \l Behavior, the Transition animation overrides the \l Behavior for that state change. - \sa {QML Animation and Transitions}, {declarative/animation/states}{states example}, {qmlstates}{States}, {QtDeclarative} + \sa {QML Animation and Transitions}, {declarative/animation/states}{states example}, {qmlstates}{States}, {QtQml} */ -QDeclarativeTransitionInstance::QDeclarativeTransitionInstance() +QQuickTransitionInstance::QQuickTransitionInstance() : m_anim(0) { } -QDeclarativeTransitionInstance::~QDeclarativeTransitionInstance() +QQuickTransitionInstance::~QQuickTransitionInstance() { delete m_anim; } -void QDeclarativeTransitionInstance::start() +void QQuickTransitionInstance::start() { if (m_anim) m_anim->start(); } -void QDeclarativeTransitionInstance::stop() +void QQuickTransitionInstance::stop() { if (m_anim) m_anim->stop(); } -bool QDeclarativeTransitionInstance::isRunning() const +bool QQuickTransitionInstance::isRunning() const { return m_anim && m_anim->state() == QAbstractAnimationJob::Running; } @@ -130,17 +130,17 @@ class ParallelAnimationWrapper : public QParallelAnimationGroupJob { public: ParallelAnimationWrapper() : QParallelAnimationGroupJob() {} - QDeclarativeTransitionManager *manager; + QQuickTransitionManager *manager; protected: virtual void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState); }; -class QDeclarativeTransitionPrivate : public QObjectPrivate +class QQuickTransitionPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QDeclarativeTransition) + Q_DECLARE_PUBLIC(QQuickTransition) public: - QDeclarativeTransitionPrivate() + QQuickTransitionPrivate() : fromState(QLatin1String("*")), toState(QLatin1String("*")), reversed(false), reversible(false), enabled(true) { @@ -152,37 +152,37 @@ public: bool reversible; bool enabled; - static void append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *a); - static int animation_count(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list); - static QDeclarativeAbstractAnimation* animation_at(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, int pos); - static void clear_animations(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list); - QList<QDeclarativeAbstractAnimation *> animations; + static void append_animation(QQmlListProperty<QQuickAbstractAnimation> *list, QQuickAbstractAnimation *a); + static int animation_count(QQmlListProperty<QQuickAbstractAnimation> *list); + static QQuickAbstractAnimation* animation_at(QQmlListProperty<QQuickAbstractAnimation> *list, int pos); + static void clear_animations(QQmlListProperty<QQuickAbstractAnimation> *list); + QList<QQuickAbstractAnimation *> animations; }; -void QDeclarativeTransitionPrivate::append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *a) +void QQuickTransitionPrivate::append_animation(QQmlListProperty<QQuickAbstractAnimation> *list, QQuickAbstractAnimation *a) { - QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object); + QQuickTransition *q = static_cast<QQuickTransition *>(list->object); q->d_func()->animations.append(a); a->setDisableUserControl(); } -int QDeclarativeTransitionPrivate::animation_count(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list) +int QQuickTransitionPrivate::animation_count(QQmlListProperty<QQuickAbstractAnimation> *list) { - QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object); + QQuickTransition *q = static_cast<QQuickTransition *>(list->object); return q->d_func()->animations.count(); } -QDeclarativeAbstractAnimation* QDeclarativeTransitionPrivate::animation_at(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, int pos) +QQuickAbstractAnimation* QQuickTransitionPrivate::animation_at(QQmlListProperty<QQuickAbstractAnimation> *list, int pos) { - QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object); + QQuickTransition *q = static_cast<QQuickTransition *>(list->object); return q->d_func()->animations.at(pos); } -void QDeclarativeTransitionPrivate::clear_animations(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list) +void QQuickTransitionPrivate::clear_animations(QQmlListProperty<QQuickAbstractAnimation> *list) { - QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object); + QQuickTransition *q = static_cast<QQuickTransition *>(list->object); while (q->d_func()->animations.count()) { - QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0); + QQuickAbstractAnimation *firstAnim = q->d_func()->animations.at(0); q->d_func()->animations.removeAll(firstAnim); } } @@ -199,34 +199,34 @@ void ParallelAnimationWrapper::updateState(QAbstractAnimationJob::State newState } -QDeclarativeTransition::QDeclarativeTransition(QObject *parent) - : QObject(*(new QDeclarativeTransitionPrivate), parent) +QQuickTransition::QQuickTransition(QObject *parent) + : QObject(*(new QQuickTransitionPrivate), parent) { } -QDeclarativeTransition::~QDeclarativeTransition() +QQuickTransition::~QQuickTransition() { } -void QDeclarativeTransition::setReversed(bool r) +void QQuickTransition::setReversed(bool r) { - Q_D(QDeclarativeTransition); + Q_D(QQuickTransition); d->reversed = r; } -QDeclarativeTransitionInstance *QDeclarativeTransition::prepare(QDeclarativeStateOperation::ActionList &actions, - QList<QDeclarativeProperty> &after, - QDeclarativeTransitionManager *manager, +QQuickTransitionInstance *QQuickTransition::prepare(QQuickStateOperation::ActionList &actions, + QList<QQmlProperty> &after, + QQuickTransitionManager *manager, QObject *defaultTarget) { - Q_D(QDeclarativeTransition); + Q_D(QQuickTransition); qmlExecuteDeferred(this); ParallelAnimationWrapper *group = new ParallelAnimationWrapper(); group->manager = manager; - QDeclarativeAbstractAnimation::TransitionDirection direction = d->reversed ? QDeclarativeAbstractAnimation::Backward : QDeclarativeAbstractAnimation::Forward; + QQuickAbstractAnimation::TransitionDirection direction = d->reversed ? QQuickAbstractAnimation::Backward : QQuickAbstractAnimation::Forward; int start = d->reversed ? d->animations.count() - 1 : 0; int end = d->reversed ? -1 : d->animations.count(); @@ -240,7 +240,7 @@ QDeclarativeTransitionInstance *QDeclarativeTransition::prepare(QDeclarativeStat group->setDirection(d->reversed ? QAbstractAnimationJob::Backward : QAbstractAnimationJob::Forward); - QDeclarativeTransitionInstance *wrapper = new QDeclarativeTransitionInstance; + QQuickTransitionInstance *wrapper = new QQuickTransitionInstance; wrapper->m_anim = group; return wrapper; } @@ -257,11 +257,11 @@ QDeclarativeTransitionInstance *QDeclarativeTransition::prepare(QDeclarativeStat properties, so the animation is always applied when changing between the two states (i.e. when the mouse is pressed and released). - \snippet doc/src/snippets/declarative/transition-from-to.qml 0 + \snippet doc/src/snippets/qml/transition-from-to.qml 0 If the transition was changed to this: - \snippet doc/src/snippets/declarative/transition-from-to-modified.qml modified transition + \snippet doc/src/snippets/qml/transition-from-to-modified.qml modified transition The animation would only be applied when changing from the default state to the "brighter" state (i.e. when the mouse is pressed, but not on release). @@ -270,15 +270,15 @@ QDeclarativeTransitionInstance *QDeclarativeTransition::prepare(QDeclarativeStat \sa reversible */ -QString QDeclarativeTransition::fromState() const +QString QQuickTransition::fromState() const { - Q_D(const QDeclarativeTransition); + Q_D(const QQuickTransition); return d->fromState; } -void QDeclarativeTransition::setFromState(const QString &f) +void QQuickTransition::setFromState(const QString &f) { - Q_D(QDeclarativeTransition); + Q_D(QQuickTransition); if (f == d->fromState) return; @@ -304,21 +304,21 @@ void QDeclarativeTransition::setFromState(const QString &f) transition applies a sequential animation when the mouse is pressed, and reverses the sequence of the animation when the mouse is released: - \snippet doc/src/snippets/declarative/transition-reversible.qml 0 + \snippet doc/src/snippets/qml/transition-reversible.qml 0 If the transition did not set the \c to and \c reversible values, then on the mouse release, the transition would play the PropertyAnimation before the ColorAnimation instead of reversing the sequence. */ -bool QDeclarativeTransition::reversible() const +bool QQuickTransition::reversible() const { - Q_D(const QDeclarativeTransition); + Q_D(const QQuickTransition); return d->reversible; } -void QDeclarativeTransition::setReversible(bool r) +void QQuickTransition::setReversible(bool r) { - Q_D(QDeclarativeTransition); + Q_D(QQuickTransition); if (r == d->reversible) return; @@ -326,15 +326,15 @@ void QDeclarativeTransition::setReversible(bool r) emit reversibleChanged(); } -QString QDeclarativeTransition::toState() const +QString QQuickTransition::toState() const { - Q_D(const QDeclarativeTransition); + Q_D(const QQuickTransition); return d->toState; } -void QDeclarativeTransition::setToState(const QString &t) +void QQuickTransition::setToState(const QString &t) { - Q_D(QDeclarativeTransition); + Q_D(QQuickTransition); if (t == d->toState) return; @@ -370,15 +370,15 @@ void QDeclarativeTransition::setToState(const QString &t) \endqml */ -bool QDeclarativeTransition::enabled() const +bool QQuickTransition::enabled() const { - Q_D(const QDeclarativeTransition); + Q_D(const QQuickTransition); return d->enabled; } -void QDeclarativeTransition::setEnabled(bool enabled) +void QQuickTransition::setEnabled(bool enabled) { - Q_D(QDeclarativeTransition); + Q_D(QQuickTransition); if (d->enabled == enabled) return; d->enabled = enabled; @@ -396,17 +396,17 @@ void QDeclarativeTransition::setEnabled(bool enabled) The top-level animations are run in parallel. To run them sequentially, define them within a SequentialAnimation: - \snippet doc/src/snippets/declarative/transition-reversible.qml sequential animations + \snippet doc/src/snippets/qml/transition-reversible.qml sequential animations */ -QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeTransition::animations() +QQmlListProperty<QQuickAbstractAnimation> QQuickTransition::animations() { - Q_D(QDeclarativeTransition); - return QDeclarativeListProperty<QDeclarativeAbstractAnimation>(this, &d->animations, QDeclarativeTransitionPrivate::append_animation, - QDeclarativeTransitionPrivate::animation_count, - QDeclarativeTransitionPrivate::animation_at, - QDeclarativeTransitionPrivate::clear_animations); + Q_D(QQuickTransition); + return QQmlListProperty<QQuickAbstractAnimation>(this, &d->animations, QQuickTransitionPrivate::append_animation, + QQuickTransitionPrivate::animation_count, + QQuickTransitionPrivate::animation_at, + QQuickTransitionPrivate::clear_animations); } QT_END_NAMESPACE -//#include <qdeclarativetransition.moc> +//#include <qquicktransition.moc> diff --git a/src/quick/util/qdeclarativetransition_p.h b/src/quick/util/qquicktransition_p.h index 839a626014..ebd82fde2c 100644 --- a/src/quick/util/qdeclarativetransition_p.h +++ b/src/quick/util/qquicktransition_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETRANSITION_H -#define QDECLARATIVETRANSITION_H +#ifndef QQUICKTRANSITION_H +#define QQUICKTRANSITION_H -#include "qdeclarativestate_p.h" -#include <qdeclarative.h> +#include "qquickstate_p.h" +#include <qqml.h> #include <QtCore/qobject.h> @@ -51,17 +51,17 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeAbstractAnimation; -class QDeclarativeTransitionPrivate; -class QDeclarativeTransitionManager; -class QDeclarativeTransition; +class QQuickAbstractAnimation; +class QQuickTransitionPrivate; +class QQuickTransitionManager; +class QQuickTransition; class QAbstractAnimationJob; -class Q_QUICK_EXPORT QDeclarativeTransitionInstance +class Q_QUICK_EXPORT QQuickTransitionInstance { public: - QDeclarativeTransitionInstance(); - ~QDeclarativeTransitionInstance(); + QQuickTransitionInstance(); + ~QQuickTransitionInstance(); void start(); void stop(); @@ -70,25 +70,25 @@ public: private: QAbstractAnimationJob *m_anim; - friend class QDeclarativeTransition; + friend class QQuickTransition; }; -class Q_QUICK_EXPORT QDeclarativeTransition : public QObject +class Q_QUICK_EXPORT QQuickTransition : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QDeclarativeTransition) + Q_DECLARE_PRIVATE(QQuickTransition) Q_PROPERTY(QString from READ fromState WRITE setFromState NOTIFY fromChanged) Q_PROPERTY(QString to READ toState WRITE setToState NOTIFY toChanged) Q_PROPERTY(bool reversible READ reversible WRITE setReversible NOTIFY reversibleChanged) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations READ animations) + Q_PROPERTY(QQmlListProperty<QQuickAbstractAnimation> animations READ animations) Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) Q_CLASSINFO("DefaultProperty", "animations") Q_CLASSINFO("DeferredPropertyNames", "animations") public: - QDeclarativeTransition(QObject *parent=0); - ~QDeclarativeTransition(); + QQuickTransition(QObject *parent=0); + ~QQuickTransition(); QString fromState() const; void setFromState(const QString &); @@ -102,11 +102,11 @@ public: bool enabled() const; void setEnabled(bool enabled); - QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations(); + QQmlListProperty<QQuickAbstractAnimation> animations(); - QDeclarativeTransitionInstance *prepare(QDeclarativeStateOperation::ActionList &actions, - QList<QDeclarativeProperty> &after, - QDeclarativeTransitionManager *end, + QQuickTransitionInstance *prepare(QQuickStateOperation::ActionList &actions, + QList<QQmlProperty> &after, + QQuickTransitionManager *end, QObject *defaultTarget); void setReversed(bool r); @@ -120,8 +120,8 @@ Q_SIGNALS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeTransition) +QML_DECLARE_TYPE(QQuickTransition) QT_END_HEADER -#endif // QDECLARATIVETRANSITION_H +#endif // QQUICKTRANSITION_H diff --git a/src/quick/util/qdeclarativetransitionmanager.cpp b/src/quick/util/qquicktransitionmanager.cpp index ebe7805c62..910043e251 100644 --- a/src/quick/util/qdeclarativetransitionmanager.cpp +++ b/src/quick/util/qquicktransitionmanager.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#include "qdeclarativetransitionmanager_p_p.h" +#include "qquicktransitionmanager_p_p.h" -#include "qdeclarativetransition_p.h" -#include "qdeclarativestate_p_p.h" +#include "qquicktransition_p.h" +#include "qquickstate_p_p.h" -#include <private/qdeclarativebinding_p.h> -#include <private/qdeclarativeglobal_p.h> -#include <private/qdeclarativeproperty_p.h> +#include <private/qqmlbinding_p.h> +#include <private/qqmlglobal_p.h> +#include <private/qqmlproperty_p.h> #include <QtCore/qdebug.h> @@ -54,63 +54,63 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG); -class QDeclarativeTransitionManagerPrivate +class QQuickTransitionManagerPrivate { public: - QDeclarativeTransitionManagerPrivate() + QQuickTransitionManagerPrivate() : state(0), transitionInstance(0) {} void applyBindings(); - typedef QList<QDeclarativeSimpleAction> SimpleActionList; - QDeclarativeState *state; - QDeclarativeTransitionInstance *transitionInstance; - QDeclarativeStateOperation::ActionList bindingsList; + typedef QList<QQuickSimpleAction> SimpleActionList; + QQuickState *state; + QQuickTransitionInstance *transitionInstance; + QQuickStateOperation::ActionList bindingsList; SimpleActionList completeList; }; -QDeclarativeTransitionManager::QDeclarativeTransitionManager() -: d(new QDeclarativeTransitionManagerPrivate) +QQuickTransitionManager::QQuickTransitionManager() +: d(new QQuickTransitionManagerPrivate) { } -void QDeclarativeTransitionManager::setState(QDeclarativeState *s) +void QQuickTransitionManager::setState(QQuickState *s) { d->state = s; } -QDeclarativeTransitionManager::~QDeclarativeTransitionManager() +QQuickTransitionManager::~QQuickTransitionManager() { delete d->transitionInstance; delete d; d = 0; } -bool QDeclarativeTransitionManager::isRunning() const +bool QQuickTransitionManager::isRunning() const { return d->transitionInstance && d->transitionInstance->isRunning(); } -void QDeclarativeTransitionManager::complete() +void QQuickTransitionManager::complete() { d->applyBindings(); for (int ii = 0; ii < d->completeList.count(); ++ii) { - const QDeclarativeProperty &prop = d->completeList.at(ii).property(); + const QQmlProperty &prop = d->completeList.at(ii).property(); prop.write(d->completeList.at(ii).value()); } d->completeList.clear(); if (d->state) - static_cast<QDeclarativeStatePrivate*>(QObjectPrivate::get(d->state))->complete(); + static_cast<QQuickStatePrivate*>(QObjectPrivate::get(d->state))->complete(); finished(); } -void QDeclarativeTransitionManagerPrivate::applyBindings() +void QQuickTransitionManagerPrivate::applyBindings() { - foreach(const QDeclarativeAction &action, bindingsList) { + foreach(const QQuickAction &action, bindingsList) { if (!action.toBinding.isNull()) { - QDeclarativePropertyPrivate::setBinding(action.property, action.toBinding.data()); + QQmlPropertyPrivate::setBinding(action.property, action.toBinding.data()); } else if (action.event) { if (action.reverseEvent) action.event->reverse(); @@ -123,23 +123,23 @@ void QDeclarativeTransitionManagerPrivate::applyBindings() bindingsList.clear(); } -void QDeclarativeTransitionManager::finished() +void QQuickTransitionManager::finished() { } -void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &list, - QDeclarativeTransition *transition, +void QQuickTransitionManager::transition(const QList<QQuickAction> &list, + QQuickTransition *transition, QObject *defaultTarget) { cancel(); - QDeclarativeStateOperation::ActionList applyList = list; + QQuickStateOperation::ActionList applyList = list; // Determine which actions are binding changes and disable any current bindings - foreach(const QDeclarativeAction &action, applyList) { + foreach(const QQuickAction &action, applyList) { if (action.toBinding) d->bindingsList << action; if (action.fromBinding) - QDeclarativePropertyPrivate::setBinding(action.property, 0); // Disable current binding + QQmlPropertyPrivate::setBinding(action.property, 0); // Disable current binding if (action.event && action.event->changesBindings()) { //### assume isReversable()? d->bindingsList << action; action.event->clearBindings(); @@ -162,34 +162,34 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & // Apply all the property and binding changes for (int ii = 0; ii < applyList.size(); ++ii) { - const QDeclarativeAction &action = applyList.at(ii); + const QQuickAction &action = applyList.at(ii); if (!action.toBinding.isNull()) { - QDeclarativePropertyPrivate::setBinding(action.property, action.toBinding.data(), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::setBinding(action.property, action.toBinding.data(), QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } else if (!action.event) { - QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } else if (action.event->isReversable()) { if (action.reverseEvent) - action.event->reverse(QDeclarativeActionEvent::FastForward); + action.event->reverse(QQuickActionEvent::FastForward); else - action.event->execute(QDeclarativeActionEvent::FastForward); + action.event->execute(QQuickActionEvent::FastForward); } } // Read all the end values for binding changes for (int ii = 0; ii < applyList.size(); ++ii) { - QDeclarativeAction *action = &applyList[ii]; + QQuickAction *action = &applyList[ii]; if (action->event) { action->event->saveTargetValues(); continue; } - const QDeclarativeProperty &prop = action->property; + const QQmlProperty &prop = action->property; if (!action->toBinding.isNull() || !action->toValue.isValid()) { action->toValue = prop.read(); } } // Revert back to the original values - foreach(const QDeclarativeAction &action, applyList) { + foreach(const QQuickAction &action, applyList) { if (action.event) { if (action.event->isReversable()) { action.event->clearBindings(); @@ -200,15 +200,15 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & } if (action.toBinding) - QDeclarativePropertyPrivate::setBinding(action.property, 0); // Make sure this is disabled during the transition + QQmlPropertyPrivate::setBinding(action.property, 0); // Make sure this is disabled during the transition - QDeclarativePropertyPrivate::write(action.property, action.fromValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + QQmlPropertyPrivate::write(action.property, action.fromValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } } if (transition) { - QList<QDeclarativeProperty> touched; - QDeclarativeTransitionInstance *oldInstance = d->transitionInstance; + QList<QQmlProperty> touched; + QQuickTransitionInstance *oldInstance = d->transitionInstance; d->transitionInstance = transition->prepare(applyList, touched, this, defaultTarget); d->transitionInstance->start(); if (oldInstance && oldInstance != d->transitionInstance) @@ -216,7 +216,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & // Modify the action list to remove actions handled in the transition for (int ii = 0; ii < applyList.count(); ++ii) { - const QDeclarativeAction &action = applyList.at(ii); + const QQuickAction &action = applyList.at(ii); if (action.event) { @@ -230,7 +230,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & if (touched.contains(action.property)) { if (action.toValue != action.fromValue) d->completeList << - QDeclarativeSimpleAction(action, QDeclarativeSimpleAction::EndState); + QQuickSimpleAction(action, QQuickSimpleAction::EndState); applyList.removeAt(ii); --ii; @@ -244,7 +244,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & // be applied immediately. We skip applying bindings, as they are all // applied at the end in applyBindings() to avoid any nastiness mid // transition - foreach(const QDeclarativeAction &action, applyList) { + foreach(const QQuickAction &action, applyList) { if (action.event && !action.event->changesBindings()) { if (action.event->isReversable() && action.reverseEvent) action.event->reverse(); @@ -256,7 +256,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & } #ifndef QT_NO_DEBUG_STREAM if (stateChangeDebug()) { - foreach(const QDeclarativeAction &action, applyList) { + foreach(const QQuickAction &action, applyList) { if (action.event) qWarning() << " No transition for event:" << action.event->type(); else @@ -270,15 +270,15 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & complete(); } -void QDeclarativeTransitionManager::cancel() +void QQuickTransitionManager::cancel() { if (d->transitionInstance && d->transitionInstance->isRunning()) d->transitionInstance->stop(); for(int i = 0; i < d->bindingsList.count(); ++i) { - QDeclarativeAction action = d->bindingsList[i]; + QQuickAction action = d->bindingsList[i]; if (!action.toBinding.isNull() && action.deletableToBinding) { - QDeclarativePropertyPrivate::setBinding(action.property, 0); + QQmlPropertyPrivate::setBinding(action.property, 0); action.toBinding.data()->destroy(); action.toBinding.clear(); action.deletableToBinding = false; diff --git a/src/quick/util/qdeclarativetransitionmanager_p_p.h b/src/quick/util/qquicktransitionmanager_p_p.h index d548c05f3a..4270ed61a8 100644 --- a/src/quick/util/qdeclarativetransitionmanager_p_p.h +++ b/src/quick/util/qquicktransitionmanager_p_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVETRANSITIONMANAGER_P_H -#define QDECLARATIVETRANSITIONMANAGER_P_H +#ifndef QQUICKTRANSITIONMANAGER_P_H +#define QQUICKTRANSITIONMANAGER_P_H // // W A R N I N G @@ -53,22 +53,22 @@ // We mean it. // -#include "qdeclarativestateoperations_p.h" -#include "qdeclarativeanimation_p.h" +#include "qquickstatechangescript_p.h" +#include "qquickanimation_p.h" QT_BEGIN_NAMESPACE -class QDeclarativeStatePrivate; -class QDeclarativeTransitionManagerPrivate; -class Q_AUTOTEST_EXPORT QDeclarativeTransitionManager +class QQuickStatePrivate; +class QQuickTransitionManagerPrivate; +class Q_AUTOTEST_EXPORT QQuickTransitionManager { public: - QDeclarativeTransitionManager(); - ~QDeclarativeTransitionManager(); + QQuickTransitionManager(); + ~QQuickTransitionManager(); bool isRunning() const; - void transition(const QList<QDeclarativeAction> &, QDeclarativeTransition *transition, QObject *defaultTarget = 0); + void transition(const QList<QQuickAction> &, QQuickTransition *transition, QObject *defaultTarget = 0); void cancel(); @@ -76,16 +76,16 @@ protected: virtual void finished(); private: - Q_DISABLE_COPY(QDeclarativeTransitionManager) - QDeclarativeTransitionManagerPrivate *d; + Q_DISABLE_COPY(QQuickTransitionManager) + QQuickTransitionManagerPrivate *d; void complete(); - void setState(QDeclarativeState *); + void setState(QQuickState *); - friend class QDeclarativeState; + friend class QQuickState; friend class ParallelAnimationWrapper; }; QT_END_NAMESPACE -#endif // QDECLARATIVETRANSITIONMANAGER_P_H +#endif // QQUICKTRANSITIONMANAGER_P_H diff --git a/src/quick/util/qquickutilmodule.cpp b/src/quick/util/qquickutilmodule.cpp new file mode 100644 index 0000000000..4abbfe591d --- /dev/null +++ b/src/quick/util/qquickutilmodule.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module 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 "qquickutilmodule_p.h" +#include "qquickanimation_p.h" +#include "qquickanimation_p_p.h" +#include "qquickbehavior_p.h" +#include "qquickbind_p.h" +#include "qquickconnections_p.h" +#include "qquicksmoothedanimation_p.h" +#include "qquickfontloader_p.h" +#include "qquickpackage_p.h" +#include "qquickpropertychanges_p.h" +#include "qquickspringanimation_p.h" +#include "qquickstategroup_p.h" +#include "qquickstatechangescript_p.h" +#include "qquickstate_p.h" +#include "qquickstate_p_p.h" +#include "qquicksystempalette_p.h" +#include "qquicktimer_p.h" +#include "qquicktransition_p.h" +#include <qqmlinfo.h> +#include <private/qqmltypenotavailable_p.h> +#include <private/qquickanimationcontroller_p.h> +#include <QtCore/qcoreapplication.h> +#include <QtGui/QInputMethod> + +void QQuickUtilModule::defineModule() +{ + qmlRegisterUncreatableType<QInputMethod>("QtQuick",2,0,"InputPanel", + QInputMethod::tr("InputPanel is an abstract class")); // deprecated + qmlRegisterUncreatableType<QInputMethod>("QtQuick",2,0,"InputMethod", + QInputMethod::tr("InputMethod is an abstract class")); + qmlRegisterUncreatableType<QQuickAbstractAnimation>("QtQuick",2,0,"Animation",QQuickAbstractAnimation::tr("Animation is an abstract class")); + + qmlRegisterType<QQuickBehavior>("QtQuick",2,0,"Behavior"); + qmlRegisterType<QQuickBind>("QtQuick",2,0,"Binding"); + qmlRegisterType<QQuickColorAnimation>("QtQuick",2,0,"ColorAnimation"); + qmlRegisterType<QQuickConnections>("QtQuick",2,0,"Connections"); + qmlRegisterType<QQuickSmoothedAnimation>("QtQuick",2,0,"SmoothedAnimation"); + qmlRegisterType<QQuickFontLoader>("QtQuick",2,0,"FontLoader"); + qmlRegisterType<QQuickNumberAnimation>("QtQuick",2,0,"NumberAnimation"); + qmlRegisterType<QQuickPackage>("QtQuick",2,0,"Package"); + qmlRegisterType<QQuickParallelAnimation>("QtQuick",2,0,"ParallelAnimation"); + qmlRegisterType<QQuickPauseAnimation>("QtQuick",2,0,"PauseAnimation"); + qmlRegisterType<QQuickPropertyAction>("QtQuick",2,0,"PropertyAction"); + qmlRegisterType<QQuickPropertyAnimation>("QtQuick",2,0,"PropertyAnimation"); + qmlRegisterType<QQuickRotationAnimation>("QtQuick",2,0,"RotationAnimation"); + qmlRegisterType<QQuickScriptAction>("QtQuick",2,0,"ScriptAction"); + qmlRegisterType<QQuickSequentialAnimation>("QtQuick",2,0,"SequentialAnimation"); + qmlRegisterType<QQuickSpringAnimation>("QtQuick",2,0,"SpringAnimation"); + qmlRegisterType<QQuickAnimationController>("QtQuick",2,0,"AnimationController"); + qmlRegisterType<QQuickStateChangeScript>("QtQuick",2,0,"StateChangeScript"); + qmlRegisterType<QQuickStateGroup>("QtQuick",2,0,"StateGroup"); + qmlRegisterType<QQuickState>("QtQuick",2,0,"State"); + qmlRegisterType<QQuickSystemPalette>("QtQuick",2,0,"SystemPalette"); + qmlRegisterType<QQuickTimer>("QtQuick",2,0,"Timer"); + qmlRegisterType<QQuickTransition>("QtQuick",2,0,"Transition"); + qmlRegisterType<QQuickVector3dAnimation>("QtQuick",2,0,"Vector3dAnimation"); + + qmlRegisterType<QQuickStateOperation>(); + + qmlRegisterCustomType<QQuickPropertyChanges>("QtQuick",2,0,"PropertyChanges", new QQuickPropertyChangesParser); + qmlRegisterCustomType<QQuickConnections>("QtQuick",2,0,"Connections", new QQmlConnectionsParser); +} diff --git a/src/quick/util/qdeclarativeutilmodule_p.h b/src/quick/util/qquickutilmodule_p.h index 9d20077554..dc0254370e 100644 --- a/src/quick/util/qdeclarativeutilmodule_p.h +++ b/src/quick/util/qquickutilmodule_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEUTILMODULE_H -#define QDECLARATIVEUTILMODULE_H +#ifndef QQUICKUTILMODULE_H +#define QQUICKUTILMODULE_H -#include <qdeclarative.h> +#include <qqml.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeUtilModule +class QQuickUtilModule { public: static void defineModule(); @@ -58,4 +58,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEUTILMODULE_H +#endif // QQUICKUTILMODULE_H diff --git a/src/quick/util/util.pri b/src/quick/util/util.pri index d933459596..c3cec91404 100644 --- a/src/quick/util/util.pri +++ b/src/quick/util/util.pri @@ -1,61 +1,61 @@ SOURCES += \ - $$PWD/qdeclarativeutilmodule.cpp\ - $$PWD/qdeclarativeconnections.cpp \ - $$PWD/qdeclarativepackage.cpp \ - $$PWD/qdeclarativeanimation.cpp \ - $$PWD/qdeclarativesystempalette.cpp \ - $$PWD/qdeclarativespringanimation.cpp \ - $$PWD/qdeclarativesmoothedanimation.cpp \ - $$PWD/qdeclarativeanimationcontroller.cpp \ - $$PWD/qdeclarativestate.cpp\ - $$PWD/qdeclarativetransitionmanager.cpp \ - $$PWD/qdeclarativestateoperations.cpp \ - $$PWD/qdeclarativepropertychanges.cpp \ - $$PWD/qdeclarativestategroup.cpp \ - $$PWD/qdeclarativetransition.cpp \ - $$PWD/qdeclarativelistaccessor.cpp \ - $$PWD/qdeclarativetimeline.cpp \ - $$PWD/qdeclarativetimer.cpp \ - $$PWD/qdeclarativebind.cpp \ - $$PWD/qdeclarativepixmapcache.cpp \ - $$PWD/qdeclarativebehavior.cpp \ - $$PWD/qdeclarativefontloader.cpp \ - $$PWD/qdeclarativestyledtext.cpp \ - $$PWD/qdeclarativepath.cpp \ - $$PWD/qdeclarativechangeset.cpp \ - $$PWD/qdeclarativelistcompositor.cpp \ - $$PWD/qdeclarativepathinterpolator.cpp \ - $$PWD/qdeclarativesvgparser.cpp + $$PWD/qquickutilmodule.cpp\ + $$PWD/qquickconnections.cpp \ + $$PWD/qquickpackage.cpp \ + $$PWD/qquickanimation.cpp \ + $$PWD/qquicksystempalette.cpp \ + $$PWD/qquickspringanimation.cpp \ + $$PWD/qquicksmoothedanimation.cpp \ + $$PWD/qquickanimationcontroller.cpp \ + $$PWD/qquickstate.cpp\ + $$PWD/qquicktransitionmanager.cpp \ + $$PWD/qquickstatechangescript.cpp \ + $$PWD/qquickpropertychanges.cpp \ + $$PWD/qquickstategroup.cpp \ + $$PWD/qquicktransition.cpp \ + $$PWD/qquicklistaccessor.cpp \ + $$PWD/qquicktimeline.cpp \ + $$PWD/qquicktimer.cpp \ + $$PWD/qquickbind.cpp \ + $$PWD/qquickpixmapcache.cpp \ + $$PWD/qquickbehavior.cpp \ + $$PWD/qquickfontloader.cpp \ + $$PWD/qquickstyledtext.cpp \ + $$PWD/qquickpath.cpp \ + $$PWD/qquickchangeset.cpp \ + $$PWD/qquicklistcompositor.cpp \ + $$PWD/qquickpathinterpolator.cpp \ + $$PWD/qquicksvgparser.cpp HEADERS += \ - $$PWD/qdeclarativeutilmodule_p.h\ - $$PWD/qdeclarativeconnections_p.h \ - $$PWD/qdeclarativepackage_p.h \ - $$PWD/qdeclarativeanimation_p.h \ - $$PWD/qdeclarativeanimation_p_p.h \ - $$PWD/qdeclarativesystempalette_p.h \ - $$PWD/qdeclarativespringanimation_p.h \ - $$PWD/qdeclarativeanimationcontroller_p.h \ - $$PWD/qdeclarativesmoothedanimation_p.h \ - $$PWD/qdeclarativesmoothedanimation_p_p.h \ - $$PWD/qdeclarativestate_p.h\ - $$PWD/qdeclarativestateoperations_p.h \ - $$PWD/qdeclarativepropertychanges_p.h \ - $$PWD/qdeclarativestate_p_p.h\ - $$PWD/qdeclarativetransitionmanager_p_p.h \ - $$PWD/qdeclarativestategroup_p.h \ - $$PWD/qdeclarativetransition_p.h \ - $$PWD/qdeclarativelistaccessor_p.h \ - $$PWD/qdeclarativetimeline_p_p.h \ - $$PWD/qdeclarativetimer_p.h \ - $$PWD/qdeclarativebind_p.h \ - $$PWD/qdeclarativepixmapcache_p.h \ - $$PWD/qdeclarativebehavior_p.h \ - $$PWD/qdeclarativefontloader_p.h \ - $$PWD/qdeclarativestyledtext_p.h \ - $$PWD/qdeclarativepath_p.h \ - $$PWD/qdeclarativepath_p_p.h \ - $$PWD/qdeclarativechangeset_p.h \ - $$PWD/qdeclarativelistcompositor_p.h \ - $$PWD/qdeclarativepathinterpolator_p.h \ - $$PWD/qdeclarativesvgparser_p.h
\ No newline at end of file + $$PWD/qquickutilmodule_p.h\ + $$PWD/qquickconnections_p.h \ + $$PWD/qquickpackage_p.h \ + $$PWD/qquickanimation_p.h \ + $$PWD/qquickanimation_p_p.h \ + $$PWD/qquicksystempalette_p.h \ + $$PWD/qquickspringanimation_p.h \ + $$PWD/qquickanimationcontroller_p.h \ + $$PWD/qquicksmoothedanimation_p.h \ + $$PWD/qquicksmoothedanimation_p_p.h \ + $$PWD/qquickstate_p.h\ + $$PWD/qquickstatechangescript_p.h \ + $$PWD/qquickpropertychanges_p.h \ + $$PWD/qquickstate_p_p.h\ + $$PWD/qquicktransitionmanager_p_p.h \ + $$PWD/qquickstategroup_p.h \ + $$PWD/qquicktransition_p.h \ + $$PWD/qquicklistaccessor_p.h \ + $$PWD/qquicktimeline_p_p.h \ + $$PWD/qquicktimer_p.h \ + $$PWD/qquickbind_p.h \ + $$PWD/qquickpixmapcache_p.h \ + $$PWD/qquickbehavior_p.h \ + $$PWD/qquickfontloader_p.h \ + $$PWD/qquickstyledtext_p.h \ + $$PWD/qquickpath_p.h \ + $$PWD/qquickpath_p_p.h \ + $$PWD/qquickchangeset_p.h \ + $$PWD/qquicklistcompositor_p.h \ + $$PWD/qquickpathinterpolator_p.h \ + $$PWD/qquicksvgparser_p.h diff --git a/src/src.pro b/src/src.pro index f8ef168260..5ea4194260 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS += declarative quick plugins +SUBDIRS += qml quick plugins contains(QT_CONFIG, qmltest): SUBDIRS += qmltest |