aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/quick/customitems/painteditem/textballoons.qml2
-rw-r--r--examples/quick/embeddedinwidgets/TextBox.qml76
-rw-r--r--examples/quick/embeddedinwidgets/embeddedinwidgets.pro12
-rw-r--r--examples/quick/embeddedinwidgets/embeddedinwidgets.qrc6
-rw-r--r--examples/quick/embeddedinwidgets/main.cpp73
-rw-r--r--examples/quick/embeddedinwidgets/main.qml113
-rw-r--r--examples/quick/quick.pro5
-rw-r--r--examples/quick/textureprovider/Label.qml49
-rw-r--r--examples/quick/textureprovider/etcprovider.cpp202
-rw-r--r--examples/quick/textureprovider/etcprovider.h82
-rw-r--r--examples/quick/textureprovider/images/qt-logo.jpgbin0 -> 19365 bytes
-rw-r--r--examples/quick/textureprovider/images/qt-logo.pkmbin0 -> 32784 bytes
-rw-r--r--examples/quick/textureprovider/main.cpp56
-rw-r--r--examples/quick/textureprovider/textureprovider.pro13
-rw-r--r--examples/quick/textureprovider/textureprovider.qml65
-rw-r--r--examples/quick/textureprovider/textureprovider.qrc8
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp10
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.h4
-rw-r--r--src/imports/testlib/signalspy.h4
-rw-r--r--src/imports/testlib/testcase.h4
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel_p.h4
-rw-r--r--src/particles/qquickage_p.h3
-rw-r--r--src/particles/qquickangledirection_p.h3
-rw-r--r--src/particles/qquickcumulativedirection_p.h4
-rw-r--r--src/particles/qquickcustomaffector_p.h3
-rw-r--r--src/particles/qquickcustomparticle_p.h4
-rw-r--r--src/particles/qquickdirection_p.h3
-rw-r--r--src/particles/qquickellipseextruder_p.h3
-rw-r--r--src/particles/qquickfriction_p.h3
-rw-r--r--src/particles/qquickgravity_p.h3
-rw-r--r--src/particles/qquickgroupgoal_p.h4
-rw-r--r--src/particles/qquickimageparticle_p.h3
-rw-r--r--src/particles/qquickitemparticle.cpp1
-rw-r--r--src/particles/qquickitemparticle_p.h3
-rw-r--r--src/particles/qquickmaskextruder_p.h4
-rw-r--r--src/particles/qquickparticleaffector_p.h3
-rw-r--r--src/particles/qquickparticleemitter_p.h4
-rw-r--r--src/particles/qquickparticleextruder_p.h4
-rw-r--r--src/particles/qquickparticlepainter_p.h3
-rw-r--r--src/particles/qquickparticlesmodule_p.h4
-rw-r--r--src/particles/qquickparticlesystem_p.h4
-rw-r--r--src/particles/qquickpointattractor_p.h3
-rw-r--r--src/particles/qquickpointdirection_p.h3
-rw-r--r--src/particles/qquickrectangleextruder_p.h4
-rw-r--r--src/particles/qquickspritegoal_p.h4
-rw-r--r--src/particles/qquicktargetdirection_p.h3
-rw-r--r--src/particles/qquicktrailemitter_p.h3
-rw-r--r--src/particles/qquickturbulence_p.h3
-rw-r--r--src/particles/qquickv8particledata_p.h4
-rw-r--r--src/particles/qquickwander_p.h3
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro15
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp148
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp220
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/usbostcomm.h191
-rw-r--r--src/qml/animations/qabstractanimationjob_p.h4
-rw-r--r--src/qml/animations/qanimationgroupjob_p.h4
-rw-r--r--src/qml/animations/qparallelanimationgroupjob_p.h4
-rw-r--r--src/qml/animations/qpauseanimationjob_p.h4
-rw-r--r--src/qml/animations/qsequentialanimationgroupjob_p.h4
-rw-r--r--src/qml/debugger/qdebugmessageservice_p.h4
-rw-r--r--src/qml/debugger/qqmldebug.h4
-rw-r--r--src/qml/debugger/qqmldebugserver_p.h4
-rw-r--r--src/qml/debugger/qqmldebugserverconnection_p.h4
-rw-r--r--src/qml/debugger/qqmldebugservice_p.h4
-rw-r--r--src/qml/debugger/qqmldebugservice_p_p.h4
-rw-r--r--src/qml/debugger/qqmldebugstatesdelegate_p.h4
-rw-r--r--src/qml/debugger/qqmlinspectorinterface_p.h4
-rw-r--r--src/qml/debugger/qqmlinspectorservice_p.h4
-rw-r--r--src/qml/debugger/qqmlprofilerservice_p.h4
-rw-r--r--src/qml/debugger/qv8debugservice_p.h4
-rw-r--r--src/qml/debugger/qv8profilerservice_p.h4
-rw-r--r--src/qml/doc/qtqml.qdocconf2
-rw-r--r--src/qml/doc/src/documents/definetypes.qdoc2
-rw-r--r--src/qml/doc/src/qmlfunctions.qdoc17
-rw-r--r--src/qml/doc/src/qmltypereference.qdoc8
-rw-r--r--src/qml/items/items.pri10
-rw-r--r--src/qml/items/qqmldelegatemodel.cpp (renamed from src/quick/items/qquickvisualdatamodel.cpp)901
-rw-r--r--src/qml/items/qqmldelegatemodel_p.h (renamed from src/quick/items/qquickvisualdatamodel_p.h)100
-rw-r--r--src/qml/items/qqmldelegatemodel_p_p.h (renamed from src/quick/items/qquickvisualdatamodel_p_p.h)196
-rw-r--r--src/qml/items/qqmlobjectmodel.cpp (renamed from src/quick/items/qquickvisualitemmodel.cpp)101
-rw-r--r--src/qml/items/qqmlobjectmodel_p.h (renamed from src/quick/items/qquickvisualitemmodel_p.h)84
-rw-r--r--src/qml/items/qquickpackage.cpp (renamed from src/quick/util/qquickpackage.cpp)0
-rw-r--r--src/qml/items/qquickpackage_p.h (renamed from src/quick/util/qquickpackage_p.h)4
-rw-r--r--src/qml/qml.pro1
-rw-r--r--src/qml/qml/ftw/qqmlrefcount_p.h4
-rw-r--r--src/qml/qml/parser/qqmljs.g117
-rw-r--r--src/qml/qml/parser/qqmljsast.cpp28
-rw-r--r--src/qml/qml/parser/qqmljsast_p.h113
-rw-r--r--src/qml/qml/parser/qqmljsastfwd_p.h4
-rw-r--r--src/qml/qml/parser/qqmljsastvisitor_p.h10
-rw-r--r--src/qml/qml/parser/qqmljsengine_p.cpp2
-rw-r--r--src/qml/qml/parser/qqmljsgrammar.cpp1785
-rw-r--r--src/qml/qml/parser/qqmljsgrammar_p.h36
-rw-r--r--src/qml/qml/parser/qqmljskeywords_p.h26
-rw-r--r--src/qml/qml/parser/qqmljslexer.cpp256
-rw-r--r--src/qml/qml/parser/qqmljslexer_p.h2
-rw-r--r--src/qml/qml/parser/qqmljsparser.cpp414
-rw-r--r--src/qml/qml/parser/qqmljsparser_p.h7
-rw-r--r--src/qml/qml/qml.pri17
-rw-r--r--src/qml/qml/qqml.h25
-rw-r--r--src/qml/qml/qqmlaccessors_p.h4
-rw-r--r--src/qml/qml/qqmlbind.cpp10
-rw-r--r--src/qml/qml/qqmlbind_p.h4
-rw-r--r--src/qml/qml/qqmlcompileddata.cpp2
-rw-r--r--src/qml/qml/qqmlcompiler.cpp47
-rw-r--r--src/qml/qml/qqmlcomponent.h4
-rw-r--r--src/qml/qml/qqmlcomponentattached_p.h4
-rw-r--r--src/qml/qml/qqmlconnections.cpp6
-rw-r--r--src/qml/qml/qqmlconnections_p.h4
-rw-r--r--src/qml/qml/qqmlcontext.h4
-rw-r--r--src/qml/qml/qqmlcustomparser_p.h4
-rw-r--r--src/qml/qml/qqmlengine.cpp49
-rw-r--r--src/qml/qml/qqmlengine.h4
-rw-r--r--src/qml/qml/qqmlengine_p.h4
-rw-r--r--src/qml/qml/qqmlerror.h4
-rw-r--r--src/qml/qml/qqmlexpression.h4
-rw-r--r--src/qml/qml/qqmlextensioninterface.h4
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp9
-rw-r--r--src/qml/qml/qqmlextensionplugin.h17
-rw-r--r--src/qml/qml/qqmlextensionplugin_p.h (renamed from src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h)49
-rw-r--r--src/qml/qml/qqmlfile.h4
-rw-r--r--src/qml/qml/qqmlglobal_p.h4
-rw-r--r--src/qml/qml/qqmlimport.cpp113
-rw-r--r--src/qml/qml/qqmlimport_p.h5
-rw-r--r--src/qml/qml/qqmlincubator.h4
-rw-r--r--src/qml/qml/qqmlinfo.h4
-rw-r--r--src/qml/qml/qqmllist.h4
-rw-r--r--src/qml/qml/qqmllistmodel.cpp (renamed from src/qml/qml/qquicklistmodel.cpp)162
-rw-r--r--src/qml/qml/qqmllistmodel_p.h (renamed from src/qml/qml/qquicklistmodel_p.h)44
-rw-r--r--src/qml/qml/qqmllistmodel_p_p.h (renamed from src/qml/qml/qquicklistmodel_p_p.h)34
-rw-r--r--src/qml/qml/qqmllistmodelworkeragent.cpp (renamed from src/qml/qml/qquicklistmodelworkeragent.cpp)56
-rw-r--r--src/qml/qml/qqmllistmodelworkeragent_p.h (renamed from src/qml/qml/qquicklistmodelworkeragent_p.h)26
-rw-r--r--src/qml/qml/qqmllocale_p.h4
-rw-r--r--src/qml/qml/qqmlmemoryprofiler_p.h3
-rw-r--r--src/qml/qml/qqmlmetatype.cpp666
-rw-r--r--src/qml/qml/qqmlmetatype_p.h15
-rw-r--r--src/qml/qml/qqmlnetworkaccessmanagerfactory.h4
-rw-r--r--src/qml/qml/qqmlopenmetaobject_p.h4
-rw-r--r--src/qml/qml/qqmlparserstatus.h4
-rw-r--r--src/qml/qml/qqmlplatform.cpp83
-rw-r--r--src/qml/qml/qqmlplatform_p.h (renamed from src/plugins/qmltooling/qmldbg_ost/qostdevice.h)35
-rw-r--r--src/qml/qml/qqmlprivate.h18
-rw-r--r--src/qml/qml/qqmlproperty.h4
-rw-r--r--src/qml/qml/qqmlpropertyvaluesource.h4
-rw-r--r--src/qml/qml/qqmlproxymetaobject_p.h4
-rw-r--r--src/qml/qml/qqmlscript.cpp2
-rw-r--r--src/qml/qml/qqmlscript_p.h4
-rw-r--r--src/qml/qml/qqmlscriptstring.h4
-rw-r--r--src/qml/qml/qqmltimer.cpp18
-rw-r--r--src/qml/qml/qqmltimer_p.h4
-rw-r--r--src/qml/qml/qqmltypeloader.cpp15
-rw-r--r--src/qml/qml/qqmltypenotavailable_p.h4
-rw-r--r--src/qml/qml/qqmlvme.cpp9
-rw-r--r--src/qml/qml/qquickworkerscript.cpp6
-rw-r--r--src/qml/qml/qquickworkerscript_p.h4
-rw-r--r--src/qml/qml/rewriter/textwriter_p.h3
-rw-r--r--src/qml/qml/v4/qv4bindings_p.h4
-rw-r--r--src/qml/qml/v4/qv4compiler_p.h4
-rw-r--r--src/qml/qml/v4/qv4compiler_p_p.h4
-rw-r--r--src/qml/qml/v4/qv4instruction_p.h4
-rw-r--r--src/qml/qml/v4/qv4ir_p.h4
-rw-r--r--src/qml/qml/v4/qv4irbuilder.cpp14
-rw-r--r--src/qml/qml/v4/qv4irbuilder_p.h8
-rw-r--r--src/qml/qml/v4/qv4program_p.h4
-rw-r--r--src/qml/qml/v8/qjsengine.h4
-rw-r--r--src/qml/qml/v8/qjsvalue.h4
-rw-r--r--src/qml/qml/v8/qjsvalueiterator.h4
-rw-r--r--src/qml/qml/v8/qv8bindings_p.h4
-rw-r--r--src/qml/qml/v8/qv8domerrors_p.h4
-rw-r--r--src/qml/qml/v8/qv8engine.cpp13
-rw-r--r--src/qml/qml/v8/qv8engine_p.h2
-rw-r--r--src/qml/qml/v8/qv8sqlerrors_p.h4
-rw-r--r--src/qml/qml/v8/qv8worker.cpp12
-rw-r--r--src/qml/qtqmlglobal.h3
-rw-r--r--src/qml/util/qqmladaptormodel.cpp (renamed from src/quick/items/qquickvisualadaptormodel.cpp)236
-rw-r--r--src/qml/util/qqmladaptormodel_p.h (renamed from src/quick/items/qquickvisualadaptormodel_p.h)66
-rw-r--r--src/qml/util/qqmlchangeset.cpp (renamed from src/quick/util/qquickchangeset.cpp)54
-rw-r--r--src/qml/util/qqmlchangeset_p.h (renamed from src/quick/util/qquickchangeset_p.h)37
-rw-r--r--src/qml/util/qqmllistaccessor.cpp (renamed from src/quick/util/qquicklistaccessor.cpp)16
-rw-r--r--src/qml/util/qqmllistaccessor_p.h (renamed from src/quick/util/qquicklistaccessor_p.h)16
-rw-r--r--src/qml/util/qqmllistcompositor.cpp (renamed from src/quick/util/qquicklistcompositor.cpp)184
-rw-r--r--src/qml/util/qqmllistcompositor_p.h (renamed from src/quick/util/qquicklistcompositor_p.h)60
-rw-r--r--src/qml/util/qqmlpropertymap.h4
-rw-r--r--src/qml/util/util.pri8
-rw-r--r--src/qmltest/qtestoptions_p.h4
-rw-r--r--src/qmltest/quicktest.h4
-rw-r--r--src/qmltest/quicktestglobal.h2
-rw-r--r--src/quick/designer/designersupport.cpp4
-rw-r--r--src/quick/designer/designersupport.h4
-rw-r--r--src/quick/designer/designerwindowmanager_p.h9
-rw-r--r--src/quick/doc/images/gridLayout_aligncenter.pngbin0 -> 476 bytes
-rw-r--r--src/quick/doc/images/gridLayout_aligntop.pngbin0 -> 472 bytes
-rw-r--r--src/quick/doc/images/gridLayout_aligntopleft.pngbin0 -> 477 bytes
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc13
-rw-r--r--src/quick/items/context2d/qquickcanvascontext_p.h4
-rw-r--r--src/quick/items/context2d/qquickcanvasitem_p.h4
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp3
-rw-r--r--src/quick/items/context2d/qquickcontext2d_p.h6
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h4
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture_p.h4
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile_p.h4
-rw-r--r--src/quick/items/items.pri17
-rw-r--r--src/quick/items/qquickaccessibleattached_p.h4
-rw-r--r--src/quick/items/qquickanchors_p.h4
-rw-r--r--src/quick/items/qquickanimatedimage_p.h4
-rw-r--r--src/quick/items/qquickanimatedsprite_p.h4
-rw-r--r--src/quick/items/qquickborderimage_p.h2
-rw-r--r--src/quick/items/qquickdrag_p.h4
-rw-r--r--src/quick/items/qquickdroparea_p.h4
-rw-r--r--src/quick/items/qquickflickable_p.h4
-rw-r--r--src/quick/items/qquickflipable_p.h4
-rw-r--r--src/quick/items/qquickfocusscope_p.h4
-rw-r--r--src/quick/items/qquickgridview.cpp21
-rw-r--r--src/quick/items/qquickgridview_p.h7
-rw-r--r--src/quick/items/qquickimage_p.h4
-rw-r--r--src/quick/items/qquickimagebase_p.h4
-rw-r--r--src/quick/items/qquickimplicitsizeitem_p.h4
-rw-r--r--src/quick/items/qquickitem.cpp57
-rw-r--r--src/quick/items/qquickitem.h4
-rw-r--r--src/quick/items/qquickitem_p.h21
-rw-r--r--src/quick/items/qquickitemanimation_p.h4
-rw-r--r--src/quick/items/qquickitemsmodule.cpp12
-rw-r--r--src/quick/items/qquickitemsmodule_p.h4
-rw-r--r--src/quick/items/qquickitemview.cpp114
-rw-r--r--src/quick/items/qquickitemview_p.h14
-rw-r--r--src/quick/items/qquickitemview_p_p.h33
-rw-r--r--src/quick/items/qquickitemviewtransition_p.h4
-rw-r--r--src/quick/items/qquicklistview.cpp21
-rw-r--r--src/quick/items/qquicklistview_p.h8
-rw-r--r--src/quick/items/qquickloader_p.h4
-rw-r--r--src/quick/items/qquickmousearea_p.h4
-rw-r--r--src/quick/items/qquickmultipointtoucharea_p.h4
-rw-r--r--src/quick/items/qquickpainteditem.h4
-rw-r--r--src/quick/items/qquickpathview.cpp84
-rw-r--r--src/quick/items/qquickpathview_p.h13
-rw-r--r--src/quick/items/qquickpathview_p_p.h5
-rw-r--r--src/quick/items/qquickpincharea_p.h4
-rw-r--r--src/quick/items/qquickpositioners.cpp111
-rw-r--r--src/quick/items/qquickpositioners_p.h28
-rw-r--r--src/quick/items/qquickrectangle.cpp2
-rw-r--r--src/quick/items/qquickrectangle_p.h4
-rw-r--r--src/quick/items/qquickrepeater.cpp82
-rw-r--r--src/quick/items/qquickrepeater_p.h12
-rw-r--r--src/quick/items/qquickrepeater_p_p.h5
-rw-r--r--src/quick/items/qquickscalegrid_p_p.h4
-rw-r--r--src/quick/items/qquickscreen.cpp4
-rw-r--r--src/quick/items/qquickscreen_p.h4
-rw-r--r--src/quick/items/qquickshadereffect_p.h4
-rw-r--r--src/quick/items/qquickshadereffectmesh_p.h4
-rw-r--r--src/quick/items/qquickshadereffectnode_p.h4
-rw-r--r--src/quick/items/qquickshadereffectsource_p.h4
-rw-r--r--src/quick/items/qquicksprite_p.h3
-rw-r--r--src/quick/items/qquickspriteengine.cpp2
-rw-r--r--src/quick/items/qquickspriteengine_p.h4
-rw-r--r--src/quick/items/qquickspritesequence_p.h4
-rw-r--r--src/quick/items/qquickstateoperations_p.h4
-rw-r--r--src/quick/items/qquicktext_p.h4
-rw-r--r--src/quick/items/qquicktextcontrol_p.h4
-rw-r--r--src/quick/items/qquicktextdocument.cpp71
-rw-r--r--src/quick/items/qquicktextdocument.h86
-rw-r--r--src/quick/items/qquicktextedit.cpp20
-rw-r--r--src/quick/items/qquicktextedit_p.h9
-rw-r--r--src/quick/items/qquicktextedit_p_p.h2
-rw-r--r--src/quick/items/qquicktextinput_p.h4
-rw-r--r--src/quick/items/qquickthreadedwindowmanager.cpp910
-rw-r--r--src/quick/items/qquickthreadedwindowmanager_p.h181
-rw-r--r--src/quick/items/qquicktranslate_p.h4
-rw-r--r--src/quick/items/qquickview.h4
-rw-r--r--src/quick/items/qquickview_p.h4
-rw-r--r--src/quick/items/qquickwindow.cpp94
-rw-r--r--src/quick/items/qquickwindow.h4
-rw-r--r--src/quick/items/qquickwindow_p.h4
-rw-r--r--src/quick/items/qquickwindowmodule_p.h4
-rw-r--r--src/quick/qtquick2_p.h4
-rw-r--r--src/quick/qtquickglobal.h2
-rw-r--r--src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp8
-rw-r--r--src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h5
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.h4
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.cpp24
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.h4
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.cpp21
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.h4
-rw-r--r--src/quick/scenegraph/coreapi/qsgnodeupdater_p.h4
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp17
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer_p.h4
-rw-r--r--src/quick/scenegraph/coreapi/qsgrendernode_p.h4
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp29
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer_p.h4
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp24
-rw-r--r--src/quick/scenegraph/qsgcontext_p.h8
-rw-r--r--src/quick/scenegraph/qsgcontextplugin.cpp2
-rw-r--r--src/quick/scenegraph/qsgcontextplugin_p.h10
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.h4
-rw-r--r--src/quick/scenegraph/qsgdefaultimagenode_p.h4
-rw-r--r--src/quick/scenegraph/qsgdefaultrectanglenode.cpp3
-rw-r--r--src/quick/scenegraph/qsgdefaultrectanglenode_p.h4
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p.h4
-rw-r--r--src/quick/scenegraph/qsgflashnode_p.h4
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp (renamed from src/quick/items/qquickwindowmanager.cpp)67
-rw-r--r--src/quick/scenegraph/qsgrenderloop_p.h (renamed from src/quick/items/qquickwindowmanager_p.h)18
-rw-r--r--src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h4
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp1133
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop_p.h124
-rw-r--r--src/quick/scenegraph/scenegraph.pri10
-rw-r--r--src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h4
-rw-r--r--src/quick/scenegraph/util/qsgflatcolormaterial.h4
-rw-r--r--src/quick/scenegraph/util/qsgpainternode.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgpainternode_p.h4
-rw-r--r--src/quick/scenegraph/util/qsgsimplematerial.h4
-rw-r--r--src/quick/scenegraph/util/qsgsimplerectnode.h4
-rw-r--r--src/quick/scenegraph/util/qsgsimpletexturenode.h4
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp110
-rw-r--r--src/quick/scenegraph/util/qsgtexture.h4
-rw-r--r--src/quick/scenegraph/util/qsgtexture_p.h1
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial.h4
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial_p.h4
-rw-r--r--src/quick/scenegraph/util/qsgtextureprovider.h4
-rw-r--r--src/quick/scenegraph/util/qsgvertexcolormaterial.h4
-rw-r--r--src/quick/util/qquickanimation_p.h4
-rw-r--r--src/quick/util/qquickanimationcontroller_p.h4
-rw-r--r--src/quick/util/qquickapplication_p.h4
-rw-r--r--src/quick/util/qquickbehavior_p.h4
-rw-r--r--src/quick/util/qquickfontloader_p.h4
-rw-r--r--src/quick/util/qquickimageprovider.h4
-rw-r--r--src/quick/util/qquickpath_p.h4
-rw-r--r--src/quick/util/qquickpathinterpolator_p.h4
-rw-r--r--src/quick/util/qquickpixmapcache.cpp11
-rw-r--r--src/quick/util/qquickpixmapcache_p.h10
-rw-r--r--src/quick/util/qquickpropertychanges_p.h4
-rw-r--r--src/quick/util/qquicksmoothedanimation_p.h4
-rw-r--r--src/quick/util/qquickspringanimation_p.h4
-rw-r--r--src/quick/util/qquickstate_p.h4
-rw-r--r--src/quick/util/qquickstatechangescript_p.h4
-rw-r--r--src/quick/util/qquickstategroup_p.h4
-rw-r--r--src/quick/util/qquicksystempalette_p.h4
-rw-r--r--src/quick/util/qquicktransition_p.h4
-rw-r--r--src/quick/util/qquickutilmodule.cpp2
-rw-r--r--src/quick/util/qquickutilmodule_p.h4
-rw-r--r--src/quick/util/qquickvaluetypes_p.h4
-rw-r--r--src/quick/util/util.pri8
-rw-r--r--sync.profile6
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js38
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js31
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js22
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js3
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js3
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js10
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js16
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js18
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js50
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js5
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js10
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js8
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js2
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js2
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js72
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp9
-rw-r--r--tests/auto/qml/qml.pro8
-rw-r--r--tests/auto/qml/qmlmin/tst_qmlmin.cpp8
-rw-r--r--tests/auto/qml/qqmlchangeset/qqmlchangeset.pro10
-rw-r--r--tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp (renamed from tests/auto/qml/qquickchangeset/tst_qquickchangeset.cpp)106
-rw-r--r--tests/auto/qml/qqmlecmascript/data/getSet.qml14
-rw-r--r--tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml47
-rw-r--r--tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml19
-rw-r--r--tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml19
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp65
-rw-r--r--tests/auto/qml/qqmllanguage/data/CompositeType5.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/CompositeType6.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml8
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/data/literals.qml4
-rw-r--r--tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp25
-rw-r--r--tests/auto/qml/qqmllistcompositor/qqmllistcompositor.pro (renamed from tests/auto/qml/qquickchangeset/qquickchangeset.pro)4
-rw-r--r--tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp (renamed from tests/auto/qml/qquicklistcompositor/tst_qquicklistcompositor.cpp)106
-rw-r--r--tests/auto/qml/qqmllistmodel/data/enumerate.qml (renamed from tests/auto/qml/qquicklistmodel/data/enumerate.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/data/multipleroles.qml (renamed from tests/auto/qml/qquicklistmodel/data/multipleroles.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/data/setmodelcachelist.qml (renamed from tests/auto/qml/qquicklistmodel/data/setmodelcachelist.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/data/signalhandlers.qml (renamed from tests/auto/qml/qquicklistmodel/data/signalhandlers.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/qqmllistmodel.pro (renamed from tests/auto/qml/qquicklistmodel/qquicklistmodel.pro)4
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp (renamed from tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp)110
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/model.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/model.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/script.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/script.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workersync.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workersync.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workersync.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/qqmllistmodelworkerscript.pro (renamed from tests/auto/qml/qquicklistmodelworkerscript/qquicklistmodelworkerscript.pro)4
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp (renamed from tests/auto/qml/qquicklistmodelworkerscript/tst_qquicklistmodelworkerscript.cpp)82
-rw-r--r--tests/auto/qml/qqmlmetatype/data/CompositeType.qml5
-rw-r--r--tests/auto/qml/qqmlmetatype/data/ImplicitType.qml5
-rw-r--r--tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml3
-rw-r--r--tests/auto/qml/qqmlmetatype/qqmlmetatype.pro3
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp58
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir1
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp2
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp36
-rw-r--r--tests/auto/quick/qquickanimations/qquickanimations.pro1
-rw-r--r--tests/auto/quick/qquickflickable/qquickflickable.pro1
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp181
-rw-r--r--tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp1
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp8
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp8
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp12
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp152
-rw-r--r--tests/auto/quick/qquickpositioners/data/gridtest.qml6
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp243
-rw-r--r--tests/auto/quick/qquicktextdocument/data/text.qml6
-rw-r--r--tests/auto/quick/qquicktextdocument/qquicktextdocument.pro (renamed from tests/auto/qml/qquicklistcompositor/qquicklistcompositor.pro)9
-rw-r--r--tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp87
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp2
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp4
-rw-r--r--tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp264
-rw-r--r--tests/auto/quick/qquickwindow/data/focus.qml4
-rw-r--r--tests/auto/quick/qquickwindow/data/ownershipRootItem.qml2
-rw-r--r--tests/auto/quick/qquickwindow/data/showHideAnimate.qml5
-rw-r--r--tests/auto/quick/qquickwindow/qquickwindow.pro3
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp192
-rw-r--r--tests/auto/quick/quick.pro1
-rw-r--r--tools/qmlmin/main.cpp8
-rw-r--r--tools/qmlplugindump/main.cpp10
-rw-r--r--tools/qmlscene/main.cpp12
442 files changed, 8032 insertions, 6756 deletions
diff --git a/examples/quick/customitems/painteditem/textballoons.qml b/examples/quick/customitems/painteditem/textballoons.qml
index a851794e2f..e498ca3a7c 100644
--- a/examples/quick/customitems/painteditem/textballoons.qml
+++ b/examples/quick/customitems/painteditem/textballoons.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import TextBalloonPlugin 1.0
+import "TextBalloonPlugin" 1.0
Item {
height: 480
diff --git a/examples/quick/embeddedinwidgets/TextBox.qml b/examples/quick/embeddedinwidgets/TextBox.qml
new file mode 100644
index 0000000000..9664726305
--- /dev/null
+++ b/examples/quick/embeddedinwidgets/TextBox.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+FocusScope {
+ id: root
+
+ width: 100
+ height: 30
+
+ property Item nextInFocus;
+ property string label;
+
+ Rectangle {
+ anchors.margins: 2
+ anchors.fill: parent
+ radius: 8
+ gradient: Gradient {
+ GradientStop { position: 0; color: "lightgray" }
+ GradientStop { position: 1; color: "white" }
+ }
+ border.color: "white"
+ border.width: 2
+ antialiasing: true
+
+ TextInput {
+ anchors.fill: parent
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ focus: true
+
+ text: root.label;
+
+ KeyNavigation.tab: root.nextInFocus;
+ }
+ }
+}
diff --git a/examples/quick/embeddedinwidgets/embeddedinwidgets.pro b/examples/quick/embeddedinwidgets/embeddedinwidgets.pro
new file mode 100644
index 0000000000..de47a397ab
--- /dev/null
+++ b/examples/quick/embeddedinwidgets/embeddedinwidgets.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+QT += widgets quick
+
+SOURCES += main.cpp
+
+OTHER_FILES += main.qml TextBox.qml
+
+RESOURCES += \
+ embeddedinwidgets.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/embeddedinwidgets
+INSTALLS += target
diff --git a/examples/quick/embeddedinwidgets/embeddedinwidgets.qrc b/examples/quick/embeddedinwidgets/embeddedinwidgets.qrc
new file mode 100644
index 0000000000..62e0ed2161
--- /dev/null
+++ b/examples/quick/embeddedinwidgets/embeddedinwidgets.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/embeddedinwidgets">
+ <file>main.qml</file>
+ <file>TextBox.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/quick/embeddedinwidgets/main.cpp b/examples/quick/embeddedinwidgets/main.cpp
new file mode 100644
index 0000000000..7a30b277de
--- /dev/null
+++ b/examples/quick/embeddedinwidgets/main.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QWidget>
+#include <QApplication>
+#include <QVBoxLayout>
+#include <QLineEdit>
+
+#include <QQuickView>
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ QWidget rootWidget;
+
+ QVBoxLayout *layout = new QVBoxLayout();
+ rootWidget.setLayout(layout);
+
+ QQuickView *view = new QQuickView();
+ view->setResizeMode(QQuickView::SizeRootObjectToView);
+ view->setSource(QUrl(QStringLiteral("qrc:///embeddedinwidgets/main.qml")));
+
+ QWidget *container = QWidget::createWindowContainer(view);
+ container->setMinimumSize(view->size());
+ container->setFocusPolicy(Qt::TabFocus);
+
+ layout->addWidget(new QLineEdit(QStringLiteral("A QLineEdit")));
+ layout->addWidget(container);
+ layout->addWidget(new QLineEdit(QStringLiteral("A QLineEdit")));
+
+ rootWidget.show();
+
+ return app.exec();
+}
diff --git a/examples/quick/embeddedinwidgets/main.qml b/examples/quick/embeddedinwidgets/main.qml
new file mode 100644
index 0000000000..f5a941a258
--- /dev/null
+++ b/examples/quick/embeddedinwidgets/main.qml
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: window
+
+ width: 400
+ height: 200
+
+ gradient: Gradient {
+ GradientStop { position: 0; color: "lightsteelblue" }
+ GradientStop { position: 1; color: "black" }
+ }
+
+ Column {
+ id: column
+ opacity: 0.99 // work around QTBUG-29037
+
+ y: 50
+ width: 200
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ TextBox {
+ id: input1
+ width: parent.width
+ height: 30
+ focus: true
+
+ label: "A QML text box.."
+
+ nextInFocus: input2;
+ }
+
+ TextBox {
+ id: input2
+ width: parent.width
+ height: 30
+
+ label: "Another QML text box.."
+
+ nextInFocus: input1;
+ }
+
+ layer.enabled: true
+ layer.smooth: true
+ }
+
+ ShaderEffect {
+ anchors.top: column.bottom
+ width: column.width
+ height: column.height;
+ anchors.left: column.left
+
+ property variant source: column;
+ property size sourceSize: Qt.size(0.5 / column.width, 0.5 / column.height);
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform lowp sampler2D source;
+ uniform lowp vec2 sourceSize;
+ uniform lowp float qt_Opacity;
+ void main() {
+
+ lowp vec2 tc = qt_TexCoord0 * vec2(1, -1) + vec2(0, 1);
+ lowp vec4 col = 0.25 * (texture2D(source, tc + sourceSize)
+ + texture2D(source, tc- sourceSize)
+ + texture2D(source, tc + sourceSize * vec2(1, -1))
+ + texture2D(source, tc + sourceSize * vec2(-1, 1))
+ );
+ gl_FragColor = col * qt_Opacity * (1.0 - qt_TexCoord0.y) * 0.2;
+ }"
+ }
+}
diff --git a/examples/quick/quick.pro b/examples/quick/quick.pro
index e3691a044b..2d8acb3345 100644
--- a/examples/quick/quick.pro
+++ b/examples/quick/quick.pro
@@ -23,6 +23,11 @@ SUBDIRS = accessibility \
particles \
demos
+# Widget dependent examples
+qtHaveModule(widgets) {
+ SUBDIRS += embeddedinwidgets
+}
+
EXAMPLE_FILES = \
ui-components \
shared
diff --git a/examples/quick/textureprovider/Label.qml b/examples/quick/textureprovider/Label.qml
new file mode 100644
index 0000000000..990ac247dc
--- /dev/null
+++ b/examples/quick/textureprovider/Label.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Text {
+ font.pixelSize: 26
+ style: Text.Outline; styleColor: "white"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 20
+}
diff --git a/examples/quick/textureprovider/etcprovider.cpp b/examples/quick/textureprovider/etcprovider.cpp
new file mode 100644
index 0000000000..507965ca9a
--- /dev/null
+++ b/examples/quick/textureprovider/etcprovider.cpp
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "etcprovider.h"
+
+#include <QFile>
+#include <QDebug>
+#include <qopenglfunctions.h>
+
+//#define ETC_DEBUG
+
+#ifndef GL_ETC1_RGB8_OES
+ #define GL_ETC1_RGB8_OES 0x8d64
+#endif
+
+typedef struct {
+ char aName[6];
+ unsigned short iBlank;
+ /* NB: Beware endianness issues here. */
+ unsigned char iPaddedWidthMSB;
+ unsigned char iPaddedWidthLSB;
+ unsigned char iPaddedHeightMSB;
+ unsigned char iPaddedHeightLSB;
+ unsigned char iWidthMSB;
+ unsigned char iWidthLSB;
+ unsigned char iHeightMSB;
+ unsigned char iHeightLSB;
+} ETCHeader;
+
+unsigned short getWidth(ETCHeader *pHeader)
+{
+ return (pHeader->iWidthMSB << 8) | pHeader->iWidthLSB;
+}
+
+unsigned short getHeight(ETCHeader *pHeader)
+{
+ return (pHeader->iHeightMSB << 8) | pHeader->iHeightLSB;
+}
+
+unsigned short getPaddedWidth(ETCHeader *pHeader)
+{
+ return (pHeader->iPaddedWidthMSB << 8) | pHeader->iPaddedWidthLSB;
+}
+
+unsigned short getPaddedHeight(ETCHeader *pHeader)
+{
+ return (pHeader->iPaddedHeightMSB << 8) | pHeader->iPaddedHeightLSB;
+}
+
+EtcTexture::EtcTexture()
+ : m_texture_id(0), m_uploaded(false)
+{
+
+}
+
+EtcTexture::~EtcTexture()
+{
+ if (m_texture_id)
+ glDeleteTextures(1, &m_texture_id);
+}
+
+int EtcTexture::textureId() const
+{
+ if (m_texture_id == 0)
+ glGenTextures(1, &const_cast<EtcTexture *>(this)->m_texture_id);
+ return m_texture_id;
+}
+
+void EtcTexture::bind()
+{
+ if (m_uploaded && m_texture_id) {
+ glBindTexture(GL_TEXTURE_2D, m_texture_id);
+ return;
+ }
+
+ if (m_texture_id == 0)
+ glGenTextures(1, &m_texture_id);
+ glBindTexture(GL_TEXTURE_2D, m_texture_id);
+
+#ifdef ETC_DEBUG
+ qDebug() << "glCompressedTexImage2D, width: " << m_size.width() << "height" << m_size.height() <<
+ "paddedWidth: " << m_paddedSize.width() << "paddedHeight: " << m_paddedSize.height();
+#endif
+
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ Q_ASSERT(ctx != 0);
+ ctx->functions()->glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES,
+ m_size.width(), m_size.height(), 0,
+ (m_paddedSize.width() * m_paddedSize.height()) >> 1,
+ m_data.data() + 16);
+
+ // Gracefully fail in case of an error...
+ GLuint error = glGetError();
+ if (error != GL_NO_ERROR) {
+ qDebug () << "glCompressedTexImage2D for compressed texture failed, error: " << error;
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDeleteTextures(1, &m_texture_id);
+ m_texture_id = 0;
+ return;
+ }
+
+ m_uploaded = true;
+ updateBindOptions(true);
+}
+
+class QEtcTextureFactory : public QQuickTextureFactory
+{
+public:
+ QByteArray m_data;
+ QSize m_size;
+ QSize m_paddedSize;
+
+ QSize textureSize() const { return m_size; }
+ int textureByteCount() const { return m_data.size(); }
+
+ QSGTexture *createTexture(QQuickWindow *) const {
+ EtcTexture *texture = new EtcTexture;
+ texture->m_data = m_data;
+ texture->m_size = m_size;
+ texture->m_paddedSize = m_paddedSize;
+ return texture;
+ }
+};
+
+QQuickTextureFactory *EtcProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize)
+{
+ Q_UNUSED(requestedSize);
+ QEtcTextureFactory *ret = 0;
+
+ size->setHeight(0);
+ size->setWidth(0);
+
+ // resolve paths relative to qrc file
+ QFile file(QLatin1String(":/textureprovider/") + id);
+#ifdef ETC_DEBUG
+ qDebug() << "requestTexture opening file: " << id;
+#endif
+ if (file.open(QIODevice::ReadOnly)) {
+ ret = new QEtcTextureFactory;
+ ret->m_data = file.readAll();
+ if (!ret->m_data.isEmpty()) {
+ ETCHeader *pETCHeader = NULL;
+ pETCHeader = (ETCHeader *)ret->m_data.data();
+ size->setHeight(getHeight(pETCHeader));
+ size->setWidth(getWidth(pETCHeader));
+ ret->m_size = *size;
+ ret->m_paddedSize.setHeight(getPaddedHeight(pETCHeader));
+ ret->m_paddedSize.setWidth(getPaddedWidth(pETCHeader));
+ }
+ else {
+ delete ret;
+ ret = 0;
+ }
+ }
+
+#ifdef ETC_DEBUG
+ if (ret)
+ qDebug() << "requestTexture returning: " << ret->m_data.length() << ", bytes; width: " << size->width() << ", height: " << size->height();
+ else
+ qDebug () << "File not found.";
+#endif
+
+ return ret;
+}
diff --git a/examples/quick/textureprovider/etcprovider.h b/examples/quick/textureprovider/etcprovider.h
new file mode 100644
index 0000000000..24570e90e9
--- /dev/null
+++ b/examples/quick/textureprovider/etcprovider.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ETCPROVIDER_H
+#define ETCPROVIDER_H
+
+#include <qopengl.h>
+#include <QQuickImageProvider>
+#include <QtQuick/QSGTexture>
+
+class EtcProvider : public QQuickImageProvider
+{
+public:
+ EtcProvider()
+ : QQuickImageProvider(QQuickImageProvider::Texture)
+ {}
+
+ QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize);
+};
+
+class EtcTexture : public QSGTexture
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qml.QmlOstPlugin")
+public:
+ EtcTexture();
+ ~EtcTexture();
+
+ void bind();
+
+ QSize textureSize() const { return m_size; }
+ int textureId() const;
+
+ bool hasAlphaChannel() const { return false; }
+ bool hasMipmaps() const { return false; }
+
+ QByteArray m_data;
+ QSize m_size;
+ QSize m_paddedSize;
+ GLuint m_texture_id;
+ bool m_uploaded;
+};
+
+#endif // ETCPROVIDER_H
diff --git a/examples/quick/textureprovider/images/qt-logo.jpg b/examples/quick/textureprovider/images/qt-logo.jpg
new file mode 100644
index 0000000000..32d151c2c5
--- /dev/null
+++ b/examples/quick/textureprovider/images/qt-logo.jpg
Binary files differ
diff --git a/examples/quick/textureprovider/images/qt-logo.pkm b/examples/quick/textureprovider/images/qt-logo.pkm
new file mode 100644
index 0000000000..3329031ab2
--- /dev/null
+++ b/examples/quick/textureprovider/images/qt-logo.pkm
Binary files differ
diff --git a/examples/quick/textureprovider/main.cpp b/examples/quick/textureprovider/main.cpp
new file mode 100644
index 0000000000..d9d4fb0d38
--- /dev/null
+++ b/examples/quick/textureprovider/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QQuickView>
+
+#include "etcprovider.h"
+
+int main(int argc, char* argv[])
+{
+ QGuiApplication app(argc,argv);
+ QQuickView view;
+
+ view.engine()->addImageProvider("etc", new EtcProvider());
+
+ view.setSource(QUrl("qrc:///textureprovider/textureprovider.qml"));
+ view.show();
+ return app.exec();
+}
diff --git a/examples/quick/textureprovider/textureprovider.pro b/examples/quick/textureprovider/textureprovider.pro
new file mode 100644
index 0000000000..5d9825f7ac
--- /dev/null
+++ b/examples/quick/textureprovider/textureprovider.pro
@@ -0,0 +1,13 @@
+TEMPLATE = app
+
+QT += quick qml
+
+HEADERS += etcprovider.h
+
+SOURCES += main.cpp \
+ etcprovider.cpp
+
+RESOURCES += textureprovider.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/textureprovider
+INSTALLS += target
diff --git a/examples/quick/textureprovider/textureprovider.qml b/examples/quick/textureprovider/textureprovider.qml
new file mode 100644
index 0000000000..9854bef229
--- /dev/null
+++ b/examples/quick/textureprovider/textureprovider.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Row {
+ width: 512
+ height: 256
+
+ Image {
+ source: "images/qt-logo.jpg"
+
+ Label { text: "Original Image" }
+ }
+
+ Image {
+ source: "image://etc/images/qt-logo.pkm"
+
+ Label { id: clabel; text: "Compressed Texture" }
+ Text {
+ text: "(requires ETC1 support)"
+ anchors.horizontalCenter: clabel.horizontalCenter
+ anchors.top: clabel.bottom
+ font.pixelSize: 14
+ color: "white"
+ }
+ }
+}
diff --git a/examples/quick/textureprovider/textureprovider.qrc b/examples/quick/textureprovider/textureprovider.qrc
new file mode 100644
index 0000000000..77a568ba1d
--- /dev/null
+++ b/examples/quick/textureprovider/textureprovider.qrc
@@ -0,0 +1,8 @@
+<RCC>
+ <qresource prefix="/textureprovider">
+ <file>images/qt-logo.jpg</file>
+ <file>images/qt-logo.pkm</file>
+ <file>textureprovider.qml</file>
+ <file>Label.qml</file>
+ </qresource>
+</RCC>
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 6cb014a5ad..421e215066 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -159,8 +159,10 @@ void QQuickFolderListModelPrivate::_q_directoryUpdated(const QString &directory,
data = list;
q->beginRemoveRows(parent, fromIndex, toIndex);
q->endRemoveRows();
- q->beginInsertRows(parent, fromIndex, list.size()-1);
- q->endInsertRows();
+ if (list.size() > 0) {
+ q->beginInsertRows(parent, fromIndex, list.size()-1);
+ q->endInsertRows();
+ }
emit q->rowCountChanged();
} else if (data.size() < list.size()) {
//qDebug() << "File added. FromIndex: " << fromIndex << " toIndex: " << toIndex << " list size: " << list.size();
@@ -334,10 +336,10 @@ QVariant QQuickFolderListModel::data(const QModelIndex &index, int role) const
rv = d->data.at(index.row()).size();
break;
case FileLastModifiedRole:
- rv = d->data.at(index.row()).lastModified().date().toString(Qt::ISODate) + " " + d->data.at(index.row()).lastModified().time().toString();
+ rv = d->data.at(index.row()).lastModified();
break;
case FileLastReadRole:
- rv = d->data.at(index.row()).lastRead().date().toString(Qt::ISODate) + " " + d->data.at(index.row()).lastRead().time().toString();
+ rv = d->data.at(index.row()).lastRead();
break;
case FileIsDirRole:
rv = d->data.at(index.row()).isDir();
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h
index eb16bd05fc..03cb24d368 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.h
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h
@@ -47,8 +47,6 @@
#include <QUrl>
#include <QAbstractListModel>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -165,6 +163,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKFOLDERLISTMODEL_H
diff --git a/src/imports/testlib/signalspy.h b/src/imports/testlib/signalspy.h
index 27dc12ae13..a7ff89f0b0 100644
--- a/src/imports/testlib/signalspy.h
+++ b/src/imports/testlib/signalspy.h
@@ -46,8 +46,6 @@
#include <QtQuick/qquickitem.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class SignalSpy : public QQuickItem
@@ -78,6 +76,4 @@ QML_DECLARE_TYPE(SignalSpy)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/imports/testlib/testcase.h b/src/imports/testlib/testcase.h
index a5e393a1a4..3b767981d0 100644
--- a/src/imports/testlib/testcase.h
+++ b/src/imports/testlib/testcase.h
@@ -46,8 +46,6 @@
#include <QtQuick/qquickitem.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class TestCase : public QQuickItem
@@ -89,6 +87,4 @@ QML_DECLARE_TYPE(TestCase)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel_p.h b/src/imports/xmllistmodel/qqmlxmllistmodel_p.h
index 776ae50f64..0a11cc6e28 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel_p.h
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel_p.h
@@ -50,8 +50,6 @@
#include <QtCore/qabstractitemmodel.h>
#include <private/qv8engine_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -207,6 +205,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickXmlListModel)
QML_DECLARE_TYPE(QQuickXmlListModelRole)
-QT_END_HEADER
-
#endif // QQUICKXMLLISTMODEL_H
diff --git a/src/particles/qquickage_p.h b/src/particles/qquickage_p.h
index b9047cab9e..0839517e95 100644
--- a/src/particles/qquickage_p.h
+++ b/src/particles/qquickage_p.h
@@ -43,8 +43,6 @@
#define KILLAFFECTOR_H
#include "qquickparticleaffector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickAgeAffector : public QQuickParticleAffector
@@ -95,5 +93,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // KILLAFFECTOR_H
diff --git a/src/particles/qquickangledirection_p.h b/src/particles/qquickangledirection_p.h
index 7ac70cef00..d89455a5e7 100644
--- a/src/particles/qquickangledirection_p.h
+++ b/src/particles/qquickangledirection_p.h
@@ -42,8 +42,6 @@
#ifndef QQuickANGLEDDIRECTION_H
#define QQuickANGLEDDIRECTION_H
#include "qquickdirection_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickAngleDirection : public QQuickDirection
@@ -127,5 +125,4 @@ qreal m_magnitudeVariation;
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // QQuickANGLEDDIRECTION_H
diff --git a/src/particles/qquickcumulativedirection_p.h b/src/particles/qquickcumulativedirection_p.h
index 52e8915e12..c9aa1e8593 100644
--- a/src/particles/qquickcumulativedirection_p.h
+++ b/src/particles/qquickcumulativedirection_p.h
@@ -43,8 +43,6 @@
#define QQuickCUMULATIVEDIRECTION_P_H
#include "qquickdirection_p.h"
#include <QQmlListProperty>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickCumulativeDirection : public QQuickDirection
@@ -62,6 +60,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQuickCUMULATIVEDIRECTION_P_H
diff --git a/src/particles/qquickcustomaffector_p.h b/src/particles/qquickcustomaffector_p.h
index ad6409ab96..a4a077f864 100644
--- a/src/particles/qquickcustomaffector_p.h
+++ b/src/particles/qquickcustomaffector_p.h
@@ -48,8 +48,6 @@
#include "qquickparticleaffector_p.h"
#include "qquickdirection_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickCustomAffector : public QQuickParticleAffector
@@ -158,5 +156,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // CUSTOMAFFECTOR_H
diff --git a/src/particles/qquickcustomparticle_p.h b/src/particles/qquickcustomparticle_p.h
index 66f0fd3e6d..16c1a0c389 100644
--- a/src/particles/qquickcustomparticle_p.h
+++ b/src/particles/qquickcustomparticle_p.h
@@ -46,8 +46,6 @@
#include <private/qquickshadereffect_p.h>
#include <QSignalMapper>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGNode;
@@ -114,6 +112,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif //HEADER_GUARD
diff --git a/src/particles/qquickdirection_p.h b/src/particles/qquickdirection_p.h
index 796be7c91c..4ceae16b35 100644
--- a/src/particles/qquickdirection_p.h
+++ b/src/particles/qquickdirection_p.h
@@ -45,8 +45,6 @@
#include <QObject>
#include <QPointF>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickDirection : public QObject
@@ -64,5 +62,4 @@ protected:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // VARYINGVECTOR_H
diff --git a/src/particles/qquickellipseextruder_p.h b/src/particles/qquickellipseextruder_p.h
index 3c65d0b792..a9425b6205 100644
--- a/src/particles/qquickellipseextruder_p.h
+++ b/src/particles/qquickellipseextruder_p.h
@@ -43,8 +43,6 @@
#define ELLIPSEEXTRUDER_H
#include "qquickparticleextruder_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickEllipseExtruder : public QQuickParticleExtruder
@@ -79,5 +77,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // ELLIPSEEXTRUDER_H
diff --git a/src/particles/qquickfriction_p.h b/src/particles/qquickfriction_p.h
index f92ed36c4b..13ba715e88 100644
--- a/src/particles/qquickfriction_p.h
+++ b/src/particles/qquickfriction_p.h
@@ -43,8 +43,6 @@
#define FRICTIONAFFECTOR_H
#include "qquickparticleaffector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickFrictionAffector : public QQuickParticleAffector
@@ -97,5 +95,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // FRICTIONAFFECTOR_H
diff --git a/src/particles/qquickgravity_p.h b/src/particles/qquickgravity_p.h
index a34e4310b8..e6010b536e 100644
--- a/src/particles/qquickgravity_p.h
+++ b/src/particles/qquickgravity_p.h
@@ -43,8 +43,6 @@
#define GRAVITYAFFECTOR_H
#include "qquickparticleaffector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickGravityAffector : public QQuickParticleAffector
@@ -111,5 +109,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // GRAVITYAFFECTOR_H
diff --git a/src/particles/qquickgroupgoal_p.h b/src/particles/qquickgroupgoal_p.h
index 64d1152d25..6a31b882a3 100644
--- a/src/particles/qquickgroupgoal_p.h
+++ b/src/particles/qquickgroupgoal_p.h
@@ -43,8 +43,6 @@
#define GROUPGOALAFFECTOR_H
#include "qquickparticleaffector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickStochasticEngine;
@@ -95,6 +93,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // GROUPGOALAFFECTOR_H
diff --git a/src/particles/qquickimageparticle_p.h b/src/particles/qquickimageparticle_p.h
index 55bf3530f4..daa3d5cdbc 100644
--- a/src/particles/qquickimageparticle_p.h
+++ b/src/particles/qquickimageparticle_p.h
@@ -48,8 +48,6 @@
#include <QtQuick/qsgsimplematerial.h>
#include <QtGui/qcolor.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class ImageMaterialData;
@@ -442,5 +440,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // ULTRAPARTICLE_H
diff --git a/src/particles/qquickitemparticle.cpp b/src/particles/qquickitemparticle.cpp
index 28a66e8c0b..7bc696e65f 100644
--- a/src/particles/qquickitemparticle.cpp
+++ b/src/particles/qquickitemparticle.cpp
@@ -40,7 +40,6 @@
****************************************************************************/
#include "qquickitemparticle_p.h"
-#include <private/qquickvisualitemmodel_p.h>
#include <QtQuick/qsgnode.h>
#include <QTimer>
#include <QQmlComponent>
diff --git a/src/particles/qquickitemparticle_p.h b/src/particles/qquickitemparticle_p.h
index df7916895f..e5c7239567 100644
--- a/src/particles/qquickitemparticle_p.h
+++ b/src/particles/qquickitemparticle_p.h
@@ -45,8 +45,6 @@
#include <QPointer>
#include <QSet>
#include <private/qquickanimation_p_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickVisualDataModel;
@@ -137,5 +135,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPEINFO(QQuickItemParticle, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
#endif // ITEMPARTICLE_H
diff --git a/src/particles/qquickmaskextruder_p.h b/src/particles/qquickmaskextruder_p.h
index 5b45559e19..5c948cc7d7 100644
--- a/src/particles/qquickmaskextruder_p.h
+++ b/src/particles/qquickmaskextruder_p.h
@@ -46,8 +46,6 @@
#include <QUrl>
#include <QImage>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickMaskExtruder : public QQuickParticleExtruder
@@ -89,6 +87,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // MASKEXTRUDER_H
diff --git a/src/particles/qquickparticleaffector_p.h b/src/particles/qquickparticleaffector_p.h
index fe8d21175c..2629ecc676 100644
--- a/src/particles/qquickparticleaffector_p.h
+++ b/src/particles/qquickparticleaffector_p.h
@@ -46,8 +46,6 @@
#include "qquickparticlesystem_p.h"
#include "qquickparticleextruder_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParticleAffector : public QQuickItem
@@ -196,5 +194,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // PARTICLEAFFECTOR_H
diff --git a/src/particles/qquickparticleemitter_p.h b/src/particles/qquickparticleemitter_p.h
index 9c34d8d2f1..70de934f6d 100644
--- a/src/particles/qquickparticleemitter_p.h
+++ b/src/particles/qquickparticleemitter_p.h
@@ -51,8 +51,6 @@
#include <QList>
#include <QPair>
#include <QPointF>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParticleEmitter : public QQuickItem
@@ -345,6 +343,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // PARTICLEEMITTER_H
diff --git a/src/particles/qquickparticleextruder_p.h b/src/particles/qquickparticleextruder_p.h
index 19000ffbfd..36edc9cf06 100644
--- a/src/particles/qquickparticleextruder_p.h
+++ b/src/particles/qquickparticleextruder_p.h
@@ -46,8 +46,6 @@
#include <QRectF>
#include <QPointF>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParticleExtruder : public QObject
@@ -66,6 +64,4 @@ protected:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // PARTICLEEXTRUDER_H
diff --git a/src/particles/qquickparticlepainter_p.h b/src/particles/qquickparticlepainter_p.h
index 82dda82b19..7801fddb6e 100644
--- a/src/particles/qquickparticlepainter_p.h
+++ b/src/particles/qquickparticlepainter_p.h
@@ -47,8 +47,6 @@
#include <QPair>
#include "qquickparticlesystem_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParticlePainter : public QQuickItem
@@ -133,5 +131,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // PARTICLE_H
diff --git a/src/particles/qquickparticlesmodule_p.h b/src/particles/qquickparticlesmodule_p.h
index 83f6e016ef..20b1d49b1e 100644
--- a/src/particles/qquickparticlesmodule_p.h
+++ b/src/particles/qquickparticlesmodule_p.h
@@ -44,8 +44,6 @@
#include <private/qtquickparticlesglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICKPARTICLES_PRIVATE_EXPORT QQuickParticlesModule
@@ -56,6 +54,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKPARTICLESMODULE_H
diff --git a/src/particles/qquickparticlesystem_p.h b/src/particles/qquickparticlesystem_p.h
index ba216798f3..1177e30b8f 100644
--- a/src/particles/qquickparticlesystem_p.h
+++ b/src/particles/qquickparticlesystem_p.h
@@ -53,8 +53,6 @@
#include <QtQml/qqml.h>
#include <private/qv8engine_p.h> //For QQmlV8Handle
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParticleSystem;
@@ -378,8 +376,6 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // PARTICLESYSTEM_H
diff --git a/src/particles/qquickpointattractor_p.h b/src/particles/qquickpointattractor_p.h
index 0f2c58d632..1332591daf 100644
--- a/src/particles/qquickpointattractor_p.h
+++ b/src/particles/qquickpointattractor_p.h
@@ -43,8 +43,6 @@
#define ATTRACTORAFFECTOR_H
#include "qquickparticleaffector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickAttractorAffector : public QQuickParticleAffector
@@ -163,5 +161,4 @@ Proportion m_proportionalToDistance;
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // ATTRACTORAFFECTOR_H
diff --git a/src/particles/qquickpointdirection_p.h b/src/particles/qquickpointdirection_p.h
index 2757588843..eae385a3b7 100644
--- a/src/particles/qquickpointdirection_p.h
+++ b/src/particles/qquickpointdirection_p.h
@@ -43,8 +43,6 @@
#define POINTVECTOR_H
#include "qquickdirection_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickPointDirection : public QQuickDirection
@@ -129,5 +127,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // POINTVECTOR_H
diff --git a/src/particles/qquickrectangleextruder_p.h b/src/particles/qquickrectangleextruder_p.h
index 3edb54bb11..e0480687a0 100644
--- a/src/particles/qquickrectangleextruder_p.h
+++ b/src/particles/qquickrectangleextruder_p.h
@@ -44,8 +44,6 @@
#include "qquickparticleextruder_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickRectangleExtruder : public QQuickParticleExtruder
@@ -81,6 +79,4 @@ protected:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // RectangleEXTRUDER_H
diff --git a/src/particles/qquickspritegoal_p.h b/src/particles/qquickspritegoal_p.h
index 7b61f0ec36..4d5f192f0a 100644
--- a/src/particles/qquickspritegoal_p.h
+++ b/src/particles/qquickspritegoal_p.h
@@ -44,8 +44,6 @@
#include "qquickparticleaffector_p.h"
#include <QtQml/qqmlinfo.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickStochasticEngine;
@@ -118,6 +116,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // SPRITEGOALAFFECTOR_H
diff --git a/src/particles/qquicktargetdirection_p.h b/src/particles/qquicktargetdirection_p.h
index aecf880506..886a560271 100644
--- a/src/particles/qquicktargetdirection_p.h
+++ b/src/particles/qquicktargetdirection_p.h
@@ -42,8 +42,6 @@
#ifndef DIRECTEDVECTOR_H
#define DIRECTEDVECTOR_H
#include "qquickdirection_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItem;
@@ -185,5 +183,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // DIRECTEDVECTOR_H
diff --git a/src/particles/qquicktrailemitter_p.h b/src/particles/qquicktrailemitter_p.h
index b57cb57e37..3ae1507f1a 100644
--- a/src/particles/qquicktrailemitter_p.h
+++ b/src/particles/qquicktrailemitter_p.h
@@ -44,8 +44,6 @@
#include "qquickparticleemitter_p.h"
#include "qquickparticleaffector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickTrailEmitter : public QQuickParticleEmitter
@@ -164,5 +162,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // FOLLOWEMITTER_H
diff --git a/src/particles/qquickturbulence_p.h b/src/particles/qquickturbulence_p.h
index d0dd458a79..eea550ed15 100644
--- a/src/particles/qquickturbulence_p.h
+++ b/src/particles/qquickturbulence_p.h
@@ -44,8 +44,6 @@
#include "qquickparticleaffector_p.h"
#include <QQmlListProperty>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParticlePainter;
@@ -112,5 +110,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // TURBULENCEAFFECTOR_H
diff --git a/src/particles/qquickv8particledata_p.h b/src/particles/qquickv8particledata_p.h
index 5b88dd9d8d..e3c1bf9324 100644
--- a/src/particles/qquickv8particledata_p.h
+++ b/src/particles/qquickv8particledata_p.h
@@ -44,8 +44,6 @@
#include <private/qv8engine_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParticleData;
@@ -61,7 +59,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/particles/qquickwander_p.h b/src/particles/qquickwander_p.h
index 54974d2d49..0f09418ea2 100644
--- a/src/particles/qquickwander_p.h
+++ b/src/particles/qquickwander_p.h
@@ -44,8 +44,6 @@
#include <QHash>
#include "qquickparticleaffector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
struct WanderData{
@@ -154,5 +152,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // WANDERAFFECTOR_H
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro
deleted file mode 100644
index 6172ee95cf..0000000000
--- a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TARGET = qmldbg_ost
-QT += qml network
-
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QmlOstPlugin
-load(qt_plugin)
-
-SOURCES += \
- qmlostplugin.cpp \
- qostdevice.cpp
-
-HEADERS += \
- qmlostplugin.h \
- qostdevice.h \
- usbostcomm.h
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp
deleted file mode 100644
index 5d8c5f3d81..0000000000
--- a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmlostplugin.h"
-#include "qostdevice.h"
-
-#include <private/qqmldebugserver_p.h>
-#include <private/qpacketprotocol_p.h>
-
-QT_BEGIN_NAMESPACE
-
-static const TInt KQmlOstProtocolId = 0x94;
-
-class QmlOstPluginPrivate {
-public:
- QmlOstPluginPrivate();
-
- QOstDevice *ost;
- QPacketProtocol *protocol;
- QQmlDebugServer *debugServer;
-};
-
-QmlOstPluginPrivate::QmlOstPluginPrivate() :
- ost(0),
- protocol(0),
- debugServer(0)
-{
-}
-
-QmlOstPlugin::QmlOstPlugin() :
- d_ptr(new QmlOstPluginPrivate)
-{
-}
-
-QmlOstPlugin::~QmlOstPlugin()
-{
- delete d_ptr;
-}
-
-void QmlOstPlugin::setServer(QQmlDebugServer *server)
-{
- Q_D(QmlOstPlugin);
- d->debugServer = server;
-}
-
-bool QmlOstPlugin::isConnected() const
-{
- Q_D(const QmlOstPlugin);
- return d->ost && d->ost->isOpen();
-}
-
-void QmlOstPlugin::send(const QByteArray &message)
-{
- Q_D(QmlOstPlugin);
-
- if (!isConnected())
- return;
-
- QPacket pack;
- pack.writeRawData(message.data(), message.length());
-
- d->protocol->send(pack);
- //d->socket->flush();
-}
-
-void QmlOstPlugin::disconnect()
-{
- Q_D(QmlOstPlugin);
-
- delete d->protocol;
- d->protocol = 0;
-}
-
-bool QmlOstPlugin::waitForMessage()
-{
- Q_D(QmlOstPlugin);
- return d->protocol->waitForReadyRead(-1);
-}
-
-void QmlOstPlugin::setPort(int port, bool block, const QString &hostaddress)
-{
- Q_UNUSED(port);
- Q_UNUSED(block);
- Q_UNUSED(hostaddress);
-
- Q_D(QmlOstPlugin);
-
- d->ost = new QOstDevice(this);
- bool ok = d->ost->open(KQmlOstProtocolId);
- if (!ok) {
- if (d->ost->errorString().length())
- qDebug("Error from QOstDevice: %s", qPrintable(d->ost->errorString()));
- qWarning("QML Debugger: Unable to listen to 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()));
- qDebug("QML Debugger: Waiting for connection via OST."); // This message is part of the signalling - do not change the format!
-}
-
-void QmlOstPlugin::readyRead()
-{
- Q_D(QmlOstPlugin);
- QPacket packet = d->protocol->read();
-
- QByteArray content = packet.data();
- d->debugServer->receiveMessage(content);
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp b/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp
deleted file mode 100644
index e01041bcfb..0000000000
--- a/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qostdevice.h"
-#include <e32base.h>
-
-#include "usbostcomm.h"
-
-class QOstDevicePrivate : public CActive
-{
- QOstDevice* q_ptr;
- Q_DECLARE_PUBLIC(QOstDevice)
-
-public:
- QOstDevicePrivate() : CActive(CActive::EPriorityStandard) {
- CActiveScheduler::Add(this);
- }
- ~QOstDevicePrivate() {
- Cancel();
- }
-
- TInt& AoFlags() { return ((TInt*)&iStatus)[1]; }
-
-private:
- void RunL();
- void DoCancel();
-
-private:
- RUsbOstComm ost;
- TBuf8<4096> readBuf;
- QByteArray dataBuf;
- TBool inReadyRead;
-};
-
-QOstDevice::QOstDevice(QObject *parent) :
- QIODevice(parent), d_ptr(new QOstDevicePrivate)
-{
- d_ptr->q_ptr = this;
-}
-
-QOstDevice::~QOstDevice()
-{
- close();
- delete d_ptr;
-}
-
-bool QOstDevice::open(int ostProtocolId)
-{
- if (isOpen())
- return false;
-
- Q_D(QOstDevice);
- TInt err = d->ost.Connect();
- if (!err) err = d->ost.Open();
- const TVersion KRequiredVersion(1,1,0);
- TVersion version = d->ost.Version();
- if (version.iMajor < KRequiredVersion.iMajor ||
- (version.iMajor == KRequiredVersion.iMajor && version.iMinor < KRequiredVersion.iMinor)) {
- setErrorString("CODA version too old. At least version 4.0.18 (without TRK) is required.");
- return false;
- }
-
- if (!err) err = d->ost.RegisterProtocolID((TOstProtIds)ostProtocolId, EFalse);
- if (!err) {
- d->ost.ReadMessage(d->iStatus, d->readBuf);
- d->SetActive();
- return QIODevice::open(ReadWrite | Unbuffered);
- }
- return false;
-}
-
-void QOstDevicePrivate::RunL()
-{
- Q_Q(QOstDevice);
- //qDebug("QOstDevice received %d bytes q=%x", readBuf.Size(), q);
- if (iStatus == KErrNone) {
- QByteArray data = QByteArray::fromRawData((const char*)readBuf.Ptr(), readBuf.Size());
- dataBuf.append(data);
-
- readBuf.Zero();
- ost.ReadMessage(iStatus, readBuf);
- SetActive();
-
- if (!inReadyRead) {
- inReadyRead = true;
- emit q->readyRead();
- inReadyRead = false;
- }
- } else {
- q->setErrorString(QString("Error %1 from RUsbOstComm::ReadMessage()").arg(iStatus.Int()));
- }
- //qDebug("-QOstDevicePrivate RunL");
-}
-
-void QOstDevicePrivate::DoCancel()
-{
- ost.ReadCancel();
-}
-
-void QOstDevice::close()
-{
- Q_D(QOstDevice);
- QIODevice::close();
- d->Cancel();
- // RDbgTrcComm::Close isn't safe to call when not open, sigh
- if (d->ost.Handle()) {
- d->ost.Close();
- }
-}
-
-qint64 QOstDevice::readData(char *data, qint64 maxSize)
-{
- Q_D(QOstDevice);
- if (d->dataBuf.length() == 0 && !d->IsActive())
- return -1;
- qint64 available = qMin(maxSize, (qint64)d->dataBuf.length());
- memcpy(data, d->dataBuf.constData(), available);
- d->dataBuf.remove(0, available);
- return available;
-}
-
-static const TInt KMaxOstPacketLen = 4096;
-
-qint64 QOstDevice::writeData(const char *data, qint64 maxSize)
-{
- Q_D(QOstDevice);
- TPtrC8 ptr((const TUint8*)data, (TInt)maxSize);
- while (ptr.Length()) {
- TPtrC8 fragment = ptr.Left(qMin(ptr.Length(), KMaxOstPacketLen));
- //qDebug("QOstDevice writing %d bytes", fragment.Length());
- TRequestStatus stat;
- d->ost.WriteMessage(stat, fragment);
- User::WaitForRequest(stat);
- if (stat.Int() != KErrNone) {
- setErrorString(QString("Error %1 from RUsbOstComm::WriteMessage()").arg(stat.Int()));
- return -1;
- }
- ptr.Set(ptr.Mid(fragment.Length()));
- }
- emit bytesWritten(maxSize); //TODO does it matter this is emitted synchronously?
- //qDebug("QOstDevice wrote %d bytes", ptr.Size());
- return maxSize;
-}
-
-qint64 QOstDevice::bytesAvailable() const
-{
- Q_D(const QOstDevice);
- return d->dataBuf.length();
-}
-
-bool QOstDevice::waitForReadyRead(int msecs)
-{
- Q_D(QOstDevice);
- if (msecs >= 0) {
- RTimer timer;
- TInt err = timer.CreateLocal();
- if (err) return false;
- TRequestStatus timeoutStat;
- timer.After(timeoutStat, msecs*1000);
- User::WaitForRequest(timeoutStat, d->iStatus);
- if (timeoutStat != KRequestPending) {
- // Timed out
- timer.Close();
- return false;
- } else {
- // We got data, so cancel timer
- timer.Cancel();
- User::WaitForRequest(timeoutStat);
- timer.Close();
- // And drop through
- }
- } else {
- // Just wait forever for data
- User::WaitForRequest(d->iStatus);
- }
-
- // If we get here we have data
- TInt err = d->iStatus.Int();
- d->AoFlags() &= ~3; // This is necessary to clean up the scheduler as you're not supposed to bypass it like this
- TRAP_IGNORE(d->RunL());
- return err == KErrNone;
-}
diff --git a/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h b/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h
deleted file mode 100644
index 6fa47bfc07..0000000000
--- a/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef USBHOSTCOMM_H
-#define USBHOSTCOMM_H
-
-// Based on the official usbostrouter header, modified to remove dependancy on
-// the client DLL
-
-#include <e32base.h>
-
-typedef int TOstProtIds;
-
-class RUsbOstComm : public RSessionBase
-{
-public:
- RUsbOstComm();
- TInt Connect();
- TInt Disconnect();
- TInt Open();
- TInt Close();
- TInt RegisterProtocolID(TOstProtIds aId, TBool aNeedHeader);
- void ReadMessage(TRequestStatus& aStatus, TDes8& aDes);
- TInt ReadCancel();
- void WriteMessage(TRequestStatus& aStatus, const TDesC8& aDes, TBool aHasHeader=EFalse);
- TVersion Version() const;
-
-private:
- enum TUsbOstCmdCode
- {
- EUsbOstCmdCodeFirst,
- EUsbOstCmdConnect,
- EUsbOstCmdDisconnect,
- EUsbOstCmdCodeGetAcmConfig,
- EUsbOstCmdCodeSetAcmConfig,
- EUsbOstCmdCodeOpen,
- EUsbOstCmdCodeClose,
- EUsbOstCmdCodeRegisterId,
- EUsbOstCmdCodeRegisterIds,
- EUsbOstCmdCodeUnRegisterId,
- EUsbOstCmdCodeUnRegisterIds,
- EUsbOstCmdCodeReadMsg,
- EUsbOstCmdCodeReadCancel,
- EUsbOstCmdCodeWriteMsg,
- EUsbOstCmdCodeWriteCancel,
- EUsbOstCmdCodeLast
- };
-};
-
-RUsbOstComm::RUsbOstComm()
-{
-}
-
-TInt RUsbOstComm::Connect()
-{
- _LIT(KUsbOstServerName, "!UsbOstRouter");
- _LIT(KUsbOstServerImageName, "usbostrouter");
- const TUid KUsbOstServerUid = { 0x200170BE };
- TInt startupAttempts = 2;
- for(;;) {
- TInt ret = CreateSession(KUsbOstServerName, TVersion(1,0,0));
- if (ret != KErrNotFound && ret != KErrServerTerminated) {
- return ret;
- }
-
- if (startupAttempts-- == 0) {
- return ret;
- }
-
- RProcess server;
- ret = server.Create(KUsbOstServerImageName, KNullDesC, KUsbOstServerUid);
- if (ret != KErrNone)
- return ret;
-
- TRequestStatus serverDiedRequestStatus;
- server.Rendezvous(serverDiedRequestStatus);
-
- if (serverDiedRequestStatus != KRequestPending) {
- // Abort startup
- server.Kill(KErrNone);
- } else {
- // Logon OK - start the server
- server.Resume();
- }
- User::WaitForRequest(serverDiedRequestStatus);
- ret = (server.ExitType() == EExitPanic) ? KErrGeneral : serverDiedRequestStatus.Int();
- server.Close();
-
- if (ret != KErrNone && ret != KErrAlreadyExists) {
- return ret;
- }
- }
-}
-
-TInt RUsbOstComm::Disconnect()
-{
- return SendReceive(EUsbOstCmdDisconnect);
-}
-
-TInt RUsbOstComm::Open()
-{
- return SendReceive(EUsbOstCmdCodeOpen);
-}
-
-TInt RUsbOstComm::Close()
-{
- TInt err = SendReceive(EUsbOstCmdCodeClose);
- RHandleBase::Close();
- return err;
-}
-
-TInt RUsbOstComm::RegisterProtocolID(const TOstProtIds aId, TBool aNeedHeader)
-{
- TIpcArgs args(aId, aNeedHeader);
- return SendReceive(EUsbOstCmdCodeRegisterId, args);
-}
-
-void RUsbOstComm::ReadMessage(TRequestStatus& aStatus, TDes8& aDes)
-{
- TIpcArgs args(aDes.MaxLength(), &aDes);
- SendReceive(EUsbOstCmdCodeReadMsg, args, aStatus);
-}
-
-TInt RUsbOstComm::ReadCancel()
-{
- return SendReceive(EUsbOstCmdCodeReadCancel);
-}
-
-void RUsbOstComm::WriteMessage(TRequestStatus& aStatus, const TDesC8& aDes, TBool aHasHeader)
-{
- TIpcArgs args(aHasHeader, aDes.Length(), &aDes);
- SendReceive(EUsbOstCmdCodeWriteMsg, args, aStatus);
-}
-
-typedef TVersion (*TVersionFunction)(const RUsbOstComm*);
-const TInt KVersionOrdinal = 17;
-
-TVersion RUsbOstComm::Version() const
-{
- // This function has to go to the DLL, unfortunately
- TVersion result; // Return 0.0.0 on any error
- RLibrary lib;
- TInt err = lib.Load(_L("usbostcomm"));
- if (err) return result;
-
- TLibraryFunction fn = lib.Lookup(KVersionOrdinal);
- if (fn)
- result = ((TVersionFunction)fn)(this);
- lib.Close();
- return result;
-}
-
-#endif //USBHOSTCOMM_H
diff --git a/src/qml/animations/qabstractanimationjob_p.h b/src/qml/animations/qabstractanimationjob_p.h
index 29e263abe7..abf3cd6df6 100644
--- a/src/qml/animations/qabstractanimationjob_p.h
+++ b/src/qml/animations/qabstractanimationjob_p.h
@@ -47,8 +47,6 @@
#include <QtCore/private/qabstractanimation_p.h>
#include "private/qpodvector_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QAnimationGroupJob;
@@ -235,6 +233,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractAnimationJob::ChangeTypes)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QABSTRACTANIMATIONJOB_P_H
diff --git a/src/qml/animations/qanimationgroupjob_p.h b/src/qml/animations/qanimationgroupjob_p.h
index 2c27e96691..0f62194656 100644
--- a/src/qml/animations/qanimationgroupjob_p.h
+++ b/src/qml/animations/qanimationgroupjob_p.h
@@ -44,8 +44,6 @@
#include "private/qabstractanimationjob_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QML_PRIVATE_EXPORT QAnimationGroupJob : public QAbstractAnimationJob
@@ -86,6 +84,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif //QANIMATIONGROUPJOB_P_H
diff --git a/src/qml/animations/qparallelanimationgroupjob_p.h b/src/qml/animations/qparallelanimationgroupjob_p.h
index 5f896a8bc9..8e29402f33 100644
--- a/src/qml/animations/qparallelanimationgroupjob_p.h
+++ b/src/qml/animations/qparallelanimationgroupjob_p.h
@@ -44,8 +44,6 @@
#include "private/qanimationgroupjob_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QML_PRIVATE_EXPORT QParallelAnimationGroupJob : public QAnimationGroupJob
@@ -74,6 +72,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QPARALLELANIMATIONGROUPJOB_P_H
diff --git a/src/qml/animations/qpauseanimationjob_p.h b/src/qml/animations/qpauseanimationjob_p.h
index 83e0553116..f84143d9bf 100644
--- a/src/qml/animations/qpauseanimationjob_p.h
+++ b/src/qml/animations/qpauseanimationjob_p.h
@@ -44,8 +44,6 @@
#include <private/qanimationgroupjob_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QML_PRIVATE_EXPORT QPauseAnimationJob : public QAbstractAnimationJob
@@ -68,6 +66,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QPAUSEANIMATIONJOB_P_H
diff --git a/src/qml/animations/qsequentialanimationgroupjob_p.h b/src/qml/animations/qsequentialanimationgroupjob_p.h
index fce83b094c..18dc6fcc7b 100644
--- a/src/qml/animations/qsequentialanimationgroupjob_p.h
+++ b/src/qml/animations/qsequentialanimationgroupjob_p.h
@@ -44,8 +44,6 @@
#include <private/qanimationgroupjob_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QPauseAnimationJob;
@@ -101,6 +99,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif //QSEQUENTIALANIMATIONGROUPJOB_P_H
diff --git a/src/qml/debugger/qdebugmessageservice_p.h b/src/qml/debugger/qdebugmessageservice_p.h
index 911f9fe3ed..dbd05646c9 100644
--- a/src/qml/debugger/qdebugmessageservice_p.h
+++ b/src/qml/debugger/qdebugmessageservice_p.h
@@ -57,8 +57,6 @@
#include <QtCore/qlogging.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QDebugMessageServicePrivate;
@@ -84,6 +82,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QDEBUGMESSAGESERVICE_P_H
diff --git a/src/qml/debugger/qqmldebug.h b/src/qml/debugger/qqmldebug.h
index 3232f6bb6f..d2b0220bc6 100644
--- a/src/qml/debugger/qqmldebug.h
+++ b/src/qml/debugger/qqmldebug.h
@@ -44,8 +44,6 @@
#include <QtQml/qtqmlglobal.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -63,6 +61,4 @@ static QQmlDebuggingEnabler qmlEnableDebuggingHelper(true);
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLDEBUG_H
diff --git a/src/qml/debugger/qqmldebugserver_p.h b/src/qml/debugger/qqmldebugserver_p.h
index d38b1d0147..27d54d6947 100644
--- a/src/qml/debugger/qqmldebugserver_p.h
+++ b/src/qml/debugger/qqmldebugserver_p.h
@@ -57,8 +57,6 @@
// We mean it.
//
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -104,6 +102,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLDEBUGSERVICE_H
diff --git a/src/qml/debugger/qqmldebugserverconnection_p.h b/src/qml/debugger/qqmldebugserverconnection_p.h
index a622855071..82a02bb29e 100644
--- a/src/qml/debugger/qqmldebugserverconnection_p.h
+++ b/src/qml/debugger/qqmldebugserverconnection_p.h
@@ -56,8 +56,6 @@
// We mean it.
//
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -82,6 +80,4 @@ Q_DECLARE_INTERFACE(QQmlDebugServerConnection, QQmlDebugServerConnection_iid)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLDEBUGSERVERCONNECTION_H
diff --git a/src/qml/debugger/qqmldebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h
index 3e7b2f11f3..71a116f6a5 100644
--- a/src/qml/debugger/qqmldebugservice_p.h
+++ b/src/qml/debugger/qqmldebugservice_p.h
@@ -58,8 +58,6 @@
// We mean it.
//
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -121,7 +119,5 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLDEBUGSERVICE_H
diff --git a/src/qml/debugger/qqmldebugservice_p_p.h b/src/qml/debugger/qqmldebugservice_p_p.h
index f81a8285eb..940990f628 100644
--- a/src/qml/debugger/qqmldebugservice_p_p.h
+++ b/src/qml/debugger/qqmldebugservice_p_p.h
@@ -56,8 +56,6 @@
#include <QtCore/qglobal.h>
#include <private/qobject_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -77,6 +75,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLDEBUGSERVICE_P_H
diff --git a/src/qml/debugger/qqmldebugstatesdelegate_p.h b/src/qml/debugger/qqmldebugstatesdelegate_p.h
index 8beb4303de..7197b8cc3b 100644
--- a/src/qml/debugger/qqmldebugstatesdelegate_p.h
+++ b/src/qml/debugger/qqmldebugstatesdelegate_p.h
@@ -57,8 +57,6 @@
#include <QtCore/QList>
#include <QtCore/QPointer>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -96,6 +94,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLDEBUGSTATESDELEGATE_P_H
diff --git a/src/qml/debugger/qqmlinspectorinterface_p.h b/src/qml/debugger/qqmlinspectorinterface_p.h
index 1bc25937e9..0b4020c4a7 100644
--- a/src/qml/debugger/qqmlinspectorinterface_p.h
+++ b/src/qml/debugger/qqmlinspectorinterface_p.h
@@ -56,8 +56,6 @@
#include <QtQml/qtqmlglobal.h>
#include <private/qqmlglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -81,6 +79,4 @@ Q_DECLARE_INTERFACE(QQmlInspectorInterface, QQmlInspectorInterface_iid)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLINSPECTORINTERFACE_H
diff --git a/src/qml/debugger/qqmlinspectorservice_p.h b/src/qml/debugger/qqmlinspectorservice_p.h
index de97e1798d..f8b2a39240 100644
--- a/src/qml/debugger/qqmlinspectorservice_p.h
+++ b/src/qml/debugger/qqmlinspectorservice_p.h
@@ -58,8 +58,6 @@
#include <QtQml/qtqmlglobal.h>
#include <QtCore/QList>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -96,6 +94,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLINSPECTORSERVICE_H
diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h
index d5443aaef6..a50fb5ea08 100644
--- a/src/qml/debugger/qqmlprofilerservice_p.h
+++ b/src/qml/debugger/qqmlprofilerservice_p.h
@@ -64,8 +64,6 @@
#include <QtCore/qwaitcondition.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
struct Q_AUTOTEST_EXPORT QQmlProfilerData
@@ -292,7 +290,5 @@ struct QQmlCompilingProfiler {
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLPROFILERSERVICE_P_H
diff --git a/src/qml/debugger/qv8debugservice_p.h b/src/qml/debugger/qv8debugservice_p.h
index c93948c402..00ecf557c3 100644
--- a/src/qml/debugger/qv8debugservice_p.h
+++ b/src/qml/debugger/qv8debugservice_p.h
@@ -56,8 +56,6 @@
#include "qqmldebugservice_p.h"
#include <private/qv8debug_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -100,6 +98,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV8DEBUGSERVICE_P_H
diff --git a/src/qml/debugger/qv8profilerservice_p.h b/src/qml/debugger/qv8profilerservice_p.h
index 6a8c1e8c3b..10906442f5 100644
--- a/src/qml/debugger/qv8profilerservice_p.h
+++ b/src/qml/debugger/qv8profilerservice_p.h
@@ -55,8 +55,6 @@
#include <private/qqmldebugservice_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -115,6 +113,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV8PROFILERSERVICE_P_H
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 61d7e706ec..ecd6b81823 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -34,7 +34,7 @@ headerdirs += ..
sourcedirs += ..
-exampledirs += ../../../examples/ \
+exampledirs += ../../../examples/qml \
../ \
snippets
diff --git a/src/qml/doc/src/documents/definetypes.qdoc b/src/qml/doc/src/documents/definetypes.qdoc
index 97a841ccb8..b9df6a4381 100644
--- a/src/qml/doc/src/documents/definetypes.qdoc
+++ b/src/qml/doc/src/documents/definetypes.qdoc
@@ -34,7 +34,7 @@ One of the core features of QML is that it enables QML object types to be easily
\section1 Defining an Object Type with a QML File
-To create an object type, a QML document should be placed into a text file named as \e <TypeName>.qml where \e <TypeName> is the desired name of the type, beginning with an uppercase letter. This document is then automatically recognized by the engine as a definition of a QML type. Additionally, a type defined in this manner is automatically made available to other QML files within the same directory as the engine searches within the immediate directory when resolving QML type names.
+To create an object type, a QML document should be placed into a text file named as \e <TypeName>.qml where \e <TypeName> is the desired name of the type, which must be comprised of alphanumeric characters or underscores and beginning with an uppercase letter. This document is then automatically recognized by the engine as a definition of a QML type. Additionally, a type defined in this manner is automatically made available to other QML files within the same directory as the engine searches within the immediate directory when resolving QML type names.
For example, below is a document that declares a \l Rectangle with a child \l MouseArea. The document has been saved to file named \c SquareButton.qml:
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index da62ddab6a..81b8fd594f 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -380,3 +380,20 @@
\endcode
*/
+
+/*!
+ \fn int qmlRegisterType(const QUrl &url, const char *uri, int versionMajor, int versionMinor, const char *qmlName);
+ \relates QQmlEngine
+
+ This function registers a type in the QML system with the name \a qmlName, in the library imported from \a uri having the
+ version number composed from \a versionMajor and \a versionMinor. The type is defined by the QML file located at \a url. The
+ url must be an absolute URL, i.e. url.isRelative() == false.
+
+ Normally QML files can be loaded as types directly from other QML files, or using a qmldir file. This function allows
+ registration of files to types from a C++ module, such as when the type mapping needs to be procedurally determined at startup.
+
+ #include <QtQml> to use this function.
+
+ Returns non-zero if the registration was sucessful.
+*/
+
diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc
index 203bdd3eb9..cce8d108d8 100644
--- a/src/qml/doc/src/qmltypereference.qdoc
+++ b/src/qml/doc/src/qmltypereference.qdoc
@@ -25,9 +25,10 @@
**
****************************************************************************/
/*!
-\page qtqml-typereference-topic.html
-\title QML Types Provided By The QtQml Module
-\brief List of QML types provided by the QtQml module
+\qmlmodule QtQml 2
+\title Qt Qml QML Types
+\ingroup qmlmodules
+\brief List of QML types provided by the Qt QML module
The \c QtQml module provides the definition and implementation of various
convenience types which can be used with the QML language, including some
@@ -153,7 +154,6 @@ run-time:
}
}
\endcode
-
*/
/*!
diff --git a/src/qml/items/items.pri b/src/qml/items/items.pri
new file mode 100644
index 0000000000..0fa489f4e1
--- /dev/null
+++ b/src/qml/items/items.pri
@@ -0,0 +1,10 @@
+SOURCES += \
+ $$PWD/qquickpackage.cpp \
+ $$PWD/qqmldelegatemodel.cpp \
+ $$PWD/qqmlobjectmodel.cpp
+
+HEADERS += \
+ $$PWD/qquickpackage_p.h \
+ $$PWD/qqmldelegatemodel_p.h \
+ $$PWD/qqmldelegatemodel_p_p.h \
+ $$PWD/qqmlobjectmodel_p.h
diff --git a/src/quick/items/qquickvisualdatamodel.cpp b/src/qml/items/qqmldelegatemodel.cpp
index d2e50e8b8a..131b539d92 100644
--- a/src/quick/items/qquickvisualdatamodel.cpp
+++ b/src/qml/items/qqmldelegatemodel.cpp
@@ -39,15 +39,14 @@
**
****************************************************************************/
-#include "qquickvisualdatamodel_p_p.h"
-#include "qquickitem.h"
+#include "qqmldelegatemodel_p_p.h"
#include <QtQml/qqmlinfo.h>
#include <private/qquickpackage_p.h>
#include <private/qmetaobjectbuilder_p.h>
-#include <private/qquickvisualadaptormodel_p.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmladaptormodel_p.h>
+#include <private/qqmlchangeset_p.h>
#include <private/qqmlengine_p.h>
#include <private/qqmlcomponent_p.h>
#include <private/qqmlincubator_p.h>
@@ -55,7 +54,7 @@
QT_BEGIN_NAMESPACE
-class QQuickVisualDataModelEngineData : public QV8Engine::Deletable
+class QQmlDelegateModelEngineData : public QV8Engine::Deletable
{
public:
enum
@@ -70,15 +69,15 @@ public:
StringCount
};
- QQuickVisualDataModelEngineData(QV8Engine *engine);
- ~QQuickVisualDataModelEngineData();
+ QQmlDelegateModelEngineData(QV8Engine *engine);
+ ~QQmlDelegateModelEngineData();
v8::Local<v8::Object> array(
- QV8Engine *engine, const QVector<QQuickChangeSet::Remove> &changes);
+ QV8Engine *engine, const QVector<QQmlChangeSet::Remove> &changes);
v8::Local<v8::Object> array(
- QV8Engine *engine, const QVector<QQuickChangeSet::Insert> &changes);
+ QV8Engine *engine, const QVector<QQmlChangeSet::Insert> &changes);
v8::Local<v8::Object> array(
- QV8Engine *engine, const QVector<QQuickChangeSet::Change> &changes);
+ QV8Engine *engine, const QVector<QQmlChangeSet::Change> &changes);
inline v8::Local<v8::String> model() { return strings->Get(Model)->ToString(); }
@@ -94,34 +93,34 @@ public:
v8::Persistent<v8::Function> constructorChangeArray;
};
-V8_DEFINE_EXTENSION(QQuickVisualDataModelEngineData, engineData)
+V8_DEFINE_EXTENSION(QQmlDelegateModelEngineData, engineData)
-void QQuickVisualDataModelPartsMetaObject::propertyCreated(int, QMetaPropertyBuilder &prop)
+void QQmlDelegateModelPartsMetaObject::propertyCreated(int, QMetaPropertyBuilder &prop)
{
prop.setWritable(false);
}
-QVariant QQuickVisualDataModelPartsMetaObject::initialValue(int id)
+QVariant QQmlDelegateModelPartsMetaObject::initialValue(int id)
{
- QQuickVisualDataModelParts *parts = static_cast<QQuickVisualDataModelParts *>(object());
- QQuickVisualPartsModel *m = new QQuickVisualPartsModel(
+ QQmlDelegateModelParts *parts = static_cast<QQmlDelegateModelParts *>(object());
+ QQmlPartsModel *m = new QQmlPartsModel(
parts->model, QString::fromUtf8(name(id)), parts);
parts->models.append(m);
return QVariant::fromValue(static_cast<QObject *>(m));
}
-QQuickVisualDataModelParts::QQuickVisualDataModelParts(QQuickVisualDataModel *parent)
+QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
: QObject(parent), model(parent)
{
- new QQuickVisualDataModelPartsMetaObject(this);
+ new QQmlDelegateModelPartsMetaObject(this);
}
//---------------------------------------------------------------------------
/*!
\qmltype VisualDataModel
- \instantiates QQuickVisualDataModel
+ \instantiates QQmlDelegateModel
\inqmlmodule QtQuick 2
\ingroup qtquick-models
\brief Encapsulates a model and delegate
@@ -141,7 +140,7 @@ QQuickVisualDataModelParts::QQuickVisualDataModelParts(QQuickVisualDataModel *pa
\snippet qml/visualdatamodel.qml 0
*/
-QQuickVisualDataModelPrivate::QQuickVisualDataModelPrivate(QQmlContext *ctxt)
+QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt)
: m_delegate(0)
, m_cacheMetaType(0)
, m_context(ctxt)
@@ -161,7 +160,7 @@ QQuickVisualDataModelPrivate::QQuickVisualDataModelPrivate(QQmlContext *ctxt)
{
}
-QQuickVisualDataModelPrivate::~QQuickVisualDataModelPrivate()
+QQmlDelegateModelPrivate::~QQmlDelegateModelPrivate()
{
qDeleteAll(m_finishedIncubating);
@@ -169,36 +168,36 @@ QQuickVisualDataModelPrivate::~QQuickVisualDataModelPrivate()
m_cacheMetaType->release();
}
-void QQuickVisualDataModelPrivate::init()
+void QQmlDelegateModelPrivate::init()
{
- Q_Q(QQuickVisualDataModel);
+ Q_Q(QQmlDelegateModel);
m_compositor.setRemoveGroups(Compositor::GroupMask & ~Compositor::PersistedFlag);
- m_items = new QQuickVisualDataGroup(QStringLiteral("items"), q, Compositor::Default, q);
+ m_items = new QQmlDataGroup(QStringLiteral("items"), q, Compositor::Default, q);
m_items->setDefaultInclude(true);
- m_persistedItems = new QQuickVisualDataGroup(QStringLiteral("persistedItems"), q, Compositor::Persisted, q);
- QQuickVisualDataGroupPrivate::get(m_items)->emitters.insert(this);
+ m_persistedItems = new QQmlDataGroup(QStringLiteral("persistedItems"), q, Compositor::Persisted, q);
+ QQmlDataGroupPrivate::get(m_items)->emitters.insert(this);
}
-QQuickVisualDataModel::QQuickVisualDataModel()
-: QQuickVisualModel(*(new QQuickVisualDataModelPrivate(0)))
+QQmlDelegateModel::QQmlDelegateModel()
+: QQmlInstanceModel(*(new QQmlDelegateModelPrivate(0)))
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
d->init();
}
-QQuickVisualDataModel::QQuickVisualDataModel(QQmlContext *ctxt, QObject *parent)
-: QQuickVisualModel(*(new QQuickVisualDataModelPrivate(ctxt)), parent)
+QQmlDelegateModel::QQmlDelegateModel(QQmlContext *ctxt, QObject *parent)
+: QQmlInstanceModel(*(new QQmlDelegateModelPrivate(ctxt)), parent)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
d->init();
}
-QQuickVisualDataModel::~QQuickVisualDataModel()
+QQmlDelegateModel::~QQmlDelegateModel()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
- foreach (QQuickVisualDataModelItem *cacheItem, d->m_cache) {
+ foreach (QQmlDelegateModelItem *cacheItem, d->m_cache) {
if (cacheItem->object) {
delete cacheItem->object;
@@ -215,25 +214,25 @@ QQuickVisualDataModel::~QQuickVisualDataModel()
}
-void QQuickVisualDataModel::classBegin()
+void QQmlDelegateModel::classBegin()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (!d->m_context)
d->m_context = qmlContext(this);
}
-void QQuickVisualDataModel::componentComplete()
+void QQmlDelegateModel::componentComplete()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
d->m_complete = true;
int defaultGroups = 0;
QStringList groupNames;
groupNames.append(QStringLiteral("items"));
groupNames.append(QStringLiteral("persistedItems"));
- if (QQuickVisualDataGroupPrivate::get(d->m_items)->defaultInclude)
+ if (QQmlDataGroupPrivate::get(d->m_items)->defaultInclude)
defaultGroups |= Compositor::DefaultFlag;
- if (QQuickVisualDataGroupPrivate::get(d->m_persistedItems)->defaultInclude)
+ if (QQmlDataGroupPrivate::get(d->m_persistedItems)->defaultInclude)
defaultGroups |= Compositor::PersistedFlag;
for (int i = Compositor::MinimumGroupCount; i < d->m_groupCount; ++i) {
QString name = d->m_groups[i]->name();
@@ -242,21 +241,21 @@ void QQuickVisualDataModel::componentComplete()
--d->m_groupCount;
--i;
} else if (name.at(0).isUpper()) {
- qmlInfo(d->m_groups[i]) << QQuickVisualDataGroup::tr("Group names must start with a lower case letter");
+ qmlInfo(d->m_groups[i]) << QQmlDataGroup::tr("Group names must start with a lower case letter");
d->m_groups[i] = d->m_groups[d->m_groupCount - 1];
--d->m_groupCount;
--i;
} else {
groupNames.append(name);
- QQuickVisualDataGroupPrivate *group = QQuickVisualDataGroupPrivate::get(d->m_groups[i]);
+ QQmlDataGroupPrivate *group = QQmlDataGroupPrivate::get(d->m_groups[i]);
group->setModel(this, Compositor::Group(i));
if (group->defaultInclude)
defaultGroups |= (1 << i);
}
}
- d->m_cacheMetaType = new QQuickVisualDataModelItemMetaType(
+ d->m_cacheMetaType = new QQmlDelegateModelItemMetaType(
QQmlEnginePrivate::getV8Engine(d->m_context->engine()), this, groupNames);
d->m_compositor.setGroupCount(d->m_groupCount);
@@ -264,7 +263,7 @@ void QQuickVisualDataModel::componentComplete()
d->updateFilterGroup();
while (!d->m_pendingParts.isEmpty())
- static_cast<QQuickVisualPartsModel *>(d->m_pendingParts.first())->updateFilterGroup();
+ static_cast<QQmlPartsModel *>(d->m_pendingParts.first())->updateFilterGroup();
QVector<Compositor::Insert> inserts;
d->m_count = d->m_adaptorModel.count();
@@ -295,15 +294,15 @@ void QQuickVisualDataModel::componentComplete()
\sa {qml-data-models}{Data Models}
*/
-QVariant QQuickVisualDataModel::model() const
+QVariant QQmlDelegateModel::model() const
{
- Q_D(const QQuickVisualDataModel);
+ Q_D(const QQmlDelegateModel);
return d->m_adaptorModel.model();
}
-void QQuickVisualDataModel::setModel(const QVariant &model)
+void QQmlDelegateModel::setModel(const QVariant &model)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (d->m_complete)
_q_itemsRemoved(0, d->m_count);
@@ -329,15 +328,15 @@ 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 {qml-data-models}{Data Model}.
*/
-QQmlComponent *QQuickVisualDataModel::delegate() const
+QQmlComponent *QQmlDelegateModel::delegate() const
{
- Q_D(const QQuickVisualDataModel);
+ Q_D(const QQmlDelegateModel);
return d->m_delegate;
}
-void QQuickVisualDataModel::setDelegate(QQmlComponent *delegate)
+void QQmlDelegateModel::setDelegate(QQmlComponent *delegate)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (d->m_transaction) {
qmlInfo(this) << tr("The delegate of a VisualDataModel cannot be changed within onUpdated.");
return;
@@ -347,13 +346,13 @@ void QQuickVisualDataModel::setDelegate(QQmlComponent *delegate)
d->m_delegateValidated = false;
if (wasValid && d->m_complete) {
for (int i = 1; i < d->m_groupCount; ++i) {
- QQuickVisualDataGroupPrivate::get(d->m_groups[i])->changeSet.remove(
+ QQmlDataGroupPrivate::get(d->m_groups[i])->changeSet.remove(
0, d->m_compositor.count(Compositor::Group(i)));
}
}
if (d->m_complete && d->m_delegate) {
for (int i = 1; i < d->m_groupCount; ++i) {
- QQuickVisualDataGroupPrivate::get(d->m_groups[i])->changeSet.insert(
+ QQmlDataGroupPrivate::get(d->m_groups[i])->changeSet.insert(
0, d->m_compositor.count(Compositor::Group(i)));
}
}
@@ -389,15 +388,15 @@ void QQuickVisualDataModel::setDelegate(QQmlComponent *delegate)
\sa modelIndex(), parentModelIndex()
*/
-QVariant QQuickVisualDataModel::rootIndex() const
+QVariant QQmlDelegateModel::rootIndex() const
{
- Q_D(const QQuickVisualDataModel);
+ Q_D(const QQmlDelegateModel);
return QVariant::fromValue(QModelIndex(d->m_adaptorModel.rootIndex));
}
-void QQuickVisualDataModel::setRootIndex(const QVariant &root)
+void QQmlDelegateModel::setRootIndex(const QVariant &root)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
QModelIndex modelIndex = qvariant_cast<QModelIndex>(root);
const bool changed = d->m_adaptorModel.rootIndex != modelIndex;
@@ -432,9 +431,9 @@ void QQuickVisualDataModel::setRootIndex(const QVariant &root)
\sa rootIndex
*/
-QVariant QQuickVisualDataModel::modelIndex(int idx) const
+QVariant QQmlDelegateModel::modelIndex(int idx) const
{
- Q_D(const QQuickVisualDataModel);
+ Q_D(const QQmlDelegateModel);
return d->m_adaptorModel.modelIndex(idx);
}
@@ -450,9 +449,9 @@ QVariant QQuickVisualDataModel::modelIndex(int idx) const
\sa rootIndex
*/
-QVariant QQuickVisualDataModel::parentModelIndex() const
+QVariant QQmlDelegateModel::parentModelIndex() const
{
- Q_D(const QQuickVisualDataModel);
+ Q_D(const QQmlDelegateModel);
return d->m_adaptorModel.parentModelIndex();
}
@@ -460,33 +459,32 @@ QVariant QQuickVisualDataModel::parentModelIndex() const
\qmlproperty int QtQuick2::VisualDataModel::count
*/
-int QQuickVisualDataModel::count() const
+int QQmlDelegateModel::count() const
{
- Q_D(const QQuickVisualDataModel);
+ Q_D(const QQmlDelegateModel);
if (!d->m_delegate)
return 0;
return d->m_compositor.count(d->m_compositorGroup);
}
-QQuickVisualDataModel::ReleaseFlags QQuickVisualDataModelPrivate::release(QObject *object)
+QQmlDelegateModel::ReleaseFlags QQmlDelegateModelPrivate::release(QObject *object)
{
- QQuickVisualDataModel::ReleaseFlags stat = 0;
+ QQmlDelegateModel::ReleaseFlags stat = 0;
if (!object)
return stat;
- if (QQuickVisualDataModelItem *cacheItem = QQuickVisualDataModelItem::dataForObject(object)) {
+ if (QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(object)) {
if (cacheItem->releaseObject()) {
cacheItem->destroyObject();
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(object))
- emitDestroyingItem(item);
+ emitDestroyingItem(object);
if (cacheItem->incubationTask) {
releaseIncubator(cacheItem->incubationTask);
cacheItem->incubationTask = 0;
}
cacheItem->Dispose();
- stat |= QQuickVisualModel::Destroyed;
+ stat |= QQmlInstanceModel::Destroyed;
} else {
- stat |= QQuickVisualDataModel::Referenced;
+ stat |= QQmlDelegateModel::Referenced;
}
}
return stat;
@@ -496,26 +494,24 @@ QQuickVisualDataModel::ReleaseFlags QQuickVisualDataModelPrivate::release(QObjec
Returns ReleaseStatus flags.
*/
-QQuickVisualDataModel::ReleaseFlags QQuickVisualDataModel::release(QQuickItem *item)
+QQmlDelegateModel::ReleaseFlags QQmlDelegateModel::release(QObject *item)
{
- Q_D(QQuickVisualDataModel);
- QQuickVisualModel::ReleaseFlags stat = d->release(item);
- if (stat & Destroyed)
- item->setParentItem(0);
+ Q_D(QQmlDelegateModel);
+ QQmlInstanceModel::ReleaseFlags stat = d->release(item);
return stat;
}
// Cancel a requested async item
-void QQuickVisualDataModel::cancel(int index)
+void QQmlDelegateModel::cancel(int index)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (!d->m_delegate || index < 0 || index >= d->m_compositor.count(d->m_compositorGroup)) {
qWarning() << "VisualDataModel::cancel: index out range" << index << d->m_compositor.count(d->m_compositorGroup);
return;
}
Compositor::iterator it = d->m_compositor.find(d->m_compositorGroup, index);
- QQuickVisualDataModelItem *cacheItem = it->inCache() ? d->m_cache.at(it.cacheIndex) : 0;
+ QQmlDelegateModelItem *cacheItem = it->inCache() ? d->m_cache.at(it.cacheIndex) : 0;
if (cacheItem) {
if (cacheItem->incubationTask && !cacheItem->isObjectReferenced()) {
d->releaseIncubator(cacheItem->incubationTask);
@@ -524,10 +520,10 @@ void QQuickVisualDataModel::cancel(int index)
if (cacheItem->object) {
QObject *object = cacheItem->object;
cacheItem->destroyObject();
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(object))
- d->emitDestroyingItem(item);
- else if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object))
+ if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object))
d->emitDestroyingPackage(package);
+ else
+ d->emitDestroyingItem(object);
}
cacheItem->scriptRef -= 1;
@@ -541,31 +537,31 @@ void QQuickVisualDataModel::cancel(int index)
}
}
-void QQuickVisualDataModelPrivate::group_append(
- QQmlListProperty<QQuickVisualDataGroup> *property, QQuickVisualDataGroup *group)
+void QQmlDelegateModelPrivate::group_append(
+ QQmlListProperty<QQmlDataGroup> *property, QQmlDataGroup *group)
{
- QQuickVisualDataModelPrivate *d = static_cast<QQuickVisualDataModelPrivate *>(property->data);
+ QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data);
if (d->m_complete)
return;
if (d->m_groupCount == Compositor::MaximumGroupCount) {
- qmlInfo(d->q_func()) << QQuickVisualDataModel::tr("The maximum number of supported VisualDataGroups is 8");
+ qmlInfo(d->q_func()) << QQmlDelegateModel::tr("The maximum number of supported VisualDataGroups is 8");
return;
}
d->m_groups[d->m_groupCount] = group;
d->m_groupCount += 1;
}
-int QQuickVisualDataModelPrivate::group_count(
- QQmlListProperty<QQuickVisualDataGroup> *property)
+int QQmlDelegateModelPrivate::group_count(
+ QQmlListProperty<QQmlDataGroup> *property)
{
- QQuickVisualDataModelPrivate *d = static_cast<QQuickVisualDataModelPrivate *>(property->data);
+ QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data);
return d->m_groupCount - 1;
}
-QQuickVisualDataGroup *QQuickVisualDataModelPrivate::group_at(
- QQmlListProperty<QQuickVisualDataGroup> *property, int index)
+QQmlDataGroup *QQmlDelegateModelPrivate::group_at(
+ QQmlListProperty<QQmlDataGroup> *property, int index)
{
- QQuickVisualDataModelPrivate *d = static_cast<QQuickVisualDataModelPrivate *>(property->data);
+ QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data);
return index >= 0 && index < d->m_groupCount - 1
? d->m_groups[index + 1]
: 0;
@@ -589,15 +585,15 @@ QQuickVisualDataGroup *QQuickVisualDataModelPrivate::group_at(
\snippet qml/visualdatagroup.qml 0
*/
-QQmlListProperty<QQuickVisualDataGroup> QQuickVisualDataModel::groups()
+QQmlListProperty<QQmlDataGroup> QQmlDelegateModel::groups()
{
- Q_D(QQuickVisualDataModel);
- return QQmlListProperty<QQuickVisualDataGroup>(
+ Q_D(QQmlDelegateModel);
+ return QQmlListProperty<QQmlDataGroup>(
this,
d,
- QQuickVisualDataModelPrivate::group_append,
- QQuickVisualDataModelPrivate::group_count,
- QQuickVisualDataModelPrivate::group_at,
+ QQmlDelegateModelPrivate::group_append,
+ QQmlDelegateModelPrivate::group_count,
+ QQmlDelegateModelPrivate::group_at,
0);
}
@@ -607,9 +603,9 @@ QQmlListProperty<QQuickVisualDataGroup> QQuickVisualDataModel::groups()
This property holds visual data model's default group to which all new items are added.
*/
-QQuickVisualDataGroup *QQuickVisualDataModel::items()
+QQmlDataGroup *QQmlDelegateModel::items()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
return d->m_items;
}
@@ -630,9 +626,9 @@ QQuickVisualDataGroup *QQuickVisualDataModel::items()
to this group.
*/
-QQuickVisualDataGroup *QQuickVisualDataModel::persistedItems()
+QQmlDataGroup *QQmlDelegateModel::persistedItems()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
return d->m_persistedItems;
}
@@ -646,15 +642,15 @@ QQuickVisualDataGroup *QQuickVisualDataModel::persistedItems()
By default this is the \l items group.
*/
-QString QQuickVisualDataModel::filterGroup() const
+QString QQmlDelegateModel::filterGroup() const
{
- Q_D(const QQuickVisualDataModel);
+ Q_D(const QQmlDelegateModel);
return d->m_filterGroup;
}
-void QQuickVisualDataModel::setFilterGroup(const QString &group)
+void QQmlDelegateModel::setFilterGroup(const QString &group)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (d->m_transaction) {
qmlInfo(this) << tr("The group of a VisualDataModel cannot be changed within onChanged");
@@ -668,18 +664,18 @@ void QQuickVisualDataModel::setFilterGroup(const QString &group)
}
}
-void QQuickVisualDataModel::resetFilterGroup()
+void QQmlDelegateModel::resetFilterGroup()
{
setFilterGroup(QStringLiteral("items"));
}
-void QQuickVisualDataModelPrivate::updateFilterGroup()
+void QQmlDelegateModelPrivate::updateFilterGroup()
{
- Q_Q(QQuickVisualDataModel);
+ Q_Q(QQmlDelegateModel);
if (!m_cacheMetaType)
return;
- QQuickListCompositor::Group previousGroup = m_compositorGroup;
+ QQmlListCompositor::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)) {
@@ -688,13 +684,13 @@ void QQuickVisualDataModelPrivate::updateFilterGroup()
}
}
- QQuickVisualDataGroupPrivate::get(m_groups[m_compositorGroup])->emitters.insert(this);
+ QQmlDataGroupPrivate::get(m_groups[m_compositorGroup])->emitters.insert(this);
if (m_compositorGroup != previousGroup) {
- QVector<QQuickChangeSet::Remove> removes;
- QVector<QQuickChangeSet::Insert> inserts;
+ QVector<QQmlChangeSet::Remove> removes;
+ QVector<QQmlChangeSet::Insert> inserts;
m_compositor.transition(previousGroup, m_compositorGroup, &removes, &inserts);
- QQuickChangeSet changeSet;
+ QQmlChangeSet changeSet;
changeSet.move(removes, inserts);
emit q->modelUpdated(changeSet, false);
@@ -702,7 +698,7 @@ void QQuickVisualDataModelPrivate::updateFilterGroup()
emit q->countChanged();
if (m_parts) {
- foreach (QQuickVisualPartsModel *model, m_parts->models)
+ foreach (QQmlPartsModel *model, m_parts->models)
model->updateFilterGroup(m_compositorGroup, changeSet);
}
}
@@ -736,40 +732,40 @@ void QQuickVisualDataModelPrivate::updateFilterGroup()
\sa Package
*/
-QObject *QQuickVisualDataModel::parts()
+QObject *QQmlDelegateModel::parts()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (!d->m_parts)
- d->m_parts = new QQuickVisualDataModelParts(this);
+ d->m_parts = new QQmlDelegateModelParts(this);
return d->m_parts;
}
-void QQuickVisualDataModelPrivate::emitCreatedPackage(QVDMIncubationTask *incubationTask, QQuickPackage *package)
+void QQmlDelegateModelPrivate::emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package)
{
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->createdPackage(incubationTask->index[i], package);
+ QQmlDataGroupPrivate::get(m_groups[i])->createdPackage(incubationTask->index[i], package);
}
-void QQuickVisualDataModelPrivate::emitInitPackage(QVDMIncubationTask *incubationTask, QQuickPackage *package)
+void QQmlDelegateModelPrivate::emitInitPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package)
{
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->initPackage(incubationTask->index[i], package);
+ QQmlDataGroupPrivate::get(m_groups[i])->initPackage(incubationTask->index[i], package);
}
-void QQuickVisualDataModelPrivate::emitDestroyingPackage(QQuickPackage *package)
+void QQmlDelegateModelPrivate::emitDestroyingPackage(QQuickPackage *package)
{
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->destroyingPackage(package);
+ QQmlDataGroupPrivate::get(m_groups[i])->destroyingPackage(package);
}
-void QVDMIncubationTask::statusChanged(Status status)
+void QQDMIncubationTask::statusChanged(Status status)
{
vdm->incubatorStatusChanged(this, status);
}
-void QQuickVisualDataModelPrivate::releaseIncubator(QVDMIncubationTask *incubationTask)
+void QQmlDelegateModelPrivate::releaseIncubator(QQDMIncubationTask *incubationTask)
{
- Q_Q(QQuickVisualDataModel);
+ Q_Q(QQmlDelegateModel);
if (!incubationTask->isError())
incubationTask->clear();
m_finishedIncubating.append(incubationTask);
@@ -779,7 +775,7 @@ void QQuickVisualDataModelPrivate::releaseIncubator(QVDMIncubationTask *incubati
}
}
-void QQuickVisualDataModelPrivate::removeCacheItem(QQuickVisualDataModelItem *cacheItem)
+void QQmlDelegateModelPrivate::removeCacheItem(QQmlDelegateModelItem *cacheItem)
{
int cidx = m_cache.indexOf(cacheItem);
if (cidx >= 0) {
@@ -789,31 +785,31 @@ void QQuickVisualDataModelPrivate::removeCacheItem(QQuickVisualDataModelItem *ca
Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache));
}
-void QQuickVisualDataModelPrivate::incubatorStatusChanged(QVDMIncubationTask *incubationTask, QQmlIncubator::Status status)
+void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status)
{
- Q_Q(QQuickVisualDataModel);
+ Q_Q(QQmlDelegateModel);
if (status != QQmlIncubator::Ready && status != QQmlIncubator::Error)
return;
- QQuickVisualDataModelItem *cacheItem = incubationTask->incubating;
+ QQmlDelegateModelItem *cacheItem = incubationTask->incubating;
cacheItem->incubationTask = 0;
incubationTask->incubating = 0;
releaseIncubator(incubationTask);
if (status == QQmlIncubator::Ready) {
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(cacheItem->object))
- emitCreatedItem(incubationTask, item);
- else if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object))
+ if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object))
emitCreatedPackage(incubationTask, package);
+ else
+ emitCreatedItem(incubationTask, cacheItem->object);
} else if (status == QQmlIncubator::Error) {
qmlInfo(q, m_delegate->errors()) << "Error creating delegate";
}
if (!cacheItem->isObjectReferenced()) {
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(cacheItem->object))
- emitDestroyingItem(item);
- else if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object))
+ if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object))
emitDestroyingPackage(package);
+ else
+ emitDestroyingItem(cacheItem->object);
delete cacheItem->object;
cacheItem->object = 0;
cacheItem->scriptRef -= 1;
@@ -826,25 +822,25 @@ void QQuickVisualDataModelPrivate::incubatorStatusChanged(QVDMIncubationTask *in
}
}
-void QVDMIncubationTask::setInitialState(QObject *o)
+void QQDMIncubationTask::setInitialState(QObject *o)
{
vdm->setInitialState(this, o);
}
-void QQuickVisualDataModelPrivate::setInitialState(QVDMIncubationTask *incubationTask, QObject *o)
+void QQmlDelegateModelPrivate::setInitialState(QQDMIncubationTask *incubationTask, QObject *o)
{
- QQuickVisualDataModelItem *cacheItem = incubationTask->incubating;
+ QQmlDelegateModelItem *cacheItem = incubationTask->incubating;
cacheItem->object = o;
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(cacheItem->object))
- emitInitItem(incubationTask, item);
- else if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object))
+ if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object))
emitInitPackage(incubationTask, package);
+ else
+ emitInitItem(incubationTask, cacheItem->object);
}
-QObject *QQuickVisualDataModelPrivate::object(Compositor::Group group, int index, bool asynchronous)
+QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, bool asynchronous)
{
- Q_Q(QQuickVisualDataModel);
+ Q_Q(QQmlDelegateModel);
if (!m_delegate || index < 0 || index >= m_compositor.count(group)) {
qWarning() << "VisualDataModel::item: index out range" << index << m_compositor.count(group);
return 0;
@@ -854,7 +850,7 @@ QObject *QQuickVisualDataModelPrivate::object(Compositor::Group group, int index
Compositor::iterator it = m_compositor.find(group, index);
- QQuickVisualDataModelItem *cacheItem = it->inCache() ? m_cache.at(it.cacheIndex) : 0;
+ QQmlDelegateModelItem *cacheItem = it->inCache() ? m_cache.at(it.cacheIndex) : 0;
if (!cacheItem) {
cacheItem = m_adaptorModel.createItem(m_cacheMetaType, m_context->engine(), it.modelIndex());
@@ -883,7 +879,7 @@ QObject *QQuickVisualDataModelPrivate::object(Compositor::Group group, int index
cacheItem->scriptRef += 1;
- cacheItem->incubationTask = new QVDMIncubationTask(this, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
+ cacheItem->incubationTask = new QQDMIncubationTask(this, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
cacheItem->incubationTask->incubating = cacheItem;
cacheItem->incubationTask->clear();
@@ -896,8 +892,8 @@ QObject *QQuickVisualDataModelPrivate::object(Compositor::Group group, int index
cacheItem->contextData = ctxt;
if (m_adaptorModel.hasProxyObject()) {
- if (QQuickVisualAdaptorModelProxyInterface *proxy
- = qobject_cast<QQuickVisualAdaptorModelProxyInterface *>(cacheItem)) {
+ if (QQmlAdaptorModelProxyInterface *proxy
+ = qobject_cast<QQmlAdaptorModelProxyInterface *>(cacheItem)) {
ctxt = new QQmlContextData;
ctxt->setParent(cacheItem->contextData, true);
ctxt->contextObject = proxy->proxiedObject();
@@ -936,9 +932,9 @@ QObject *QQuickVisualDataModelPrivate::object(Compositor::Group group, int index
to ensure a reference is held. Any call to item() which returns a valid item
must be matched by a call to release() in order to destroy the item.
*/
-QQuickItem *QQuickVisualDataModel::item(int index, bool asynchronous)
+QObject *QQmlDelegateModel::object(int index, bool asynchronous)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (!d->m_delegate || index < 0 || index >= d->m_compositor.count(d->m_compositorGroup)) {
qWarning() << "VisualDataModel::item: index out range" << index << d->m_compositor.count(d->m_compositorGroup);
return 0;
@@ -948,22 +944,13 @@ QQuickItem *QQuickVisualDataModel::item(int index, bool asynchronous)
if (!object)
return 0;
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(object))
- return item;
-
- d->release(object);
- if (!d->m_delegateValidated) {
- if (object)
- qmlInfo(d->m_delegate) << QQuickVisualDataModel::tr("Delegate component must be Item type.");
- d->m_delegateValidated = true;
- }
- return 0;
+ return object;
}
-QString QQuickVisualDataModelPrivate::stringValue(Compositor::Group group, int index, const QString &name)
+QString QQmlDelegateModelPrivate::stringValue(Compositor::Group group, int index, const QString &name)
{
Compositor::iterator it = m_compositor.find(group, index);
- if (QQuickVisualAdaptorModel *model = it.list<QQuickVisualAdaptorModel>()) {
+ if (QQmlAdaptorModel *model = it.list<QQmlAdaptorModel>()) {
QString role = name;
int dot = name.indexOf(QLatin1Char('.'));
if (dot > 0)
@@ -982,28 +969,28 @@ QString QQuickVisualDataModelPrivate::stringValue(Compositor::Group group, int i
return QString();
}
-QString QQuickVisualDataModel::stringValue(int index, const QString &name)
+QString QQmlDelegateModel::stringValue(int index, const QString &name)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
return d->stringValue(d->m_compositorGroup, index, name);
}
-int QQuickVisualDataModel::indexOf(QQuickItem *item, QObject *) const
+int QQmlDelegateModel::indexOf(QObject *item, QObject *) const
{
- Q_D(const QQuickVisualDataModel);
- if (QQuickVisualDataModelItem *cacheItem = QQuickVisualDataModelItem::dataForObject(item))
+ Q_D(const QQmlDelegateModel);
+ if (QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(item))
return cacheItem->groupIndex(d->m_compositorGroup);
return -1;
}
-void QQuickVisualDataModel::setWatchedRoles(QList<QByteArray> roles)
+void QQmlDelegateModel::setWatchedRoles(QList<QByteArray> roles)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
d->m_adaptorModel.replaceWatchedRoles(d->m_watchedRoles, roles);
d->m_watchedRoles = roles;
}
-void QQuickVisualDataModelPrivate::addGroups(
+void QQmlDelegateModelPrivate::addGroups(
Compositor::iterator from, int count, Compositor::Group group, int groupFlags)
{
QVector<Compositor::Insert> inserts;
@@ -1012,7 +999,7 @@ void QQuickVisualDataModelPrivate::addGroups(
emitChanges();
}
-void QQuickVisualDataModelPrivate::removeGroups(
+void QQmlDelegateModelPrivate::removeGroups(
Compositor::iterator from, int count, Compositor::Group group, int groupFlags)
{
QVector<Compositor::Remove> removes;
@@ -1021,7 +1008,7 @@ void QQuickVisualDataModelPrivate::removeGroups(
emitChanges();
}
-void QQuickVisualDataModelPrivate::setGroups(
+void QQmlDelegateModelPrivate::setGroups(
Compositor::iterator from, int count, Compositor::Group group, int groupFlags)
{
QVector<Compositor::Remove> removes;
@@ -1037,9 +1024,9 @@ void QQuickVisualDataModelPrivate::setGroups(
emitChanges();
}
-bool QQuickVisualDataModel::event(QEvent *e)
+bool QQmlDelegateModel::event(QEvent *e)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (e->type() == QEvent::UpdateRequest) {
d->m_adaptorModel.fetchMore();
} else if (e->type() == QEvent::User) {
@@ -1047,31 +1034,31 @@ bool QQuickVisualDataModel::event(QEvent *e)
qDeleteAll(d->m_finishedIncubating);
d->m_finishedIncubating.clear();
}
- return QQuickVisualModel::event(e);
+ return QQmlInstanceModel::event(e);
}
-void QQuickVisualDataModelPrivate::itemsChanged(const QVector<Compositor::Change> &changes)
+void QQmlDelegateModelPrivate::itemsChanged(const QVector<Compositor::Change> &changes)
{
if (!m_delegate)
return;
- QVarLengthArray<QVector<QQuickChangeSet::Change>, Compositor::MaximumGroupCount> translatedChanges(m_groupCount);
+ QVarLengthArray<QVector<QQmlChangeSet::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(QQuickChangeSet::Change(change.index[i], change.count));
+ translatedChanges[i].append(QQmlChangeSet::Change(change.index[i], change.count));
}
}
}
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->changeSet.change(translatedChanges.at(i));
+ QQmlDataGroupPrivate::get(m_groups[i])->changeSet.change(translatedChanges.at(i));
}
-void QQuickVisualDataModel::_q_itemsChanged(int index, int count, const QVector<int> &roles)
+void QQmlDelegateModel::_q_itemsChanged(int index, int count, const QVector<int> &roles)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (count <= 0 || !d->m_complete)
return;
@@ -1083,22 +1070,22 @@ void QQuickVisualDataModel::_q_itemsChanged(int index, int count, const QVector<
}
}
-static void incrementIndexes(QQuickVisualDataModelItem *cacheItem, int count, const int *deltas)
+static void incrementIndexes(QQmlDelegateModelItem *cacheItem, int count, const int *deltas)
{
- if (QVDMIncubationTask *incubationTask = cacheItem->incubationTask) {
+ if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask) {
for (int i = 1; i < count; ++i)
incubationTask->index[i] += deltas[i];
}
- if (QQuickVisualDataModelAttached *attached = cacheItem->attached) {
+ if (QQmlDelegateModelAttached *attached = cacheItem->attached) {
for (int i = 1; i < count; ++i)
attached->m_currentIndex[i] += deltas[i];
}
}
-void QQuickVisualDataModelPrivate::itemsInserted(
+void QQmlDelegateModelPrivate::itemsInserted(
const QVector<Compositor::Insert> &inserts,
- QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts,
- QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems)
+ QVarLengthArray<QVector<QQmlChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts,
+ QHash<int, QList<QQmlDelegateModelItem *> > *movedItems)
{
int cacheIndex = 0;
@@ -1113,7 +1100,7 @@ void QQuickVisualDataModelPrivate::itemsInserted(
for (int i = 1; i < m_groupCount; ++i) {
if (insert.inGroup(i)) {
(*translatedInserts)[i].append(
- QQuickChangeSet::Insert(insert.index[i], insert.count, insert.moveId));
+ QQmlChangeSet::Insert(insert.index[i], insert.count, insert.moveId));
inserted[i] += insert.count;
}
}
@@ -1122,22 +1109,22 @@ void QQuickVisualDataModelPrivate::itemsInserted(
continue;
if (movedItems && insert.isMove()) {
- QList<QQuickVisualDataModelItem *> items = movedItems->take(insert.moveId);
+ QList<QQmlDelegateModelItem *> items = movedItems->take(insert.moveId);
Q_ASSERT(items.count() == insert.count);
m_cache = m_cache.mid(0, insert.cacheIndex) + items + m_cache.mid(insert.cacheIndex);
}
if (insert.inGroup()) {
for (int offset = 0; cacheIndex < insert.cacheIndex + insert.count; ++cacheIndex, ++offset) {
- QQuickVisualDataModelItem *cacheItem = m_cache.at(cacheIndex);
+ QQmlDelegateModelItem *cacheItem = m_cache.at(cacheIndex);
cacheItem->groups |= insert.flags & Compositor::GroupMask;
- if (QVDMIncubationTask *incubationTask = cacheItem->incubationTask) {
+ if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask) {
for (int i = 1; i < m_groupCount; ++i)
incubationTask->index[i] = cacheItem->groups & (1 << i)
? insert.index[i] + offset
: insert.index[i];
}
- if (QQuickVisualDataModelAttached *attached = cacheItem->attached) {
+ if (QQmlDelegateModelAttached *attached = cacheItem->attached) {
for (int i = 1; i < m_groupCount; ++i)
attached->m_currentIndex[i] = cacheItem->groups & (1 << i)
? insert.index[i] + offset
@@ -1152,29 +1139,29 @@ void QQuickVisualDataModelPrivate::itemsInserted(
incrementIndexes(m_cache.at(cacheIndex), m_groupCount, inserted);
}
-void QQuickVisualDataModelPrivate::itemsInserted(const QVector<Compositor::Insert> &inserts)
+void QQmlDelegateModelPrivate::itemsInserted(const QVector<Compositor::Insert> &inserts)
{
- QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount);
+ QVarLengthArray<QVector<QQmlChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount);
itemsInserted(inserts, &translatedInserts);
Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache));
if (!m_delegate)
return;
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->changeSet.insert(translatedInserts.at(i));
+ QQmlDataGroupPrivate::get(m_groups[i])->changeSet.insert(translatedInserts.at(i));
}
-void QQuickVisualDataModel::_q_itemsInserted(int index, int count)
+void QQmlDelegateModel::_q_itemsInserted(int index, int count)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (count <= 0 || !d->m_complete)
return;
d->m_count += count;
for (int i = 0, c = d->m_cache.count(); i < c; ++i) {
- QQuickVisualDataModelItem *item = d->m_cache.at(i);
+ QQmlDelegateModelItem *item = d->m_cache.at(i);
if (item->modelIndex() >= index)
item->setModelIndex(item->modelIndex() + count);
}
@@ -1185,10 +1172,10 @@ void QQuickVisualDataModel::_q_itemsInserted(int index, int count)
d->emitChanges();
}
-void QQuickVisualDataModelPrivate::itemsRemoved(
+void QQmlDelegateModelPrivate::itemsRemoved(
const QVector<Compositor::Remove> &removes,
- QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves,
- QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems)
+ QVarLengthArray<QVector<QQmlChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves,
+ QHash<int, QList<QQmlDelegateModelItem *> > *movedItems)
{
int cacheIndex = 0;
int removedCache = 0;
@@ -1204,7 +1191,7 @@ void QQuickVisualDataModelPrivate::itemsRemoved(
for (int i = 1; i < m_groupCount; ++i) {
if (remove.inGroup(i)) {
(*translatedRemoves)[i].append(
- QQuickChangeSet::Remove(remove.index[i], remove.count, remove.moveId));
+ QQmlChangeSet::Remove(remove.index[i], remove.count, remove.moveId));
removed[i] -= remove.count;
}
}
@@ -1214,19 +1201,19 @@ void QQuickVisualDataModelPrivate::itemsRemoved(
if (movedItems && remove.isMove()) {
movedItems->insert(remove.moveId, m_cache.mid(remove.cacheIndex, remove.count));
- QList<QQuickVisualDataModelItem *>::iterator begin = m_cache.begin() + remove.cacheIndex;
- QList<QQuickVisualDataModelItem *>::iterator end = begin + remove.count;
+ QList<QQmlDelegateModelItem *>::iterator begin = m_cache.begin() + remove.cacheIndex;
+ QList<QQmlDelegateModelItem *>::iterator end = begin + remove.count;
m_cache.erase(begin, end);
} else {
for (; cacheIndex < remove.cacheIndex + remove.count - removedCache; ++cacheIndex) {
- QQuickVisualDataModelItem *cacheItem = m_cache.at(cacheIndex);
+ QQmlDelegateModelItem *cacheItem = m_cache.at(cacheIndex);
if (remove.inGroup(Compositor::Persisted) && cacheItem->objectRef == 0 && cacheItem->object) {
QObject *object = cacheItem->object;
cacheItem->destroyObject();
if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object))
emitDestroyingPackage(package);
- else if (QQuickItem *item = qmlobject_cast<QQuickItem *>(object))
- emitDestroyingItem(item);
+ else
+ emitDestroyingItem(object);
cacheItem->scriptRef -= 1;
}
if (!cacheItem->isReferenced()) {
@@ -1238,22 +1225,22 @@ void QQuickVisualDataModelPrivate::itemsRemoved(
Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache));
} else if (remove.groups() == cacheItem->groups) {
cacheItem->groups = 0;
- if (QVDMIncubationTask *incubationTask = cacheItem->incubationTask) {
+ if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask) {
for (int i = 1; i < m_groupCount; ++i)
incubationTask->index[i] = -1;
}
- if (QQuickVisualDataModelAttached *attached = cacheItem->attached) {
+ if (QQmlDelegateModelAttached *attached = cacheItem->attached) {
for (int i = 1; i < m_groupCount; ++i)
attached->m_currentIndex[i] = -1;
}
} else {
- if (QVDMIncubationTask *incubationTask = cacheItem->incubationTask) {
+ if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask) {
for (int i = 1; i < m_groupCount; ++i) {
if (remove.inGroup(i))
incubationTask->index[i] = remove.index[i];
}
}
- if (QQuickVisualDataModelAttached *attached = cacheItem->attached) {
+ if (QQmlDelegateModelAttached *attached = cacheItem->attached) {
for (int i = 1; i < m_groupCount; ++i) {
if (remove.inGroup(i))
attached->m_currentIndex[i] = remove.index[i];
@@ -1269,28 +1256,28 @@ void QQuickVisualDataModelPrivate::itemsRemoved(
incrementIndexes(m_cache.at(cacheIndex), m_groupCount, removed);
}
-void QQuickVisualDataModelPrivate::itemsRemoved(const QVector<Compositor::Remove> &removes)
+void QQmlDelegateModelPrivate::itemsRemoved(const QVector<Compositor::Remove> &removes)
{
- QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount);
+ QVarLengthArray<QVector<QQmlChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount);
itemsRemoved(removes, &translatedRemoves);
Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache));
if (!m_delegate)
return;
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->changeSet.remove(translatedRemoves.at(i));
+ QQmlDataGroupPrivate::get(m_groups[i])->changeSet.remove(translatedRemoves.at(i));
}
-void QQuickVisualDataModel::_q_itemsRemoved(int index, int count)
+void QQmlDelegateModel::_q_itemsRemoved(int index, int count)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (count <= 0|| !d->m_complete)
return;
d->m_count -= count;
for (int i = 0, c = d->m_cache.count(); i < c; ++i) {
- QQuickVisualDataModelItem *item = d->m_cache.at(i);
+ QQmlDelegateModelItem *item = d->m_cache.at(i);
if (item->modelIndex() >= index + count)
item->setModelIndex(item->modelIndex() - count);
else if (item->modelIndex() >= index)
@@ -1304,15 +1291,15 @@ void QQuickVisualDataModel::_q_itemsRemoved(int index, int count)
d->emitChanges();
}
-void QQuickVisualDataModelPrivate::itemsMoved(
+void QQmlDelegateModelPrivate::itemsMoved(
const QVector<Compositor::Remove> &removes, const QVector<Compositor::Insert> &inserts)
{
- QHash<int, QList<QQuickVisualDataModelItem *> > movedItems;
+ QHash<int, QList<QQmlDelegateModelItem *> > movedItems;
- QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount);
+ QVarLengthArray<QVector<QQmlChangeSet::Remove>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount);
itemsRemoved(removes, &translatedRemoves, &movedItems);
- QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount);
+ QVarLengthArray<QVector<QQmlChangeSet::Insert>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount);
itemsInserted(inserts, &translatedInserts, &movedItems);
Q_ASSERT(m_cache.count() == m_compositor.count(Compositor::Cache));
Q_ASSERT(movedItems.isEmpty());
@@ -1320,15 +1307,15 @@ void QQuickVisualDataModelPrivate::itemsMoved(
return;
for (int i = 1; i < m_groupCount; ++i) {
- QQuickVisualDataGroupPrivate::get(m_groups[i])->changeSet.move(
+ QQmlDataGroupPrivate::get(m_groups[i])->changeSet.move(
translatedRemoves.at(i),
translatedInserts.at(i));
}
}
-void QQuickVisualDataModel::_q_itemsMoved(int from, int to, int count)
+void QQmlDelegateModel::_q_itemsMoved(int from, int to, int count)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (count <= 0 || !d->m_complete)
return;
@@ -1337,7 +1324,7 @@ void QQuickVisualDataModel::_q_itemsMoved(int from, int to, int count)
const int difference = from > to ? count : -count;
for (int i = 0, c = d->m_cache.count(); i < c; ++i) {
- QQuickVisualDataModelItem *item = d->m_cache.at(i);
+ QQmlDelegateModelItem *item = d->m_cache.at(i);
if (item->modelIndex() >= from && item->modelIndex() < from + count)
item->setModelIndex(item->modelIndex() - from + to);
else if (item->modelIndex() >= minimum && item->modelIndex() < maximum)
@@ -1352,7 +1339,7 @@ void QQuickVisualDataModel::_q_itemsMoved(int from, int to, int count)
}
template <typename T> v8::Local<v8::Array>
-QQuickVisualDataModelPrivate::buildChangeList(const QVector<T> &changes)
+QQmlDelegateModelPrivate::buildChangeList(const QVector<T> &changes)
{
v8::Local<v8::Array> indexes = v8::Array::New(changes.count());
v8::Local<v8::String> indexKey = v8::String::New("index");
@@ -1369,15 +1356,15 @@ QQuickVisualDataModelPrivate::buildChangeList(const QVector<T> &changes)
return indexes;
}
-void QQuickVisualDataModelPrivate::emitModelUpdated(const QQuickChangeSet &changeSet, bool reset)
+void QQmlDelegateModelPrivate::emitModelUpdated(const QQmlChangeSet &changeSet, bool reset)
{
- Q_Q(QQuickVisualDataModel);
+ Q_Q(QQmlDelegateModel);
emit q->modelUpdated(changeSet, reset);
if (changeSet.difference() != 0)
emit q->countChanged();
}
-void QQuickVisualDataModelPrivate::emitChanges()
+void QQmlDelegateModelPrivate::emitChanges()
{
if (m_transaction || !m_complete || !m_context->isValid())
return;
@@ -1385,23 +1372,23 @@ void QQuickVisualDataModelPrivate::emitChanges()
m_transaction = true;
QV8Engine *engine = QQmlEnginePrivate::getV8Engine(m_context->engine());
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->emitChanges(engine);
+ QQmlDataGroupPrivate::get(m_groups[i])->emitChanges(engine);
m_transaction = false;
const bool reset = m_reset;
m_reset = false;
for (int i = 1; i < m_groupCount; ++i)
- QQuickVisualDataGroupPrivate::get(m_groups[i])->emitModelUpdated(reset);
+ QQmlDataGroupPrivate::get(m_groups[i])->emitModelUpdated(reset);
- foreach (QQuickVisualDataModelItem *cacheItem, m_cache) {
+ foreach (QQmlDelegateModelItem *cacheItem, m_cache) {
if (cacheItem->attached)
cacheItem->attached->emitChanges();
}
}
-void QQuickVisualDataModel::_q_modelReset()
+void QQmlDelegateModel::_q_modelReset()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (!d->m_delegate)
return;
@@ -1412,7 +1399,7 @@ void QQuickVisualDataModel::_q_modelReset()
d->m_count = d->m_adaptorModel.count();
for (int i = 0, c = d->m_cache.count(); i < c; ++i) {
- QQuickVisualDataModelItem *item = d->m_cache.at(i);
+ QQmlDelegateModelItem *item = d->m_cache.at(i);
if (item->modelIndex() != -1)
item->setModelIndex(-1);
}
@@ -1434,16 +1421,16 @@ void QQuickVisualDataModel::_q_modelReset()
emit rootIndexChanged();
}
-void QQuickVisualDataModel::_q_rowsInserted(const QModelIndex &parent, int begin, int end)
+void QQmlDelegateModel::_q_rowsInserted(const QModelIndex &parent, int begin, int end)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (parent == d->m_adaptorModel.rootIndex)
_q_itemsInserted(begin, end - begin + 1);
}
-void QQuickVisualDataModel::_q_rowsAboutToBeRemoved(const QModelIndex &parent, int begin, int end)
+void QQmlDelegateModel::_q_rowsAboutToBeRemoved(const QModelIndex &parent, int begin, int end)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (!d->m_adaptorModel.rootIndex.isValid())
return;
const QModelIndex index = d->m_adaptorModel.rootIndex;
@@ -1461,18 +1448,18 @@ void QQuickVisualDataModel::_q_rowsAboutToBeRemoved(const QModelIndex &parent, i
}
}
-void QQuickVisualDataModel::_q_rowsRemoved(const QModelIndex &parent, int begin, int end)
+void QQmlDelegateModel::_q_rowsRemoved(const QModelIndex &parent, int begin, int end)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (parent == d->m_adaptorModel.rootIndex)
_q_itemsRemoved(begin, end - begin + 1);
}
-void QQuickVisualDataModel::_q_rowsMoved(
+void QQmlDelegateModel::_q_rowsMoved(
const QModelIndex &sourceParent, int sourceStart, int sourceEnd,
const QModelIndex &destinationParent, int destinationRow)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
const int count = sourceEnd - sourceStart + 1;
if (destinationParent == d->m_adaptorModel.rootIndex && sourceParent == d->m_adaptorModel.rootIndex) {
_q_itemsMoved(sourceStart, sourceStart > destinationRow ? destinationRow : destinationRow - count, count);
@@ -1483,37 +1470,37 @@ void QQuickVisualDataModel::_q_rowsMoved(
}
}
-void QQuickVisualDataModel::_q_dataChanged(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles)
+void QQmlDelegateModel::_q_dataChanged(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles)
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
if (begin.parent() == d->m_adaptorModel.rootIndex)
_q_itemsChanged(begin.row(), end.row() - begin.row() + 1, roles);
}
-void QQuickVisualDataModel::_q_layoutChanged()
+void QQmlDelegateModel::_q_layoutChanged()
{
- Q_D(QQuickVisualDataModel);
+ Q_D(QQmlDelegateModel);
_q_itemsChanged(0, d->m_count, QVector<int>());
}
-QQuickVisualDataModelAttached *QQuickVisualDataModel::qmlAttachedProperties(QObject *obj)
+QQmlDelegateModelAttached *QQmlDelegateModel::qmlAttachedProperties(QObject *obj)
{
- if (QQuickVisualDataModelItem *cacheItem = QQuickVisualDataModelItem::dataForObject(obj)) {
+ if (QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(obj)) {
if (cacheItem->object == obj) { // Don't create attached item for child objects.
- cacheItem->attached = new QQuickVisualDataModelAttached(cacheItem, obj);
+ cacheItem->attached = new QQmlDelegateModelAttached(cacheItem, obj);
return cacheItem->attached;
}
}
- return new QQuickVisualDataModelAttached(obj);
+ return new QQmlDelegateModelAttached(obj);
}
-bool QQuickVisualDataModelPrivate::insert(
+bool QQmlDelegateModelPrivate::insert(
Compositor::insert_iterator &before, const v8::Local<v8::Object> &object, int groups)
{
if (!m_context->isValid())
return false;
- QQuickVisualDataModelItem *cacheItem = m_adaptorModel.createItem(m_cacheMetaType, m_context->engine(), -1);
+ QQmlDelegateModelItem *cacheItem = m_adaptorModel.createItem(m_cacheMetaType, m_context->engine(), -1);
if (!cacheItem)
return false;
@@ -1538,8 +1525,8 @@ bool QQuickVisualDataModelPrivate::insert(
//============================================================================
-QQuickVisualDataModelItemMetaType::QQuickVisualDataModelItemMetaType(
- QV8Engine *engine, QQuickVisualDataModel *model, const QStringList &groupNames)
+QQmlDelegateModelItemMetaType::QQmlDelegateModelItemMetaType(
+ QV8Engine *engine, QQmlDelegateModel *model, const QStringList &groupNames)
: model(model)
, groupCount(groupNames.count() + 1)
, v8Engine(engine)
@@ -1548,19 +1535,19 @@ QQuickVisualDataModelItemMetaType::QQuickVisualDataModelItemMetaType(
{
}
-QQuickVisualDataModelItemMetaType::~QQuickVisualDataModelItemMetaType()
+QQmlDelegateModelItemMetaType::~QQmlDelegateModelItemMetaType()
{
if (metaObject)
metaObject->release();
qPersistentDispose(constructor);
}
-void QQuickVisualDataModelItemMetaType::initializeMetaObject()
+void QQmlDelegateModelItemMetaType::initializeMetaObject()
{
QMetaObjectBuilder builder;
builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
- builder.setClassName(QQuickVisualDataModelAttached::staticMetaObject.className());
- builder.setSuperClass(&QQuickVisualDataModelAttached::staticMetaObject);
+ builder.setClassName(QQmlDelegateModelAttached::staticMetaObject.className());
+ builder.setSuperClass(&QQmlDelegateModelAttached::staticMetaObject);
int notifierId = 0;
for (int i = 0; i < groupNames.count(); ++i, ++notifierId) {
@@ -1579,15 +1566,15 @@ void QQuickVisualDataModelItemMetaType::initializeMetaObject()
propertyBuilder.setWritable(true);
}
- metaObject = new QQuickVisualDataModelAttachedMetaObject(this, builder.toMetaObject());
+ metaObject = new QQmlDelegateModelAttachedMetaObject(this, builder.toMetaObject());
}
-void QQuickVisualDataModelItemMetaType::initializeConstructor()
+void QQmlDelegateModelItemMetaType::initializeConstructor()
{
v8::HandleScope handleScope;
v8::Context::Scope contextScope(v8Engine->context());
- QQuickVisualDataModelEngineData *data = engineData(v8Engine);
+ QQmlDelegateModelEngineData *data = engineData(v8Engine);
constructor = qPersistentNew(v8::ObjectTemplate::New());
@@ -1613,7 +1600,7 @@ void QQuickVisualDataModelItemMetaType::initializeConstructor()
}
}
-int QQuickVisualDataModelItemMetaType::parseGroups(const QStringList &groups) const
+int QQmlDelegateModelItemMetaType::parseGroups(const QStringList &groups) const
{
int groupFlags = 0;
foreach (const QString &groupName, groups) {
@@ -1624,7 +1611,7 @@ int QQuickVisualDataModelItemMetaType::parseGroups(const QStringList &groups) co
return groupFlags;
}
-int QQuickVisualDataModelItemMetaType::parseGroups(const v8::Local<v8::Value> &groups) const
+int QQmlDelegateModelItemMetaType::parseGroups(const v8::Local<v8::Value> &groups) const
{
int groupFlags = 0;
if (groups->IsString()) {
@@ -1644,10 +1631,10 @@ int QQuickVisualDataModelItemMetaType::parseGroups(const v8::Local<v8::Value> &g
return groupFlags;
}
-v8::Handle<v8::Value> QQuickVisualDataModelItemMetaType::get_model(
+v8::Handle<v8::Value> QQmlDelegateModelItemMetaType::get_model(
v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *cacheItem = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *cacheItem = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(cacheItem, "Not a valid VisualData object");
if (!cacheItem->metaType->model)
return v8::Undefined();
@@ -1655,10 +1642,10 @@ v8::Handle<v8::Value> QQuickVisualDataModelItemMetaType::get_model(
return cacheItem->get();
}
-v8::Handle<v8::Value> QQuickVisualDataModelItemMetaType::get_groups(
+v8::Handle<v8::Value> QQmlDelegateModelItemMetaType::get_groups(
v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *cacheItem = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *cacheItem = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(cacheItem, "Not a valid VisualData object");
QStringList groups;
@@ -1670,15 +1657,15 @@ v8::Handle<v8::Value> QQuickVisualDataModelItemMetaType::get_groups(
return cacheItem->engine->fromVariant(groups);
}
-void QQuickVisualDataModelItemMetaType::set_groups(
+void QQmlDelegateModelItemMetaType::set_groups(
v8::Local<v8::String>, v8::Local<v8::Value> value, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *cacheItem = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *cacheItem = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE_SETTER(cacheItem, "Not a valid VisualData object");
if (!cacheItem->metaType->model)
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(cacheItem->metaType->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(cacheItem->metaType->model);
const int groupFlags = model->m_cacheMetaType->parseGroups(value);
const int cacheIndex = model->m_cache.indexOf(cacheItem);
@@ -1686,24 +1673,24 @@ void QQuickVisualDataModelItemMetaType::set_groups(
model->setGroups(it, 1, Compositor::Cache, groupFlags);
}
-v8::Handle<v8::Value> QQuickVisualDataModelItemMetaType::get_member(
+v8::Handle<v8::Value> QQmlDelegateModelItemMetaType::get_member(
v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *cacheItem = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *cacheItem = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(cacheItem, "Not a valid VisualData object");
return v8::Boolean::New(cacheItem->groups & (1 << info.Data()->Int32Value()));
}
-void QQuickVisualDataModelItemMetaType::set_member(
+void QQmlDelegateModelItemMetaType::set_member(
v8::Local<v8::String>, v8::Local<v8::Value> value, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *cacheItem = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *cacheItem = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE_SETTER(cacheItem, "Not a valid VisualData object");
if (!cacheItem->metaType->model)
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(cacheItem->metaType->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(cacheItem->metaType->model);
Compositor::Group group = Compositor::Group(info.Data()->Int32Value());
const bool member = value->BooleanValue();
@@ -1719,10 +1706,10 @@ void QQuickVisualDataModelItemMetaType::set_member(
model->removeGroups(it, 1, Compositor::Cache, groupFlag);
}
-v8::Handle<v8::Value> QQuickVisualDataModelItemMetaType::get_index(
+v8::Handle<v8::Value> QQmlDelegateModelItemMetaType::get_index(
v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *cacheItem = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *cacheItem = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(cacheItem, "Not a valid VisualData object");
return v8::Integer::New(cacheItem->groupIndex(Compositor::Group(info.Data()->Int32Value())));
@@ -1731,8 +1718,8 @@ v8::Handle<v8::Value> QQuickVisualDataModelItemMetaType::get_index(
//---------------------------------------------------------------------------
-QQuickVisualDataModelItem::QQuickVisualDataModelItem(
- QQuickVisualDataModelItemMetaType *metaType, int modelIndex)
+QQmlDelegateModelItem::QQmlDelegateModelItem(
+ QQmlDelegateModelItemMetaType *metaType, int modelIndex)
: QV8ObjectResource(metaType->v8Engine)
, metaType(metaType)
, contextData(0)
@@ -1747,27 +1734,27 @@ QQuickVisualDataModelItem::QQuickVisualDataModelItem(
metaType->addref();
}
-QQuickVisualDataModelItem::~QQuickVisualDataModelItem()
+QQmlDelegateModelItem::~QQmlDelegateModelItem()
{
Q_ASSERT(scriptRef == 0);
Q_ASSERT(objectRef == 0);
Q_ASSERT(!object);
if (incubationTask && metaType->model)
- QQuickVisualDataModelPrivate::get(metaType->model)->releaseIncubator(incubationTask);
+ QQmlDelegateModelPrivate::get(metaType->model)->releaseIncubator(incubationTask);
metaType->release();
}
-void QQuickVisualDataModelItem::Dispose()
+void QQmlDelegateModelItem::Dispose()
{
--scriptRef;
if (isReferenced())
return;
if (metaType->model) {
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(metaType->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(metaType->model);
model->removeCacheItem(this);
}
delete this;
@@ -1778,7 +1765,7 @@ void QQuickVisualDataModelItem::Dispose()
arguments instead of QQmlContext which means we don't have to construct the rather weighty
wrapper class for every delegate item.
*/
-void QQuickVisualDataModelItem::incubateObject(
+void QQmlDelegateModelItem::incubateObject(
QQmlComponent *component,
QQmlEngine *engine,
QQmlContextData *context,
@@ -1799,7 +1786,7 @@ void QQuickVisualDataModelItem::incubateObject(
enginePriv->incubate(*incubationTask, forContext);
}
-void QQuickVisualDataModelItem::destroyObject()
+void QQmlDelegateModelItem::destroyObject()
{
Q_ASSERT(object);
Q_ASSERT(contextData);
@@ -1821,14 +1808,14 @@ void QQuickVisualDataModelItem::destroyObject()
object = 0;
}
-QQuickVisualDataModelItem *QQuickVisualDataModelItem::dataForObject(QObject *object)
+QQmlDelegateModelItem *QQmlDelegateModelItem::dataForObject(QObject *object)
{
QObjectPrivate *p = QObjectPrivate::get(object);
QQmlContextData *context = p->declarativeData
? static_cast<QQmlData *>(p->declarativeData)->context
: 0;
for (context = context ? context->parent : 0; context; context = context->parent) {
- if (QQuickVisualDataModelItem *cacheItem = qobject_cast<QQuickVisualDataModelItem *>(
+ if (QQmlDelegateModelItem *cacheItem = qobject_cast<QQmlDelegateModelItem *>(
context->contextObject)) {
return cacheItem;
}
@@ -1836,10 +1823,10 @@ QQuickVisualDataModelItem *QQuickVisualDataModelItem::dataForObject(QObject *obj
return 0;
}
-int QQuickVisualDataModelItem::groupIndex(Compositor::Group group)
+int QQmlDelegateModelItem::groupIndex(Compositor::Group group)
{
- if (QQuickVisualDataModelPrivate * const model = metaType->model
- ? QQuickVisualDataModelPrivate::get(metaType->model)
+ if (QQmlDelegateModelPrivate * const model = metaType->model
+ ? QQmlDelegateModelPrivate::get(metaType->model)
: 0) {
return model->m_compositor.find(Compositor::Cache, model->m_cache.indexOf(this)).index[group];
}
@@ -1848,12 +1835,12 @@ int QQuickVisualDataModelItem::groupIndex(Compositor::Group group)
//---------------------------------------------------------------------------
-QQuickVisualDataModelAttachedMetaObject::QQuickVisualDataModelAttachedMetaObject(
- QQuickVisualDataModelItemMetaType *metaType, QMetaObject *metaObject)
+QQmlDelegateModelAttachedMetaObject::QQmlDelegateModelAttachedMetaObject(
+ QQmlDelegateModelItemMetaType *metaType, QMetaObject *metaObject)
: metaType(metaType)
, metaObject(metaObject)
- , memberPropertyOffset(QQuickVisualDataModelAttached::staticMetaObject.propertyCount())
- , indexPropertyOffset(QQuickVisualDataModelAttached::staticMetaObject.propertyCount() + metaType->groupNames.count())
+ , memberPropertyOffset(QQmlDelegateModelAttached::staticMetaObject.propertyCount())
+ , indexPropertyOffset(QQmlDelegateModelAttached::staticMetaObject.propertyCount() + metaType->groupNames.count())
{
// Don't reference count the meta-type here as that would create a circular reference.
// Instead we rely the fact that the meta-type's reference count can't reach 0 without first
@@ -1861,19 +1848,19 @@ QQuickVisualDataModelAttachedMetaObject::QQuickVisualDataModelAttachedMetaObject
*static_cast<QMetaObject *>(this) = *metaObject;
}
-QQuickVisualDataModelAttachedMetaObject::~QQuickVisualDataModelAttachedMetaObject()
+QQmlDelegateModelAttachedMetaObject::~QQmlDelegateModelAttachedMetaObject()
{
::free(metaObject);
}
-void QQuickVisualDataModelAttachedMetaObject::objectDestroyed(QObject *)
+void QQmlDelegateModelAttachedMetaObject::objectDestroyed(QObject *)
{
release();
}
-int QQuickVisualDataModelAttachedMetaObject::metaCall(QObject *object, QMetaObject::Call call, int _id, void **arguments)
+int QQmlDelegateModelAttachedMetaObject::metaCall(QObject *object, QMetaObject::Call call, int _id, void **arguments)
{
- QQuickVisualDataModelAttached *attached = static_cast<QQuickVisualDataModelAttached *>(object);
+ QQmlDelegateModelAttached *attached = static_cast<QQmlDelegateModelAttached *>(object);
if (call == QMetaObject::ReadProperty) {
if (_id >= indexPropertyOffset) {
Compositor::Group group = Compositor::Group(_id - indexPropertyOffset + 1);
@@ -1888,7 +1875,7 @@ int QQuickVisualDataModelAttachedMetaObject::metaCall(QObject *object, QMetaObje
if (_id >= memberPropertyOffset) {
if (!metaType->model)
return -1;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(metaType->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(metaType->model);
Compositor::Group group = Compositor::Group(_id - memberPropertyOffset + 1);
const int groupFlag = 1 << group;
const bool member = attached->m_cacheItem->groups & groupFlag;
@@ -1912,24 +1899,24 @@ int QQuickVisualDataModelAttachedMetaObject::metaCall(QObject *object, QMetaObje
return attached->qt_metacall(call, _id, arguments);
}
-QQuickVisualDataModelAttached::QQuickVisualDataModelAttached(QObject *parent)
+QQmlDelegateModelAttached::QQmlDelegateModelAttached(QObject *parent)
: m_cacheItem(0)
, m_previousGroups(0)
{
QQml_setParent_noEvent(this, parent);
}
-QQuickVisualDataModelAttached::QQuickVisualDataModelAttached(
- QQuickVisualDataModelItem *cacheItem, QObject *parent)
+QQmlDelegateModelAttached::QQmlDelegateModelAttached(
+ QQmlDelegateModelItem *cacheItem, QObject *parent)
: m_cacheItem(cacheItem)
, m_previousGroups(cacheItem->groups)
{
QQml_setParent_noEvent(this, parent);
- if (QVDMIncubationTask *incubationTask = m_cacheItem->incubationTask) {
+ if (QQDMIncubationTask *incubationTask = m_cacheItem->incubationTask) {
for (int i = 1; i < m_cacheItem->metaType->groupCount; ++i)
m_currentIndex[i] = m_previousIndex[i] = incubationTask->index[i];
} else {
- QQuickVisualDataModelPrivate * const model = QQuickVisualDataModelPrivate::get(m_cacheItem->metaType->model);
+ QQmlDelegateModelPrivate * const model = QQmlDelegateModelPrivate::get(m_cacheItem->metaType->model);
Compositor::iterator it = model->m_compositor.find(
Compositor::Cache, model->m_cache.indexOf(m_cacheItem));
for (int i = 1; i < m_cacheItem->metaType->groupCount; ++i)
@@ -1951,7 +1938,7 @@ QQuickVisualDataModelAttached::QQuickVisualDataModelAttached(
It is attached to each instance of the delegate.
*/
-QQuickVisualDataModel *QQuickVisualDataModelAttached::model() const
+QQmlDelegateModel *QQmlDelegateModelAttached::model() const
{
return m_cacheItem ? m_cacheItem->metaType->model : 0;
}
@@ -1964,7 +1951,7 @@ QQuickVisualDataModel *QQuickVisualDataModelAttached::model() const
It is attached to each instance of the delegate.
*/
-QStringList QQuickVisualDataModelAttached::groups() const
+QStringList QQmlDelegateModelAttached::groups() const
{
QStringList groups;
@@ -1977,12 +1964,12 @@ QStringList QQuickVisualDataModelAttached::groups() const
return groups;
}
-void QQuickVisualDataModelAttached::setGroups(const QStringList &groups)
+void QQmlDelegateModelAttached::setGroups(const QStringList &groups)
{
if (!m_cacheItem)
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(m_cacheItem->metaType->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_cacheItem->metaType->model);
const int groupFlags = model->m_cacheMetaType->parseGroups(groups);
const int cacheIndex = model->m_cache.indexOf(m_cacheItem);
@@ -2002,7 +1989,7 @@ void QQuickVisualDataModelAttached::setGroups(const QStringList &groups)
It is attached to each instance of the delegate.
*/
-bool QQuickVisualDataModelAttached::isUnresolved() const
+bool QQmlDelegateModelAttached::isUnresolved() const
{
if (!m_cacheItem)
return false;
@@ -2048,7 +2035,7 @@ bool QQuickVisualDataModelAttached::isUnresolved() const
It is attached to each instance of the delegate.
*/
-void QQuickVisualDataModelAttached::emitChanges()
+void QQmlDelegateModelAttached::emitChanges()
{
const int groupChanges = m_previousGroups ^ m_cacheItem->groups;
m_previousGroups = m_cacheItem->groups;
@@ -2078,22 +2065,22 @@ void QQuickVisualDataModelAttached::emitChanges()
//============================================================================
-void QQuickVisualDataGroupPrivate::setModel(QQuickVisualDataModel *m, Compositor::Group g)
+void QQmlDataGroupPrivate::setModel(QQmlDelegateModel *m, Compositor::Group g)
{
Q_ASSERT(!model);
model = m;
group = g;
}
-bool QQuickVisualDataGroupPrivate::isChangedConnected()
+bool QQmlDataGroupPrivate::isChangedConnected()
{
- Q_Q(QQuickVisualDataGroup);
- IS_SIGNAL_CONNECTED(q, QQuickVisualDataGroup, changed, (const QQmlV8Handle &,const QQmlV8Handle &));
+ Q_Q(QQmlDataGroup);
+ IS_SIGNAL_CONNECTED(q, QQmlDataGroup, changed, (const QQmlV8Handle &,const QQmlV8Handle &));
}
-void QQuickVisualDataGroupPrivate::emitChanges(QV8Engine *engine)
+void QQmlDataGroupPrivate::emitChanges(QV8Engine *engine)
{
- Q_Q(QQuickVisualDataGroup);
+ Q_Q(QQmlDataGroup);
if (isChangedConnected() && !changeSet.isEmpty()) {
v8::HandleScope handleScope;
v8::Context::Scope contextScope(engine->context());
@@ -2105,34 +2092,34 @@ void QQuickVisualDataGroupPrivate::emitChanges(QV8Engine *engine)
emit q->countChanged();
}
-void QQuickVisualDataGroupPrivate::emitModelUpdated(bool reset)
+void QQmlDataGroupPrivate::emitModelUpdated(bool reset)
{
- for (QQuickVisualDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+ for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
it->emitModelUpdated(changeSet, reset);
changeSet.clear();
}
-void QQuickVisualDataGroupPrivate::createdPackage(int index, QQuickPackage *package)
+void QQmlDataGroupPrivate::createdPackage(int index, QQuickPackage *package)
{
- for (QQuickVisualDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+ for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
it->createdPackage(index, package);
}
-void QQuickVisualDataGroupPrivate::initPackage(int index, QQuickPackage *package)
+void QQmlDataGroupPrivate::initPackage(int index, QQuickPackage *package)
{
- for (QQuickVisualDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+ for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
it->initPackage(index, package);
}
-void QQuickVisualDataGroupPrivate::destroyingPackage(QQuickPackage *package)
+void QQmlDataGroupPrivate::destroyingPackage(QQuickPackage *package)
{
- for (QQuickVisualDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+ for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
it->destroyingPackage(package);
}
/*!
\qmltype VisualDataGroup
- \instantiates QQuickVisualDataGroup
+ \instantiates QQmlDataGroup
\inqmlmodule QtQuick 2
\ingroup qtquick-models
\brief Encapsulates a filtered set of visual data items
@@ -2165,21 +2152,21 @@ void QQuickVisualDataGroupPrivate::destroyingPackage(QQuickPackage *package)
\sa {QML Dynamic View Ordering Tutorial}
*/
-QQuickVisualDataGroup::QQuickVisualDataGroup(QObject *parent)
- : QObject(*new QQuickVisualDataGroupPrivate, parent)
+QQmlDataGroup::QQmlDataGroup(QObject *parent)
+ : QObject(*new QQmlDataGroupPrivate, parent)
{
}
-QQuickVisualDataGroup::QQuickVisualDataGroup(
- const QString &name, QQuickVisualDataModel *model, int index, QObject *parent)
- : QObject(*new QQuickVisualDataGroupPrivate, parent)
+QQmlDataGroup::QQmlDataGroup(
+ const QString &name, QQmlDelegateModel *model, int index, QObject *parent)
+ : QObject(*new QQmlDataGroupPrivate, parent)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
d->name = name;
d->setModel(model, Compositor::Group(index));
}
-QQuickVisualDataGroup::~QQuickVisualDataGroup()
+QQmlDataGroup::~QQmlDataGroup()
{
}
@@ -2191,15 +2178,15 @@ QQuickVisualDataGroup::~QQuickVisualDataGroup()
Each group in a model must have a unique name starting with a lower case letter.
*/
-QString QQuickVisualDataGroup::name() const
+QString QQmlDataGroup::name() const
{
- Q_D(const QQuickVisualDataGroup);
+ Q_D(const QQmlDataGroup);
return d->name;
}
-void QQuickVisualDataGroup::setName(const QString &name)
+void QQmlDataGroup::setName(const QString &name)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
if (d->model)
return;
if (d->name != name) {
@@ -2214,12 +2201,12 @@ void QQuickVisualDataGroup::setName(const QString &name)
This property holds the number of items in the group.
*/
-int QQuickVisualDataGroup::count() const
+int QQmlDataGroup::count() const
{
- Q_D(const QQuickVisualDataGroup);
+ Q_D(const QQmlDataGroup);
if (!d->model)
return 0;
- return QQuickVisualDataModelPrivate::get(d->model)->m_compositor.count(d->group);
+ return QQmlDelegateModelPrivate::get(d->model)->m_compositor.count(d->group);
}
/*!
@@ -2228,23 +2215,23 @@ int QQuickVisualDataGroup::count() const
This property holds whether new items are assigned to this group by default.
*/
-bool QQuickVisualDataGroup::defaultInclude() const
+bool QQmlDataGroup::defaultInclude() const
{
- Q_D(const QQuickVisualDataGroup);
+ Q_D(const QQmlDataGroup);
return d->defaultInclude;
}
-void QQuickVisualDataGroup::setDefaultInclude(bool include)
+void QQmlDataGroup::setDefaultInclude(bool include)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
if (d->defaultInclude != include) {
d->defaultInclude = include;
if (d->model) {
if (include)
- QQuickVisualDataModelPrivate::get(d->model)->m_compositor.setDefaultGroup(d->group);
+ QQmlDelegateModelPrivate::get(d->model)->m_compositor.setDefaultGroup(d->group);
else
- QQuickVisualDataModelPrivate::get(d->model)->m_compositor.clearDefaultGroup(d->group);
+ QQmlDelegateModelPrivate::get(d->model)->m_compositor.clearDefaultGroup(d->group);
}
emit defaultIncludeChanged();
}
@@ -2274,13 +2261,13 @@ void QQuickVisualDataGroup::setDefaultInclude(bool include)
\endlist
*/
-QQmlV8Handle QQuickVisualDataGroup::get(int index)
+QQmlV8Handle QQmlDataGroup::get(int index)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
if (!d->model)
return QQmlV8Handle::fromHandle(v8::Undefined());;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
if (!model->m_context->isValid()) {
return QQmlV8Handle::fromHandle(v8::Undefined());
} else if (index < 0 || index >= model->m_compositor.count(d->group)) {
@@ -2289,7 +2276,7 @@ QQmlV8Handle QQuickVisualDataGroup::get(int index)
}
Compositor::iterator it = model->m_compositor.find(d->group, index);
- QQuickVisualDataModelItem *cacheItem = it->inCache()
+ QQmlDelegateModelItem *cacheItem = it->inCache()
? model->m_cache.at(it.cacheIndex)
: 0;
@@ -2313,7 +2300,7 @@ QQmlV8Handle QQuickVisualDataGroup::get(int index)
return QQmlV8Handle::fromHandle(handle);
}
-bool QQuickVisualDataGroupPrivate::parseIndex(
+bool QQmlDataGroupPrivate::parseIndex(
const v8::Local<v8::Value> &value, int *index, Compositor::Group *group) const
{
if (value->IsInt32()) {
@@ -2321,9 +2308,9 @@ bool QQuickVisualDataGroupPrivate::parseIndex(
return true;
} else if (value->IsObject()) {
v8::Local<v8::Object> object = value->ToObject();
- QQuickVisualDataModelItem * const cacheItem = v8_resource_cast<QQuickVisualDataModelItem>(object);
- if (QQuickVisualDataModelPrivate *model = cacheItem && cacheItem->metaType->model
- ? QQuickVisualDataModelPrivate::get(cacheItem->metaType->model)
+ QQmlDelegateModelItem * const cacheItem = v8_resource_cast<QQmlDelegateModelItem>(object);
+ if (QQmlDelegateModelPrivate *model = cacheItem && cacheItem->metaType->model
+ ? QQmlDelegateModelPrivate::get(cacheItem->metaType->model)
: 0) {
*index = model->m_cache.indexOf(cacheItem);
*group = Compositor::Cache;
@@ -2350,10 +2337,10 @@ bool QQuickVisualDataGroupPrivate::parseIndex(
items that are later replaced by actual data.
*/
-void QQuickVisualDataGroup::insert(QQmlV8Function *args)
+void QQmlDataGroup::insert(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ Q_D(QQmlDataGroup);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
int index = model->m_compositor.count(d->group);
Compositor::Group group = d->group;
@@ -2406,16 +2393,16 @@ void QQuickVisualDataGroup::insert(QQmlV8Function *args)
group remain instantiated when not referenced by any view.
*/
-void QQuickVisualDataGroup::create(QQmlV8Function *args)
+void QQmlDataGroup::create(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
if (!d->model)
return;
if (args->Length() == 0)
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
int index = model->m_compositor.count(d->group);
Compositor::Group group = d->group;
@@ -2478,13 +2465,13 @@ void QQuickVisualDataGroup::create(QQmlV8Function *args)
that the previously unresolved item has simply moved.
*/
-void QQuickVisualDataGroup::resolve(QQmlV8Function *args)
+void QQmlDataGroup::resolve(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
if (!d->model)
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
if (args->Length() < 2)
return;
@@ -2533,7 +2520,7 @@ void QQuickVisualDataGroup::resolve(QQmlV8Function *args)
const int resolvedIndex = toIt.modelIndex();
void * const resolvedList = toIt->list;
- QQuickVisualDataModelItem *cacheItem = model->m_cache.at(fromIt.cacheIndex);
+ QQmlDelegateModelItem *cacheItem = model->m_cache.at(fromIt.cacheIndex);
cacheItem->groups &= ~Compositor::UnresolvedFlag;
if (toIt.cacheIndex > fromIt.cacheIndex)
@@ -2578,9 +2565,9 @@ void QQuickVisualDataGroup::resolve(QQmlV8Function *args)
Removes \a count items starting at \a index from the group.
*/
-void QQuickVisualDataGroup::remove(QQmlV8Function *args)
+void QQmlDataGroup::remove(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
if (!d->model)
return;
Compositor::Group group = d->group;
@@ -2603,7 +2590,7 @@ void QQuickVisualDataGroup::remove(QQmlV8Function *args)
count = v->Int32Value();
}
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
if (index < 0 || index >= model->m_compositor.count(group)) {
qmlInfo(this) << tr("remove: index out of range");
} else if (count != 0) {
@@ -2616,10 +2603,10 @@ void QQuickVisualDataGroup::remove(QQmlV8Function *args)
}
}
-bool QQuickVisualDataGroupPrivate::parseGroupArgs(
+bool QQmlDataGroupPrivate::parseGroupArgs(
QQmlV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const
{
- if (!model || !QQuickVisualDataModelPrivate::get(model)->m_cacheMetaType)
+ if (!model || !QQmlDelegateModelPrivate::get(model)->m_cacheMetaType)
return false;
if (args->Length() < 2)
@@ -2639,7 +2626,7 @@ bool QQuickVisualDataGroupPrivate::parseGroupArgs(
v = (*args)[i];
}
- *groups = QQuickVisualDataModelPrivate::get(model)->m_cacheMetaType->parseGroups(v);
+ *groups = QQmlDelegateModelPrivate::get(model)->m_cacheMetaType->parseGroups(v);
return true;
}
@@ -2650,9 +2637,9 @@ bool QQuickVisualDataGroupPrivate::parseGroupArgs(
Adds \a count items starting at \a index to \a groups.
*/
-void QQuickVisualDataGroup::addGroups(QQmlV8Function *args)
+void QQmlDataGroup::addGroups(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
Compositor::Group group = d->group;
int index = -1;
int count = 1;
@@ -2661,7 +2648,7 @@ void QQuickVisualDataGroup::addGroups(QQmlV8Function *args)
if (!d->parseGroupArgs(args, &group, &index, &count, &groups))
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
if (index < 0 || index >= model->m_compositor.count(group)) {
qmlInfo(this) << tr("addGroups: index out of range");
} else if (count != 0) {
@@ -2680,9 +2667,9 @@ void QQuickVisualDataGroup::addGroups(QQmlV8Function *args)
Removes \a count items starting at \a index from \a groups.
*/
-void QQuickVisualDataGroup::removeGroups(QQmlV8Function *args)
+void QQmlDataGroup::removeGroups(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
Compositor::Group group = d->group;
int index = -1;
int count = 1;
@@ -2691,7 +2678,7 @@ void QQuickVisualDataGroup::removeGroups(QQmlV8Function *args)
if (!d->parseGroupArgs(args, &group, &index, &count, &groups))
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
if (index < 0 || index >= model->m_compositor.count(group)) {
qmlInfo(this) << tr("removeGroups: index out of range");
} else if (count != 0) {
@@ -2710,9 +2697,9 @@ void QQuickVisualDataGroup::removeGroups(QQmlV8Function *args)
Sets the \a groups \a count items starting at \a index belong to.
*/
-void QQuickVisualDataGroup::setGroups(QQmlV8Function *args)
+void QQmlDataGroup::setGroups(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
Compositor::Group group = d->group;
int index = -1;
int count = 1;
@@ -2721,7 +2708,7 @@ void QQuickVisualDataGroup::setGroups(QQmlV8Function *args)
if (!d->parseGroupArgs(args, &group, &index, &count, &groups))
return;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
if (index < 0 || index >= model->m_compositor.count(group)) {
qmlInfo(this) << tr("setGroups: index out of range");
} else if (count != 0) {
@@ -2746,9 +2733,9 @@ void QQuickVisualDataGroup::setGroups(QQmlV8Function *args)
Moves \a count at \a from in a group \a to a new position.
*/
-void QQuickVisualDataGroup::move(QQmlV8Function *args)
+void QQmlDataGroup::move(QQmlV8Function *args)
{
- Q_D(QQuickVisualDataGroup);
+ Q_D(QQmlDataGroup);
if (args->Length() < 2)
return;
@@ -2775,7 +2762,7 @@ void QQuickVisualDataGroup::move(QQmlV8Function *args)
count = v->Int32Value();
}
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(d->model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
if (count < 0) {
qmlInfo(this) << tr("move: invalid count");
@@ -2808,36 +2795,36 @@ void QQuickVisualDataGroup::move(QQmlV8Function *args)
//============================================================================
-QQuickVisualPartsModel::QQuickVisualPartsModel(QQuickVisualDataModel *model, const QString &part, QObject *parent)
- : QQuickVisualModel(*new QObjectPrivate, parent)
+QQmlPartsModel::QQmlPartsModel(QQmlDelegateModel *model, const QString &part, QObject *parent)
+ : QQmlInstanceModel(*new QObjectPrivate, parent)
, m_model(model)
, m_part(part)
, m_compositorGroup(Compositor::Cache)
, m_inheritGroup(true)
{
- QQuickVisualDataModelPrivate *d = QQuickVisualDataModelPrivate::get(m_model);
+ QQmlDelegateModelPrivate *d = QQmlDelegateModelPrivate::get(m_model);
if (d->m_cacheMetaType) {
- QQuickVisualDataGroupPrivate::get(d->m_groups[1])->emitters.insert(this);
+ QQmlDataGroupPrivate::get(d->m_groups[1])->emitters.insert(this);
m_compositorGroup = Compositor::Default;
} else {
d->m_pendingParts.insert(this);
}
}
-QQuickVisualPartsModel::~QQuickVisualPartsModel()
+QQmlPartsModel::~QQmlPartsModel()
{
}
-QString QQuickVisualPartsModel::filterGroup() const
+QString QQmlPartsModel::filterGroup() const
{
if (m_inheritGroup)
return m_model->filterGroup();
return m_filterGroup;
}
-void QQuickVisualPartsModel::setFilterGroup(const QString &group)
+void QQmlPartsModel::setFilterGroup(const QString &group)
{
- if (QQuickVisualDataModelPrivate::get(m_model)->m_transaction) {
+ if (QQmlDelegateModelPrivate::get(m_model)->m_transaction) {
qmlInfo(this) << tr("The group of a VisualDataModel cannot be changed within onChanged");
return;
}
@@ -2851,7 +2838,7 @@ void QQuickVisualPartsModel::setFilterGroup(const QString &group)
}
}
-void QQuickVisualPartsModel::resetFilterGroup()
+void QQmlPartsModel::resetFilterGroup()
{
if (!m_inheritGroup) {
m_inheritGroup = true;
@@ -2860,9 +2847,9 @@ void QQuickVisualPartsModel::resetFilterGroup()
}
}
-void QQuickVisualPartsModel::updateFilterGroup()
+void QQmlPartsModel::updateFilterGroup()
{
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(m_model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model);
if (!model->m_cacheMetaType)
return;
@@ -2872,9 +2859,9 @@ void QQuickVisualPartsModel::updateFilterGroup()
m_filterGroup = model->m_filterGroup;
}
- QQuickListCompositor::Group previousGroup = m_compositorGroup;
+ QQmlListCompositor::Group previousGroup = m_compositorGroup;
m_compositorGroup = Compositor::Default;
- QQuickVisualDataGroupPrivate::get(model->m_groups[Compositor::Default])->emitters.insert(this);
+ QQmlDataGroupPrivate::get(model->m_groups[Compositor::Default])->emitters.insert(this);
for (int i = 1; i < model->m_groupCount; ++i) {
if (m_filterGroup == model->m_cacheMetaType->groupNames.at(i - 1)) {
m_compositorGroup = Compositor::Group(i);
@@ -2882,13 +2869,13 @@ void QQuickVisualPartsModel::updateFilterGroup()
}
}
- QQuickVisualDataGroupPrivate::get(model->m_groups[m_compositorGroup])->emitters.insert(this);
+ QQmlDataGroupPrivate::get(model->m_groups[m_compositorGroup])->emitters.insert(this);
if (m_compositorGroup != previousGroup) {
- QVector<QQuickChangeSet::Remove> removes;
- QVector<QQuickChangeSet::Insert> inserts;
+ QVector<QQmlChangeSet::Remove> removes;
+ QVector<QQmlChangeSet::Insert> inserts;
model->m_compositor.transition(previousGroup, m_compositorGroup, &removes, &inserts);
- QQuickChangeSet changeSet;
+ QQmlChangeSet changeSet;
changeSet.move(removes, inserts);
if (!changeSet.isEmpty())
emit modelUpdated(changeSet, false);
@@ -2898,14 +2885,14 @@ void QQuickVisualPartsModel::updateFilterGroup()
}
}
-void QQuickVisualPartsModel::updateFilterGroup(
- Compositor::Group group, const QQuickChangeSet &changeSet)
+void QQmlPartsModel::updateFilterGroup(
+ Compositor::Group group, const QQmlChangeSet &changeSet)
{
if (!m_inheritGroup)
return;
m_compositorGroup = group;
- QQuickVisualDataGroupPrivate::get(QQuickVisualDataModelPrivate::get(m_model)->m_groups[m_compositorGroup])->emitters.insert(this);
+ QQmlDataGroupPrivate::get(QQmlDelegateModelPrivate::get(m_model)->m_groups[m_compositorGroup])->emitters.insert(this);
if (!changeSet.isEmpty())
emit modelUpdated(changeSet, false);
@@ -2916,22 +2903,22 @@ void QQuickVisualPartsModel::updateFilterGroup(
emit filterGroupChanged();
}
-int QQuickVisualPartsModel::count() const
+int QQmlPartsModel::count() const
{
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(m_model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model);
return model->m_delegate
? model->m_compositor.count(m_compositorGroup)
: 0;
}
-bool QQuickVisualPartsModel::isValid() const
+bool QQmlPartsModel::isValid() const
{
return m_model->isValid();
}
-QQuickItem *QQuickVisualPartsModel::item(int index, bool asynchronous)
+QObject *QQmlPartsModel::object(int index, bool asynchronous)
{
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(m_model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model);
if (!model->m_delegate || index < 0 || index >= model->m_compositor.count(m_compositorGroup)) {
qWarning() << "VisualDataModel::item: index out range" << index << model->m_compositor.count(m_compositorGroup);
@@ -2944,10 +2931,8 @@ QQuickItem *QQuickVisualPartsModel::item(int index, bool asynchronous)
QObject *part = package->part(m_part);
if (!part)
return 0;
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(part)) {
- m_packaged.insertMulti(item, package);
- return item;
- }
+ m_packaged.insertMulti(part, package);
+ return part;
}
model->release(object);
@@ -2960,68 +2945,64 @@ QQuickItem *QQuickVisualPartsModel::item(int index, bool asynchronous)
return 0;
}
-QQuickVisualModel::ReleaseFlags QQuickVisualPartsModel::release(QQuickItem *item)
+QQmlInstanceModel::ReleaseFlags QQmlPartsModel::release(QObject *item)
{
- QQuickVisualModel::ReleaseFlags flags = 0;
+ QQmlInstanceModel::ReleaseFlags flags = 0;
QHash<QObject *, QQuickPackage *>::iterator it = m_packaged.find(item);
if (it != m_packaged.end()) {
QQuickPackage *package = *it;
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(m_model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model);
flags = model->release(package);
m_packaged.erase(it);
if (!m_packaged.contains(item))
flags &= ~Referenced;
if (flags & Destroyed)
- QQuickVisualDataModelPrivate::get(m_model)->emitDestroyingPackage(package);
+ QQmlDelegateModelPrivate::get(m_model)->emitDestroyingPackage(package);
}
return flags;
}
-QString QQuickVisualPartsModel::stringValue(int index, const QString &role)
+QString QQmlPartsModel::stringValue(int index, const QString &role)
{
- return QQuickVisualDataModelPrivate::get(m_model)->stringValue(m_compositorGroup, index, role);
+ return QQmlDelegateModelPrivate::get(m_model)->stringValue(m_compositorGroup, index, role);
}
-void QQuickVisualPartsModel::setWatchedRoles(QList<QByteArray> roles)
+void QQmlPartsModel::setWatchedRoles(QList<QByteArray> roles)
{
- QQuickVisualDataModelPrivate *model = QQuickVisualDataModelPrivate::get(m_model);
+ QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model);
model->m_adaptorModel.replaceWatchedRoles(m_watchedRoles, roles);
m_watchedRoles = roles;
}
-int QQuickVisualPartsModel::indexOf(QQuickItem *item, QObject *) const
+int QQmlPartsModel::indexOf(QObject *item, QObject *) const
{
QHash<QObject *, QQuickPackage *>::const_iterator it = m_packaged.find(item);
if (it != m_packaged.end()) {
- if (QQuickVisualDataModelItem *cacheItem = QQuickVisualDataModelItem::dataForObject(*it))
+ if (QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(*it))
return cacheItem->groupIndex(m_compositorGroup);
}
return -1;
}
-void QQuickVisualPartsModel::createdPackage(int index, QQuickPackage *package)
+void QQmlPartsModel::createdPackage(int index, QQuickPackage *package)
{
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(package->part(m_part)))
- emit createdItem(index, item);
+ emit createdItem(index, package->part(m_part));
}
-void QQuickVisualPartsModel::initPackage(int index, QQuickPackage *package)
+void QQmlPartsModel::initPackage(int index, QQuickPackage *package)
{
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(package->part(m_part)))
- emit initItem(index, item);
+ emit initItem(index, package->part(m_part));
}
-void QQuickVisualPartsModel::destroyingPackage(QQuickPackage *package)
+void QQmlPartsModel::destroyingPackage(QQuickPackage *package)
{
- if (QQuickItem *item = qmlobject_cast<QQuickItem *>(package->part(m_part))) {
- Q_ASSERT(!m_packaged.contains(item));
- emit destroyingItem(item);
- item->setParentItem(0);
- }
+ QObject *item = package->part(m_part);
+ Q_ASSERT(!m_packaged.contains(item));
+ emit destroyingItem(item);
}
-void QQuickVisualPartsModel::emitModelUpdated(const QQuickChangeSet &changeSet, bool reset)
+void QQmlPartsModel::emitModelUpdated(const QQmlChangeSet &changeSet, bool reset)
{
emit modelUpdated(changeSet, reset);
if (changeSet.difference() != 0)
@@ -3045,27 +3026,27 @@ v8::Handle<v8::Value> get_change_moveId(v8::Local<v8::String>, const v8::Accesso
return info.This()->GetInternalField(2);
}
-class QQuickVisualDataGroupChangeArray : public QV8ObjectResource
+class QQmlDataGroupChangeArray : public QV8ObjectResource
{
V8_RESOURCE_TYPE(ChangeSetArrayType)
public:
- QQuickVisualDataGroupChangeArray(QV8Engine *engine)
+ QQmlDataGroupChangeArray(QV8Engine *engine)
: QV8ObjectResource(engine)
{
}
virtual quint32 count() const = 0;
- virtual const QQuickChangeSet::Change &at(int index) const = 0;
+ virtual const QQmlChangeSet::Change &at(int index) const = 0;
static v8::Handle<v8::Value> get_change(quint32 index, const v8::AccessorInfo &info)
{
- QQuickVisualDataGroupChangeArray *array = v8_resource_cast<QQuickVisualDataGroupChangeArray>(info.This());
+ QQmlDataGroupChangeArray *array = v8_resource_cast<QQmlDataGroupChangeArray>(info.This());
V8ASSERT_TYPE(array, "Not a valid change array");
if (index >= array->count())
return v8::Undefined();
- const QQuickChangeSet::Change &change = array->at(index);
+ const QQmlChangeSet::Change &change = array->at(index);
v8::Local<v8::Object> object = engineData(array->engine)->constructorChange->NewInstance();
object->SetInternalField(0, v8::Int32::New(change.index));
@@ -3078,7 +3059,7 @@ public:
static v8::Handle<v8::Value> get_length(v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataGroupChangeArray *array = v8_resource_cast<QQuickVisualDataGroupChangeArray>(info.This());
+ QQmlDataGroupChangeArray *array = v8_resource_cast<QQmlDataGroupChangeArray>(info.This());
V8ASSERT_TYPE(array, "Not a valid change array");
return v8::Integer::New(array->count());
@@ -3094,39 +3075,39 @@ public:
}
};
-class QQuickVisualDataGroupRemoveArray : public QQuickVisualDataGroupChangeArray
+class QQmlDataGroupRemoveArray : public QQmlDataGroupChangeArray
{
public:
- QQuickVisualDataGroupRemoveArray(QV8Engine *engine, const QVector<QQuickChangeSet::Remove> &changes)
- : QQuickVisualDataGroupChangeArray(engine)
+ QQmlDataGroupRemoveArray(QV8Engine *engine, const QVector<QQmlChangeSet::Remove> &changes)
+ : QQmlDataGroupChangeArray(engine)
, changes(changes)
{
}
quint32 count() const { return changes.count(); }
- const QQuickChangeSet::Change &at(int index) const { return changes.at(index); }
+ const QQmlChangeSet::Change &at(int index) const { return changes.at(index); }
private:
- QVector<QQuickChangeSet::Remove> changes;
+ QVector<QQmlChangeSet::Remove> changes;
};
-class QQuickVisualDataGroupInsertArray : public QQuickVisualDataGroupChangeArray
+class QQmlDataGroupInsertArray : public QQmlDataGroupChangeArray
{
public:
- QQuickVisualDataGroupInsertArray(QV8Engine *engine, const QVector<QQuickChangeSet::Insert> &changes)
- : QQuickVisualDataGroupChangeArray(engine)
+ QQmlDataGroupInsertArray(QV8Engine *engine, const QVector<QQmlChangeSet::Insert> &changes)
+ : QQmlDataGroupChangeArray(engine)
, changes(changes)
{
}
quint32 count() const { return changes.count(); }
- const QQuickChangeSet::Change &at(int index) const { return changes.at(index); }
+ const QQmlChangeSet::Change &at(int index) const { return changes.at(index); }
private:
- QVector<QQuickChangeSet::Insert> changes;
+ QVector<QQmlChangeSet::Insert> changes;
};
-QQuickVisualDataModelEngineData::QQuickVisualDataModelEngineData(QV8Engine *)
+QQmlDelegateModelEngineData::QQmlDelegateModelEngineData(QV8Engine *)
{
strings = qPersistentNew(v8::Array::New(StringCount));
strings->Set(Model, v8::String::New("model"));
@@ -3143,29 +3124,29 @@ QQuickVisualDataModelEngineData::QQuickVisualDataModelEngineData(QV8Engine *)
change->InstanceTemplate()->SetAccessor(v8::String::New("moveId"), get_change_moveId);
change->InstanceTemplate()->SetInternalFieldCount(3);
constructorChange = qPersistentNew(change->GetFunction());
- constructorChangeArray = qPersistentNew(QQuickVisualDataGroupChangeArray::constructor());
+ constructorChangeArray = qPersistentNew(QQmlDataGroupChangeArray::constructor());
}
-QQuickVisualDataModelEngineData::~QQuickVisualDataModelEngineData()
+QQmlDelegateModelEngineData::~QQmlDelegateModelEngineData()
{
qPersistentDispose(strings);
qPersistentDispose(constructorChange);
qPersistentDispose(constructorChangeArray);
}
-v8::Local<v8::Object> QQuickVisualDataModelEngineData::array(
- QV8Engine *engine, const QVector<QQuickChangeSet::Remove> &changes)
+v8::Local<v8::Object> QQmlDelegateModelEngineData::array(
+ QV8Engine *engine, const QVector<QQmlChangeSet::Remove> &changes)
{
v8::Local<v8::Object> array = constructorChangeArray->NewInstance();
- array->SetExternalResource(new QQuickVisualDataGroupRemoveArray(engine, changes));
+ array->SetExternalResource(new QQmlDataGroupRemoveArray(engine, changes));
return array;
}
-v8::Local<v8::Object> QQuickVisualDataModelEngineData::array(
- QV8Engine *engine, const QVector<QQuickChangeSet::Insert> &changes)
+v8::Local<v8::Object> QQmlDelegateModelEngineData::array(
+ QV8Engine *engine, const QVector<QQmlChangeSet::Insert> &changes)
{
v8::Local<v8::Object> array = constructorChangeArray->NewInstance();
- array->SetExternalResource(new QQuickVisualDataGroupInsertArray(engine, changes));
+ array->SetExternalResource(new QQmlDataGroupInsertArray(engine, changes));
return array;
}
diff --git a/src/quick/items/qquickvisualdatamodel_p.h b/src/qml/items/qqmldelegatemodel_p.h
index 03e06c82ac..0fccf5720d 100644
--- a/src/quick/items/qquickvisualdatamodel_p.h
+++ b/src/qml/items/qqmldelegatemodel_p.h
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#ifndef QQUICKVISUALDATAMODEL_P_H
-#define QQUICKVISUALDATAMODEL_P_H
+#ifndef QQMLDATAMODEL_P_H
+#define QQMLDATAMODEL_P_H
-#include <private/qtquickglobal_p.h>
-#include <private/qquicklistcompositor_p.h>
-#include <private/qquickvisualitemmodel_p.h>
+#include <private/qtqmlglobal_p.h>
+#include <private/qqmllistcompositor_p.h>
+#include <private/qqmlobjectmodel_p.h>
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qstringlist.h>
@@ -52,40 +52,38 @@
#include <private/qv8engine_p.h>
#include <private/qqmlglobal_p.h>
-QT_BEGIN_HEADER
-
Q_DECLARE_METATYPE(QModelIndex)
QT_BEGIN_NAMESPACE
-class QQuickChangeSet;
+class QQmlChangeSet;
class QQmlComponent;
class QQuickPackage;
class QQmlV8Function;
-class QQuickVisualDataGroup;
-class QQuickVisualDataModelAttached;
-class QQuickVisualDataModelPrivate;
+class QQmlDataGroup;
+class QQmlDelegateModelAttached;
+class QQmlDelegateModelPrivate;
-class Q_QUICK_PRIVATE_EXPORT QQuickVisualDataModel : public QQuickVisualModel, public QQmlParserStatus
+class Q_QML_PRIVATE_EXPORT QQmlDelegateModel : public QQmlInstanceModel, public QQmlParserStatus
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QQuickVisualDataModel)
+ Q_DECLARE_PRIVATE(QQmlDelegateModel)
Q_PROPERTY(QVariant model READ model WRITE setModel)
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(QQmlListProperty<QQuickVisualDataGroup> groups READ groups CONSTANT)
+ Q_PROPERTY(QQmlDataGroup *items READ items CONSTANT) //TODO : worth renaming?
+ Q_PROPERTY(QQmlDataGroup *persistedItems READ persistedItems CONSTANT)
+ Q_PROPERTY(QQmlListProperty<QQmlDataGroup> 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(QQmlParserStatus)
public:
- QQuickVisualDataModel();
- QQuickVisualDataModel(QQmlContext *, QObject *parent=0);
- virtual ~QQuickVisualDataModel();
+ QQmlDelegateModel();
+ QQmlDelegateModel(QQmlContext *, QObject *parent=0);
+ virtual ~QQmlDelegateModel();
void classBegin();
void componentComplete();
@@ -104,26 +102,26 @@ public:
int count() const;
bool isValid() const { return delegate() != 0; }
- QQuickItem *item(int index, bool asynchronous=false);
- ReleaseFlags release(QQuickItem *item);
+ QObject *object(int index, bool asynchronous=false);
+ ReleaseFlags release(QObject *object);
void cancel(int index);
virtual QString stringValue(int index, const QString &role);
virtual void setWatchedRoles(QList<QByteArray> roles);
- int indexOf(QQuickItem *item, QObject *objectContext) const;
+ int indexOf(QObject *object, QObject *objectContext) const;
QString filterGroup() const;
void setFilterGroup(const QString &group);
void resetFilterGroup();
- QQuickVisualDataGroup *items();
- QQuickVisualDataGroup *persistedItems();
- QQmlListProperty<QQuickVisualDataGroup> groups();
+ QQmlDataGroup *items();
+ QQmlDataGroup *persistedItems();
+ QQmlListProperty<QQmlDataGroup> groups();
QObject *parts();
bool event(QEvent *);
- static QQuickVisualDataModelAttached *qmlAttachedProperties(QObject *obj);
+ static QQmlDelegateModelAttached *qmlAttachedProperties(QObject *obj);
Q_SIGNALS:
void filterGroupChanged();
@@ -144,20 +142,20 @@ private Q_SLOTS:
void _q_layoutChanged();
private:
- Q_DISABLE_COPY(QQuickVisualDataModel)
+ Q_DISABLE_COPY(QQmlDelegateModel)
};
-class QQuickVisualDataGroupPrivate;
-class Q_AUTOTEST_EXPORT QQuickVisualDataGroup : public QObject
+class QQmlDataGroupPrivate;
+class Q_QML_PRIVATE_EXPORT QQmlDataGroup : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(bool includeByDefault READ defaultInclude WRITE setDefaultInclude NOTIFY defaultIncludeChanged)
public:
- QQuickVisualDataGroup(QObject *parent = 0);
- QQuickVisualDataGroup(const QString &name, QQuickVisualDataModel *model, int compositorType, QObject *parent = 0);
- ~QQuickVisualDataGroup();
+ QQmlDataGroup(QObject *parent = 0);
+ QQmlDataGroup(const QString &name, QQmlDelegateModel *model, int compositorType, QObject *parent = 0);
+ ~QQmlDataGroup();
QString name() const;
void setName(const QString &name);
@@ -185,25 +183,25 @@ Q_SIGNALS:
void defaultIncludeChanged();
void changed(const QQmlV8Handle &removed, const QQmlV8Handle &inserted);
private:
- Q_DECLARE_PRIVATE(QQuickVisualDataGroup)
+ Q_DECLARE_PRIVATE(QQmlDataGroup)
};
-class QQuickVisualDataModelItem;
-class QQuickVisualDataModelAttachedMetaObject;
-class QQuickVisualDataModelAttached : public QObject
+class QQmlDelegateModelItem;
+class QQmlDelegateModelAttachedMetaObject;
+class QQmlDelegateModelAttached : public QObject
{
Q_OBJECT
- Q_PROPERTY(QQuickVisualDataModel *model READ model CONSTANT)
+ Q_PROPERTY(QQmlDelegateModel *model READ model CONSTANT)
Q_PROPERTY(QStringList groups READ groups WRITE setGroups NOTIFY groupsChanged)
Q_PROPERTY(bool isUnresolved READ isUnresolved NOTIFY unresolvedChanged)
public:
- QQuickVisualDataModelAttached(QObject *parent);
- QQuickVisualDataModelAttached(QQuickVisualDataModelItem *cacheItem, QObject *parent);
- ~QQuickVisualDataModelAttached() {}
+ QQmlDelegateModelAttached(QObject *parent);
+ QQmlDelegateModelAttached(QQmlDelegateModelItem *cacheItem, QObject *parent);
+ ~QQmlDelegateModelAttached() {}
- void setCacheItem(QQuickVisualDataModelItem *item);
+ void setCacheItem(QQmlDelegateModelItem *item);
- QQuickVisualDataModel *model() const;
+ QQmlDelegateModel *model() const;
QStringList groups() const;
void setGroups(const QStringList &groups);
@@ -219,20 +217,18 @@ Q_SIGNALS:
void unresolvedChanged();
public:
- QQuickVisualDataModelItem *m_cacheItem;
+ QQmlDelegateModelItem *m_cacheItem;
int m_previousGroups;
- int m_currentIndex[QQuickListCompositor::MaximumGroupCount];
- int m_previousIndex[QQuickListCompositor::MaximumGroupCount];
+ int m_currentIndex[QQmlListCompositor::MaximumGroupCount];
+ int m_previousIndex[QQmlListCompositor::MaximumGroupCount];
- friend class QQuickVisualDataModelAttachedMetaObject;
+ friend class QQmlDelegateModelAttachedMetaObject;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickVisualDataModel)
-QML_DECLARE_TYPEINFO(QQuickVisualDataModel, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(QQuickVisualDataGroup)
-
-QT_END_HEADER
+QML_DECLARE_TYPE(QQmlDelegateModel)
+QML_DECLARE_TYPEINFO(QQmlDelegateModel, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QQmlDataGroup)
-#endif // QQUICKVISUALDATAMODEL_P_H
+#endif // QQMLDATAMODEL_P_H
diff --git a/src/quick/items/qquickvisualdatamodel_p_p.h b/src/qml/items/qqmldelegatemodel_p_p.h
index 89ecece064..0ac7285cab 100644
--- a/src/quick/items/qquickvisualdatamodel_p_p.h
+++ b/src/qml/items/qqmldelegatemodel_p_p.h
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#ifndef QQUICKVISUALDATAMODEL_P_P_H
-#define QQUICKVISUALDATAMODEL_P_P_H
+#ifndef QQMLDATAMODEL_P_P_H
+#define QQMLDATAMODEL_P_P_H
-#include "qquickvisualdatamodel_p.h"
+#include "qqmldelegatemodel_p.h"
-#include "qquickvisualadaptormodel_p.h"
#include <QtQml/qqmlcontext.h>
#include <QtQml/qqmlincubator.h>
+#include <private/qqmladaptormodel_p.h>
#include <private/qqmlopenmetaobject_p.h>
//
@@ -64,15 +64,15 @@
QT_BEGIN_NAMESPACE
-typedef QQuickListCompositor Compositor;
+typedef QQmlListCompositor Compositor;
-class QQuickVisualDataModelAttachedMetaObject;
+class QQmlDelegateModelAttachedMetaObject;
-class QQuickVisualDataModelItemMetaType : public QQmlRefCount
+class QQmlDelegateModelItemMetaType : public QQmlRefCount
{
public:
- QQuickVisualDataModelItemMetaType(QV8Engine *engine, QQuickVisualDataModel *model, const QStringList &groupNames);
- ~QQuickVisualDataModelItemMetaType();
+ QQmlDelegateModelItemMetaType(QV8Engine *engine, QQmlDelegateModel *model, const QStringList &groupNames);
+ ~QQmlDelegateModelItemMetaType();
void initializeMetaObject();
void initializeConstructor();
@@ -92,26 +92,26 @@ 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);
- QQmlGuard<QQuickVisualDataModel> model;
+ QQmlGuard<QQmlDelegateModel> model;
const int groupCount;
QV8Engine * const v8Engine;
- QQuickVisualDataModelAttachedMetaObject *metaObject;
+ QQmlDelegateModelAttachedMetaObject *metaObject;
const QStringList groupNames;
v8::Persistent<v8::ObjectTemplate> constructor;
};
-class QQuickVisualAdaptorModel;
-class QVDMIncubationTask;
+class QQmlAdaptorModel;
+class QQDMIncubationTask;
-class QQuickVisualDataModelItem : public QObject, public QV8ObjectResource
+class QQmlDelegateModelItem : public QObject, public QV8ObjectResource
{
Q_OBJECT
Q_PROPERTY(int index READ modelIndex NOTIFY modelIndexChanged)
Q_PROPERTY(QObject *model READ modelObject CONSTANT)
V8_RESOURCE_TYPE(VisualDataItemType)
public:
- QQuickVisualDataModelItem(QQuickVisualDataModelItemMetaType *metaType, int modelIndex);
- ~QQuickVisualDataModelItem();
+ QQmlDelegateModelItem(QQmlDelegateModelItemMetaType *metaType, int modelIndex);
+ ~QQmlDelegateModelItem();
void referenceObject() { ++objectRef; }
bool releaseObject() { return --objectRef == 0 && !(groups & Compositor::PersistedFlag); }
@@ -134,7 +134,7 @@ public:
QQmlContextData *forContext);
void destroyObject();
- static QQuickVisualDataModelItem *dataForObject(QObject *object);
+ static QQmlDelegateModelItem *dataForObject(QObject *object);
int groupIndex(Compositor::Group group);
@@ -144,13 +144,13 @@ public:
virtual v8::Handle<v8::Value> get() { return engine->newQObject(this); }
virtual void setValue(const QString &role, const QVariant &value) { Q_UNUSED(role); Q_UNUSED(value); }
- virtual bool resolveIndex(const QQuickVisualAdaptorModel &, int) { return false; }
+ virtual bool resolveIndex(const QQmlAdaptorModel &, int) { return false; }
- QQuickVisualDataModelItemMetaType * const metaType;
+ QQmlDelegateModelItemMetaType * const metaType;
QQmlContextData *contextData;
QObject *object;
- QQuickVisualDataModelAttached *attached;
- QVDMIncubationTask *incubationTask;
+ QQmlDelegateModelAttached *attached;
+ QQDMIncubationTask *incubationTask;
int objectRef;
int scriptRef;
int groups;
@@ -165,11 +165,11 @@ protected:
};
-class QQuickVisualDataModelPrivate;
-class QVDMIncubationTask : public QQmlIncubator
+class QQmlDelegateModelPrivate;
+class QQDMIncubationTask : public QQmlIncubator
{
public:
- QVDMIncubationTask(QQuickVisualDataModelPrivate *l, IncubationMode mode)
+ QQDMIncubationTask(QQmlDelegateModelPrivate *l, IncubationMode mode)
: QQmlIncubator(mode)
, incubating(0)
, vdm(l) {}
@@ -177,17 +177,17 @@ public:
virtual void statusChanged(Status);
virtual void setInitialState(QObject *);
- QQuickVisualDataModelItem *incubating;
- QQuickVisualDataModelPrivate *vdm;
- int index[QQuickListCompositor::MaximumGroupCount];
+ QQmlDelegateModelItem *incubating;
+ QQmlDelegateModelPrivate *vdm;
+ int index[QQmlListCompositor::MaximumGroupCount];
};
-class QQuickVisualDataGroupEmitter
+class QQmlDataGroupEmitter
{
public:
- virtual ~QQuickVisualDataGroupEmitter() {}
- virtual void emitModelUpdated(const QQuickChangeSet &changeSet, bool reset) = 0;
+ virtual ~QQmlDataGroupEmitter() {}
+ virtual void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) = 0;
virtual void createdPackage(int, QQuickPackage *) {}
virtual void initPackage(int, QQuickPackage *) {}
virtual void destroyingPackage(QQuickPackage *) {}
@@ -195,19 +195,19 @@ public:
QIntrusiveListNode emitterNode;
};
-typedef QIntrusiveList<QQuickVisualDataGroupEmitter, &QQuickVisualDataGroupEmitter::emitterNode> QQuickVisualDataGroupEmitterList;
+typedef QIntrusiveList<QQmlDataGroupEmitter, &QQmlDataGroupEmitter::emitterNode> QQmlDataGroupEmitterList;
-class QQuickVisualDataGroupPrivate : public QObjectPrivate
+class QQmlDataGroupPrivate : public QObjectPrivate
{
public:
- Q_DECLARE_PUBLIC(QQuickVisualDataGroup)
+ Q_DECLARE_PUBLIC(QQmlDataGroup)
- QQuickVisualDataGroupPrivate() : group(Compositor::Cache), defaultInclude(false) {}
+ QQmlDataGroupPrivate() : group(Compositor::Cache), defaultInclude(false) {}
- static QQuickVisualDataGroupPrivate *get(QQuickVisualDataGroup *group) {
- return static_cast<QQuickVisualDataGroupPrivate *>(QObjectPrivate::get(group)); }
+ static QQmlDataGroupPrivate *get(QQmlDataGroup *group) {
+ return static_cast<QQmlDataGroupPrivate *>(QObjectPrivate::get(group)); }
- void setModel(QQuickVisualDataModel *model, Compositor::Group group);
+ void setModel(QQmlDelegateModel *model, Compositor::Group group);
bool isChangedConnected();
void emitChanges(QV8Engine *engine);
void emitModelUpdated(bool reset);
@@ -221,41 +221,41 @@ public:
QQmlV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const;
Compositor::Group group;
- QQmlGuard<QQuickVisualDataModel> model;
- QQuickVisualDataGroupEmitterList emitters;
- QQuickChangeSet changeSet;
+ QQmlGuard<QQmlDelegateModel> model;
+ QQmlDataGroupEmitterList emitters;
+ QQmlChangeSet changeSet;
QString name;
bool defaultInclude;
};
-class QQuickVisualDataModelParts;
+class QQmlDelegateModelParts;
-class QQuickVisualDataModelPrivate : public QObjectPrivate, public QQuickVisualDataGroupEmitter
+class QQmlDelegateModelPrivate : public QObjectPrivate, public QQmlDataGroupEmitter
{
- Q_DECLARE_PUBLIC(QQuickVisualDataModel)
+ Q_DECLARE_PUBLIC(QQmlDelegateModel)
public:
- QQuickVisualDataModelPrivate(QQmlContext *);
- ~QQuickVisualDataModelPrivate();
+ QQmlDelegateModelPrivate(QQmlContext *);
+ ~QQmlDelegateModelPrivate();
- static QQuickVisualDataModelPrivate *get(QQuickVisualDataModel *m) {
- return static_cast<QQuickVisualDataModelPrivate *>(QObjectPrivate::get(m));
+ static QQmlDelegateModelPrivate *get(QQmlDelegateModel *m) {
+ return static_cast<QQmlDelegateModelPrivate *>(QObjectPrivate::get(m));
}
void init();
- void connectModel(QQuickVisualAdaptorModel *model);
+ void connectModel(QQmlAdaptorModel *model);
QObject *object(Compositor::Group group, int index, bool asynchronous);
- QQuickVisualDataModel::ReleaseFlags release(QObject *object);
+ QQmlDelegateModel::ReleaseFlags release(QObject *object);
QString stringValue(Compositor::Group group, int index, const QString &name);
- void emitCreatedPackage(QVDMIncubationTask *incubationTask, QQuickPackage *package);
- void emitInitPackage(QVDMIncubationTask *incubationTask, QQuickPackage *package);
- void emitCreatedItem(QVDMIncubationTask *incubationTask, QQuickItem *item) {
+ void emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package);
+ void emitInitPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package);
+ void emitCreatedItem(QQDMIncubationTask *incubationTask, QObject *item) {
emit q_func()->createdItem(incubationTask->index[m_compositorGroup], item); }
- void emitInitItem(QVDMIncubationTask *incubationTask, QQuickItem *item) {
+ void emitInitItem(QQDMIncubationTask *incubationTask, QObject *item) {
emit q_func()->initItem(incubationTask->index[m_compositorGroup], item); }
void emitDestroyingPackage(QQuickPackage *package);
- void emitDestroyingItem(QQuickItem *item) { emit q_func()->destroyingItem(item); }
- void removeCacheItem(QQuickVisualDataModelItem *cacheItem);
+ void emitDestroyingItem(QObject *item) { emit q_func()->destroyingItem(item); }
+ void removeCacheItem(QQmlDelegateModelItem *cacheItem);
void updateFilterGroup();
@@ -265,41 +265,41 @@ public:
void itemsInserted(
const QVector<Compositor::Insert> &inserts,
- QVarLengthArray<QVector<QQuickChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts,
- QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems = 0);
+ QVarLengthArray<QVector<QQmlChangeSet::Insert>, Compositor::MaximumGroupCount> *translatedInserts,
+ QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = 0);
void itemsInserted(const QVector<Compositor::Insert> &inserts);
void itemsRemoved(
const QVector<Compositor::Remove> &removes,
- QVarLengthArray<QVector<QQuickChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves,
- QHash<int, QList<QQuickVisualDataModelItem *> > *movedItems = 0);
+ QVarLengthArray<QVector<QQmlChangeSet::Remove>, Compositor::MaximumGroupCount> *translatedRemoves,
+ QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = 0);
void itemsRemoved(const QVector<Compositor::Remove> &removes);
void itemsMoved(
const QVector<Compositor::Remove> &removes, const QVector<Compositor::Insert> &inserts);
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 QQuickChangeSet &changeSet, bool reset);
+ void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset);
bool insert(Compositor::insert_iterator &before, const v8::Local<v8::Object> &object, int groups);
- 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);
+ static void group_append(QQmlListProperty<QQmlDataGroup> *property, QQmlDataGroup *group);
+ static int group_count(QQmlListProperty<QQmlDataGroup> *property);
+ static QQmlDataGroup *group_at(QQmlListProperty<QQmlDataGroup> *property, int index);
- void releaseIncubator(QVDMIncubationTask *incubationTask);
- void incubatorStatusChanged(QVDMIncubationTask *incubationTask, QQmlIncubator::Status status);
- void setInitialState(QVDMIncubationTask *incubationTask, QObject *o);
+ void releaseIncubator(QQDMIncubationTask *incubationTask);
+ void incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status);
+ void setInitialState(QQDMIncubationTask *incubationTask, QObject *o);
- QQuickVisualAdaptorModel m_adaptorModel;
- QQuickListCompositor m_compositor;
+ QQmlAdaptorModel m_adaptorModel;
+ QQmlListCompositor m_compositor;
QQmlComponent *m_delegate;
- QQuickVisualDataModelItemMetaType *m_cacheMetaType;
+ QQmlDelegateModelItemMetaType *m_cacheMetaType;
QQmlContext *m_context;
- QQuickVisualDataModelParts *m_parts;
- QQuickVisualDataGroupEmitterList m_pendingParts;
+ QQmlDelegateModelParts *m_parts;
+ QQmlDataGroupEmitterList m_pendingParts;
- QList<QQuickVisualDataModelItem *> m_cache;
- QList<QVDMIncubationTask *> m_finishedIncubating;
+ QList<QQmlDelegateModelItem *> m_cache;
+ QList<QQDMIncubationTask *> m_finishedIncubating;
QList<QByteArray> m_watchedRoles;
QString m_filterGroup;
@@ -307,7 +307,7 @@ public:
int m_count;
int m_groupCount;
- QQuickListCompositor::Group m_compositorGroup;
+ QQmlListCompositor::Group m_compositorGroup;
bool m_complete : 1;
bool m_delegateValidated : 1;
bool m_reset : 1;
@@ -316,39 +316,39 @@ public:
union {
struct {
- QQuickVisualDataGroup *m_cacheItems;
- QQuickVisualDataGroup *m_items;
- QQuickVisualDataGroup *m_persistedItems;
+ QQmlDataGroup *m_cacheItems;
+ QQmlDataGroup *m_items;
+ QQmlDataGroup *m_persistedItems;
};
- QQuickVisualDataGroup *m_groups[Compositor::MaximumGroupCount];
+ QQmlDataGroup *m_groups[Compositor::MaximumGroupCount];
};
};
-class QQuickVisualPartsModel : public QQuickVisualModel, public QQuickVisualDataGroupEmitter
+class QQmlPartsModel : public QQmlInstanceModel, public QQmlDataGroupEmitter
{
Q_OBJECT
Q_PROPERTY(QString filterOnGroup READ filterGroup WRITE setFilterGroup NOTIFY filterGroupChanged RESET resetFilterGroup)
public:
- QQuickVisualPartsModel(QQuickVisualDataModel *model, const QString &part, QObject *parent = 0);
- ~QQuickVisualPartsModel();
+ QQmlPartsModel(QQmlDelegateModel *model, const QString &part, QObject *parent = 0);
+ ~QQmlPartsModel();
QString filterGroup() const;
void setFilterGroup(const QString &group);
void resetFilterGroup();
void updateFilterGroup();
- void updateFilterGroup(Compositor::Group group, const QQuickChangeSet &changeSet);
+ void updateFilterGroup(Compositor::Group group, const QQmlChangeSet &changeSet);
int count() const;
bool isValid() const;
- QQuickItem *item(int index, bool asynchronous=false);
- ReleaseFlags release(QQuickItem *item);
+ QObject *object(int index, bool asynchronous=false);
+ ReleaseFlags release(QObject *item);
QString stringValue(int index, const QString &role);
QList<QByteArray> watchedRoles() const { return m_watchedRoles; }
void setWatchedRoles(QList<QByteArray> roles);
- int indexOf(QQuickItem *item, QObject *objectContext) const;
+ int indexOf(QObject *item, QObject *objectContext) const;
- void emitModelUpdated(const QQuickChangeSet &changeSet, bool reset);
+ void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset);
void createdPackage(int index, QQuickPackage *package);
void initPackage(int index, QQuickPackage *package);
@@ -358,7 +358,7 @@ Q_SIGNALS:
void filterGroupChanged();
private:
- QQuickVisualDataModel *m_model;
+ QQmlDelegateModel *m_model;
QHash<QObject *, QQuickPackage *> m_packaged;
QString m_part;
QString m_filterGroup;
@@ -369,38 +369,38 @@ private:
class QMetaPropertyBuilder;
-class QQuickVisualDataModelPartsMetaObject : public QQmlOpenMetaObject
+class QQmlDelegateModelPartsMetaObject : public QQmlOpenMetaObject
{
public:
- QQuickVisualDataModelPartsMetaObject(QObject *parent)
+ QQmlDelegateModelPartsMetaObject(QObject *parent)
: QQmlOpenMetaObject(parent) {}
virtual void propertyCreated(int, QMetaPropertyBuilder &);
virtual QVariant initialValue(int);
};
-class QQuickVisualDataModelParts : public QObject
+class QQmlDelegateModelParts : public QObject
{
Q_OBJECT
public:
- QQuickVisualDataModelParts(QQuickVisualDataModel *parent);
+ QQmlDelegateModelParts(QQmlDelegateModel *parent);
- QQuickVisualDataModel *model;
- QList<QQuickVisualPartsModel *> models;
+ QQmlDelegateModel *model;
+ QList<QQmlPartsModel *> models;
};
-class QQuickVisualDataModelAttachedMetaObject : public QAbstractDynamicMetaObject, public QQmlRefCount
+class QQmlDelegateModelAttachedMetaObject : public QAbstractDynamicMetaObject, public QQmlRefCount
{
public:
- QQuickVisualDataModelAttachedMetaObject(
- QQuickVisualDataModelItemMetaType *metaType, QMetaObject *metaObject);
- ~QQuickVisualDataModelAttachedMetaObject();
+ QQmlDelegateModelAttachedMetaObject(
+ QQmlDelegateModelItemMetaType *metaType, QMetaObject *metaObject);
+ ~QQmlDelegateModelAttachedMetaObject();
void objectDestroyed(QObject *);
int metaCall(QObject *, QMetaObject::Call, int _id, void **);
private:
- QQuickVisualDataModelItemMetaType * const metaType;
+ QQmlDelegateModelItemMetaType * const metaType;
QMetaObject * const metaObject;
const int memberPropertyOffset;
const int indexPropertyOffset;
diff --git a/src/quick/items/qquickvisualitemmodel.cpp b/src/qml/items/qqmlobjectmodel.cpp
index bdc489e2cf..913fa79719 100644
--- a/src/quick/items/qquickvisualitemmodel.cpp
+++ b/src/qml/items/qqmlobjectmodel.cpp
@@ -39,14 +39,13 @@
**
****************************************************************************/
-#include "qquickvisualitemmodel_p.h"
-#include "qquickitem.h"
+#include "qqmlobjectmodel_p.h"
#include <QtCore/qcoreapplication.h>
#include <QtQml/qqmlcontext.h>
#include <QtQml/qqmlengine.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmlchangeset_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qobject_p.h>
@@ -55,69 +54,69 @@
QT_BEGIN_NAMESPACE
-QHash<QObject*, QQuickVisualItemModelAttached*> QQuickVisualItemModelAttached::attachedProperties;
+QHash<QObject*, QQmlObjectModelAttached*> QQmlObjectModelAttached::attachedProperties;
-class QQuickVisualItemModelPrivate : public QObjectPrivate
+class QQmlObjectModelPrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QQuickVisualItemModel)
+ Q_DECLARE_PUBLIC(QQmlObjectModel)
public:
class Item {
public:
- Item(QQuickItem *i) : item(i), ref(0) {}
+ Item(QObject *i) : item(i), ref(0) {}
void addRef() { ++ref; }
bool deref() { return --ref == 0; }
- QQuickItem *item;
+ QObject *item;
int ref;
};
- QQuickVisualItemModelPrivate() : QObjectPrivate() {}
+ QQmlObjectModelPrivate() : QObjectPrivate() {}
- static void children_append(QQmlListProperty<QQuickItem> *prop, QQuickItem *item) {
- static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children.append(Item(item));
- static_cast<QQuickVisualItemModelPrivate *>(prop->data)->itemAppended();
- static_cast<QQuickVisualItemModelPrivate *>(prop->data)->emitChildrenChanged();
+ static void children_append(QQmlListProperty<QObject> *prop, QObject *item) {
+ static_cast<QQmlObjectModelPrivate *>(prop->data)->children.append(Item(item));
+ static_cast<QQmlObjectModelPrivate *>(prop->data)->itemAppended();
+ static_cast<QQmlObjectModelPrivate *>(prop->data)->emitChildrenChanged();
}
- static int children_count(QQmlListProperty<QQuickItem> *prop) {
- return static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children.count();
+ static int children_count(QQmlListProperty<QObject> *prop) {
+ return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count();
}
- static QQuickItem *children_at(QQmlListProperty<QQuickItem> *prop, int index) {
- return static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children.at(index).item;
+ static QObject *children_at(QQmlListProperty<QObject> *prop, int index) {
+ return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.at(index).item;
}
- static void children_clear(QQmlListProperty<QQuickItem> *prop) {
- static_cast<QQuickVisualItemModelPrivate *>(prop->data)->itemCleared(static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children);
- static_cast<QQuickVisualItemModelPrivate *>(prop->data)->children.clear();
- static_cast<QQuickVisualItemModelPrivate *>(prop->data)->emitChildrenChanged();
+ static void children_clear(QQmlListProperty<QObject> *prop) {
+ static_cast<QQmlObjectModelPrivate *>(prop->data)->itemCleared(static_cast<QQmlObjectModelPrivate *>(prop->data)->children);
+ static_cast<QQmlObjectModelPrivate *>(prop->data)->children.clear();
+ static_cast<QQmlObjectModelPrivate *>(prop->data)->emitChildrenChanged();
}
void itemAppended() {
- Q_Q(QQuickVisualItemModel);
- QQuickVisualItemModelAttached *attached = QQuickVisualItemModelAttached::properties(children.last().item);
+ Q_Q(QQmlObjectModel);
+ QQmlObjectModelAttached *attached = QQmlObjectModelAttached::properties(children.last().item);
attached->setIndex(children.count()-1);
- QQuickChangeSet changeSet;
+ QQmlChangeSet changeSet;
changeSet.insert(children.count() - 1, 1);
emit q->modelUpdated(changeSet, false);
emit q->countChanged();
}
void itemCleared(const QList<Item> &children) {
- Q_Q(QQuickVisualItemModel);
+ Q_Q(QQmlObjectModel);
foreach (const Item &child, children)
emit q->destroyingItem(child.item);
emit q->countChanged();
}
void emitChildrenChanged() {
- Q_Q(QQuickVisualItemModel);
+ Q_Q(QQmlObjectModel);
emit q->childrenChanged();
}
- int indexOf(QQuickItem *item) const {
+ int indexOf(QObject *item) const {
for (int i = 0; i < children.count(); ++i)
if (children.at(i).item == item)
return i;
@@ -131,7 +130,7 @@ public:
/*!
\qmltype VisualItemModel
- \instantiates QQuickVisualItemModel
+ \instantiates QQmlObjectModel
\inqmlmodule QtQuick 2
\ingroup qtquick-models
\brief Defines items to be used added to a view
@@ -167,8 +166,8 @@ public:
\sa {quick/modelviews/visualitemmodel}{VisualItemModel example}
*/
-QQuickVisualItemModel::QQuickVisualItemModel(QObject *parent)
- : QQuickVisualModel(*(new QQuickVisualItemModelPrivate), parent)
+QQmlObjectModel::QQmlObjectModel(QObject *parent)
+ : QQmlInstanceModel(*(new QQmlObjectModelPrivate), parent)
{
}
@@ -179,10 +178,10 @@ QQuickVisualItemModel::QQuickVisualItemModel(QObject *parent)
It is attached to each instance of the delegate.
*/
-QQmlListProperty<QQuickItem> QQuickVisualItemModel::children()
+QQmlListProperty<QObject> QQmlObjectModel::children()
{
- Q_D(QQuickVisualItemModel);
- return QQmlListProperty<QQuickItem>(this,
+ Q_D(QQmlObjectModel);
+ return QQmlListProperty<QObject>(this,
d,
d->children_append,
d->children_count,
@@ -195,21 +194,21 @@ QQmlListProperty<QQuickItem> QQuickVisualItemModel::children()
The number of items in the model. This property is readonly.
*/
-int QQuickVisualItemModel::count() const
+int QQmlObjectModel::count() const
{
- Q_D(const QQuickVisualItemModel);
+ Q_D(const QQmlObjectModel);
return d->children.count();
}
-bool QQuickVisualItemModel::isValid() const
+bool QQmlObjectModel::isValid() const
{
return true;
}
-QQuickItem *QQuickVisualItemModel::item(int index, bool)
+QObject *QQmlObjectModel::object(int index, bool)
{
- Q_D(QQuickVisualItemModel);
- QQuickVisualItemModelPrivate::Item &item = d->children[index];
+ Q_D(QQmlObjectModel);
+ QQmlObjectModelPrivate::Item &item = d->children[index];
item.addRef();
if (item.ref == 1) {
emit initItem(index, item.item);
@@ -218,38 +217,34 @@ QQuickItem *QQuickVisualItemModel::item(int index, bool)
return item.item;
}
-QQuickVisualModel::ReleaseFlags QQuickVisualItemModel::release(QQuickItem *item)
+QQmlInstanceModel::ReleaseFlags QQmlObjectModel::release(QObject *item)
{
- Q_D(QQuickVisualItemModel);
+ Q_D(QQmlObjectModel);
int idx = d->indexOf(item);
if (idx >= 0) {
- if (d->children[idx].deref()) {
- // XXX todo - the original did item->scene()->removeItem(). Why?
- item->setParentItem(0);
- } else {
- return QQuickVisualModel::Referenced;
- }
+ if (!d->children[idx].deref())
+ return QQmlInstanceModel::Referenced;
}
return 0;
}
-QString QQuickVisualItemModel::stringValue(int index, const QString &name)
+QString QQmlObjectModel::stringValue(int index, const QString &name)
{
- Q_D(QQuickVisualItemModel);
+ Q_D(QQmlObjectModel);
if (index < 0 || index >= d->children.count())
return QString();
return QQmlEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString();
}
-int QQuickVisualItemModel::indexOf(QQuickItem *item, QObject *) const
+int QQmlObjectModel::indexOf(QObject *item, QObject *) const
{
- Q_D(const QQuickVisualItemModel);
+ Q_D(const QQmlObjectModel);
return d->indexOf(item);
}
-QQuickVisualItemModelAttached *QQuickVisualItemModel::qmlAttachedProperties(QObject *obj)
+QQmlObjectModelAttached *QQmlObjectModel::qmlAttachedProperties(QObject *obj)
{
- return QQuickVisualItemModelAttached::properties(obj);
+ return QQmlObjectModelAttached::properties(obj);
}
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickvisualitemmodel_p.h b/src/qml/items/qqmlobjectmodel_p.h
index a5d50f9d38..59a4a551a7 100644
--- a/src/quick/items/qquickvisualitemmodel_p.h
+++ b/src/qml/items/qqmlobjectmodel_p.h
@@ -39,99 +39,97 @@
**
****************************************************************************/
-#ifndef QQUICKVISUALITEMMODEL_P_H
-#define QQUICKVISUALITEMMODEL_P_H
+#ifndef QQMLINSTANCEMODEL_P_H
+#define QQMLINSTANCEMODEL_P_H
-#include <private/qtquickglobal_p.h>
+#include <private/qtqmlglobal_p.h>
#include <QtQml/qqml.h>
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-class QQuickItem;
-class QQuickChangeSet;
+class QObject;
+class QQmlChangeSet;
-class Q_QUICK_PRIVATE_EXPORT QQuickVisualModel : public QObject
+class Q_QML_PRIVATE_EXPORT QQmlInstanceModel : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
- virtual ~QQuickVisualModel() {}
+ virtual ~QQmlInstanceModel() {}
enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 };
Q_DECLARE_FLAGS(ReleaseFlags, ReleaseFlag)
virtual int count() const = 0;
virtual bool isValid() const = 0;
- virtual QQuickItem *item(int index, bool asynchronous=false) = 0;
- virtual ReleaseFlags release(QQuickItem *item) = 0;
+ virtual QObject *object(int index, bool asynchronous=false) = 0;
+ virtual ReleaseFlags release(QObject *object) = 0;
virtual void cancel(int) {}
virtual QString stringValue(int, const QString &) = 0;
virtual void setWatchedRoles(QList<QByteArray> roles) = 0;
- virtual int indexOf(QQuickItem *item, QObject *objectContext) const = 0;
+ virtual int indexOf(QObject *object, QObject *objectContext) const = 0;
Q_SIGNALS:
void countChanged();
- void modelUpdated(const QQuickChangeSet &changeSet, bool reset);
- void createdItem(int index, QQuickItem *item);
- void initItem(int index, QQuickItem *item);
- void destroyingItem(QQuickItem *item);
+ void modelUpdated(const QQmlChangeSet &changeSet, bool reset);
+ void createdItem(int index, QObject *object);
+ void initItem(int index, QObject *object);
+ void destroyingItem(QObject *object);
protected:
- QQuickVisualModel(QObjectPrivate &dd, QObject *parent = 0)
+ QQmlInstanceModel(QObjectPrivate &dd, QObject *parent = 0)
: QObject(dd, parent) {}
private:
- Q_DISABLE_COPY(QQuickVisualModel)
+ Q_DISABLE_COPY(QQmlInstanceModel)
};
-class QQuickVisualItemModelAttached;
-class QQuickVisualItemModelPrivate;
-class Q_QUICK_PRIVATE_EXPORT QQuickVisualItemModel : public QQuickVisualModel
+class QQmlObjectModelAttached;
+class QQmlObjectModelPrivate;
+class Q_QML_PRIVATE_EXPORT QQmlObjectModel : public QQmlInstanceModel
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QQuickVisualItemModel)
+ Q_DECLARE_PRIVATE(QQmlObjectModel)
- Q_PROPERTY(QQmlListProperty<QQuickItem> children READ children NOTIFY childrenChanged DESIGNABLE false)
+ Q_PROPERTY(QQmlListProperty<QObject> children READ children NOTIFY childrenChanged DESIGNABLE false)
Q_CLASSINFO("DefaultProperty", "children")
public:
- QQuickVisualItemModel(QObject *parent=0);
- virtual ~QQuickVisualItemModel() {}
+ QQmlObjectModel(QObject *parent=0);
+ virtual ~QQmlObjectModel() {}
virtual int count() const;
virtual bool isValid() const;
- virtual QQuickItem *item(int index, bool asynchronous=false);
- virtual ReleaseFlags release(QQuickItem *item);
+ virtual QObject *object(int index, bool asynchronous=false);
+ virtual ReleaseFlags release(QObject *object);
virtual QString stringValue(int index, const QString &role);
virtual void setWatchedRoles(QList<QByteArray>) {}
- virtual int indexOf(QQuickItem *item, QObject *objectContext) const;
+ virtual int indexOf(QObject *object, QObject *objectContext) const;
- QQmlListProperty<QQuickItem> children();
+ QQmlListProperty<QObject> children();
- static QQuickVisualItemModelAttached *qmlAttachedProperties(QObject *obj);
+ static QQmlObjectModelAttached *qmlAttachedProperties(QObject *obj);
Q_SIGNALS:
void childrenChanged();
private:
- Q_DISABLE_COPY(QQuickVisualItemModel)
+ Q_DISABLE_COPY(QQmlObjectModel)
};
-class QQuickVisualItemModelAttached : public QObject
+class QQmlObjectModelAttached : public QObject
{
Q_OBJECT
public:
- QQuickVisualItemModelAttached(QObject *parent)
+ QQmlObjectModelAttached(QObject *parent)
: QObject(parent), m_index(0) {}
- ~QQuickVisualItemModelAttached() {
+ ~QQmlObjectModelAttached() {
attachedProperties.remove(parent());
}
@@ -144,10 +142,10 @@ public:
}
}
- static QQuickVisualItemModelAttached *properties(QObject *obj) {
- QQuickVisualItemModelAttached *rv = attachedProperties.value(obj);
+ static QQmlObjectModelAttached *properties(QObject *obj) {
+ QQmlObjectModelAttached *rv = attachedProperties.value(obj);
if (!rv) {
- rv = new QQuickVisualItemModelAttached(obj);
+ rv = new QQmlObjectModelAttached(obj);
attachedProperties.insert(obj, rv);
}
return rv;
@@ -159,16 +157,14 @@ Q_SIGNALS:
public:
int m_index;
- static QHash<QObject*, QQuickVisualItemModelAttached*> attachedProperties;
+ static QHash<QObject*, QQmlObjectModelAttached*> attachedProperties;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickVisualModel)
-QML_DECLARE_TYPE(QQuickVisualItemModel)
-QML_DECLARE_TYPEINFO(QQuickVisualItemModel, QML_HAS_ATTACHED_PROPERTIES)
-
-QT_END_HEADER
+QML_DECLARE_TYPE(QQmlInstanceModel)
+QML_DECLARE_TYPE(QQmlObjectModel)
+QML_DECLARE_TYPEINFO(QQmlObjectModel, QML_HAS_ATTACHED_PROPERTIES)
-#endif // QQUICKVISUALITEMMODEL_P_H
+#endif // QQMLINSTANCEMODEL_P_H
diff --git a/src/quick/util/qquickpackage.cpp b/src/qml/items/qquickpackage.cpp
index e885524b27..e885524b27 100644
--- a/src/quick/util/qquickpackage.cpp
+++ b/src/qml/items/qquickpackage.cpp
diff --git a/src/quick/util/qquickpackage_p.h b/src/qml/items/qquickpackage_p.h
index a777ff4a7e..9427c886a8 100644
--- a/src/quick/util/qquickpackage_p.h
+++ b/src/qml/items/qquickpackage_p.h
@@ -44,8 +44,6 @@
#include <qqml.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickPackagePrivate;
@@ -91,6 +89,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickPackage)
QML_DECLARE_TYPEINFO(QQuickPackage, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
-
#endif // QQUICKPACKAGE_H
diff --git a/src/qml/qml.pro b/src/qml/qml.pro
index 4f55b83e14..08aa369ac3 100644
--- a/src/qml/qml.pro
+++ b/src/qml/qml.pro
@@ -25,3 +25,4 @@ include(util/util.pri)
include(qml/qml.pri)
include(debugger/debugger.pri)
include(animations/animations.pri)
+include(items/items.pri)
diff --git a/src/qml/qml/ftw/qqmlrefcount_p.h b/src/qml/qml/ftw/qqmlrefcount_p.h
index 0bc3ea038a..24c3e7a2cc 100644
--- a/src/qml/qml/ftw/qqmlrefcount_p.h
+++ b/src/qml/qml/ftw/qqmlrefcount_p.h
@@ -56,8 +56,6 @@
#include <QtCore/qglobal.h>
#include <QtCore/qatomic.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -193,6 +191,4 @@ QQmlRefPointer<T> &QQmlRefPointer<T>::take(T *other)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLREFCOUNT_P_H
diff --git a/src/qml/qml/parser/qqmljs.g b/src/qml/qml/parser/qqmljs.g
index df891da992..b4307909ea 100644
--- a/src/qml/qml/parser/qqmljs.g
+++ b/src/qml/qml/parser/qqmljs.g
@@ -24,7 +24,7 @@
%parser QQmlJSGrammar
%decl qqmljsparser_p.h
%impl qqmljsparser.cpp
-%expect 2
+%expect 5
%expect-rr 2
%token T_AND "&" T_AND_AND "&&" T_AND_EQ "&="
@@ -67,6 +67,8 @@
%token T_IMPORT "import"
%token T_AS "as"
%token T_ON "on"
+%token T_GET "get"
+%token T_SET "set"
%token T_ERROR
@@ -79,7 +81,7 @@
%token T_FEED_JS_PROGRAM
%nonassoc SHIFT_THERE
-%nonassoc T_IDENTIFIER T_COLON T_SIGNAL T_PROPERTY T_READONLY
+%nonassoc T_IDENTIFIER T_COLON T_SIGNAL T_PROPERTY T_READONLY T_ON T_SET T_GET
%nonassoc REDUCE_HERE
%start TopLevel
@@ -240,7 +242,8 @@ public:
AST::FunctionDeclaration *FunctionDeclaration;
AST::Node *Node;
AST::PropertyName *PropertyName;
- AST::PropertyNameAndValueList *PropertyNameAndValueList;
+ AST::PropertyAssignment *PropertyAssignment;
+ AST::PropertyAssignmentList *PropertyAssignmentList;
AST::SourceElement *SourceElement;
AST::SourceElements *SourceElements;
AST::Statement *Statement;
@@ -1043,6 +1046,8 @@ JsIdentifier: T_PROPERTY ;
JsIdentifier: T_SIGNAL ;
JsIdentifier: T_READONLY ;
JsIdentifier: T_ON ;
+JsIdentifier: T_GET ;
+JsIdentifier: T_SET ;
--------------------------------------------------------------------------------------------------------
-- Expressions
@@ -1219,13 +1224,13 @@ case $rule_number: {
-- } break;
-- ./
-PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ;
+PrimaryExpression: T_LBRACE PropertyAssignmentListOpt T_RBRACE ;
/.
case $rule_number: {
AST::ObjectLiteral *node = 0;
if (sym(2).Node)
node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyNameAndValueList->finish ());
+ sym(2).PropertyAssignmentList->finish ());
else
node = new (pool) AST::ObjectLiteral();
node->lbraceToken = loc(1);
@@ -1234,11 +1239,11 @@ case $rule_number: {
} break;
./
-PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ;
+PrimaryExpression: T_LBRACE PropertyAssignmentList T_COMMA T_RBRACE ;
/.
case $rule_number: {
AST::ObjectLiteral *node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyNameAndValueList->finish ());
+ sym(2).PropertyAssignmentList->finish ());
node->lbraceToken = loc(1);
node->rbraceToken = loc(4);
sym(1).Node = node;
@@ -1330,40 +1335,62 @@ case $rule_number: {
} break;
./
-PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ;
+PropertyAssignment: PropertyName T_COLON AssignmentExpression ;
/.
case $rule_number: {
- AST::PropertyNameAndValueList *node = new (pool) AST::PropertyNameAndValueList(
+ AST::PropertyNameAndValue *node = new (pool) AST::PropertyNameAndValue(
sym(1).PropertyName, sym(3).Expression);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
./
-PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ;
+PropertyAssignment: T_GET PropertyName T_LPAREN T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
/.
case $rule_number: {
- AST::PropertyNameAndValueList *node = new (pool) AST::PropertyNameAndValueList(
- sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
- node->commaToken = loc(2);
- node->colonToken = loc(4);
+ AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
+ sym(2).PropertyName, sym(6).FunctionBody);
+ node->getSetToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(4);
+ node->lbraceToken = loc(5);
+ node->rbraceToken = loc(7);
sym(1).Node = node;
} break;
./
-PropertyName: T_IDENTIFIER %prec SHIFT_THERE ;
+PropertyAssignment: T_SET PropertyName T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
/.
case $rule_number: {
- AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
+ AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
+ sym(2).PropertyName, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->getSetToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
sym(1).Node = node;
} break;
./
-PropertyName: T_SIGNAL ;
-/.case $rule_number:./
+PropertyAssignmentList: PropertyAssignment ;
+/.
+case $rule_number: {
+ sym(1).Node = new (pool) AST::PropertyAssignmentList(sym(1).PropertyAssignment);
+} break;
+./
+
+PropertyAssignmentList: PropertyAssignmentList T_COMMA PropertyAssignment ;
+/.
+case $rule_number: {
+ AST::PropertyAssignmentList *node = new (pool) AST::PropertyAssignmentList(
+ sym(1).PropertyAssignmentList, sym(3).PropertyAssignment);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
-PropertyName: T_PROPERTY ;
+PropertyName: JsIdentifier %prec SHIFT_THERE ;
/.
case $rule_number: {
AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
@@ -2669,20 +2696,7 @@ case $rule_number: {
} break;
./
-LabelledStatement: T_SIGNAL T_COLON Statement ;
-/.case $rule_number:./
-
-LabelledStatement: T_PROPERTY T_COLON Statement ;
-/.
-case $rule_number: {
- AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement);
- node->identifierToken = loc(1);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-LabelledStatement: T_IDENTIFIER T_COLON Statement ;
+LabelledStatement: JsIdentifier T_COLON Statement ;
/.
case $rule_number: {
AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement);
@@ -2762,7 +2776,12 @@ case $rule_number: {
} break;
./
-FunctionDeclaration: T_FUNCTION JsIdentifier T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+-- tell the parser to prefer function declarations to function expressions.
+-- That is, the `Function' symbol is used to mark the start of a function
+-- declaration.
+Function: T_FUNCTION %prec REDUCE_HERE ;
+
+FunctionDeclaration: Function JsIdentifier T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
/.
case $rule_number: {
AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
@@ -2776,7 +2795,7 @@ case $rule_number: {
} break;
./
-FunctionExpression: T_FUNCTION IdentifierOpt T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+FunctionExpression: T_FUNCTION JsIdentifier T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
/.
case $rule_number: {
AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
@@ -2791,6 +2810,19 @@ case $rule_number: {
} break;
./
+FunctionExpression: T_FUNCTION T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).FunctionBody);
+ node->functionToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ node->lbraceToken = loc(5);
+ node->rbraceToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
FormalParameterList: JsIdentifier ;
/.
case $rule_number: {
@@ -2877,23 +2909,14 @@ case $rule_number: {
} break;
./
-IdentifierOpt: ;
-/.
-case $rule_number: {
- stringRef(1) = QStringRef();
-} break;
-./
-
-IdentifierOpt: JsIdentifier ;
-
-PropertyNameAndValueListOpt: ;
+PropertyAssignmentListOpt: ;
/.
case $rule_number: {
sym(1).Node = 0;
} break;
./
-PropertyNameAndValueListOpt: PropertyNameAndValueList ;
+PropertyAssignmentListOpt: PropertyAssignmentList ;
/.
} // switch
diff --git a/src/qml/qml/parser/qqmljsast.cpp b/src/qml/qml/parser/qqmljsast.cpp
index 6b5ef15352..ea0df4a537 100644
--- a/src/qml/qml/parser/qqmljsast.cpp
+++ b/src/qml/qml/parser/qqmljsast.cpp
@@ -213,12 +213,32 @@ void Elision::accept0(Visitor *visitor)
visitor->endVisit(this);
}
-void PropertyNameAndValueList::accept0(Visitor *visitor)
+void PropertyNameAndValue::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
- for (PropertyNameAndValueList *it = this; it; it = it->next) {
- accept(it->name, visitor);
- accept(it->value, visitor);
+ accept(name, visitor);
+ accept(value, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PropertyGetterSetter::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(name, visitor);
+ accept(formals, visitor);
+ accept(functionBody, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PropertyAssignmentList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (PropertyAssignmentList *it = this; it; it = it->next) {
+ accept(it->assignment, visitor);
}
}
diff --git a/src/qml/qml/parser/qqmljsast_p.h b/src/qml/qml/parser/qqmljsast_p.h
index 65a598c783..4c4af9ce9c 100644
--- a/src/qml/qml/parser/qqmljsast_p.h
+++ b/src/qml/qml/parser/qqmljsast_p.h
@@ -176,8 +176,10 @@ public:
Kind_PreDecrementExpression,
Kind_PreIncrementExpression,
Kind_Program,
+ Kind_PropertyAssignmentList,
+ Kind_PropertyGetterSetter,
Kind_PropertyName,
- Kind_PropertyNameAndValueList,
+ Kind_PropertyNameAndValue,
Kind_RegExpLiteral,
Kind_ReturnStatement,
Kind_SourceElement,
@@ -487,7 +489,7 @@ public:
ObjectLiteral():
properties (0) { kind = K; }
- ObjectLiteral(PropertyNameAndValueList *plist):
+ ObjectLiteral(PropertyAssignmentList *plist):
properties (plist) { kind = K; }
virtual void accept0(Visitor *visitor);
@@ -499,7 +501,7 @@ public:
{ return rbraceToken; }
// attributes
- PropertyNameAndValueList *properties;
+ PropertyAssignmentList *properties;
SourceLocation lbraceToken;
SourceLocation rbraceToken;
};
@@ -603,50 +605,113 @@ public:
SourceLocation propertyNameToken;
};
-class QML_PARSER_EXPORT PropertyNameAndValueList: public Node
+class QML_PARSER_EXPORT PropertyAssignment: public Node
{
public:
- QQMLJS_DECLARE_AST_NODE(PropertyNameAndValueList)
+ PropertyAssignment() {}
+};
- PropertyNameAndValueList(PropertyName *n, ExpressionNode *v):
- name (n), value (v), next (this)
- { kind = K; }
+class QML_PARSER_EXPORT PropertyAssignmentList: public Node
+{
+public:
+ QQMLJS_DECLARE_AST_NODE(PropertyAssignmentList)
- PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v):
- name (n), value (v)
+ PropertyAssignmentList(PropertyAssignment *assignment)
+ : assignment(assignment)
+ , next(this)
+ { kind = K; }
+
+ PropertyAssignmentList(PropertyAssignmentList *previous, PropertyAssignment *assignment)
+ : assignment(assignment)
{
kind = K;
next = previous->next;
previous->next = this;
}
+ inline PropertyAssignmentList *finish ()
+ {
+ PropertyAssignmentList *front = next;
+ next = 0;
+ return front;
+ }
+
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
- { return name->firstSourceLocation(); }
+ { return assignment->firstSourceLocation(); }
virtual SourceLocation lastSourceLocation() const
- {
- if (next)
- return next->lastSourceLocation();
- return value->lastSourceLocation();
- }
+ { return next ? next->lastSourceLocation() : assignment->lastSourceLocation(); }
- inline PropertyNameAndValueList *finish ()
- {
- PropertyNameAndValueList *front = next;
- next = 0;
- return front;
- }
+// attributes
+ PropertyAssignment *assignment;
+ PropertyAssignmentList *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT PropertyNameAndValue: public PropertyAssignment
+{
+public:
+ QQMLJS_DECLARE_AST_NODE(PropertyNameAndValue)
+
+ PropertyNameAndValue(PropertyName *n, ExpressionNode *v)
+ : name(n), value(v)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return name->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return value->lastSourceLocation(); }
// attributes
PropertyName *name;
- ExpressionNode *value;
- PropertyNameAndValueList *next;
SourceLocation colonToken;
+ ExpressionNode *value;
SourceLocation commaToken;
};
+class QML_PARSER_EXPORT PropertyGetterSetter: public PropertyAssignment
+{
+public:
+ QQMLJS_DECLARE_AST_NODE(PropertyGetterSetter)
+
+ enum Type {
+ Getter,
+ Setter
+ };
+
+ PropertyGetterSetter(PropertyName *n, FunctionBody *b)
+ : type(Getter), name(n), formals(0), functionBody (b)
+ { kind = K; }
+
+ PropertyGetterSetter(PropertyName *n, FormalParameterList *f, FunctionBody *b)
+ : type(Setter), name(n), formals(f), functionBody (b)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return getSetToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
+// attributes
+ Type type;
+ SourceLocation getSetToken;
+ PropertyName *name;
+ SourceLocation lparenToken;
+ FormalParameterList *formals;
+ SourceLocation rparenToken;
+ SourceLocation lbraceToken;
+ FunctionBody *functionBody;
+ SourceLocation rbraceToken;
+};
+
class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName
{
public:
diff --git a/src/qml/qml/parser/qqmljsastfwd_p.h b/src/qml/qml/parser/qqmljsastfwd_p.h
index 67868234b2..fe5572c4b2 100644
--- a/src/qml/qml/parser/qqmljsastfwd_p.h
+++ b/src/qml/qml/parser/qqmljsastfwd_p.h
@@ -98,7 +98,9 @@ class ArrayLiteral;
class ObjectLiteral;
class ElementList;
class Elision;
-class PropertyNameAndValueList;
+class PropertyAssignmentList;
+class PropertyGetterSetter;
+class PropertyNameAndValue;
class PropertyName;
class IdentifierPropertyName;
class StringLiteralPropertyName;
diff --git a/src/qml/qml/parser/qqmljsastvisitor_p.h b/src/qml/qml/parser/qqmljsastvisitor_p.h
index 32f94bd436..ef022f617c 100644
--- a/src/qml/qml/parser/qqmljsastvisitor_p.h
+++ b/src/qml/qml/parser/qqmljsastvisitor_p.h
@@ -137,8 +137,14 @@ public:
virtual bool visit(Elision *) { return true; }
virtual void endVisit(Elision *) {}
- virtual bool visit(PropertyNameAndValueList *) { return true; }
- virtual void endVisit(PropertyNameAndValueList *) {}
+ virtual bool visit(PropertyAssignmentList *) { return true; }
+ virtual void endVisit(PropertyAssignmentList *) {}
+
+ virtual bool visit(PropertyNameAndValue *) { return true; }
+ virtual void endVisit(PropertyNameAndValue *) {}
+
+ virtual bool visit(PropertyGetterSetter *) { return true; }
+ virtual void endVisit(PropertyGetterSetter *) {}
virtual bool visit(NestedExpression *) { return true; }
virtual void endVisit(NestedExpression *) {}
diff --git a/src/qml/qml/parser/qqmljsengine_p.cpp b/src/qml/qml/parser/qqmljsengine_p.cpp
index 8e3903d7e0..9a61a62e3b 100644
--- a/src/qml/qml/parser/qqmljsengine_p.cpp
+++ b/src/qml/qml/parser/qqmljsengine_p.cpp
@@ -50,7 +50,7 @@ QT_QML_BEGIN_NAMESPACE
namespace QQmlJS {
-static int toDigit(char c)
+static inline int toDigit(char c)
{
if ((c >= '0') && (c <= '9'))
return c - '0';
diff --git a/src/qml/qml/parser/qqmljsgrammar.cpp b/src/qml/qml/parser/qqmljsgrammar.cpp
index d1b29be70a..4a5672a796 100644
--- a/src/qml/qml/parser/qqmljsgrammar.cpp
+++ b/src/qml/qml/parser/qqmljsgrammar.cpp
@@ -54,45 +54,46 @@ const char *const QQmlJSGrammar::spell [] = {
")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch",
"this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^",
"^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", 0,
- "public", "import", "as", "on", 0, 0, 0, 0, 0, 0,
- 0, 0, 0};
+ "public", "import", "as", "on", "get", "set", 0, 0, 0, 0,
+ 0, 0, 0, 0, 0};
const short QQmlJSGrammar::lhs [] = {
- 103, 103, 103, 103, 103, 103, 104, 110, 110, 113,
- 113, 115, 114, 114, 114, 114, 114, 114, 114, 114,
- 117, 112, 111, 120, 120, 121, 121, 122, 122, 119,
- 108, 108, 108, 108, 124, 124, 124, 124, 124, 124,
- 124, 108, 132, 132, 132, 133, 133, 134, 134, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 118, 118, 118, 118,
- 118, 137, 137, 137, 137, 137, 137, 137, 137, 137,
- 137, 137, 137, 137, 137, 137, 137, 137, 137, 123,
- 139, 139, 139, 139, 138, 138, 141, 141, 143, 143,
- 143, 143, 143, 143, 144, 144, 144, 144, 144, 144,
- 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
- 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
- 144, 144, 144, 144, 144, 145, 145, 116, 116, 116,
- 116, 116, 148, 148, 149, 149, 149, 149, 147, 147,
- 150, 150, 151, 151, 152, 152, 152, 153, 153, 153,
- 153, 153, 153, 153, 153, 153, 153, 154, 154, 154,
- 154, 155, 155, 155, 156, 156, 156, 156, 157, 157,
- 157, 157, 157, 157, 157, 158, 158, 158, 158, 158,
- 158, 159, 159, 159, 159, 159, 160, 160, 160, 160,
- 160, 161, 161, 162, 162, 163, 163, 164, 164, 165,
- 165, 166, 166, 167, 167, 168, 168, 169, 169, 170,
- 170, 171, 171, 172, 172, 142, 142, 173, 173, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 106, 106, 175, 175, 176, 176, 177, 177, 105,
- 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
- 105, 105, 105, 105, 125, 186, 186, 185, 185, 136,
- 136, 187, 187, 188, 188, 190, 190, 189, 191, 194,
- 192, 192, 195, 193, 193, 126, 127, 127, 128, 128,
- 178, 178, 178, 178, 178, 178, 178, 178, 179, 179,
- 179, 179, 180, 180, 180, 180, 181, 181, 129, 130,
- 196, 196, 199, 199, 197, 197, 200, 198, 182, 182,
- 182, 183, 183, 131, 131, 131, 201, 202, 184, 184,
- 135, 146, 206, 206, 203, 203, 204, 204, 207, 109,
- 109, 208, 208, 107, 107, 205, 205, 140, 140, 209};
+ 105, 105, 105, 105, 105, 105, 106, 112, 112, 115,
+ 115, 117, 116, 116, 116, 116, 116, 116, 116, 116,
+ 119, 114, 113, 122, 122, 123, 123, 124, 124, 121,
+ 110, 110, 110, 110, 126, 126, 126, 126, 126, 126,
+ 126, 110, 134, 134, 134, 135, 135, 136, 136, 110,
+ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
+ 110, 110, 110, 110, 110, 110, 120, 120, 120, 120,
+ 120, 120, 120, 139, 139, 139, 139, 139, 139, 139,
+ 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+ 139, 125, 141, 141, 141, 141, 140, 140, 145, 145,
+ 145, 143, 143, 146, 146, 146, 146, 149, 149, 149,
+ 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+ 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
+ 149, 149, 149, 149, 149, 149, 149, 149, 150, 150,
+ 118, 118, 118, 118, 118, 153, 153, 154, 154, 154,
+ 154, 152, 152, 155, 155, 156, 156, 157, 157, 157,
+ 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
+ 159, 159, 159, 159, 160, 160, 160, 161, 161, 161,
+ 161, 162, 162, 162, 162, 162, 162, 162, 163, 163,
+ 163, 163, 163, 163, 164, 164, 164, 164, 164, 165,
+ 165, 165, 165, 165, 166, 166, 167, 167, 168, 168,
+ 169, 169, 170, 170, 171, 171, 172, 172, 173, 173,
+ 174, 174, 175, 175, 176, 176, 177, 177, 144, 144,
+ 178, 178, 179, 179, 179, 179, 179, 179, 179, 179,
+ 179, 179, 179, 179, 108, 108, 180, 180, 181, 181,
+ 182, 182, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 127, 191, 191,
+ 190, 190, 138, 138, 192, 192, 193, 193, 195, 195,
+ 194, 196, 199, 197, 197, 200, 198, 198, 128, 129,
+ 129, 130, 130, 183, 183, 183, 183, 183, 183, 183,
+ 183, 184, 184, 184, 184, 185, 185, 185, 185, 186,
+ 186, 131, 132, 201, 201, 204, 204, 202, 202, 205,
+ 203, 187, 188, 188, 133, 133, 133, 206, 207, 189,
+ 189, 208, 137, 151, 151, 209, 209, 148, 148, 147,
+ 147, 210, 111, 111, 211, 211, 109, 109, 142, 142,
+ 212};
const short QQmlJSGrammar::rhs [] = {
2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
@@ -103,593 +104,600 @@ const short QQmlJSGrammar::rhs [] = {
6, 3, 3, 7, 7, 4, 4, 5, 5, 5,
6, 6, 10, 6, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 3, 3, 4, 5, 3, 4, 3, 1,
- 1, 2, 3, 4, 1, 2, 3, 5, 1, 1,
+ 1, 1, 1, 2, 3, 3, 4, 5, 3, 4,
+ 3, 1, 1, 2, 3, 4, 1, 2, 3, 7,
+ 8, 1, 3, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 4,
- 3, 5, 1, 2, 4, 4, 4, 3, 0, 1,
- 1, 3, 1, 1, 1, 2, 2, 1, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 1, 3, 3,
- 3, 1, 3, 3, 1, 3, 3, 3, 1, 3,
- 3, 3, 3, 3, 3, 1, 3, 3, 3, 3,
- 3, 1, 3, 3, 3, 3, 1, 3, 3, 3,
- 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 3, 1, 5, 1, 5, 1, 3, 1, 3, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 0, 1, 1, 3, 0, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 3, 1, 2, 0, 1, 3,
- 3, 1, 1, 1, 3, 1, 3, 2, 2, 2,
- 0, 1, 2, 0, 1, 1, 2, 2, 7, 5,
- 7, 7, 7, 5, 9, 10, 7, 8, 2, 2,
- 3, 3, 2, 2, 3, 3, 3, 3, 5, 5,
- 3, 5, 1, 2, 0, 1, 4, 3, 3, 3,
- 3, 3, 3, 3, 3, 4, 5, 2, 2, 2,
- 8, 8, 1, 3, 0, 1, 0, 1, 1, 1,
- 1, 1, 2, 1, 1, 0, 1, 0, 1, 2};
+ 1, 1, 4, 3, 5, 1, 2, 4, 4, 4,
+ 3, 0, 1, 1, 3, 1, 1, 1, 2, 2,
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 3, 3, 3, 1, 3, 3, 1, 3, 3,
+ 3, 1, 3, 3, 3, 3, 3, 3, 1, 3,
+ 3, 3, 3, 3, 1, 3, 3, 3, 3, 1,
+ 3, 3, 3, 3, 1, 3, 1, 3, 1, 3,
+ 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
+ 1, 3, 1, 3, 1, 5, 1, 5, 1, 3,
+ 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 3, 0, 1, 1, 3,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2,
+ 0, 1, 3, 3, 1, 1, 1, 3, 1, 3,
+ 2, 2, 2, 0, 1, 2, 0, 1, 1, 2,
+ 2, 7, 5, 7, 7, 7, 5, 9, 10, 7,
+ 8, 2, 2, 3, 3, 2, 2, 3, 3, 3,
+ 3, 5, 5, 3, 5, 1, 2, 0, 1, 4,
+ 3, 3, 3, 3, 3, 3, 4, 5, 2, 2,
+ 2, 1, 8, 8, 7, 1, 3, 0, 1, 0,
+ 1, 1, 1, 1, 1, 2, 1, 1, 0, 1,
+ 2};
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,
- 80, 81, 76, 346, 67, 348, 0, 0, 0, 0,
- 78, 0, 0, 74, 77, 71, 0, 0, 68, 70,
- 69, 79, 72, 0, 75, 0, 0, 168, 0, 0,
- 155, 174, 157, 156, 0, 0, 0, 170, 171, 169,
- 173, 0, 203, 0, 0, 0, 0, 193, 0, 0,
- 0, 0, 0, 0, 183, 0, 0, 0, 177, 178,
- 176, 181, 185, 184, 182, 180, 195, 194, 196, 0,
- 211, 0, 207, 0, 0, 149, 136, 148, 137, 105,
- 106, 107, 132, 108, 133, 109, 110, 111, 112, 113,
- 114, 115, 116, 117, 118, 119, 120, 121, 134, 122,
- 123, 124, 125, 126, 127, 128, 129, 130, 131, 135,
- 0, 0, 147, 243, 150, 0, 151, 0, 152, 146,
- 0, 239, 232, 230, 237, 238, 236, 235, 241, 234,
- 233, 231, 240, 227, 0, 215, 0, 0, 219, 0,
- 0, 223, 0, 0, 149, 141, 0, 140, 0, 145,
- 159, 0, 347, 335, 336, 0, 333, 0, 334, 0,
- 337, 250, 257, 256, 264, 252, 0, 253, 338, 0,
- 345, 254, 255, 260, 258, 342, 339, 344, 261, 0,
- 272, 0, 0, 0, 0, 346, 67, 0, 348, 68,
- 244, 286, 69, 0, 0, 0, 273, 0, 0, 262,
- 263, 0, 251, 259, 287, 288, 332, 343, 0, 303,
- 304, 305, 306, 0, 299, 300, 301, 302, 329, 330,
- 0, 0, 0, 0, 0, 291, 292, 293, 248, 246,
- 208, 216, 212, 228, 204, 249, 0, 155, 220, 224,
- 197, 186, 0, 0, 205, 0, 0, 0, 0, 198,
- 0, 0, 0, 0, 0, 190, 188, 191, 189, 187,
- 200, 199, 201, 0, 213, 0, 209, 0, 247, 155,
- 0, 229, 244, 245, 0, 244, 0, 0, 295, 0,
- 0, 0, 297, 0, 217, 0, 0, 221, 0, 0,
- 225, 284, 0, 276, 285, 279, 0, 283, 0, 244,
- 277, 0, 244, 0, 0, 296, 0, 0, 0, 298,
- 347, 335, 0, 0, 337, 0, 331, 0, 321, 0,
- 0, 0, 290, 0, 289, 0, 349, 0, 104, 266,
- 269, 0, 105, 272, 108, 133, 110, 111, 76, 115,
- 116, 67, 117, 120, 74, 77, 68, 244, 69, 79,
- 123, 72, 125, 75, 127, 128, 273, 130, 131, 135,
- 0, 97, 0, 0, 99, 103, 101, 88, 100, 102,
- 0, 98, 87, 267, 265, 143, 144, 149, 0, 142,
- 0, 320, 0, 307, 308, 0, 319, 0, 0, 0,
- 310, 315, 313, 316, 0, 0, 314, 315, 0, 311,
- 0, 312, 268, 318, 0, 268, 317, 0, 322, 323,
- 0, 268, 324, 325, 0, 0, 326, 0, 0, 0,
- 327, 328, 161, 160, 0, 0, 0, 294, 0, 0,
- 0, 309, 281, 274, 0, 282, 278, 0, 280, 270,
- 0, 271, 275, 91, 0, 0, 95, 82, 0, 84,
- 93, 0, 85, 94, 96, 86, 92, 83, 0, 89,
- 165, 163, 167, 164, 162, 166, 340, 6, 341, 4,
- 2, 65, 90, 0, 0, 68, 70, 69, 31, 5,
- 0, 66, 0, 45, 44, 43, 0, 0, 58, 0,
- 59, 35, 36, 37, 38, 40, 41, 62, 39, 0,
- 45, 0, 0, 0, 0, 0, 54, 0, 55, 0,
- 0, 26, 0, 0, 63, 27, 0, 30, 28, 24,
- 0, 29, 25, 0, 56, 0, 57, 143, 0, 60,
- 64, 0, 0, 0, 0, 61, 0, 52, 46, 53,
- 47, 0, 0, 0, 0, 49, 0, 50, 51, 48,
- 0, 0, 143, 268, 0, 0, 42, 105, 272, 108,
- 133, 110, 111, 76, 115, 116, 67, 117, 120, 74,
- 77, 68, 244, 69, 79, 123, 72, 125, 75, 127,
- 128, 273, 130, 131, 135, 0, 32, 33, 0, 34,
+ 0, 0, 22, 0, 0, 0, 22, 0, 178, 245,
+ 209, 217, 213, 157, 229, 205, 3, 142, 75, 158,
+ 221, 225, 146, 175, 156, 161, 141, 195, 182, 0,
+ 82, 83, 78, 0, 72, 67, 349, 0, 0, 0,
+ 0, 80, 0, 0, 76, 79, 71, 0, 0, 68,
+ 70, 73, 69, 81, 74, 0, 77, 0, 0, 171,
+ 0, 0, 158, 177, 160, 159, 0, 0, 0, 173,
+ 174, 172, 176, 0, 206, 0, 0, 0, 0, 196,
+ 0, 0, 0, 0, 0, 0, 186, 0, 0, 0,
+ 180, 181, 179, 184, 188, 187, 185, 183, 198, 197,
+ 199, 0, 214, 0, 210, 0, 0, 152, 139, 151,
+ 140, 108, 109, 110, 135, 111, 136, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+ 137, 125, 126, 127, 128, 129, 130, 131, 132, 133,
+ 134, 138, 0, 0, 150, 246, 153, 0, 154, 0,
+ 155, 149, 0, 242, 235, 233, 240, 241, 239, 238,
+ 244, 237, 236, 234, 243, 230, 0, 218, 0, 0,
+ 222, 0, 0, 226, 0, 0, 152, 144, 0, 143,
+ 0, 148, 162, 0, 338, 338, 339, 0, 336, 0,
+ 337, 0, 340, 253, 260, 259, 267, 255, 0, 256,
+ 0, 341, 0, 348, 257, 258, 75, 263, 261, 345,
+ 342, 347, 264, 0, 275, 0, 0, 0, 0, 332,
+ 0, 349, 247, 289, 0, 0, 0, 276, 0, 0,
+ 265, 266, 0, 254, 262, 290, 291, 0, 338, 0,
+ 0, 340, 0, 333, 334, 0, 322, 346, 0, 306,
+ 307, 308, 309, 0, 302, 303, 304, 305, 330, 331,
+ 0, 0, 0, 0, 0, 294, 295, 296, 251, 249,
+ 211, 219, 215, 231, 207, 252, 0, 158, 223, 227,
+ 200, 189, 0, 0, 208, 0, 0, 0, 0, 201,
+ 0, 0, 0, 0, 0, 193, 191, 194, 192, 190,
+ 203, 202, 204, 0, 216, 0, 212, 0, 250, 158,
+ 0, 232, 247, 248, 0, 247, 0, 0, 298, 0,
+ 0, 0, 300, 0, 220, 0, 0, 224, 0, 0,
+ 228, 287, 0, 279, 288, 282, 0, 286, 0, 247,
+ 280, 0, 247, 0, 0, 299, 0, 0, 0, 301,
+ 0, 0, 0, 293, 0, 292, 75, 102, 350, 0,
+ 0, 107, 269, 272, 0, 108, 275, 111, 136, 113,
+ 114, 78, 118, 119, 72, 120, 123, 76, 79, 247,
+ 73, 81, 126, 74, 128, 77, 130, 131, 276, 133,
+ 134, 138, 0, 104, 103, 106, 90, 105, 89, 0,
+ 99, 270, 268, 0, 0, 0, 340, 0, 100, 146,
+ 147, 152, 0, 145, 0, 310, 311, 0, 338, 0,
+ 0, 340, 0, 101, 0, 0, 0, 313, 318, 316,
+ 319, 0, 0, 317, 318, 0, 314, 0, 315, 271,
+ 321, 0, 271, 320, 0, 323, 324, 0, 271, 325,
+ 326, 0, 0, 327, 0, 0, 0, 328, 329, 164,
+ 163, 0, 0, 0, 297, 0, 0, 0, 312, 284,
+ 277, 0, 285, 281, 0, 283, 273, 0, 274, 278,
+ 0, 0, 340, 0, 335, 93, 0, 0, 97, 84,
+ 0, 86, 95, 0, 87, 96, 98, 88, 94, 85,
+ 0, 91, 168, 166, 170, 167, 165, 169, 343, 6,
+ 344, 4, 2, 65, 92, 0, 0, 68, 70, 69,
+ 31, 5, 0, 66, 0, 45, 44, 43, 0, 0,
+ 58, 0, 59, 35, 36, 37, 38, 40, 41, 62,
+ 39, 0, 45, 0, 0, 0, 0, 0, 54, 0,
+ 55, 0, 0, 26, 0, 0, 63, 27, 0, 30,
+ 28, 24, 0, 29, 25, 0, 56, 0, 57, 146,
+ 0, 60, 64, 0, 0, 0, 0, 61, 0, 52,
+ 46, 53, 47, 0, 0, 0, 0, 49, 0, 50,
+ 51, 48, 0, 0, 146, 271, 0, 0, 42, 75,
+ 108, 275, 111, 136, 113, 114, 78, 118, 119, 120,
+ 123, 76, 79, 247, 81, 126, 74, 128, 77, 130,
+ 131, 276, 133, 134, 138, 0, 32, 33, 0, 34,
8, 0, 10, 0, 9, 0, 1, 21, 12, 0,
13, 0, 14, 0, 19, 20, 0, 15, 16, 0,
- 17, 18, 11, 23, 7, 350};
+ 17, 18, 11, 23, 7, 351};
const short QQmlJSGrammar::goto_default [] = {
- 7, 626, 207, 196, 205, 509, 497, 625, 644, 496,
- 624, 622, 627, 22, 623, 18, 508, 550, 540, 547,
- 542, 527, 191, 195, 197, 201, 233, 208, 230, 531,
- 571, 570, 200, 232, 26, 475, 474, 357, 356, 9,
- 355, 358, 107, 17, 145, 24, 13, 144, 19, 25,
- 57, 23, 8, 28, 27, 270, 15, 264, 10, 260,
- 12, 262, 11, 261, 20, 268, 21, 269, 14, 263,
- 259, 300, 412, 265, 266, 202, 193, 192, 204, 203,
- 229, 194, 361, 360, 231, 464, 463, 322, 323, 466,
- 325, 465, 324, 420, 424, 427, 423, 422, 442, 443,
- 185, 199, 181, 184, 198, 206, 0};
+ 7, 636, 211, 198, 209, 521, 509, 635, 654, 508,
+ 634, 632, 637, 22, 633, 18, 520, 562, 552, 559,
+ 554, 539, 193, 197, 199, 204, 234, 212, 231, 543,
+ 583, 582, 203, 233, 26, 487, 486, 359, 358, 9,
+ 357, 360, 202, 480, 361, 109, 17, 147, 24, 13,
+ 146, 19, 25, 59, 23, 8, 28, 27, 280, 15,
+ 274, 10, 270, 12, 272, 11, 271, 20, 278, 21,
+ 279, 14, 273, 269, 310, 414, 275, 276, 205, 195,
+ 194, 208, 207, 230, 196, 364, 363, 232, 471, 470,
+ 332, 333, 473, 335, 472, 334, 427, 431, 434, 430,
+ 429, 449, 450, 200, 186, 201, 210, 0};
const short QQmlJSGrammar::action_index [] = {
- 425, 1471, 2619, 2619, 2718, 1193, 69, 100, 86, -103,
- 97, 62, 60, 236, -103, 278, 93, -103, -103, 609,
- 83, 117, 266, 184, -103, -103, -103, 514, 179, 1471,
- -103, -103, -103, 392, -103, 2421, 1754, 1471, 1471, 1471,
- -103, 1001, 1471, -103, -103, -103, 1471, 1471, -103, -103,
- -103, -103, -103, 1471, -103, 1471, 1471, -103, 1471, 1471,
- 115, 169, -103, -103, 1471, 1471, 1471, -103, -103, -103,
- 152, 1471, 286, 1471, 1471, 1471, 1471, 562, 1471, 1471,
- 1471, 1471, 1471, 1471, 198, 1471, 1471, 1471, 87, 122,
- 138, 212, 197, 183, 227, 265, 562, 504, 472, 1471,
- 79, 1471, 102, 2322, 1471, 1471, -103, -103, -103, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- 132, 1471, -103, -103, 94, 11, -103, 1471, -103, -103,
- 1471, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- -103, -103, -103, -103, 1471, 31, 1471, 1471, 67, 68,
- 1471, -103, 2322, 1471, 1471, -103, 98, -103, 39, -103,
- -103, 61, -103, 296, 66, 30, -103, 376, -103, 35,
- 2619, -103, -103, -103, -103, -103, 237, -103, -103, 21,
- -103, -103, -103, -103, -103, -103, 2619, -103, -103, 513,
- -103, 541, 114, 2718, 36, 422, 59, 42, 2916, 75,
- 1471, -103, 77, 53, 1471, 63, -103, 57, 58, -103,
- -103, 407, -103, -103, -103, -103, -103, -103, 80, -103,
- -103, -103, -103, 82, -103, -103, -103, -103, -103, -103,
- 52, 51, 1471, 96, 200, -103, -103, -103, 1659, -103,
- 76, 44, 46, -103, 298, 73, 48, 736, 78, 95,
- 363, 233, 347, 1471, 303, 1471, 1471, 1471, 1471, 402,
- 1471, 1471, 1471, 1471, 1471, 248, 189, 159, 167, 174,
- 482, 482, 444, 1471, 7, 1471, 64, 1471, -103, 627,
- 1471, -103, 1471, 65, 34, 1471, 54, 2718, -103, 1471,
- 140, 2718, -103, 1471, 74, 1471, 1471, 81, 84, 1471,
- -103, 71, 116, 33, -103, -103, 1471, -103, 313, 1471,
- -103, 70, 1471, 72, 2718, -103, 1471, 234, 2718, -103,
- -16, 324, -42, -12, 2619, -39, -103, 2718, -103, 1471,
- 151, 2718, 12, 2718, -103, 20, 16, -32, -103, -103,
- 2718, -52, 521, -2, 505, 129, 1471, 2718, -5, -35,
- 497, 2, -24, 819, 6, 3, -103, 1567, -103, -1,
- -36, 26, 1471, 47, 22, 1471, 45, 1471, 17, 15,
- 1471, -103, 2520, 49, -103, -103, -103, -103, -103, -103,
- 1471, -103, -103, -103, -103, 322, -103, 1471, -25, -103,
- 2718, -103, 118, -103, -103, 2718, -103, 1471, 112, 8,
- -103, 40, -103, 41, 106, 1471, -103, 38, 32, -103,
- -38, -103, 2718, -103, 104, 2718, -103, 247, -103, -103,
- 99, 2718, -6, -103, -10, -18, -103, 387, 10, 9,
- -103, -103, -103, -103, 1471, 125, 2718, -103, 1471, 127,
- 2718, -103, -13, -103, 187, -103, -103, 1471, -103, -103,
- 398, -103, -103, -103, 110, 2039, -103, -103, 1849, -103,
- -103, 1944, -103, -103, -103, -103, -103, -103, 105, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, 2619, -103,
- -103, -103, 113, -7, 1009, 145, -8, 19, -103, -103,
- 186, -103, 178, -103, -103, -103, 356, 226, -103, 2131,
- -103, -103, -103, -103, -103, -103, -103, -103, -103, 322,
- -26, 364, 205, 43, 316, 206, -103, -3, -103, 1009,
- 107, -103, -11, 827, -103, -103, 1379, -103, -103, -103,
- 1286, -103, -103, 195, -103, 2131, -103, 305, -4, -103,
- -103, 209, 379, 18, 2131, -103, 182, -103, 199, -103,
- 0, -53, 306, 154, 284, -103, 108, -103, -103, -103,
- 2223, 918, 300, 2817, 1754, 5, -103, 549, 139, 636,
- 114, 1471, 2718, 50, 24, 463, 55, -17, 910, 23,
- 56, -103, 1567, -103, 27, 1, 29, 1471, 37, 14,
- 1471, 25, 1471, 4, 13, 126, -103, -103, 28, -103,
- -103, 1100, -103, 267, -41, 714, -103, -103, 121, 301,
- -103, 215, -103, 91, -103, -103, 336, -103, -103, 89,
- -103, -103, -103, -103, -103, -103,
+ 235, 1289, 2663, 2663, 2562, 1005, 64, 90, 103, -105,
+ 88, 94, 79, 173, -105, 302, 69, -105, -105, 724,
+ 65, 135, 195, 239, -105, -105, -105, 367, 278, 1289,
+ -105, -105, -105, 485, -105, -105, 2360, 1772, 1289, 1289,
+ 1289, -105, 817, 1289, -105, -105, -105, 1289, 1289, -105,
+ -105, -105, -105, -105, -105, 1289, -105, 1289, 1289, -105,
+ 1289, 1289, 95, 207, -105, -105, 1289, 1289, 1289, -105,
+ -105, -105, 202, 1289, 300, 1289, 1289, 1289, 1289, 377,
+ 1289, 1289, 1289, 1289, 1289, 1289, 253, 1289, 1289, 1289,
+ 151, 147, 129, 196, 170, 199, 279, 270, 470, 470,
+ 387, 1289, 53, 1289, 80, 2158, 1289, 1289, -105, -105,
+ -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
+ -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
+ -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
+ -105, -105, 128, 1289, -105, -105, 74, 52, -105, 1289,
+ -105, -105, 1289, -105, -105, -105, -105, -105, -105, -105,
+ -105, -105, -105, -105, -105, -105, 1289, 51, 1289, 1289,
+ 77, 66, 1289, -105, 2158, 1289, 1289, -105, 125, -105,
+ 48, -105, -105, 47, 451, 374, 83, 87, -105, 397,
+ -105, 62, 2663, -105, -105, -105, -105, -105, 205, -105,
+ 415, -105, 68, -105, -105, -105, 86, -105, -105, -105,
+ 2663, -105, -105, 622, -105, 576, 102, 2562, 75, 89,
+ 81, 2865, 1289, -105, 70, 1289, 63, -105, 92, 93,
+ -105, -105, 546, -105, -105, -105, -105, 91, 546, 40,
+ 45, 2663, 49, -105, -105, 2562, -105, -105, 106, -105,
+ -105, -105, -105, 121, -105, -105, -105, -105, -105, -105,
+ 42, 44, 1289, 114, 222, -105, -105, -105, 1481, -105,
+ 84, 57, 56, -105, 388, 78, 54, 682, 82, 99,
+ 357, 247, 546, 1289, 295, 1289, 1289, 1289, 1289, 334,
+ 1289, 1289, 1289, 1289, 1289, 203, 217, 244, 263, 211,
+ 341, 319, 351, 1289, 56, 1289, 73, 1289, -105, 724,
+ 1289, -105, 1289, 67, 46, 1289, 61, 2562, -105, 1289,
+ 136, 2562, -105, 1289, 76, 1289, 1289, 85, 59, 1289,
+ -105, 71, 133, 72, -105, -105, 1289, -105, 546, 1289,
+ -105, -53, 1289, -60, 2562, -105, 1289, 143, 2562, -105,
+ 1289, 132, 2562, 8, 2562, -105, 7, -105, 12, -37,
+ 107, -105, -105, 2562, -33, 622, 22, 555, 115, 1289,
+ 2562, 23, -13, 502, 2259, -10, 817, 18, 6, 1387,
+ 2259, 0, 9, -6, 1289, -4, -23, 1289, 5, 1289,
+ -25, -27, 2461, -105, -105, -105, -105, -105, -105, 1289,
+ -105, -105, -105, -3, -1, 21, 2663, 1, -105, 218,
+ -105, 1289, 4, -105, 111, -105, -105, 26, 466, 16,
+ 38, 2663, 39, -105, 1289, 110, 37, -105, 55, -105,
+ 60, 116, 1289, -105, 58, 43, -105, -15, -105, 2562,
+ -105, 123, 2562, -105, 154, -105, -105, 96, 2562, 32,
+ -105, 3, 14, -105, 546, -11, 13, -105, -105, -105,
+ -105, 1289, 126, 2562, -105, 1289, 130, 2562, -105, 15,
+ -105, 301, -105, -105, 1289, -105, -105, 546, -105, -105,
+ -45, -12, 2663, -24, -105, -105, 204, 1578, -105, -105,
+ 1869, -105, -105, 1675, -105, -105, -105, -105, -105, -105,
+ 101, -105, -105, -105, -105, -105, -105, -105, -105, -105,
+ 2663, -105, -105, -105, 105, 2, 910, 206, -47, -2,
+ -105, -105, 246, -105, 214, -105, -105, -105, 364, 232,
+ -105, 1963, -105, -105, -105, -105, -105, -105, -105, -105,
+ -105, 191, 24, 394, 172, -18, 384, 215, -105, -30,
+ -105, 910, 149, -105, -16, 910, -105, -105, 1100, -105,
+ -105, -105, 1195, -105, -105, 225, -105, 1963, -105, 316,
+ -17, -105, -105, 269, 418, -5, 1963, -105, 184, -105,
+ 175, -105, 20, -9, 546, 182, 469, -105, 104, -105,
+ -105, -105, 2057, 910, 292, 2764, 1772, 10, -105, 35,
+ 622, 34, 525, 98, 1289, 2562, 50, 17, 536, 19,
+ 817, 31, 27, 1387, 28, 9, 29, 1289, 30, 11,
+ 1289, 41, 1289, 33, 36, 137, -105, -105, 25, -105,
+ -105, 910, -105, 268, -86, 910, -105, -105, 141, 546,
+ -105, 156, -105, 117, -105, -105, 546, -105, -105, 138,
+ -105, -105, -105, -105, -105, -105,
- -107, 12, -95, 3, 6, 275, 2, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -37,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, 96,
- -107, -107, -107, 8, -107, -107, -17, 24, 95, 74,
- -107, 85, 175, -107, -107, -107, 172, 168, -107, -107,
- -107, -107, -107, 169, -107, 165, 164, -107, 156, 176,
- -107, -107, -107, -107, 182, 178, 112, -107, -107, -107,
- -107, 121, -107, 144, 118, 116, 117, -107, 108, 133,
- 134, 137, 143, 152, -107, 147, 141, 136, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, 107,
- -107, 173, -107, 153, 84, 56, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, 36, -107, -107, -107, -107, -107, 30, -107, -107,
- 0, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, 79, -107, 99, 44, -107, -107,
- 46, -107, 194, 70, 64, -107, -107, -107, -107, -107,
- -107, -107, -107, 29, -107, -107, -107, 65, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, 80, -107, -107, 51,
- -107, 48, -107, 40, -107, 34, -107, -107, 86, -107,
- 88, -107, -107, -107, 78, 60, -107, -107, -107, -107,
- -107, -6, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, 21, -107, -107, -107, -107, -107, 104, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, 16, 201, -107, 202, 224, 223, 215, -107,
- 67, 73, 75, 59, 106, -107, -107, -107, -107, -107,
- -107, -107, -107, 185, -107, 208, -107, 233, -107, -107,
- 234, -107, 203, -107, -107, 299, -107, 90, -107, -2,
- -107, 11, -107, 181, -107, 200, 192, -107, -107, 189,
- -107, -107, -107, -107, -107, -107, 199, -107, 123, 131,
- -107, -107, 111, -107, 77, -107, 87, -107, 195, -107,
- -107, 110, -107, -107, -50, -107, -107, 39, -107, 42,
- -107, 63, -107, 66, -107, -107, -107, -107, -107, -107,
- 68, -107, 43, -107, 47, -107, 92, 35, -107, -107,
- 31, -107, -107, 105, -107, -107, -107, 94, -107, -107,
- -107, -107, 71, -107, 54, 101, -107, 89, -107, -107,
- 55, -107, 49, -107, -107, -107, -107, -107, -107, -107,
- 38, -107, -107, -107, -107, -107, -107, 114, -107, -107,
- 76, -107, -107, -107, -107, 91, -107, 93, -107, -107,
- -107, -107, -107, -57, -107, 50, -107, -44, -107, -107,
- -107, -107, 98, -107, -107, 97, -107, -107, -107, -107,
- -107, 52, -42, -107, -107, 45, -107, 41, -107, 37,
- -107, -107, -107, -107, 57, -107, 53, -107, 58, -107,
- 62, -107, -107, -107, -107, -107, -107, 9, -107, -107,
- 187, -107, -107, -107, -107, 33, -107, -107, 139, -107,
- -107, 32, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, 82, -107,
- -107, -107, -107, -107, -11, -107, -107, -107, -107, -107,
- -107, -107, -25, -107, -107, -107, -9, -107, -107, 297,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -3, -26, -107, -10, -107, -107, -107, -107, 160,
- -107, -107, -107, 120, -107, -107, 279, -107, -107, -107,
- 285, -107, -107, -107, -107, 329, -107, -107, 17, -107,
- -107, -13, 14, -107, 385, -107, -107, -107, 23, -107,
- -107, -107, 28, 18, 20, -107, -107, -107, -107, -107,
- 313, 188, -107, 26, 267, 7, -107, 5, -107, -1,
- -107, 69, 19, -107, -107, 10, -107, -107, 103, -107,
- -107, -107, 27, -107, -107, -107, -107, 15, -107, -5,
- 61, -107, 81, -107, -107, -107, -107, -107, 13, -107,
- -107, 25, -107, -107, 22, 119, -107, -107, -107, 4,
- -107, -107, -107, -107, -107, -107, -15, -107, -107, -107,
- -107, -107, -107, -107, -107, -107};
+ -108, 0, 79, 128, 132, 301, 2, -108, -108, -108,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -47,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, 51,
+ -108, -108, -108, -3, -108, -108, 8, -23, 12, 78,
+ 106, -108, 69, 74, -108, -108, -108, 195, 204, -108,
+ -108, -108, -108, -108, -108, 188, -108, 201, 200, -108,
+ 127, 129, -108, -108, -108, -108, 140, 137, 133, -108,
+ -108, -108, -108, 146, -108, 177, 168, 170, 167, -108,
+ 144, 152, 166, 158, 160, 131, -108, 194, 187, 207,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ -108, 88, -108, 112, -108, 121, 90, -38, -108, -108,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ -108, -108, -108, 32, -108, -108, -108, -108, -108, 26,
+ -108, -108, 27, -108, -108, -108, -108, -108, -108, -108,
+ -108, -108, -108, -108, -108, -108, 102, -108, 103, 41,
+ -108, -108, 37, -108, 250, 38, 83, -108, -108, -108,
+ -108, -108, -108, -108, 42, 126, -108, -108, -108, 40,
+ -108, -108, 43, -108, -108, -108, -108, -108, -108, -108,
+ 39, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ 225, -108, -108, 30, -108, 24, -108, 211, -108, 55,
+ -108, 77, 60, -108, -108, 66, 34, -108, -108, -108,
+ -108, -108, -8, -108, -108, -108, -108, -108, 153, -108,
+ -108, 164, -108, -108, -108, 241, -108, -108, -108, -108,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ -108, -108, 11, -108, -108, -108, -108, -108, 179, -108,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ -108, -108, 19, 259, -108, 255, 228, 240, 246, -108,
+ 52, 63, 67, 65, 50, -108, -108, -108, -108, -108,
+ -108, -108, -108, 210, -108, 256, -108, 226, -108, -108,
+ 252, -108, 161, -108, -108, 268, -108, 197, -108, 5,
+ -108, 218, -108, 222, -108, 213, 249, -108, -108, 236,
+ -108, -108, -108, -108, -108, -108, 212, -108, 80, 87,
+ -108, -108, 86, -108, 98, -108, 61, -108, 245, -108,
+ 59, -108, 208, -108, 192, -108, -108, -108, -108, -108,
+ -108, -108, -108, 257, -108, 33, -108, 28, -108, 73,
+ 71, -108, -108, 36, 57, -108, 62, -108, -108, 46,
+ 70, -108, -108, -108, 49, -108, 45, 99, -108, 84,
+ -108, -108, 100, -108, -108, -108, -108, -108, -108, 21,
+ -108, -108, -108, -108, -108, -108, 118, -108, -108, -108,
+ -108, 81, -108, -108, -108, -108, -108, -108, 123, -108,
+ -108, 134, -108, -108, 56, -108, -108, -108, -108, -108,
+ -58, -108, 47, -108, -57, -108, -108, -108, -108, 265,
+ -108, -108, 374, -108, -108, -108, -108, -108, 94, -66,
+ -108, -108, 25, -108, 22, -108, 31, -108, -108, -108,
+ -108, 58, -108, 229, -108, 35, -108, 235, -108, -108,
+ -108, -108, -108, -108, 29, -108, -108, 186, -108, -108,
+ -108, -108, 162, -108, -108, -108, -108, 48, -108, -108,
+ 163, -108, -108, 44, -108, -108, -108, -108, -108, -108,
+ -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+ 141, -108, -108, -108, -108, -108, -7, -108, -108, -108,
+ -108, -108, -108, -108, -19, -108, -108, -108, -6, -108,
+ -108, 334, -108, -108, -108, -108, -108, -108, -108, -108,
+ -108, -108, -108, -15, -27, -108, -10, -108, -108, -108,
+ -108, 159, -108, -108, -108, 176, -108, -108, 319, -108,
+ -108, -108, 322, -108, -108, -108, -108, 469, -108, -108,
+ 10, -108, -108, 6, 16, -108, 342, -108, -108, -108,
+ 17, -108, -108, -108, 15, 3, 9, -108, -108, -108,
+ -108, -108, 358, 68, -108, 82, 310, 1, -108, -108,
+ -2, -108, 7, -108, 54, 76, -108, -108, 4, -108,
+ 64, -108, -108, 23, -108, -108, -108, 18, -108, -5,
+ 95, -108, 91, -108, -108, -108, -108, -108, -1, -108,
+ -108, 20, -108, -108, 14, 142, -108, -108, -108, 13,
+ -108, -108, -108, -108, -108, -108, -11, -108, -108, -108,
+ -108, -108, -108, -108, -108, -108};
const short QQmlJSGrammar::action_info [] = {
- 417, 258, -113, 404, 467, -132, -102, 576, 573, 347,
- -103, 532, 349, -121, 445, 441, 346, 431, 343, 349,
- 341, 344, 546, 402, 392, 564, 447, 390, 353, 546,
- -121, 539, -129, -124, -102, 409, -124, 417, 546, 432,
- 454, 421, 441, 425, -126, 425, 425, 441, 566, 458,
- 621, 458, -129, 454, -126, 441, 400, -113, 561, 512,
- 258, 546, 347, -103, 336, 273, 347, 534, 190, 164,
- 449, 149, 258, 141, 187, 170, 236, 273, 349, 99,
- 313, 297, 410, 313, 415, 164, 295, 252, 326, 417,
- 189, 319, 293, 454, 458, 305, 441, 183, 71, 179,
- 645, 141, 147, 71, 141, 444, 141, 0, 0, 302,
- 99, 435, 141, 141, 307, 543, 428, 0, 478, 445,
- 141, 0, 293, 0, 328, 295, 58, 58, 172, 251,
- 0, 332, 334, 141, 543, 141, 172, 59, 59, 101,
- 141, 242, 241, 247, 246, 315, -132, 173, 141, 316,
- 641, 640, 635, 634, 177, 173, 254, 62, 101, 141,
- 621, 429, 58, 544, 64, 489, 479, 166, 63, 578,
- 577, 167, 419, 59, 530, 249, 248, 329, 58, 414,
- 413, 64, 616, 513, 85, 456, 86, 460, 142, 59,
- 249, 248, 85, 580, 86, 470, 64, 87, 0, 85,
- 311, 86, 555, 0, 85, 87, 86, 513, 85, 65,
- 86, 351, 87, 537, 85, 66, 86, 87, 568, 546,
- 515, 87, 85, 85, 86, 86, 65, 87, 513, 515,
- 0, 514, 66, 519, 513, 87, 87, 85, 513, 86,
- 514, 65, 141, 569, 567, 141, 0, 66, 471, 469,
- 87, 103, 85, 515, 86, 141, 556, 554, 85, 0,
- 86, 257, 255, 0, 514, 87, 0, 538, 536, 0,
- 104, 87, 105, 85, 515, 86, 638, 637, 0, 581,
- 515, 172, 0, 0, 515, 514, 87, 520, 518, 256,
- 85, 514, 86, 0, 338, 514, 73, 74, 235, 234,
- 173, 0, 174, 87, 73, 74, 0, 636, 439, 438,
- 0, 0, 0, 34, 631, 172, 275, 276, 0, 0,
- 172, 275, 276, 75, 76, 34, 0, 0, 632, 630,
- 34, 75, 76, -90, 173, 34, 174, 172, -90, 173,
- 0, 174, 34, 277, 278, 34, 0, 0, 277, 278,
- 48, 50, 49, 34, 0, 0, 173, 0, 407, 629,
- 0, 0, 48, 50, 49, 34, 0, 48, 50, 49,
- 0, 0, 48, 50, 49, 0, 34, 45, 0, 48,
- 50, 49, 48, 50, 49, 34, 280, 281, 0, 45,
- 48, 50, 49, 34, 45, 282, 0, 0, 283, 45,
- 284, 0, 48, 50, 49, 34, 45, 0, 34, 45,
- 0, 0, 0, 48, 50, 49, 34, 45, 0, 0,
- 0, 34, 48, 50, 49, 280, 281, 34, 0, 45,
- 48, 50, 49, 0, 282, 0, 34, 283, 0, 284,
- 45, 0, 48, 50, 49, 48, 50, 49, 0, 45,
- 0, 34, 0, 48, 50, 49, 0, 45, 48, 50,
- 49, 0, 0, 0, 48, 50, 49, 280, 281, 45,
- 0, 0, 45, 48, 50, 49, 282, 0, 0, 283,
- 45, 284, 0, 0, 0, 45, 0, 0, 48, 50,
- 49, 45, 34, 0, 0, 78, 79, 0, 0, -346,
- 45, 0, 0, 80, 81, 280, 281, 82, 0, 83,
- 0, 0, 0, 0, 282, 45, 0, 283, 0, 284,
- 6, 5, 4, 1, 3, 2, 34, 78, 79, 48,
- 50, 49, 0, -346, 34, 80, 81, 78, 79, 82,
- 0, 83, 34, 0, 0, 80, 81, 0, 0, 82,
- 34, 83, 0, 0, 0, 0, 45, 0, 0, 0,
- 0, 0, 0, 48, 50, 49, 245, 244, 0, 0,
- 34, 48, 50, 49, 240, 239, 0, 0, 34, 48,
- 50, 49, 240, 239, 0, 78, 79, 48, 50, 49,
- 45, 0, 0, 80, 81, 0, 0, 82, 45, 83,
- 0, 0, 245, 244, 0, 0, 45, 48, 50, 49,
- 240, 239, 151, 0, 45, 48, 50, 49, 0, 0,
- 0, 0, 152, 0, 0, 0, 153, 0, 0, 0,
- 151, 0, 0, 0, 45, 154, 0, 155, 0, 0,
- 152, 0, 45, 0, 153, 0, 0, 0, 156, 0,
- 157, 62, 0, 154, 0, 155, 0, 0, 158, 0,
- 0, 159, 63, 0, 0, 34, 156, 160, 157, 62,
- 0, 0, 0, 161, 0, 0, 158, 0, 0, 159,
- 63, 0, 0, 0, 0, 160, 0, 0, 0, 162,
- 0, 161, 0, 0, 0, 0, 0, 245, 244, 0,
- 0, 0, 48, 50, 49, 0, 0, 162, 0, 0,
+ 344, -127, 576, -129, 551, 631, 546, -105, 342, 465,
+ 448, 461, -132, -106, 245, 481, 558, 558, 398, 573,
+ 392, 482, 402, 268, 354, -124, 350, 578, 585, -135,
+ -116, 484, 474, 404, -106, -105, -127, -129, -124, 454,
+ 438, -135, 245, 558, 448, 424, 448, 448, -132, 456,
+ 439, 588, 452, 268, 406, 350, 408, -116, 558, 405,
+ 432, 544, 418, 432, 413, 432, 329, 166, 524, 461,
+ 428, 421, 465, 172, 283, 143, 420, 143, 241, 166,
+ 262, 73, 149, 185, 323, 283, 307, 323, 336, 73,
+ 655, 189, 0, 245, 423, 192, 448, 0, 0, 101,
+ 240, 0, 451, 346, 243, 303, 424, 315, 181, 143,
+ 0, 268, 151, 0, 399, 312, 452, 350, 143, 261,
+ 174, 317, 143, 244, 303, 184, 435, 238, 461, 465,
+ 442, 143, 103, 143, 143, 305, 143, 64, 143, 175,
+ 143, 338, 101, 60, 143, 555, 0, 191, 65, 325,
+ 0, 143, 0, 326, 61, 631, 174, 555, 103, 259,
+ 258, 501, 143, 259, 258, 590, 589, 252, 251, 60,
+ 426, 436, 416, 415, 264, 175, 259, 258, 645, 644,
+ 61, 179, 257, 256, 144, 168, 463, 60, 105, 169,
+ 467, 60, 352, 626, 339, 87, 321, 88, 61, 651,
+ 650, 525, 61, 348, 525, 556, 174, 106, 89, 107,
+ 174, 525, 490, 143, 66, 446, 445, 648, 647, 66,
+ 580, 87, 549, 88, 87, 175, 88, 411, 87, 175,
+ 88, 176, 567, 174, 89, 542, 87, 89, 88, 531,
+ 0, 89, 87, 525, 88, 581, 579, 527, 646, 89,
+ 527, 66, 175, 592, 411, 89, 0, 527, 526, 67,
+ 491, 526, 0, 0, 67, 68, 236, 235, 526, 87,
+ 68, 88, 87, 0, 88, 0, 550, 548, 87, 558,
+ 88, 527, 89, 267, 265, 89, 568, 566, 87, 527,
+ 88, 89, 526, 532, 530, 87, 67, 88, 525, 0,
+ 526, 89, 68, 87, 87, 88, 88, 174, 89, 477,
+ 0, 266, 0, 285, 286, 641, 89, 89, 75, 76,
+ 75, 76, 0, 0, 0, -92, 175, 0, 176, 642,
+ 640, 174, 6, 5, 4, 1, 3, 2, 0, 593,
+ 287, 288, 290, 291, 527, 77, 78, 77, 78, -92,
+ 175, 292, 176, 0, 293, 526, 294, 290, 291, 0,
+ 639, 0, 478, 476, 290, 291, 292, 0, 0, 293,
+ 0, 294, 0, 292, 290, 291, 293, 0, 294, 0,
+ 290, 291, 0, 292, 0, 0, 293, 0, 294, 292,
+ 80, 81, 293, 35, 294, 0, 0, 0, 82, 83,
+ 80, 81, 84, 35, 85, 0, 285, 286, 82, 83,
+ 80, 81, 84, 35, 85, 0, 0, 0, 82, 83,
+ 0, 0, 84, 35, 85, 0, 35, 0, 0, 0,
+ 49, 52, 50, 287, 288, 0, 0, 0, 0, 0,
+ 49, 52, 50, 0, 35, 0, 0, 35, 0, 0,
+ 49, 52, 50, 0, 0, 0, 0, 46, 34, 51,
+ 49, 52, 50, 49, 52, 50, 0, 46, 34, 51,
+ 0, 0, 0, 0, 0, 0, 0, 46, 34, 51,
+ 35, 49, 52, 50, 49, 52, 50, 46, 34, 51,
+ 46, 34, 51, 80, 81, 35, 0, 0, 35, 0,
+ 0, 82, 83, 0, 0, 84, 0, 85, 46, 34,
+ 51, 46, 34, 51, 35, 0, 0, 49, 52, 50,
+ 0, 184, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 35, 49, 52, 50, 49, 52, 50, 184, 0,
+ 0, 0, 0, 0, 46, 34, 51, 0, 0, 0,
+ 0, 49, 52, 50, 35, 0, 0, 0, 0, 46,
+ 34, 51, 46, 34, 51, 35, 0, 0, 49, 52,
+ 50, 0, 184, 0, 0, 35, 0, 0, 46, 34,
+ 51, 0, 0, 0, 35, 0, 255, 254, 0, 0,
+ 0, 49, 52, 50, 0, 46, 34, 51, 0, 0,
+ 0, 0, 49, 52, 50, 35, 0, 0, 0, 0,
+ 0, 0, 49, 52, 50, 0, 255, 254, 46, 34,
+ 51, 49, 52, 50, 0, 0, 0, 0, 0, 46,
+ 34, 51, 0, 0, 0, 0, 0, 255, 254, 46,
+ 34, 51, 49, 52, 50, 0, 0, 0, 46, 34,
+ 51, 35, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 46,
+ 34, 51, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 250, 249, 153, 0, 0, 49, 52,
+ 50, 0, 0, 0, 0, 154, 0, 0, 0, 155,
+ 0, 0, 0, 0, 0, 0, 0, 0, 156, 0,
+ 157, 0, 0, 319, 0, 46, 34, 51, 0, 0,
+ 0, 158, 0, 159, 64, 0, 0, 153, 0, 0,
+ 0, 160, 0, 0, 161, 65, 0, 154, 0, 0,
+ 162, 155, 0, 0, 0, 0, 163, 0, 0, 0,
+ 156, 0, 157, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 164, 158, 0, 159, 64, 0, 0, 0,
+ 0, 0, 0, 160, 0, 0, 161, 65, 0, 0,
+ 0, 0, 162, 0, 0, 0, 0, 0, 163, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 30, 31, 0, 45,
- 0, 0, 0, 0, 0, 0, 33, 0, 0, 151,
- 0, 0, 0, 34, 0, 0, 0, 35, 36, 152,
- 37, 0, 0, 153, 0, 0, 0, 504, 0, 0,
- 0, 44, 154, 0, 155, 0, 0, 309, 0, 0,
- 0, 0, 0, 0, 0, 156, 0, 157, 62, 51,
- 48, 50, 49, 0, 52, 158, 0, 0, 159, 63,
- 0, 0, 0, 0, 160, 43, 54, 32, 0, 0,
- 161, 40, 0, 0, 0, 0, 0, 45, 0, 0,
- 0, 0, 0, 0, 0, 0, 162, 0, 0, 0,
+ 0, 0, 0, 0, 164, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 30, 31, 0, 0, 0, 0, 0, 0, 30,
- 31, 33, 0, 0, 0, 0, 0, 0, 34, 33,
- 0, 0, 35, 36, 0, 37, 34, 0, 0, 0,
- 35, 36, 41, 37, 0, 0, 44, 0, 0, 0,
- 504, 0, 0, 0, 44, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 51, 48, 50, 49, 0, 52,
- 0, 0, 51, 48, 50, 49, 0, 52, 0, 0,
- 43, 54, 32, 0, 0, 0, 40, 0, 43, 54,
- 32, 0, 45, 0, 40, 0, 0, 0, 0, 0,
- 45, 0, 30, 31, 0, 0, 0, 0, 0, 0,
- 30, 31, 33, 0, 0, 0, 0, 0, 0, 34,
- 33, 0, 0, 35, 36, 0, 37, 34, 0, 0,
- 0, 35, 36, 41, 37, 0, 0, 44, 0, 0,
- 0, 504, 0, 0, 0, 44, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 51, 48, 50, 49, 0,
- 52, 0, 0, 51, 48, 50, 49, 0, 52, 0,
- 0, 43, 54, 32, 0, 0, 0, 40, 0, 43,
- 54, 32, 0, 45, 0, 40, 0, 0, 0, 0,
- 0, 45, 0, 30, 31, 0, 0, 0, 0, 0,
- 0, 30, 31, 33, 0, 0, 0, 0, 0, 0,
- 34, 33, 0, 0, 35, 36, 0, 37, 34, 0,
- 0, 0, 35, 36, 41, 37, 0, 0, 44, 0,
- 0, 0, 504, 0, 0, 0, 44, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 51, 48, 50, 49,
- 0, 52, 0, 0, 51, 48, 50, 49, 0, 52,
- 0, 0, 43, 54, 32, 0, 0, 0, 40, 0,
- 43, 54, 32, 0, 45, 0, 40, 0, 0, 0,
- 0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,
+ 31, 0, 0, 0, 0, 0, 0, 0, 0, 33,
+ 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,
+ 36, 37, 0, 38, 0, 0, 0, 0, 0, 0,
+ 42, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 53, 49, 52, 50, 0, 54, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 44, 56,
+ 32, 0, 0, 0, 41, 0, 0, 0, 0, 0,
+ 46, 34, 51, 0, 0, 0, 0, 0, 0, 0,
0, 0, 30, 31, 0, 0, 0, 0, 0, 0,
- 0, 0, 33, 0, 0, 0, 0, 0, 0, 34,
- 0, 0, 0, 35, 36, 0, 37, 0, 0, 0,
- 0, 0, 0, 504, 0, 0, 0, 44, 0, 0,
+ 0, 0, 33, 0, 0, 0, 0, 0, 0, 35,
+ 0, 0, 0, 36, 37, 0, 38, 0, 0, 0,
+ 0, 0, 0, 516, 0, 0, 0, 45, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 51, 48, 50, 49, 0,
- 52, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 43, 54, 32, 0, 0, 0, 40, 0, 0,
- 0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 503, 0, 30, 31, 0, 0, 0,
- 0, 0, 0, 0, 0, 215, 0, 0, 0, 0,
- 0, 0, 34, 0, 0, 0, 35, 36, 0, 37,
- 0, 0, 0, 0, 0, 0, 504, 0, 0, 0,
- 44, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 51, 505,
- 507, 506, 0, 52, 0, 0, 0, 0, 226, 0,
- 0, 0, 0, 0, 43, 54, 32, 210, 0, 0,
- 40, 0, 0, 0, 0, 0, 45, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 503, 0, 30, 31,
- 0, 0, 0, 0, 0, 0, 0, 0, 215, 0,
- 0, 0, 0, 0, 0, 34, 0, 0, 0, 35,
- 36, 0, 37, 0, 0, 0, 0, 0, 0, 504,
- 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
- 0, 551, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 51, 505, 507, 506, 0, 52, 0, 0, 0,
- 0, 226, 0, 0, 0, 0, 0, 43, 54, 32,
- 210, 0, 0, 40, 0, 0, 0, 0, 0, 45,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 503,
- 0, 30, 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 215, 0, 0, 0, 0, 0, 0, 34, 0,
- 0, 0, 35, 36, 0, 37, 0, 0, 0, 0,
- 0, 0, 504, 0, 0, 0, 44, 0, 0, 0,
- 0, 0, 0, 0, 548, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 51, 505, 507, 506, 0, 52,
- 0, 0, 0, 0, 226, 0, 0, 0, 0, 0,
- 43, 54, 32, 210, 0, 0, 40, 0, 0, 0,
- 0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
- 0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
- 34, 0, 0, 0, 35, 36, 0, 37, 0, 0,
- 0, 38, 0, 39, 41, 42, 0, 0, 44, 0,
- 0, 0, 46, 0, 47, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 51, 48, 50, 49,
- 0, 52, 0, 53, 0, 55, 0, 56, 0, 0,
- 0, 0, 43, 54, 32, 0, 0, 0, 40, 0,
- 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, -122, 0, 0, 0, 29, 30,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 33,
- 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
- 35, 36, 0, 37, 0, 0, 0, 38, 0, 39,
- 41, 42, 0, 0, 44, 0, 0, 0, 46, 0,
- 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 51, 48, 50, 49, 0, 52, 0, 53,
- 0, 55, 0, 56, 0, 0, 0, 0, 43, 54,
- 32, 0, 0, 0, 40, 0, 0, 0, 0, 0,
- 45, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 29, 30, 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
- 0, 0, 35, 36, 0, 37, 0, 0, 0, 38,
- 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
- 46, 0, 47, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 51, 48, 50, 49, 0, 52,
- 0, 53, 0, 55, 272, 56, 0, 0, 0, 0,
- 43, 54, 32, 0, 0, 0, 40, 0, 0, 0,
+ 0, 0, 0, 0, 0, 53, 49, 52, 50, 0,
+ 54, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 44, 56, 32, 0, 0, 0, 41, 0, 0,
+ 0, 0, 0, 46, 34, 51, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 515, 0, 30, 31, 0,
+ 0, 0, 0, 0, 0, 0, 0, 219, 0, 0,
+ 0, 0, 0, 0, 35, 0, 0, 0, 36, 37,
+ 0, 38, 0, 0, 0, 0, 0, 0, 516, 0,
0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 476, 0, 0, 29, 30, 31, 0, 0,
- 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
- 0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
- 37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
- 0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
- 477, 0, 0, 0, 0, 0, 0, 0, 0, 51,
- 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
- 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
- 0, 40, 0, 0, 0, 0, 0, 45, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 476, 0, 0,
- 29, 30, 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
- 0, 0, 35, 36, 0, 37, 0, 0, 0, 38,
- 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
- 46, 0, 47, 0, 0, 482, 0, 0, 0, 0,
- 0, 0, 0, 0, 51, 48, 50, 49, 0, 52,
- 0, 53, 0, 55, 0, 56, 0, 0, 0, 0,
- 43, 54, 32, 0, 0, 0, 40, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 53, 517, 519, 518, 0, 54, 0, 0, 0, 0,
+ 227, 0, 0, 0, 0, 0, 44, 56, 32, 214,
+ 0, 0, 41, 0, 0, 0, 0, 0, 46, 34,
+ 51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 515, 0, 30, 31, 0, 0, 0, 0, 0, 0,
+ 0, 0, 219, 0, 0, 0, 0, 0, 0, 35,
+ 0, 0, 0, 36, 37, 0, 38, 0, 0, 0,
+ 0, 0, 0, 516, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 560, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 53, 517, 519, 518, 0,
+ 54, 0, 0, 0, 0, 227, 0, 0, 0, 0,
+ 0, 44, 56, 32, 214, 0, 0, 41, 0, 0,
+ 0, 0, 0, 46, 34, 51, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 515, 0, 30, 31, 0,
+ 0, 0, 0, 0, 0, 0, 0, 219, 0, 0,
+ 0, 0, 0, 0, 35, 0, 0, 0, 36, 37,
+ 0, 38, 0, 0, 0, 0, 0, 0, 516, 0,
0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 484, 0, 0, 29, 30, 31, 0, 0,
- 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
- 0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
- 37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
- 0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
- 485, 0, 0, 0, 0, 0, 0, 0, 0, 51,
- 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
- 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
- 0, 40, 0, 0, 0, 0, 0, 45, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 484, 0, 0,
+ 563, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 53, 517, 519, 518, 0, 54, 0, 0, 0, 0,
+ 227, 0, 0, 0, 0, 0, 44, 56, 32, 214,
+ 0, 0, 41, 0, 0, 0, 0, 0, 46, 34,
+ 51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29, 30, 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
- 0, 0, 35, 36, 0, 37, 0, 0, 0, 38,
- 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
- 46, 0, 47, 0, 0, 487, 0, 0, 0, 0,
- 0, 0, 0, 0, 51, 48, 50, 49, 0, 52,
- 0, 53, 0, 55, 0, 56, 0, 0, 0, 0,
- 43, 54, 32, 0, 0, 0, 40, 0, 0, 0,
- 0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
+ 0, 33, 0, 0, 0, 0, 0, 0, 35, 0,
+ 0, 0, 36, 37, 0, 38, 0, 0, 0, 39,
+ 0, 40, 42, 43, 0, 0, 45, 0, 0, 0,
+ 47, 0, 48, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 53, 49, 52, 50, 0, 54,
+ 0, 55, 0, 57, 0, 58, 0, 0, 0, 0,
+ 44, 56, 32, 0, 0, 0, 41, 0, 0, 0,
+ 0, 0, 46, 34, 51, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, -125, 0, 0, 0, 29, 30,
+ 31, 0, 0, 0, 0, 0, 0, 0, 0, 33,
+ 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,
+ 36, 37, 0, 38, 0, 0, 0, 39, 0, 40,
+ 42, 43, 0, 0, 45, 0, 0, 0, 47, 0,
+ 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 53, 49, 52, 50, 0, 54, 0, 55,
+ 0, 57, 0, 58, 0, 0, 0, 0, 44, 56,
+ 32, 0, 0, 0, 41, 0, 0, 0, 0, 0,
+ 46, 34, 51, 0, 0, 0, 0, 0, 0, 0,
0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
- 34, 217, 0, 0, 218, 36, 0, 37, 0, 0,
- 0, 38, 0, 39, 41, 42, 0, 0, 44, 0,
- 0, 0, 46, 0, 47, 0, 0, 0, 0, 0,
- 0, 0, 221, 0, 0, 0, 51, 48, 50, 49,
- 223, 52, 0, 53, 225, 55, 0, 56, 0, 228,
- 0, 0, 43, 54, 32, 0, 0, 0, 40, 0,
- 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 35, 0, 0, 0, 36, 37, 0, 38, 0, 0,
+ 0, 39, 0, 40, 42, 43, 0, 0, 45, 0,
+ 0, 0, 47, 0, 48, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 53, 49, 52, 50,
+ 0, 54, 0, 55, 0, 57, 282, 58, 0, 0,
+ 0, 0, 44, 56, 32, 0, 0, 0, 41, 0,
+ 0, 0, 0, 0, 46, 34, 51, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 496, 0, 0, 29,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 35, 0, 0,
+ 0, 36, 37, 0, 38, 0, 0, 0, 39, 0,
+ 40, 42, 43, 0, 0, 45, 0, 0, 0, 47,
+ 0, 48, 0, 0, 499, 0, 0, 0, 0, 0,
+ 0, 0, 0, 53, 49, 52, 50, 0, 54, 0,
+ 55, 0, 57, 0, 58, 0, 0, 0, 0, 44,
+ 56, 32, 0, 0, 0, 41, 0, 0, 0, 0,
+ 0, 46, 34, 51, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 496, 0, 0, 29, 30, 31, 0,
+ 0, 0, 0, 0, 0, 0, 0, 33, 0, 0,
+ 0, 0, 0, 0, 35, 0, 0, 0, 36, 37,
+ 0, 38, 0, 0, 0, 39, 0, 40, 42, 43,
+ 0, 0, 45, 0, 0, 0, 47, 0, 48, 0,
+ 0, 497, 0, 0, 0, 0, 0, 0, 0, 0,
+ 53, 49, 52, 50, 0, 54, 0, 55, 0, 57,
+ 0, 58, 0, 0, 0, 0, 44, 56, 32, 0,
+ 0, 0, 41, 0, 0, 0, 0, 0, 46, 34,
+ 51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 488, 0, 0, 29, 30, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
+ 0, 35, 0, 0, 0, 36, 37, 0, 38, 0,
+ 0, 0, 39, 0, 40, 42, 43, 0, 0, 45,
+ 0, 0, 0, 47, 0, 48, 0, 0, 489, 0,
+ 0, 0, 0, 0, 0, 0, 0, 53, 49, 52,
+ 50, 0, 54, 0, 55, 0, 57, 0, 58, 0,
+ 0, 0, 0, 44, 56, 32, 0, 0, 0, 41,
+ 0, 0, 0, 0, 0, 46, 34, 51, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 488, 0, 0,
+ 29, 30, 31, 0, 0, 0, 0, 0, 0, 0,
+ 0, 33, 0, 0, 0, 0, 0, 0, 35, 0,
+ 0, 0, 36, 37, 0, 38, 0, 0, 0, 39,
+ 0, 40, 42, 43, 0, 0, 45, 0, 0, 0,
+ 47, 0, 48, 0, 0, 494, 0, 0, 0, 0,
+ 0, 0, 0, 0, 53, 49, 52, 50, 0, 54,
+ 0, 55, 0, 57, 0, 58, 0, 0, 0, 0,
+ 44, 56, 32, 0, 0, 0, 41, 0, 0, 0,
+ 0, 0, 46, 34, 51, 0, 0, 0, 0, 0,
0, 0, 0, 0, 29, 30, 31, 0, 0, 0,
0, 0, 0, 0, 0, 33, 0, 0, 0, 0,
- 0, 0, 34, 217, 0, 0, 583, 584, 0, 37,
- 0, 0, 0, 38, 0, 39, 41, 42, 0, 0,
- 44, 0, 0, 0, 46, 0, 47, 0, 0, 0,
- 0, 0, 0, 0, 221, 0, 0, 0, 51, 48,
- 50, 49, 223, 52, 0, 53, 225, 55, 0, 56,
- 0, 228, 0, 0, 43, 54, 32, 0, 0, 0,
- 40, 0, 0, 0, 0, 0, 45, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 109, 110, 111, 0,
- 0, 113, 115, 116, 0, 0, 117, 0, 118, 0,
- 0, 0, 120, 121, 122, 0, 0, 0, 0, 0,
- 0, 34, 123, 124, 125, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 126, 0, 0, 0, 0,
+ 0, 0, 35, 220, 0, 0, 221, 37, 0, 38,
+ 0, 0, 0, 39, 0, 40, 42, 43, 0, 0,
+ 45, 0, 0, 0, 47, 0, 48, 0, 0, 0,
+ 0, 0, 0, 0, 223, 0, 0, 0, 53, 49,
+ 52, 50, 224, 54, 0, 55, 226, 57, 0, 58,
+ 0, 229, 0, 0, 44, 56, 32, 0, 0, 0,
+ 41, 0, 0, 0, 0, 0, 46, 34, 51, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 29, 30,
+ 31, 0, 0, 0, 0, 0, 0, 0, 0, 33,
+ 0, 0, 0, 0, 0, 0, 35, 220, 0, 0,
+ 595, 596, 0, 38, 0, 0, 0, 39, 0, 40,
+ 42, 43, 0, 0, 45, 0, 0, 0, 47, 0,
+ 48, 0, 0, 0, 0, 0, 0, 0, 223, 0,
+ 0, 0, 53, 49, 52, 50, 224, 54, 0, 55,
+ 226, 57, 0, 58, 0, 229, 0, 0, 44, 56,
+ 32, 0, 0, 0, 41, 0, 0, 0, 0, 0,
+ 46, 34, 51, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 111, 112, 113, 0, 0, 115, 117, 118,
+ 0, 0, 119, 0, 120, 0, 0, 0, 122, 123,
+ 124, 0, 0, 0, 0, 0, 0, 35, 125, 126,
+ 127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 128, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 131, 0, 0,
+ 0, 0, 0, 0, 49, 52, 50, 132, 133, 134,
+ 0, 136, 137, 138, 139, 140, 141, 0, 0, 129,
+ 135, 121, 114, 116, 130, 0, 0, 0, 0, 0,
+ 0, 46, 34, 51, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 111, 112, 113, 0, 0, 115, 117,
+ 118, 0, 0, 119, 0, 120, 0, 0, 0, 122,
+ 123, 124, 0, 0, 0, 0, 0, 0, 35, 125,
+ 126, 127, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 128, 0, 0, 0, 395, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 131, 0,
+ 0, 0, 0, 0, 397, 49, 52, 50, 132, 133,
+ 134, 0, 136, 137, 138, 139, 140, 141, 0, 0,
+ 129, 135, 121, 114, 116, 130, 0, 0, 0, 0,
+ 0, 0, 46, 34, 51, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 111, 112, 113, 0, 0, 115,
+ 117, 118, 0, 0, 119, 0, 120, 0, 0, 0,
+ 122, 123, 124, 0, 0, 0, 0, 0, 0, 35,
+ 125, 126, 127, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 128, 0, 0, 0, 395, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 131,
+ 0, 0, 0, 0, 0, 397, 49, 52, 50, 132,
+ 133, 134, 0, 136, 137, 138, 139, 140, 141, 0,
+ 0, 129, 135, 121, 114, 116, 130, 0, 0, 0,
+ 0, 0, 0, 46, 374, 380, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 111, 112, 113, 0, 0,
+ 115, 117, 118, 0, 0, 119, 0, 120, 0, 0,
+ 0, 122, 123, 124, 0, 0, 0, 0, 0, 0,
+ 35, 125, 126, 127, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 128, 0, 0, 0, 395, 0,
+ 0, 0, 0, 0, 0, 0, 396, 0, 0, 0,
+ 131, 0, 0, 0, 0, 0, 397, 49, 52, 50,
+ 132, 133, 134, 0, 136, 137, 138, 139, 140, 141,
+ 0, 0, 129, 135, 121, 114, 116, 130, 0, 0,
+ 0, 0, 0, 0, 46, 374, 380, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 213, 0, 0, 0,
+ 0, 215, 0, 29, 30, 31, 217, 0, 0, 0,
+ 0, 0, 0, 218, 33, 0, 0, 0, 0, 0,
+ 0, 35, 220, 0, 0, 221, 37, 0, 38, 0,
+ 0, 0, 39, 0, 40, 42, 43, 0, 0, 45,
+ 0, 0, 0, 47, 0, 48, 0, 0, 0, 0,
+ 0, 222, 0, 223, 0, 0, 0, 53, 49, 52,
+ 50, 224, 54, 225, 55, 226, 57, 227, 58, 228,
+ 229, 0, 0, 44, 56, 32, 214, 216, 0, 41,
+ 0, 0, 0, 0, 0, 46, 34, 51, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 213, 0, 0,
+ 0, 0, 215, 0, 29, 30, 31, 217, 0, 0,
+ 0, 0, 0, 0, 218, 219, 0, 0, 0, 0,
+ 0, 0, 35, 220, 0, 0, 221, 37, 0, 38,
+ 0, 0, 0, 39, 0, 40, 42, 43, 0, 0,
+ 45, 0, 0, 0, 47, 0, 48, 0, 0, 0,
+ 0, 0, 222, 0, 223, 0, 0, 0, 53, 49,
+ 52, 50, 224, 54, 225, 55, 226, 57, 227, 58,
+ 228, 229, 0, 0, 44, 56, 32, 214, 216, 0,
+ 41, 0, 0, 0, 0, 0, 46, 34, 51, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 600, 112,
+ 113, 0, 0, 602, 117, 604, 30, 31, 605, 0,
+ 120, 0, 0, 0, 122, 607, 608, 0, 0, 0,
+ 0, 0, 0, 35, 609, 126, 127, 221, 37, 0,
+ 38, 0, 0, 0, 39, 0, 40, 610, 43, 0,
+ 0, 612, 0, 0, 0, 47, 0, 48, 0, 0,
+ 0, 0, 0, 613, 0, 223, 0, 0, 0, 614,
+ 49, 52, 50, 615, 616, 617, 55, 619, 620, 621,
+ 622, 623, 624, 0, 0, 611, 618, 606, 601, 603,
+ 130, 41, 0, 0, 0, 0, 0, 46, 374, 380,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 365,
+ 112, 113, 0, 0, 367, 117, 369, 30, 31, 370,
+ 0, 120, 0, 0, 0, 122, 372, 373, 0, 0,
+ 0, 0, 0, 0, 35, 375, 126, 127, 221, 37,
+ 0, 38, 0, 0, 0, 39, 0, 40, 376, 43,
+ 0, 0, 378, 0, 0, 0, 47, 0, 48, 0,
+ -271, 0, 0, 0, 379, 0, 223, 0, 0, 0,
+ 381, 49, 52, 50, 382, 383, 384, 55, 386, 387,
+ 388, 389, 390, 391, 0, 0, 377, 385, 371, 366,
+ 368, 130, 41, 0, 0, 0, 0, 0, 46, 374,
+ 380, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 565, 148, 545, 16, 649, 547, 541, 469, 320, 529,
+ 528, 630, 183, 248, 263, 500, 485, 447, 629, 183,
+ 627, 444, 253, 393, 587, 652, 313, 152, 643, 572,
+ 591, 575, 586, 638, 331, 574, 453, 455, 466, 253,
+ 437, 178, 433, 253, 0, 248, 584, 458, 248, 313,
+ 441, 183, 444, 457, 237, 190, 447, 188, 206, 425,
+ 400, 462, 351, 313, 347, 150, 165, 447, 475, 444,
+ 183, 145, 393, 260, 0, 409, 173, 409, 260, 362,
+ 171, 514, 409, 495, 362, 393, 206, 498, 628, 313,
+ 313, 206, 356, 142, 206, 331, 362, 599, 403, 0,
+ 345, 62, 62, 62, 182, 62, 299, 182, 295, 206,
+ 410, 417, 410, 206, 62, 393, 62, 410, 62, 296,
+ 148, 298, 148, 297, 62, 62, 182, 504, 412, 62,
+ 180, 502, 511, 206, 512, 62, 108, 460, 188, 62,
+ 394, 188, 62, 206, 460, 247, 62, 206, 459, 206,
+ 62, 102, 459, 62, 62, 514, 206, 62, 653, 503,
+ 407, 343, 341, 62, 313, 110, 419, 167, 188, 187,
+ 170, 340, 514, 104, 0, 553, 422, 206, 62, 206,
+ 62, 63, 62, 72, 62, 510, 71, 97, 62, 514,
+ 70, 62, 557, 69, 355, 62, 239, 62, 493, 318,
+ 86, 469, 492, 62, 483, 74, 242, 206, 93, 62,
+ 353, 62, 206, 260, 95, 0, 96, 62, 62, 62,
+ 322, 62, 94, 206, 100, 98, 206, 99, 62, 247,
+ 277, 464, 0, 206, 79, 281, 314, 468, 62, 62,
+ 206, 507, 91, 246, 206, 62, 62, 349, 505, 90,
+ 206, 62, 62, 460, 459, 62, 206, 506, 62, 401,
+ 206, 62, 92, 309, 62, 108, 281, 362, 281, 281,
+ 0, 313, 206, 62, 304, 479, 0, 309, 281, 62,
+ 206, 327, 281, 0, 281, 337, 300, 309, 324, 0,
+ 0, 62, 281, 0, 110, 177, 281, 62, 301, 308,
+ 309, 0, 281, 309, 302, 281, 62, 62, 281, 330,
+ 62, 281, 281, 289, 514, 281, 0, 0, 306, 284,
+ 0, 522, 328, 569, 561, 311, 553, 564, 625, 0,
+ 0, 0, 514, 513, 523, 514, 0, 0, 0, 522,
+ 0, 0, 522, 316, 0, 0, 0, 0, 0, 485,
+ 440, 513, 523, 0, 513, 523, 533, 534, 535, 536,
+ 540, 537, 538, 577, 533, 534, 535, 536, 540, 537,
+ 538, 594, 0, 0, 0, 0, 362, 0, 597, 598,
+ 533, 534, 535, 536, 540, 537, 538, 0, 0, 206,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 129, 0, 0, 0, 0, 0, 0, 48, 50,
- 49, 130, 131, 132, 0, 134, 135, 136, 137, 138,
- 139, 0, 0, 127, 133, 119, 112, 114, 128, 0,
- 0, 0, 0, 0, 0, 45, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 109, 110, 111, 0, 0,
- 113, 115, 116, 0, 0, 117, 0, 118, 0, 0,
- 0, 120, 121, 122, 0, 0, 0, 0, 0, 0,
- 394, 123, 124, 125, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 126, 0, 0, 0, 395, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 129, 0, 0, 0, 0, 0, 399, 396, 398, 0,
- 130, 131, 132, 0, 134, 135, 136, 137, 138, 139,
- 0, 0, 127, 133, 119, 112, 114, 128, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 109, 110, 111, 0, 0, 113,
- 115, 116, 0, 0, 117, 0, 118, 0, 0, 0,
- 120, 121, 122, 0, 0, 0, 0, 0, 0, 394,
- 123, 124, 125, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 126, 0, 0, 0, 395, 0, 0,
- 0, 0, 0, 0, 0, 397, 0, 0, 0, 129,
- 0, 0, 0, 0, 0, 399, 396, 398, 0, 130,
- 131, 132, 0, 134, 135, 136, 137, 138, 139, 0,
- 0, 127, 133, 119, 112, 114, 128, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 209, 0, 0, 0, 0, 211, 0,
- 29, 30, 31, 213, 0, 0, 0, 0, 0, 0,
- 214, 215, 0, 0, 0, 0, 0, 0, 216, 217,
- 0, 0, 218, 36, 0, 37, 0, 0, 0, 38,
- 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
- 46, 0, 47, 0, 0, 0, 0, 0, 220, 0,
- 221, 0, 0, 0, 51, 219, 222, 49, 223, 52,
- 224, 53, 225, 55, 226, 56, 227, 228, 0, 0,
- 43, 54, 32, 210, 212, 0, 40, 0, 0, 0,
- 0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 209, 0, 0, 0, 0, 211, 0, 29,
- 30, 31, 213, 0, 0, 0, 0, 0, 0, 214,
- 33, 0, 0, 0, 0, 0, 0, 216, 217, 0,
- 0, 218, 36, 0, 37, 0, 0, 0, 38, 0,
- 39, 41, 42, 0, 0, 44, 0, 0, 0, 46,
- 0, 47, 0, 0, 0, 0, 0, 220, 0, 221,
- 0, 0, 0, 51, 219, 222, 49, 223, 52, 224,
- 53, 225, 55, 226, 56, 227, 228, 0, 0, 43,
- 54, 32, 210, 212, 0, 40, 0, 0, 0, 0,
- 0, 45, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 587, 110, 111, 0, 0, 589, 115, 591, 30,
- 31, 592, 0, 118, 0, 0, 0, 120, 594, 595,
- 0, 0, 0, 0, 0, 0, 596, 597, 124, 125,
- 218, 36, 0, 37, 0, 0, 0, 38, 0, 39,
- 598, 42, 0, 0, 600, 0, 0, 0, 46, 0,
- 47, 0, 0, 0, 0, 0, 602, 0, 221, 0,
- 0, 0, 604, 601, 603, 49, 605, 606, 607, 53,
- 609, 610, 611, 612, 613, 614, 0, 0, 599, 608,
- 593, 588, 590, 128, 40, 0, 0, 0, 0, 0,
- 45, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 362, 110, 111, 0, 0, 364, 115, 366, 30, 31,
- 367, 0, 118, 0, 0, 0, 120, 369, 370, 0,
- 0, 0, 0, 0, 0, 371, 372, 124, 125, 218,
- 36, 0, 37, 0, 0, 0, 38, 0, 39, 373,
- 42, 0, 0, 375, 0, 0, 0, 46, 0, 47,
- 0, -268, 0, 0, 0, 377, 0, 221, 0, 0,
- 0, 379, 376, 378, 49, 380, 381, 382, 53, 384,
- 385, 386, 387, 388, 389, 0, 0, 374, 383, 368,
- 363, 365, 128, 40, 0, 0, 0, 0, 0, 45,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 639, 310, 529, 533, 516, 535, 517, 499, 500, 462,
- 498, 620, 553, 312, 243, 16, 562, 440, 437, 633,
- 238, 250, 473, 182, 253, 182, 617, 488, 359, 563,
- 303, 321, 619, 642, 150, 575, 560, 250, 628, 163,
- 426, 348, 250, 579, 186, 350, 182, 574, 468, 340,
- 430, 345, 572, 434, 359, 457, 448, 446, 238, 450,
- 455, 459, 243, 243, 461, 352, 238, 451, 354, 148,
- 403, 483, 486, 176, 437, 143, 440, 401, 411, 335,
- 188, 437, 440, 169, 237, 171, 237, 140, 359, 393,
- 337, 303, 308, 416, 391, 146, 418, 303, 405, 359,
- 359, 0, 0, 146, 0, 0, 0, 60, 178, 60,
- 0, 452, 288, 0, 303, 60, 405, 60, 405, 180,
- 285, 60, 60, 60, 491, 186, 286, 60, 287, 60,
- 406, 453, 502, 502, 303, 643, 545, 60, 321, 453,
- 60, 165, 180, 60, 60, 490, 180, 60, 406, 60,
- 406, 452, 267, 146, 60, 60, 60, 271, 408, 289,
- 60, 84, 69, 168, 60, 60, 60, 100, 106, 60,
- 97, 98, 96, 502, 481, 0, 541, 72, 480, 436,
- 433, 60, 60, 333, 60, 60, 91, 92, 90, 60,
- 93, 60, 60, 89, 108, 60, 94, 339, 77, 88,
- 60, 502, 462, 331, 60, 95, 303, 61, 618, 106,
- 342, 330, 60, 60, 453, 452, 60, 60, 494, 495,
- 60, 60, 493, 60, 60, 492, 60, 70, 68, 60,
- 60, 102, 67, 60, 271, 108, 175, 299, 271, 0,
- 299, 0, 271, 0, 314, 271, 294, 299, 60, 60,
- 60, 0, 271, 271, 271, 271, 60, 279, 274, 320,
- 0, 271, 318, 60, 0, 317, 0, 296, 271, 327,
- 292, 60, 60, 472, 0, 304, 271, 271, 291, 290,
- 557, 299, 299, 541, 549, 615, 271, 271, 502, 0,
- 552, 0, 502, 0, 0, 510, 0, 0, 502, 510,
- 0, 0, 303, 298, 301, 510, 473, 501, 511, 0,
- 0, 501, 511, 0, 0, 0, 0, 501, 511, 521,
- 522, 523, 524, 528, 525, 526, 582, 0, 0, 0,
- 0, 0, 0, 585, 586, 521, 522, 523, 524, 528,
- 525, 526, 557, 0, 0, 0, 0, 0, 0, 558,
- 559, 521, 522, 523, 524, 528, 525, 526, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 306, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 443,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 565, 521, 522, 523,
- 524, 528, 525, 526, 0, 0, 0, 0, 0, 0,
+ 0, 0, 569, 0, 0, 0, 0, 0, 0, 570,
+ 571, 533, 534, 535, 536, 540, 537, 538, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -697,120 +705,101 @@ const short QQmlJSGrammar::action_info [] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0};
+ 0, 0, 0, 0, 0, 0, 0};
const short QQmlJSGrammar::action_check [] = {
- 36, 36, 7, 55, 17, 7, 7, 60, 8, 7,
- 7, 37, 36, 7, 20, 33, 55, 55, 60, 36,
- 36, 33, 33, 55, 8, 7, 36, 7, 16, 33,
- 7, 34, 7, 7, 7, 60, 7, 36, 33, 7,
- 36, 33, 33, 5, 7, 5, 5, 33, 29, 36,
- 91, 36, 7, 36, 7, 33, 7, 7, 66, 66,
- 36, 33, 7, 7, 31, 1, 7, 24, 33, 2,
- 60, 60, 36, 8, 8, 7, 55, 1, 36, 48,
- 2, 8, 7, 2, 7, 2, 79, 36, 17, 36,
- 60, 7, 48, 36, 36, 61, 33, 36, 1, 60,
- 0, 8, 8, 1, 8, 6, 8, -1, -1, 61,
- 48, 7, 8, 8, 60, 8, 10, -1, 8, 20,
- 8, -1, 48, -1, 8, 79, 40, 40, 15, 77,
- -1, 61, 60, 8, 8, 8, 15, 51, 51, 79,
- 8, 61, 62, 61, 62, 50, 7, 34, 8, 54,
- 61, 62, 61, 62, 56, 34, 60, 42, 79, 8,
- 91, 55, 40, 56, 12, 60, 56, 50, 53, 61,
- 62, 54, 60, 51, 29, 61, 62, 61, 40, 61,
- 62, 12, 56, 29, 25, 60, 27, 60, 56, 51,
- 61, 62, 25, 7, 27, 8, 12, 38, -1, 25,
- 60, 27, 7, -1, 25, 38, 27, 29, 25, 57,
- 27, 60, 38, 7, 25, 63, 27, 38, 36, 33,
- 75, 38, 25, 25, 27, 27, 57, 38, 29, 75,
- -1, 86, 63, 7, 29, 38, 38, 25, 29, 27,
- 86, 57, 8, 61, 62, 8, -1, 63, 61, 62,
- 38, 15, 25, 75, 27, 8, 61, 62, 25, -1,
- 27, 61, 62, -1, 86, 38, -1, 61, 62, -1,
- 34, 38, 36, 25, 75, 27, 61, 62, -1, 93,
- 75, 15, -1, -1, 75, 86, 38, 61, 62, 89,
- 25, 86, 27, -1, 60, 86, 18, 19, 61, 62,
- 34, -1, 36, 38, 18, 19, -1, 92, 61, 62,
- -1, -1, -1, 29, 47, 15, 18, 19, -1, -1,
- 15, 18, 19, 45, 46, 29, -1, -1, 61, 62,
- 29, 45, 46, 33, 34, 29, 36, 15, 33, 34,
- -1, 36, 29, 45, 46, 29, -1, -1, 45, 46,
- 66, 67, 68, 29, -1, -1, 34, -1, 36, 92,
- -1, -1, 66, 67, 68, 29, -1, 66, 67, 68,
- -1, -1, 66, 67, 68, -1, 29, 93, -1, 66,
- 67, 68, 66, 67, 68, 29, 23, 24, -1, 93,
- 66, 67, 68, 29, 93, 32, -1, -1, 35, 93,
- 37, -1, 66, 67, 68, 29, 93, -1, 29, 93,
- -1, -1, -1, 66, 67, 68, 29, 93, -1, -1,
- -1, 29, 66, 67, 68, 23, 24, 29, -1, 93,
- 66, 67, 68, -1, 32, -1, 29, 35, -1, 37,
- 93, -1, 66, 67, 68, 66, 67, 68, -1, 93,
- -1, 29, -1, 66, 67, 68, -1, 93, 66, 67,
- 68, -1, -1, -1, 66, 67, 68, 23, 24, 93,
- -1, -1, 93, 66, 67, 68, 32, -1, -1, 35,
- 93, 37, -1, -1, -1, 93, -1, -1, 66, 67,
- 68, 93, 29, -1, -1, 23, 24, -1, -1, 36,
- 93, -1, -1, 31, 32, 23, 24, 35, -1, 37,
- -1, -1, -1, -1, 32, 93, -1, 35, -1, 37,
- 95, 96, 97, 98, 99, 100, 29, 23, 24, 66,
- 67, 68, -1, 36, 29, 31, 32, 23, 24, 35,
- -1, 37, 29, -1, -1, 31, 32, -1, -1, 35,
- 29, 37, -1, -1, -1, -1, 93, -1, -1, -1,
- -1, -1, -1, 66, 67, 68, 61, 62, -1, -1,
- 29, 66, 67, 68, 61, 62, -1, -1, 29, 66,
- 67, 68, 61, 62, -1, 23, 24, 66, 67, 68,
- 93, -1, -1, 31, 32, -1, -1, 35, 93, 37,
- -1, -1, 61, 62, -1, -1, 93, 66, 67, 68,
- 61, 62, 3, -1, 93, 66, 67, 68, -1, -1,
- -1, -1, 13, -1, -1, -1, 17, -1, -1, -1,
- 3, -1, -1, -1, 93, 26, -1, 28, -1, -1,
- 13, -1, 93, -1, 17, -1, -1, -1, 39, -1,
- 41, 42, -1, 26, -1, 28, -1, -1, 49, -1,
- -1, 52, 53, -1, -1, 29, 39, 58, 41, 42,
- -1, -1, -1, 64, -1, -1, 49, -1, -1, 52,
- 53, -1, -1, -1, -1, 58, -1, -1, -1, 80,
- -1, 64, -1, -1, -1, -1, -1, 61, 62, -1,
- -1, -1, 66, 67, 68, -1, -1, 80, -1, -1,
+ 60, 7, 7, 7, 34, 91, 24, 7, 61, 36,
+ 33, 36, 7, 7, 7, 60, 33, 33, 55, 66,
+ 8, 33, 55, 36, 16, 7, 36, 29, 8, 7,
+ 7, 55, 17, 36, 7, 7, 7, 7, 7, 36,
+ 55, 7, 7, 33, 33, 36, 33, 33, 7, 60,
+ 7, 60, 20, 36, 33, 36, 55, 7, 33, 60,
+ 5, 37, 36, 5, 60, 5, 7, 2, 66, 36,
+ 33, 33, 36, 7, 1, 8, 60, 8, 33, 2,
+ 36, 1, 8, 36, 2, 1, 8, 2, 17, 1,
+ 0, 8, -1, 7, 55, 33, 33, -1, -1, 48,
+ 60, -1, 6, 31, 55, 48, 36, 61, 60, 8,
+ -1, 36, 60, -1, 7, 61, 20, 36, 8, 77,
+ 15, 60, 8, 55, 48, 36, 10, 36, 36, 36,
+ 7, 8, 79, 8, 8, 79, 8, 42, 8, 34,
+ 8, 8, 48, 40, 8, 8, -1, 60, 53, 50,
+ -1, 8, -1, 54, 51, 91, 15, 8, 79, 61,
+ 62, 60, 8, 61, 62, 61, 62, 61, 62, 40,
+ 60, 55, 61, 62, 60, 34, 61, 62, 61, 62,
+ 51, 56, 61, 62, 56, 50, 60, 40, 15, 54,
+ 60, 40, 60, 56, 61, 25, 60, 27, 51, 61,
+ 62, 29, 51, 60, 29, 56, 15, 34, 38, 36,
+ 15, 29, 8, 8, 12, 61, 62, 61, 62, 12,
+ 36, 25, 7, 27, 25, 34, 27, 36, 25, 34,
+ 27, 36, 7, 15, 38, 29, 25, 38, 27, 7,
+ -1, 38, 25, 29, 27, 61, 62, 75, 92, 38,
+ 75, 12, 34, 7, 36, 38, -1, 75, 86, 57,
+ 56, 86, -1, -1, 57, 63, 61, 62, 86, 25,
+ 63, 27, 25, -1, 27, -1, 61, 62, 25, 33,
+ 27, 75, 38, 61, 62, 38, 61, 62, 25, 75,
+ 27, 38, 86, 61, 62, 25, 57, 27, 29, -1,
+ 86, 38, 63, 25, 25, 27, 27, 15, 38, 8,
+ -1, 89, -1, 18, 19, 47, 38, 38, 18, 19,
+ 18, 19, -1, -1, -1, 33, 34, -1, 36, 61,
+ 62, 15, 97, 98, 99, 100, 101, 102, -1, 93,
+ 45, 46, 23, 24, 75, 45, 46, 45, 46, 33,
+ 34, 32, 36, -1, 35, 86, 37, 23, 24, -1,
+ 92, -1, 61, 62, 23, 24, 32, -1, -1, 35,
+ -1, 37, -1, 32, 23, 24, 35, -1, 37, -1,
+ 23, 24, -1, 32, -1, -1, 35, -1, 37, 32,
+ 23, 24, 35, 29, 37, -1, -1, -1, 31, 32,
+ 23, 24, 35, 29, 37, -1, 18, 19, 31, 32,
+ 23, 24, 35, 29, 37, -1, -1, -1, 31, 32,
+ -1, -1, 35, 29, 37, -1, 29, -1, -1, -1,
+ 66, 67, 68, 45, 46, -1, -1, -1, -1, -1,
+ 66, 67, 68, -1, 29, -1, -1, 29, -1, -1,
+ 66, 67, 68, -1, -1, -1, -1, 93, 94, 95,
+ 66, 67, 68, 66, 67, 68, -1, 93, 94, 95,
+ -1, -1, -1, -1, -1, -1, -1, 93, 94, 95,
+ 29, 66, 67, 68, 66, 67, 68, 93, 94, 95,
+ 93, 94, 95, 23, 24, 29, -1, -1, 29, -1,
+ -1, 31, 32, -1, -1, 35, -1, 37, 93, 94,
+ 95, 93, 94, 95, 29, -1, -1, 66, 67, 68,
+ -1, 36, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 29, 66, 67, 68, 66, 67, 68, 36, -1,
+ -1, -1, -1, -1, 93, 94, 95, -1, -1, -1,
+ -1, 66, 67, 68, 29, -1, -1, -1, -1, 93,
+ 94, 95, 93, 94, 95, 29, -1, -1, 66, 67,
+ 68, -1, 36, -1, -1, 29, -1, -1, 93, 94,
+ 95, -1, -1, -1, 29, -1, 61, 62, -1, -1,
+ -1, 66, 67, 68, -1, 93, 94, 95, -1, -1,
+ -1, -1, 66, 67, 68, 29, -1, -1, -1, -1,
+ -1, -1, 66, 67, 68, -1, 61, 62, 93, 94,
+ 95, 66, 67, 68, -1, -1, -1, -1, -1, 93,
+ 94, 95, -1, -1, -1, -1, -1, 61, 62, 93,
+ 94, 95, 66, 67, 68, -1, -1, -1, 93, 94,
+ 95, 29, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 93,
+ 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 61, 62, 3, -1, -1, 66, 67,
+ 68, -1, -1, -1, -1, 13, -1, -1, -1, 17,
+ -1, -1, -1, -1, -1, -1, -1, -1, 26, -1,
+ 28, -1, -1, 31, -1, 93, 94, 95, -1, -1,
+ -1, 39, -1, 41, 42, -1, -1, 3, -1, -1,
+ -1, 49, -1, -1, 52, 53, -1, 13, -1, -1,
+ 58, 17, -1, -1, -1, -1, 64, -1, -1, -1,
+ 26, -1, 28, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 80, 39, -1, 41, 42, -1, -1, -1,
+ -1, -1, -1, 49, -1, -1, 52, 53, -1, -1,
+ -1, -1, 58, -1, -1, -1, -1, -1, 64, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 12, 13, -1, 93,
- -1, -1, -1, -1, -1, -1, 22, -1, -1, 3,
- -1, -1, -1, 29, -1, -1, -1, 33, 34, 13,
- 36, -1, -1, 17, -1, -1, -1, 43, -1, -1,
- -1, 47, 26, -1, 28, -1, -1, 31, -1, -1,
- -1, -1, -1, -1, -1, 39, -1, 41, 42, 65,
- 66, 67, 68, -1, 70, 49, -1, -1, 52, 53,
- -1, -1, -1, -1, 58, 81, 82, 83, -1, -1,
- 64, 87, -1, -1, -1, -1, -1, 93, -1, -1,
- -1, -1, -1, -1, -1, -1, 80, -1, -1, -1,
+ -1, -1, -1, -1, 80, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 12, 13, -1, -1, -1, -1, -1, -1, 12,
- 13, 22, -1, -1, -1, -1, -1, -1, 29, 22,
- -1, -1, 33, 34, -1, 36, 29, -1, -1, -1,
- 33, 34, 43, 36, -1, -1, 47, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 12,
+ 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
+ 33, 34, -1, 36, -1, -1, -1, -1, -1, -1,
43, -1, -1, -1, 47, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 65, 66, 67, 68, -1, 70, -1, -1,
- 81, 82, 83, -1, -1, -1, 87, -1, 81, 82,
- 83, -1, 93, -1, 87, -1, -1, -1, -1, -1,
- 93, -1, 12, 13, -1, -1, -1, -1, -1, -1,
- 12, 13, 22, -1, -1, -1, -1, -1, -1, 29,
- 22, -1, -1, 33, 34, -1, 36, 29, -1, -1,
- -1, 33, 34, 43, 36, -1, -1, 47, -1, -1,
- -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 65, 66, 67, 68, -1,
- 70, -1, -1, 65, 66, 67, 68, -1, 70, -1,
- -1, 81, 82, 83, -1, -1, -1, 87, -1, 81,
- 82, 83, -1, 93, -1, 87, -1, -1, -1, -1,
- -1, 93, -1, 12, 13, -1, -1, -1, -1, -1,
- -1, 12, 13, 22, -1, -1, -1, -1, -1, -1,
- 29, 22, -1, -1, 33, 34, -1, 36, 29, -1,
- -1, -1, 33, 34, 43, 36, -1, -1, 47, -1,
- -1, -1, 43, -1, -1, -1, 47, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
- -1, 70, -1, -1, 65, 66, 67, 68, -1, 70,
- -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
- 81, 82, 83, -1, 93, -1, 87, -1, -1, -1,
- -1, -1, 93, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, -1, -1, -1, -1,
+ 93, 94, 95, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 12, 13, -1, -1, -1, -1, -1, -1,
-1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
-1, -1, -1, 33, 34, -1, 36, -1, -1, -1,
@@ -819,44 +808,45 @@ const short QQmlJSGrammar::action_check [] = {
-1, -1, -1, -1, -1, 65, 66, 67, 68, -1,
70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 81, 82, 83, -1, -1, -1, 87, -1, -1,
- -1, -1, -1, 93, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 10, -1, 12, 13, -1, -1, -1,
- -1, -1, -1, -1, -1, 22, -1, -1, -1, -1,
- -1, -1, 29, -1, -1, -1, 33, 34, -1, 36,
- -1, -1, -1, -1, -1, -1, 43, -1, -1, -1,
- 47, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 65, 66,
- 67, 68, -1, 70, -1, -1, -1, -1, 75, -1,
- -1, -1, -1, -1, 81, 82, 83, 84, -1, -1,
- 87, -1, -1, -1, -1, -1, 93, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 10, -1, 12, 13,
- -1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
- -1, -1, -1, -1, -1, 29, -1, -1, -1, 33,
- 34, -1, 36, -1, -1, -1, -1, -1, -1, 43,
- -1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
- -1, 55, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 65, 66, 67, 68, -1, 70, -1, -1, -1,
- -1, 75, -1, -1, -1, -1, -1, 81, 82, 83,
- 84, -1, -1, 87, -1, -1, -1, -1, -1, 93,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 10,
- -1, 12, 13, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 93, 94, 95, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 10, -1, 12, 13, -1,
+ -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
+ -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
+ -1, 36, -1, -1, -1, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, -1, -1, -1,
+ 75, -1, -1, -1, -1, -1, 81, 82, 83, 84,
+ -1, -1, 87, -1, -1, -1, -1, -1, 93, 94,
+ 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 10, -1, 12, 13, -1, -1, -1, -1, -1, -1,
+ -1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
+ -1, -1, -1, 33, 34, -1, 36, -1, -1, -1,
+ -1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
+ -1, -1, -1, -1, -1, 55, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 65, 66, 67, 68, -1,
+ 70, -1, -1, -1, -1, 75, -1, -1, -1, -1,
+ -1, 81, 82, 83, 84, -1, -1, 87, -1, -1,
+ -1, -1, -1, 93, 94, 95, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 10, -1, 12, 13, -1,
+ -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
+ -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
+ -1, 36, -1, -1, -1, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ 55, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, -1, -1, -1,
+ 75, -1, -1, -1, -1, -1, 81, 82, 83, 84,
+ -1, -1, 87, -1, -1, -1, -1, -1, 93, 94,
+ 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
-1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
- -1, -1, 33, 34, -1, 36, -1, -1, -1, -1,
- -1, -1, 43, -1, -1, -1, 47, -1, -1, -1,
- -1, -1, -1, -1, 55, -1, -1, -1, -1, -1,
+ -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
+ -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
+ 51, -1, 53, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
- -1, -1, -1, -1, 75, -1, -1, -1, -1, -1,
- 81, 82, 83, 84, -1, -1, 87, -1, -1, -1,
- -1, -1, 93, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
- -1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
- 29, -1, -1, -1, 33, 34, -1, 36, -1, -1,
- -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
- -1, -1, 51, -1, 53, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
- -1, 70, -1, 72, -1, 74, -1, 76, -1, -1,
- -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
- -1, -1, -1, -1, 93, -1, -1, -1, -1, -1,
+ -1, 72, -1, 74, -1, 76, -1, -1, -1, -1,
+ 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
+ -1, -1, 93, 94, 95, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 7, -1, -1, -1, 11, 12,
13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
-1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
@@ -866,44 +856,45 @@ const short QQmlJSGrammar::action_check [] = {
-1, -1, 65, 66, 67, 68, -1, 70, -1, 72,
-1, 74, -1, 76, -1, -1, -1, -1, 81, 82,
83, -1, -1, -1, 87, -1, -1, -1, -1, -1,
- 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
- -1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
- -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
- -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
- 51, -1, 53, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
- -1, 72, -1, 74, 75, 76, -1, -1, -1, -1,
- 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
- -1, -1, 93, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 8, -1, -1, 11, 12, 13, -1, -1,
- -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
- -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
- 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
- -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
- 56, -1, -1, -1, -1, -1, -1, -1, -1, 65,
- 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
- 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
- -1, 87, -1, -1, -1, -1, -1, 93, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 8, -1, -1,
- 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
- -1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
- -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
- -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
- 51, -1, 53, -1, -1, 56, -1, -1, -1, -1,
- -1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
- -1, 72, -1, 74, -1, 76, -1, -1, -1, -1,
- 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
- -1, -1, 93, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 8, -1, -1, 11, 12, 13, -1, -1,
- -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
- -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
- 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
- -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
- 56, -1, -1, -1, -1, -1, -1, -1, -1, 65,
- 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
- 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
- -1, 87, -1, -1, -1, -1, -1, 93, -1, -1,
+ 93, 94, 95, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
+ -1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
+ 29, -1, -1, -1, 33, 34, -1, 36, -1, -1,
+ -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
+ -1, -1, 51, -1, 53, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
+ -1, 70, -1, 72, -1, 74, 75, 76, -1, -1,
+ -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
+ -1, -1, -1, -1, 93, 94, 95, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 8, -1, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
+ 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
+ -1, 53, -1, -1, 56, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ 72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
+ -1, 93, 94, 95, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 8, -1, -1, 11, 12, 13, -1,
+ -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
+ -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
+ -1, 36, -1, -1, -1, 40, -1, 42, 43, 44,
+ -1, -1, 47, -1, -1, -1, 51, -1, 53, -1,
+ -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, 72, -1, 74,
+ -1, 76, -1, -1, -1, -1, 81, 82, 83, -1,
+ -1, -1, 87, -1, -1, -1, -1, -1, 93, 94,
+ 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 8, -1, -1, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
+ -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, 56, -1,
+ -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
+ 68, -1, 70, -1, 72, -1, 74, -1, 76, -1,
+ -1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
+ -1, -1, -1, -1, -1, 93, 94, 95, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 8, -1, -1,
11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
-1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
@@ -913,16 +904,7 @@ const short QQmlJSGrammar::action_check [] = {
-1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
-1, 72, -1, 74, -1, 76, -1, -1, -1, -1,
81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
- -1, -1, 93, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
- -1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
- 29, 30, -1, -1, 33, 34, -1, 36, -1, -1,
- -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
- -1, -1, 51, -1, 53, -1, -1, -1, -1, -1,
- -1, -1, 61, -1, -1, -1, 65, 66, 67, 68,
- 69, 70, -1, 72, 73, 74, -1, 76, -1, 78,
- -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
- -1, -1, -1, -1, 93, -1, -1, -1, -1, -1,
+ -1, -1, 93, 94, 95, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 11, 12, 13, -1, -1, -1,
-1, -1, -1, -1, -1, 22, -1, -1, -1, -1,
-1, -1, 29, 30, -1, -1, 33, 34, -1, 36,
@@ -931,120 +913,149 @@ const short QQmlJSGrammar::action_check [] = {
-1, -1, -1, -1, 61, -1, -1, -1, 65, 66,
67, 68, 69, 70, -1, 72, 73, 74, -1, 76,
-1, 78, -1, -1, 81, 82, 83, -1, -1, -1,
- 87, -1, -1, -1, -1, -1, 93, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 4, 5, 6, -1,
- -1, 9, 10, 11, -1, -1, 14, -1, 16, -1,
- -1, -1, 20, 21, 22, -1, -1, -1, -1, -1,
- -1, 29, 30, 31, 32, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 43, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 59, -1, -1, -1, -1, -1, -1, 66, 67,
- 68, 69, 70, 71, -1, 73, 74, 75, 76, 77,
- 78, -1, -1, 81, 82, 83, 84, 85, 86, -1,
- -1, -1, -1, -1, -1, 93, -1, -1, -1, -1,
+ 87, -1, -1, -1, -1, -1, 93, 94, 95, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 11, 12,
+ 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, 30, -1, -1,
+ 33, 34, -1, 36, -1, -1, -1, 40, -1, 42,
+ 43, 44, -1, -1, 47, -1, -1, -1, 51, -1,
+ 53, -1, -1, -1, -1, -1, -1, -1, 61, -1,
+ -1, -1, 65, 66, 67, 68, 69, 70, -1, 72,
+ 73, 74, -1, 76, -1, 78, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, -1, -1, -1, -1,
+ 93, 94, 95, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 4, 5, 6, -1, -1, 9, 10, 11,
+ -1, -1, 14, -1, 16, -1, -1, -1, 20, 21,
+ 22, -1, -1, -1, -1, -1, -1, 29, 30, 31,
+ 32, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 43, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
+ -1, -1, -1, -1, 66, 67, 68, 69, 70, 71,
+ -1, 73, 74, 75, 76, 77, 78, -1, -1, 81,
+ 82, 83, 84, 85, 86, -1, -1, -1, -1, -1,
+ -1, 93, 94, 95, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 4, 5, 6, -1, -1, 9, 10,
+ 11, -1, -1, 14, -1, 16, -1, -1, -1, 20,
+ 21, 22, -1, -1, -1, -1, -1, -1, 29, 30,
+ 31, 32, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 43, -1, -1, -1, 47, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 59, -1,
+ -1, -1, -1, -1, 65, 66, 67, 68, 69, 70,
+ 71, -1, 73, 74, 75, 76, 77, 78, -1, -1,
+ 81, 82, 83, 84, 85, 86, -1, -1, -1, -1,
+ -1, -1, 93, 94, 95, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 4, 5, 6, -1, -1, 9,
+ 10, 11, -1, -1, 14, -1, 16, -1, -1, -1,
+ 20, 21, 22, -1, -1, -1, -1, -1, -1, 29,
+ 30, 31, 32, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
+ -1, -1, -1, -1, -1, 65, 66, 67, 68, 69,
+ 70, 71, -1, 73, 74, 75, 76, 77, 78, -1,
+ -1, 81, 82, 83, 84, 85, 86, -1, -1, -1,
+ -1, -1, -1, 93, 94, 95, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 4, 5, 6, -1, -1,
9, 10, 11, -1, -1, 14, -1, 16, -1, -1,
-1, 20, 21, 22, -1, -1, -1, -1, -1, -1,
29, 30, 31, 32, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 43, -1, -1, -1, 47, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 59, -1, -1, -1, -1, -1, 65, 66, 67, -1,
+ -1, -1, -1, -1, -1, -1, 55, -1, -1, -1,
+ 59, -1, -1, -1, -1, -1, 65, 66, 67, 68,
69, 70, 71, -1, 73, 74, 75, 76, 77, 78,
-1, -1, 81, 82, 83, 84, 85, 86, -1, -1,
+ -1, -1, -1, -1, 93, 94, 95, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 4, -1, -1, -1,
+ -1, 9, -1, 11, 12, 13, 14, -1, -1, -1,
+ -1, -1, -1, 21, 22, -1, -1, -1, -1, -1,
+ -1, 29, 30, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, 59, -1, 61, -1, -1, -1, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, -1, -1, 81, 82, 83, 84, 85, -1, 87,
+ -1, -1, -1, -1, -1, 93, 94, 95, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 4, -1, -1,
+ -1, -1, 9, -1, 11, 12, 13, 14, -1, -1,
+ -1, -1, -1, -1, 21, 22, -1, -1, -1, -1,
+ -1, -1, 29, 30, -1, -1, 33, 34, -1, 36,
+ -1, -1, -1, 40, -1, 42, 43, 44, -1, -1,
+ 47, -1, -1, -1, 51, -1, 53, -1, -1, -1,
+ -1, -1, 59, -1, 61, -1, -1, -1, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, -1, -1, 81, 82, 83, 84, 85, -1,
+ 87, -1, -1, -1, -1, -1, 93, 94, 95, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 4, 5,
+ 6, -1, -1, 9, 10, 11, 12, 13, 14, -1,
+ 16, -1, -1, -1, 20, 21, 22, -1, -1, -1,
+ -1, -1, -1, 29, 30, 31, 32, 33, 34, -1,
+ 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
+ -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
+ -1, -1, -1, 59, -1, 61, -1, -1, -1, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, -1, -1, 81, 82, 83, 84, 85,
+ 86, 87, -1, -1, -1, -1, -1, 93, 94, 95,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 4,
+ 5, 6, -1, -1, 9, 10, 11, 12, 13, 14,
+ -1, 16, -1, -1, -1, 20, 21, 22, -1, -1,
+ -1, -1, -1, -1, 29, 30, 31, 32, 33, 34,
+ -1, 36, -1, -1, -1, 40, -1, 42, 43, 44,
+ -1, -1, 47, -1, -1, -1, 51, -1, 53, -1,
+ 55, -1, -1, -1, 59, -1, 61, -1, -1, -1,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, -1, -1, 81, 82, 83, 84,
+ 85, 86, 87, -1, -1, -1, -1, -1, 93, 94,
+ 95, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+
+ 15, 39, 29, 3, 15, 15, 13, 15, 3, 15,
+ 29, 9, 15, 15, 3, 3, 39, 22, 19, 15,
+ 19, 3, 15, 15, 15, 11, 3, 74, 15, 19,
+ 15, 15, 29, 13, 15, 29, 102, 15, 3, 15,
+ 97, 3, 100, 15, -1, 15, 29, 22, 15, 3,
+ 3, 15, 3, 22, 15, 15, 22, 15, 15, 3,
+ 39, 3, 3, 3, 3, 39, 39, 22, 39, 3,
+ 15, 39, 15, 2, -1, 13, 39, 13, 2, 2,
+ 39, 13, 13, 39, 2, 15, 15, 39, 20, 3,
+ 3, 15, 15, 3, 15, 15, 2, 15, 41, -1,
+ 2, 51, 51, 51, 53, 51, 56, 53, 56, 15,
+ 48, 41, 48, 15, 51, 15, 51, 48, 51, 56,
+ 39, 56, 39, 56, 51, 51, 53, 53, 47, 51,
+ 47, 53, 4, 15, 2, 51, 15, 53, 15, 51,
+ 40, 15, 51, 15, 53, 4, 51, 15, 53, 15,
+ 51, 63, 53, 51, 51, 13, 15, 51, 16, 53,
+ 42, 75, 75, 51, 3, 44, 43, 65, 15, 43,
+ 67, 91, 13, 61, -1, 16, 42, 15, 51, 15,
+ 51, 54, 51, 54, 51, 106, 53, 56, 51, 13,
+ 53, 51, 16, 53, 2, 51, 43, 51, 35, 2,
+ 56, 15, 39, 51, 42, 59, 42, 15, 56, 51,
+ 2, 51, 15, 2, 56, -1, 56, 51, 51, 51,
+ 2, 51, 56, 15, 57, 57, 15, 57, 51, 4,
+ 51, 2, -1, 15, 57, 56, 75, 2, 51, 51,
+ 15, 53, 55, 2, 15, 51, 51, 2, 53, 55,
+ 15, 51, 51, 53, 53, 51, 15, 53, 51, 2,
+ 15, 51, 55, 51, 51, 15, 56, 2, 56, 56,
+ -1, 3, 15, 51, 64, 89, -1, 51, 56, 51,
+ 15, 68, 56, -1, 56, 73, 58, 51, 66, -1,
+ -1, 51, 56, -1, 44, 45, 56, 51, 58, 73,
+ 51, -1, 56, 51, 58, 56, 51, 51, 56, 73,
+ 51, 56, 56, 58, 13, 56, -1, -1, 62, 60,
+ -1, 20, 73, 13, 5, 73, 16, 5, 18, -1,
+ -1, -1, 13, 32, 33, 13, -1, -1, -1, 20,
+ -1, -1, 20, 75, -1, -1, -1, -1, -1, 39,
+ 85, 32, 33, -1, 32, 33, 22, 23, 24, 25,
+ 26, 27, 28, 21, 22, 23, 24, 25, 26, 27,
+ 28, 13, -1, -1, -1, -1, 2, -1, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, -1, -1, 15,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 4, 5, 6, -1, -1, 9,
- 10, 11, -1, -1, 14, -1, 16, -1, -1, -1,
- 20, 21, 22, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, 32, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
- -1, -1, -1, -1, -1, 55, -1, -1, -1, 59,
- -1, -1, -1, -1, -1, 65, 66, 67, -1, 69,
- 70, 71, -1, 73, 74, 75, 76, 77, 78, -1,
- -1, 81, 82, 83, 84, 85, 86, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 4, -1, -1, -1, -1, 9, -1,
- 11, 12, 13, 14, -1, -1, -1, -1, -1, -1,
- 21, 22, -1, -1, -1, -1, -1, -1, 29, 30,
- -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
- -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
- 51, -1, 53, -1, -1, -1, -1, -1, 59, -1,
- 61, -1, -1, -1, 65, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 76, 77, 78, -1, -1,
- 81, 82, 83, 84, 85, -1, 87, -1, -1, -1,
- -1, -1, 93, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 4, -1, -1, -1, -1, 9, -1, 11,
- 12, 13, 14, -1, -1, -1, -1, -1, -1, 21,
- 22, -1, -1, -1, -1, -1, -1, 29, 30, -1,
- -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
- 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
- -1, 53, -1, -1, -1, -1, -1, 59, -1, 61,
- -1, -1, -1, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, -1, -1, 81,
- 82, 83, 84, 85, -1, 87, -1, -1, -1, -1,
- -1, 93, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 4, 5, 6, -1, -1, 9, 10, 11, 12,
- 13, 14, -1, 16, -1, -1, -1, 20, 21, 22,
- -1, -1, -1, -1, -1, -1, 29, 30, 31, 32,
- 33, 34, -1, 36, -1, -1, -1, 40, -1, 42,
- 43, 44, -1, -1, 47, -1, -1, -1, 51, -1,
- 53, -1, -1, -1, -1, -1, 59, -1, 61, -1,
- -1, -1, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, -1, -1, 81, 82,
- 83, 84, 85, 86, 87, -1, -1, -1, -1, -1,
- 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 4, 5, 6, -1, -1, 9, 10, 11, 12, 13,
- 14, -1, 16, -1, -1, -1, 20, 21, 22, -1,
- -1, -1, -1, -1, -1, 29, 30, 31, 32, 33,
- 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
- 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
- -1, 55, -1, -1, -1, 59, -1, 61, -1, -1,
- -1, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, -1, -1, 81, 82, 83,
- 84, 85, 86, 87, -1, -1, -1, -1, -1, 93,
- -1, -1, -1, -1, -1, -1, -1, -1, -1,
-
- 15, 3, 13, 29, 29, 15, 15, 4, 2, 15,
- 105, 9, 15, 2, 15, 3, 29, 22, 3, 15,
- 15, 2, 39, 15, 3, 15, 19, 3, 2, 15,
- 3, 15, 19, 11, 71, 15, 19, 2, 13, 39,
- 97, 2, 2, 15, 15, 3, 15, 29, 39, 15,
- 94, 101, 29, 3, 2, 2, 15, 99, 15, 22,
- 3, 3, 15, 15, 2, 2, 15, 22, 2, 39,
- 2, 39, 39, 3, 3, 39, 22, 39, 2, 2,
- 15, 3, 22, 39, 4, 39, 4, 3, 2, 40,
- 3, 3, 2, 2, 39, 39, 3, 3, 13, 2,
- 2, -1, -1, 39, -1, -1, -1, 48, 44, 48,
- -1, 50, 53, -1, 3, 48, 13, 48, 13, 50,
- 53, 48, 48, 48, 50, 15, 53, 48, 53, 48,
- 45, 50, 13, 13, 3, 16, 16, 48, 15, 50,
- 48, 62, 50, 48, 48, 50, 50, 48, 45, 48,
- 45, 50, 48, 39, 48, 48, 48, 53, 44, 53,
- 48, 53, 50, 64, 48, 48, 48, 60, 15, 48,
- 54, 54, 54, 13, 35, -1, 16, 56, 39, 82,
- 82, 48, 48, 72, 48, 48, 53, 53, 52, 48,
- 53, 48, 48, 52, 41, 48, 53, 2, 54, 52,
- 48, 13, 15, 72, 48, 53, 3, 51, 20, 15,
- 100, 88, 48, 48, 50, 50, 48, 48, 50, 50,
- 48, 48, 50, 48, 48, 50, 48, 51, 50, 48,
- 48, 58, 50, 48, 53, 41, 42, 48, 53, -1,
- 48, -1, 53, -1, 63, 53, 61, 48, 48, 48,
- 48, -1, 53, 53, 53, 53, 48, 55, 57, 70,
- -1, 53, 70, 48, -1, 65, -1, 59, 53, 70,
- 55, 48, 48, 86, -1, 72, 53, 53, 55, 55,
- 13, 48, 48, 16, 5, 18, 53, 53, 13, -1,
- 5, -1, 13, -1, -1, 20, -1, -1, 13, 20,
- -1, -1, 3, 70, 70, 20, 39, 32, 33, -1,
- -1, 32, 33, -1, -1, -1, -1, 32, 33, 22,
- 23, 24, 25, 26, 27, 28, 13, -1, -1, -1,
- -1, -1, -1, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 13, -1, -1, -1, -1, -1, -1, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 72, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 21, 22, 23, 24,
- 25, 26, 27, 28, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 85,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 13, -1, -1, -1, -1, -1, -1, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1052,6 +1063,6 @@ const short QQmlJSGrammar::action_check [] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1};
+ -1, -1, -1, -1, -1, -1, -1};
QT_END_NAMESPACE
diff --git a/src/qml/qml/parser/qqmljsgrammar_p.h b/src/qml/qml/parser/qqmljsgrammar_p.h
index 651c6e391f..9ef4695d69 100644
--- a/src/qml/qml/parser/qqmljsgrammar_p.h
+++ b/src/qml/qml/parser/qqmljsgrammar_p.h
@@ -63,8 +63,8 @@ class QQmlJSGrammar
public:
enum VariousConstants {
EOF_SYMBOL = 0,
- REDUCE_HERE = 102,
- SHIFT_THERE = 101,
+ REDUCE_HERE = 104,
+ SHIFT_THERE = 103,
T_AND = 1,
T_AND_AND = 2,
T_AND_EQ = 3,
@@ -90,18 +90,19 @@ public:
T_EQ = 17,
T_EQ_EQ = 18,
T_EQ_EQ_EQ = 19,
- T_ERROR = 94,
+ T_ERROR = 96,
T_FALSE = 83,
- T_FEED_JS_EXPRESSION = 98,
- T_FEED_JS_PROGRAM = 100,
- T_FEED_JS_SOURCE_ELEMENT = 99,
- T_FEED_JS_STATEMENT = 97,
- T_FEED_UI_OBJECT_MEMBER = 96,
- T_FEED_UI_PROGRAM = 95,
+ T_FEED_JS_EXPRESSION = 100,
+ T_FEED_JS_PROGRAM = 102,
+ T_FEED_JS_SOURCE_ELEMENT = 101,
+ T_FEED_JS_STATEMENT = 99,
+ T_FEED_UI_OBJECT_MEMBER = 98,
+ T_FEED_UI_PROGRAM = 97,
T_FINALLY = 20,
T_FOR = 21,
T_FUNCTION = 22,
T_GE = 23,
+ T_GET = 94,
T_GT = 24,
T_GT_GT = 25,
T_GT_GT_EQ = 26,
@@ -148,6 +149,7 @@ public:
T_RETURN = 59,
T_RPAREN = 60,
T_SEMICOLON = 61,
+ T_SET = 95,
T_SIGNAL = 67,
T_STAR = 63,
T_STAR_EQ = 64,
@@ -166,15 +168,15 @@ public:
T_XOR = 79,
T_XOR_EQ = 80,
- ACCEPT_STATE = 645,
- RULE_COUNT = 350,
- STATE_COUNT = 646,
- TERMINAL_COUNT = 103,
- NON_TERMINAL_COUNT = 107,
+ ACCEPT_STATE = 655,
+ RULE_COUNT = 351,
+ STATE_COUNT = 656,
+ TERMINAL_COUNT = 105,
+ NON_TERMINAL_COUNT = 108,
- GOTO_INDEX_OFFSET = 646,
- GOTO_INFO_OFFSET = 3019,
- GOTO_CHECK_OFFSET = 3019
+ GOTO_INDEX_OFFSET = 656,
+ GOTO_INFO_OFFSET = 2970,
+ GOTO_CHECK_OFFSET = 2970
};
static const char *const spell [];
diff --git a/src/qml/qml/parser/qqmljskeywords_p.h b/src/qml/qml/parser/qqmljskeywords_p.h
index 8bbbe2355b..7fcf001303 100644
--- a/src/qml/qml/parser/qqmljskeywords_p.h
+++ b/src/qml/qml/parser/qqmljskeywords_p.h
@@ -53,6 +53,12 @@
// We mean it.
//
+#include "qqmljslexer_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QQmlJS {
+
static inline int classify2(const QChar *s, bool qmlMode) {
if (s[0].unicode() == 'a') {
if (s[1].unicode() == 's') {
@@ -88,6 +94,13 @@ static inline int classify3(const QChar *s, bool qmlMode) {
}
}
}
+ else if (s[0].unicode() == 'g') {
+ if (s[1].unicode() == 'e') {
+ if (s[2].unicode() == 't') {
+ return Lexer::T_GET;
+ }
+ }
+ }
else if (s[0].unicode() == 'i') {
if (s[1].unicode() == 'n') {
if (s[2].unicode() == 't') {
@@ -102,6 +115,13 @@ static inline int classify3(const QChar *s, bool qmlMode) {
}
}
}
+ else if (s[0].unicode() == 's') {
+ if (s[1].unicode() == 'e') {
+ if (s[2].unicode() == 't') {
+ return Lexer::T_SET;
+ }
+ }
+ }
else if (s[0].unicode() == 't') {
if (s[1].unicode() == 'r') {
if (s[2].unicode() == 'y') {
@@ -309,7 +329,7 @@ static inline int classify5(const QChar *s, bool qmlMode) {
if (s[2].unicode() == 'p') {
if (s[3].unicode() == 'e') {
if (s[4].unicode() == 'r') {
- return qmlMode ? int(Lexer::T_SUPER) : int(Lexer::T_IDENTIFIER);
+ return qmlMode ? int(Lexer::T_SUPER) : int(Lexer::T_RESERVED_WORD);
}
}
}
@@ -857,4 +877,8 @@ int Lexer::classify(const QChar *s, int n, bool qmlMode) {
} // switch
}
+} // namespace QQmlJS
+
+QT_QML_END_NAMESPACE
+
#endif // QQMLJSKEYWORDS_P_H
diff --git a/src/qml/qml/parser/qqmljslexer.cpp b/src/qml/qml/parser/qqmljslexer.cpp
index ec9b718917..9175efe054 100644
--- a/src/qml/qml/parser/qqmljslexer.cpp
+++ b/src/qml/qml/parser/qqmljslexer.cpp
@@ -42,6 +42,7 @@
#include "qqmljslexer_p.h"
#include "qqmljsengine_p.h"
#include "qqmljsmemorypool_p.h"
+#include "qqmljskeywords_p.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QVarLengthArray>
@@ -136,6 +137,7 @@ void Lexer::setCode(const QString &code, int lineno, bool qmlMode)
_tokenSpell = QStringRef();
_codePtr = code.unicode();
+ _endPtr = _codePtr + code.length();
_lastLinePtr = _codePtr;
_tokenLinePtr = _codePtr;
_tokenStartPtr = _codePtr;
@@ -177,6 +179,52 @@ void Lexer::scanChar()
}
}
+namespace {
+inline bool isBinop(int tok)
+{
+ switch (tok) {
+ case Lexer::T_AND:
+ case Lexer::T_AND_AND:
+ case Lexer::T_AND_EQ:
+ case Lexer::T_DIVIDE_:
+ case Lexer::T_DIVIDE_EQ:
+ case Lexer::T_EQ:
+ case Lexer::T_EQ_EQ:
+ case Lexer::T_EQ_EQ_EQ:
+ case Lexer::T_GE:
+ case Lexer::T_GT:
+ case Lexer::T_GT_GT:
+ case Lexer::T_GT_GT_EQ:
+ case Lexer::T_GT_GT_GT:
+ case Lexer::T_GT_GT_GT_EQ:
+ case Lexer::T_LE:
+ case Lexer::T_LT:
+ case Lexer::T_LT_LT:
+ case Lexer::T_LT_LT_EQ:
+ case Lexer::T_MINUS:
+ case Lexer::T_MINUS_EQ:
+ case Lexer::T_NOT_EQ:
+ case Lexer::T_NOT_EQ_EQ:
+ case Lexer::T_OR:
+ case Lexer::T_OR_EQ:
+ case Lexer::T_OR_OR:
+ case Lexer::T_PLUS:
+ case Lexer::T_PLUS_EQ:
+ case Lexer::T_REMAINDER:
+ case Lexer::T_REMAINDER_EQ:
+ case Lexer::T_RETURN:
+ case Lexer::T_STAR:
+ case Lexer::T_STAR_EQ:
+ case Lexer::T_XOR:
+ case Lexer::T_XOR_EQ:
+ return true;
+
+ default:
+ return false;
+ }
+}
+} // anonymous namespace
+
int Lexer::lex()
{
const int previousTokenKind = _tokenKind;
@@ -193,9 +241,15 @@ int Lexer::lex()
switch (_tokenKind) {
case T_LBRACE:
case T_SEMICOLON:
+ case T_QUESTION:
case T_COLON:
+ case T_TILDE:
_delimited = true;
break;
+ default:
+ if (isBinop(_tokenKind))
+ _delimited = true;
+ break;
case T_IF:
case T_FOR:
@@ -275,6 +329,59 @@ QChar Lexer::decodeUnicodeEscapeCharacter(bool *ok)
return QChar();
}
+static inline bool isIdentifierStart(QChar ch)
+{
+ // fast path for ascii
+ if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') ||
+ (ch.unicode() >= 'A' && ch.unicode() <= 'Z') ||
+ ch == '$' || ch == '_')
+ return true;
+
+ switch (ch.category()) {
+ case QChar::Number_Letter:
+ case QChar::Letter_Uppercase:
+ case QChar::Letter_Lowercase:
+ case QChar::Letter_Titlecase:
+ case QChar::Letter_Modifier:
+ case QChar::Letter_Other:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+static bool isIdentifierPart(QChar ch)
+{
+ // fast path for ascii
+ if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') ||
+ (ch.unicode() >= 'A' && ch.unicode() <= 'Z') ||
+ (ch.unicode() >= '0' && ch.unicode() <= '9') ||
+ ch == '$' || ch == '_' ||
+ ch.unicode() == 0x200c /* ZWNJ */ || ch.unicode() == 0x200d /* ZWJ */)
+ return true;
+
+ switch (ch.category()) {
+ case QChar::Mark_NonSpacing:
+ case QChar::Mark_SpacingCombining:
+
+ case QChar::Number_DecimalDigit:
+ case QChar::Number_Letter:
+
+ case QChar::Letter_Uppercase:
+ case QChar::Letter_Lowercase:
+ case QChar::Letter_Titlecase:
+ case QChar::Letter_Modifier:
+ case QChar::Letter_Other:
+
+ case QChar::Punctuation_Connector:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
int Lexer::scanToken()
{
if (_stackToken != -1) {
@@ -310,7 +417,7 @@ again:
_tokenStartPtr = _codePtr - 1;
_tokenLine = _currentLineNumber;
- if (_char.isNull())
+ if (_codePtr > _endPtr)
return EOF_SYMBOL;
const QChar ch = _char;
@@ -395,7 +502,7 @@ again:
case '/':
if (_char == QLatin1Char('*')) {
scanChar();
- while (!_char.isNull()) {
+ while (_codePtr <= _endPtr) {
if (_char == QLatin1Char('*')) {
scanChar();
if (_char == QLatin1Char('/')) {
@@ -413,7 +520,7 @@ again:
}
}
} else if (_char == QLatin1Char('/')) {
- while (!_char.isNull() && !isLineTerminator()) {
+ while (_codePtr <= _endPtr && !isLineTerminator()) {
scanChar();
}
if (_engine) {
@@ -555,8 +662,14 @@ again:
const QChar *startCode = _codePtr;
if (_engine) {
- while (!_char.isNull()) {
- if (isLineTerminator() || _char == QLatin1Char('\\')) {
+ while (_codePtr <= _endPtr) {
+ if (isLineTerminator()) {
+ if (qmlMode())
+ break;
+ _errorCode = IllegalCharacter;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "Stray newline in string literal");
+ return T_ERROR;
+ } else if (_char == QLatin1Char('\\')) {
break;
} else if (_char == quote) {
_tokenSpell = _engine->midRef(startCode - _code.unicode() - 1, _codePtr - startCode);
@@ -574,7 +687,7 @@ again:
while (startCode != _codePtr - 1)
_tokenText += *startCode++;
- while (! _char.isNull()) {
+ while (_codePtr <= _endPtr) {
if (unsigned sequenceLength = isLineTerminatorSequence()) {
multilineStringLiteral = true;
_tokenText += _char;
@@ -598,8 +711,11 @@ again:
// unicode escape sequence
case 'u':
u = decodeUnicodeEscapeCharacter(&ok);
- if (! ok)
- u = _char;
+ if (! ok) {
+ _errorCode = IllegalUnicodeEscapeSequence;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence");
+ return T_ERROR;
+ }
break;
// hex escape sequence
@@ -631,14 +747,24 @@ again:
case 'v': u = QLatin1Char('\v'); scanChar(); break;
case '0':
- if (! _codePtr[1].isDigit()) {
+ if (! _codePtr->isDigit()) {
scanChar();
u = QLatin1Char('\0');
- } else {
- // ### parse deprecated octal escape sequence ?
- u = _char;
+ break;
}
- break;
+ // fall through
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ _errorCode = IllegalEscapeSequence;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "Octal escape sequences are not allowed");
+ return T_ERROR;
case '\r':
if (isLineTerminatorSequence() == 2) {
@@ -687,28 +813,28 @@ again:
case '9':
return scanNumber(ch);
- default:
- if (ch.isLetter() || ch == QLatin1Char('$') || ch == QLatin1Char('_') || (ch == QLatin1Char('\\') && _char == QLatin1Char('u'))) {
- bool identifierWithEscapeChars = false;
- if (ch == QLatin1Char('\\')) {
- identifierWithEscapeChars = true;
+ default: {
+ QChar c = ch;
+ bool identifierWithEscapeChars = false;
+ if (c == QLatin1Char('\\') && _char == QLatin1Char('u')) {
+ identifierWithEscapeChars = true;
+ bool ok = false;
+ c = decodeUnicodeEscapeCharacter(&ok);
+ if (! ok) {
+ _errorCode = IllegalUnicodeEscapeSequence;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence");
+ return T_ERROR;
+ }
+ }
+ if (isIdentifierStart(c)) {
+ if (identifierWithEscapeChars) {
_tokenText.resize(0);
- bool ok = false;
- _tokenText += decodeUnicodeEscapeCharacter(&ok);
+ _tokenText += c;
_validTokenText = true;
- if (! ok) {
- _errorCode = IllegalUnicodeEscapeSequence;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence");
- return T_ERROR;
- }
}
while (true) {
- if (_char.isLetterOrNumber() || _char == QLatin1Char('$') || _char == QLatin1Char('_')) {
- if (identifierWithEscapeChars)
- _tokenText += _char;
-
- scanChar();
- } else if (_char == QLatin1Char('\\') && _codePtr[0] == QLatin1Char('u')) {
+ c = _char;
+ if (_char == QLatin1Char('\\') && _codePtr[0] == QLatin1Char('u')) {
if (! identifierWithEscapeChars) {
identifierWithEscapeChars = true;
_tokenText.resize(0);
@@ -718,31 +844,41 @@ again:
scanChar(); // skip '\\'
bool ok = false;
- _tokenText += decodeUnicodeEscapeCharacter(&ok);
+ c = decodeUnicodeEscapeCharacter(&ok);
if (! ok) {
_errorCode = IllegalUnicodeEscapeSequence;
_errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence");
return T_ERROR;
}
- } else {
- _tokenLength = _codePtr - _tokenStartPtr - 1;
+ if (isIdentifierPart(c))
+ _tokenText += c;
+ continue;
+ } else if (isIdentifierPart(c)) {
+ if (identifierWithEscapeChars)
+ _tokenText += c;
- int kind = T_IDENTIFIER;
+ scanChar();
+ continue;
+ }
- if (! identifierWithEscapeChars)
- kind = classify(_tokenStartPtr, _tokenLength, _qmlMode);
+ _tokenLength = _codePtr - _tokenStartPtr - 1;
- if (_engine) {
- if (kind == T_IDENTIFIER && identifierWithEscapeChars)
- _tokenSpell = _engine->newStringRef(_tokenText);
- else
- _tokenSpell = _engine->midRef(_tokenStartPtr - _code.unicode(), _tokenLength);
- }
+ int kind = T_IDENTIFIER;
- return kind;
+ if (! identifierWithEscapeChars)
+ kind = classify(_tokenStartPtr, _tokenLength, _qmlMode);
+
+ if (_engine) {
+ if (kind == T_IDENTIFIER && identifierWithEscapeChars)
+ _tokenSpell = _engine->newStringRef(_tokenText);
+ else
+ _tokenSpell = _engine->midRef(_tokenStartPtr - _code.unicode(), _tokenLength);
}
+
+ return kind;
}
}
+ }
break;
}
@@ -753,12 +889,14 @@ again:
int Lexer::scanNumber(QChar ch)
{
if (ch != QLatin1Char('0')) {
- double integer = ch.unicode() - '0';
+ QByteArray buf;
+ buf.reserve(64);
+ buf += ch.toLatin1();
QChar n = _char;
const QChar *code = _codePtr;
while (n.isDigit()) {
- integer = integer * 10 + (n.unicode() - '0');
+ buf += n.toLatin1();
n = *code++;
}
@@ -767,17 +905,23 @@ int Lexer::scanNumber(QChar ch)
_codePtr = code - 1;
scanChar();
}
- _tokenValue = integer;
+ buf.append('\0');
+ _tokenValue = strtod(buf.constData(), 0);
return T_NUMERIC_LITERAL;
}
+ } else if (_char.isDigit() && !qmlMode()) {
+ _errorCode = IllegalCharacter;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "Decimal numbers can't start with '0'");
+ return T_ERROR;
}
QVarLengthArray<char,32> chars;
chars.append(ch.unicode());
if (ch == QLatin1Char('0') && (_char == QLatin1Char('x') || _char == QLatin1Char('X'))) {
- // parse hex integer literal
+ ch = _char; // remember the x or X to use it in the error message below.
+ // parse hex integer literal
chars.append(_char.unicode());
scanChar(); // consume `x'
@@ -786,6 +930,12 @@ int Lexer::scanNumber(QChar ch)
scanChar();
}
+ if (chars.size() < 3) {
+ _errorCode = IllegalHexNumber;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "At least one hexadecimal digit is required after '0%1'").arg(ch);
+ return T_ERROR;
+ }
+
_tokenValue = integerFromString(chars.constData(), chars.size(), 16);
return T_NUMERIC_LITERAL;
}
@@ -900,7 +1050,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
_tokenText += _char;
scanChar();
- if (_char.isNull() || isLineTerminator()) {
+ if (_codePtr > _endPtr || isLineTerminator()) {
_errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression backslash sequence");
return false;
}
@@ -914,7 +1064,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
_tokenText += _char;
scanChar();
- while (! _char.isNull() && ! isLineTerminator()) {
+ while (_codePtr <= _endPtr && ! isLineTerminator()) {
if (_char == QLatin1Char(']'))
break;
else if (_char == QLatin1Char('\\')) {
@@ -922,7 +1072,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
_tokenText += _char;
scanChar();
- if (_char.isNull() || isLineTerminator()) {
+ if (_codePtr > _endPtr || isLineTerminator()) {
_errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression backslash sequence");
return false;
}
@@ -945,7 +1095,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
break;
default:
- if (_char.isNull() || isLineTerminator()) {
+ if (_codePtr > _endPtr || isLineTerminator()) {
_errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression literal");
return false;
} else {
@@ -1172,5 +1322,3 @@ bool Lexer::scanDirectives(Directives *directives)
return true;
}
-
-#include "qqmljskeywords_p.h"
diff --git a/src/qml/qml/parser/qqmljslexer_p.h b/src/qml/qml/parser/qqmljslexer_p.h
index c6ae0931c1..e7e15cbf94 100644
--- a/src/qml/qml/parser/qqmljslexer_p.h
+++ b/src/qml/qml/parser/qqmljslexer_p.h
@@ -121,6 +121,7 @@ public:
enum Error {
NoError,
IllegalCharacter,
+ IllegalHexNumber,
UnclosedStringLiteral,
IllegalEscapeSequence,
IllegalUnicodeEscapeSequence,
@@ -211,6 +212,7 @@ private:
QStringRef _tokenSpell;
const QChar *_codePtr;
+ const QChar *_endPtr;
const QChar *_lastLinePtr;
const QChar *_tokenLinePtr;
const QChar *_tokenStartPtr;
diff --git a/src/qml/qml/parser/qqmljsparser.cpp b/src/qml/qml/parser/qqmljsparser.cpp
index 1ef760b80a..bc03b57525 100644
--- a/src/qml/qml/parser/qqmljsparser.cpp
+++ b/src/qml/qml/parser/qqmljsparser.cpp
@@ -537,49 +537,49 @@ case 65: {
sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
} break;
-case 71: {
+case 73: {
AST::ThisExpression *node = new (pool) AST::ThisExpression();
node->thisToken = loc(1);
sym(1).Node = node;
} break;
-case 72: {
+case 74: {
AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1));
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 73: {
+case 75: {
AST::NullExpression *node = new (pool) AST::NullExpression();
node->nullToken = loc(1);
sym(1).Node = node;
} break;
-case 74: {
+case 76: {
AST::TrueLiteral *node = new (pool) AST::TrueLiteral();
node->trueToken = loc(1);
sym(1).Node = node;
} break;
-case 75: {
+case 77: {
AST::FalseLiteral *node = new (pool) AST::FalseLiteral();
node->falseToken = loc(1);
sym(1).Node = node;
} break;
-case 76: {
+case 78: {
AST::NumericLiteral *node = new (pool) AST::NumericLiteral(sym(1).dval);
node->literalToken = loc(1);
sym(1).Node = node;
} break;
-case 77:
-case 78: {
+case 79:
+case 80: {
AST::StringLiteral *node = new (pool) AST::StringLiteral(stringRef(1));
node->literalToken = loc(1);
sym(1).Node = node;
} break;
-case 79: {
+case 81: {
bool rx = lexer->scanRegExp(Lexer::NoPrefix);
if (!rx) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
@@ -595,7 +595,7 @@ case 79: {
sym(1).Node = node;
} break;
-case 80: {
+case 82: {
bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
if (!rx) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
@@ -611,28 +611,28 @@ case 80: {
sym(1).Node = node;
} break;
-case 81: {
+case 83: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) 0);
node->lbracketToken = loc(1);
node->rbracketToken = loc(2);
sym(1).Node = node;
} break;
-case 82: {
+case 84: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).Elision->finish());
node->lbracketToken = loc(1);
node->rbracketToken = loc(3);
sym(1).Node = node;
} break;
-case 83: {
+case 85: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish ());
node->lbracketToken = loc(1);
node->rbracketToken = loc(3);
sym(1).Node = node;
} break;
-case 84: {
+case 86: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
(AST::Elision *) 0);
node->lbracketToken = loc(1);
@@ -641,7 +641,7 @@ case 84: {
sym(1).Node = node;
} break;
-case 85: {
+case 87: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
sym(4).Elision->finish());
node->lbracketToken = loc(1);
@@ -650,11 +650,11 @@ case 85: {
sym(1).Node = node;
} break;
-case 86: {
+case 88: {
AST::ObjectLiteral *node = 0;
if (sym(2).Node)
node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyNameAndValueList->finish ());
+ sym(2).PropertyAssignmentList->finish ());
else
node = new (pool) AST::ObjectLiteral();
node->lbraceToken = loc(1);
@@ -662,22 +662,22 @@ case 86: {
sym(1).Node = node;
} break;
-case 87: {
+case 89: {
AST::ObjectLiteral *node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyNameAndValueList->finish ());
+ sym(2).PropertyAssignmentList->finish ());
node->lbraceToken = loc(1);
node->rbraceToken = loc(4);
sym(1).Node = node;
} break;
-case 88: {
+case 90: {
AST::NestedExpression *node = new (pool) AST::NestedExpression(sym(2).Expression);
node->lparenToken = loc(1);
node->rparenToken = loc(3);
sym(1).Node = node;
} break;
-case 89: {
+case 91: {
if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
QLatin1String("Ignored annotation")));
@@ -697,100 +697,119 @@ case 89: {
}
} break;
-case 90: {
+case 92: {
sym(1).Node = new (pool) AST::ElementList((AST::Elision *) 0, sym(1).Expression);
} break;
-case 91: {
+case 93: {
sym(1).Node = new (pool) AST::ElementList(sym(1).Elision->finish(), sym(2).Expression);
} break;
-case 92: {
+case 94: {
AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList,
(AST::Elision *) 0, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 93: {
+case 95: {
AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList, sym(3).Elision->finish(),
sym(4).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 94: {
+case 96: {
AST::Elision *node = new (pool) AST::Elision();
node->commaToken = loc(1);
sym(1).Node = node;
} break;
-case 95: {
+case 97: {
AST::Elision *node = new (pool) AST::Elision(sym(1).Elision);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 96: {
- AST::PropertyNameAndValueList *node = new (pool) AST::PropertyNameAndValueList(
+case 98: {
+ AST::PropertyNameAndValue *node = new (pool) AST::PropertyNameAndValue(
sym(1).PropertyName, sym(3).Expression);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 97: {
- AST::PropertyNameAndValueList *node = new (pool) AST::PropertyNameAndValueList(
- sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
- node->commaToken = loc(2);
- node->colonToken = loc(4);
+case 99: {
+ AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
+ sym(2).PropertyName, sym(6).FunctionBody);
+ node->getSetToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(4);
+ node->lbraceToken = loc(5);
+ node->rbraceToken = loc(7);
sym(1).Node = node;
} break;
-case 98: {
- AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
+case 100: {
+ AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
+ sym(2).PropertyName, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->getSetToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
sym(1).Node = node;
} break;
-case 99:
-case 100: {
+
+case 101: {
+ sym(1).Node = new (pool) AST::PropertyAssignmentList(sym(1).PropertyAssignment);
+} break;
+
+case 102: {
+ AST::PropertyAssignmentList *node = new (pool) AST::PropertyAssignmentList(
+ sym(1).PropertyAssignmentList, sym(3).PropertyAssignment);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 103: {
AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 101: {
+case 104: {
AST::StringLiteralPropertyName *node = new (pool) AST::StringLiteralPropertyName(stringRef(1));
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 102: {
+case 105: {
AST::NumericLiteralPropertyName *node = new (pool) AST::NumericLiteralPropertyName(sym(1).dval);
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 103: {
+case 106: {
AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 139: {
+case 142: {
AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
node->lbracketToken = loc(2);
node->rbracketToken = loc(4);
sym(1).Node = node;
} break;
-case 140: {
+case 143: {
AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
node->dotToken = loc(2);
node->identifierToken = loc(3);
sym(1).Node = node;
} break;
-case 141: {
+case 144: {
AST::NewMemberExpression *node = new (pool) AST::NewMemberExpression(sym(2).Expression, sym(4).ArgumentList);
node->newToken = loc(1);
node->lparenToken = loc(3);
@@ -798,384 +817,384 @@ case 141: {
sym(1).Node = node;
} break;
-case 143: {
+case 146: {
AST::NewExpression *node = new (pool) AST::NewExpression(sym(2).Expression);
node->newToken = loc(1);
sym(1).Node = node;
} break;
-case 144: {
+case 147: {
AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
node->lparenToken = loc(2);
node->rparenToken = loc(4);
sym(1).Node = node;
} break;
-case 145: {
+case 148: {
AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
node->lparenToken = loc(2);
node->rparenToken = loc(4);
sym(1).Node = node;
} break;
-case 146: {
+case 149: {
AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
node->lbracketToken = loc(2);
node->rbracketToken = loc(4);
sym(1).Node = node;
} break;
-case 147: {
+case 150: {
AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
node->dotToken = loc(2);
node->identifierToken = loc(3);
sym(1).Node = node;
} break;
-case 148: {
+case 151: {
sym(1).Node = 0;
} break;
-case 149: {
+case 152: {
sym(1).Node = sym(1).ArgumentList->finish();
} break;
-case 150: {
+case 153: {
sym(1).Node = new (pool) AST::ArgumentList(sym(1).Expression);
} break;
-case 151: {
+case 154: {
AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 155: {
+case 158: {
AST::PostIncrementExpression *node = new (pool) AST::PostIncrementExpression(sym(1).Expression);
node->incrementToken = loc(2);
sym(1).Node = node;
} break;
-case 156: {
+case 159: {
AST::PostDecrementExpression *node = new (pool) AST::PostDecrementExpression(sym(1).Expression);
node->decrementToken = loc(2);
sym(1).Node = node;
} break;
-case 158: {
+case 161: {
AST::DeleteExpression *node = new (pool) AST::DeleteExpression(sym(2).Expression);
node->deleteToken = loc(1);
sym(1).Node = node;
} break;
-case 159: {
+case 162: {
AST::VoidExpression *node = new (pool) AST::VoidExpression(sym(2).Expression);
node->voidToken = loc(1);
sym(1).Node = node;
} break;
-case 160: {
+case 163: {
AST::TypeOfExpression *node = new (pool) AST::TypeOfExpression(sym(2).Expression);
node->typeofToken = loc(1);
sym(1).Node = node;
} break;
-case 161: {
+case 164: {
AST::PreIncrementExpression *node = new (pool) AST::PreIncrementExpression(sym(2).Expression);
node->incrementToken = loc(1);
sym(1).Node = node;
} break;
-case 162: {
+case 165: {
AST::PreDecrementExpression *node = new (pool) AST::PreDecrementExpression(sym(2).Expression);
node->decrementToken = loc(1);
sym(1).Node = node;
} break;
-case 163: {
+case 166: {
AST::UnaryPlusExpression *node = new (pool) AST::UnaryPlusExpression(sym(2).Expression);
node->plusToken = loc(1);
sym(1).Node = node;
} break;
-case 164: {
+case 167: {
AST::UnaryMinusExpression *node = new (pool) AST::UnaryMinusExpression(sym(2).Expression);
node->minusToken = loc(1);
sym(1).Node = node;
} break;
-case 165: {
+case 168: {
AST::TildeExpression *node = new (pool) AST::TildeExpression(sym(2).Expression);
node->tildeToken = loc(1);
sym(1).Node = node;
} break;
-case 166: {
+case 169: {
AST::NotExpression *node = new (pool) AST::NotExpression(sym(2).Expression);
node->notToken = loc(1);
sym(1).Node = node;
} break;
-case 168: {
+case 171: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Mul, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 169: {
+case 172: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Div, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 170: {
+case 173: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Mod, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 172: {
+case 175: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Add, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 173: {
+case 176: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Sub, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 175: {
+case 178: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::LShift, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 176: {
+case 179: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::RShift, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 177: {
+case 180: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::URShift, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 179: {
+case 182: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Lt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 180: {
+case 183: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Gt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 181: {
+case 184: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Le, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 182: {
+case 185: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Ge, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 183: {
+case 186: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::InstanceOf, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 184: {
+case 187: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::In, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 186: {
+case 189: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Lt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 187: {
+case 190: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Gt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 188: {
+case 191: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Le, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 189: {
+case 192: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Ge, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 190: {
+case 193: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::InstanceOf, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 192: {
+case 195: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Equal, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 193: {
+case 196: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::NotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 194: {
+case 197: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::StrictEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 195: {
+case 198: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::StrictNotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 197: {
+case 200: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Equal, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 198: {
+case 201: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::NotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 199: {
+case 202: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::StrictEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 200: {
+case 203: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::StrictNotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 202: {
+case 205: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::BitAnd, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 204: {
+case 207: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::BitAnd, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 206: {
+case 209: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::BitXor, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 208: {
+case 211: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::BitXor, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 210: {
+case 213: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::BitOr, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 212: {
+case 215: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::BitOr, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 214: {
+case 217: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::And, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 216: {
+case 219: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::And, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 218: {
+case 221: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Or, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 220: {
+case 223: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
QSOperator::Or, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 222: {
+case 225: {
AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
sym(3).Expression, sym(5).Expression);
node->questionToken = loc(2);
@@ -1183,7 +1202,7 @@ case 222: {
sym(1).Node = node;
} break;
-case 224: {
+case 227: {
AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
sym(3).Expression, sym(5).Expression);
node->questionToken = loc(2);
@@ -1191,112 +1210,112 @@ case 224: {
sym(1).Node = node;
} break;
-case 226: {
+case 229: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
sym(2).ival, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 228: {
+case 231: {
AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
sym(2).ival, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 229: {
+case 232: {
sym(1).ival = QSOperator::Assign;
} break;
-case 230: {
+case 233: {
sym(1).ival = QSOperator::InplaceMul;
} break;
-case 231: {
+case 234: {
sym(1).ival = QSOperator::InplaceDiv;
} break;
-case 232: {
+case 235: {
sym(1).ival = QSOperator::InplaceMod;
} break;
-case 233: {
+case 236: {
sym(1).ival = QSOperator::InplaceAdd;
} break;
-case 234: {
+case 237: {
sym(1).ival = QSOperator::InplaceSub;
} break;
-case 235: {
+case 238: {
sym(1).ival = QSOperator::InplaceLeftShift;
} break;
-case 236: {
+case 239: {
sym(1).ival = QSOperator::InplaceRightShift;
} break;
-case 237: {
+case 240: {
sym(1).ival = QSOperator::InplaceURightShift;
} break;
-case 238: {
+case 241: {
sym(1).ival = QSOperator::InplaceAnd;
} break;
-case 239: {
+case 242: {
sym(1).ival = QSOperator::InplaceXor;
} break;
-case 240: {
+case 243: {
sym(1).ival = QSOperator::InplaceOr;
} break;
-case 242: {
+case 245: {
AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 243: {
+case 246: {
sym(1).Node = 0;
} break;
-case 246: {
+case 249: {
AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 247: {
+case 250: {
sym(1).Node = 0;
} break;
-case 264: {
+case 267: {
AST::Block *node = new (pool) AST::Block(sym(2).StatementList);
node->lbraceToken = loc(1);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
-case 265: {
+case 268: {
sym(1).Node = new (pool) AST::StatementList(sym(1).Statement);
} break;
-case 266: {
+case 269: {
sym(1).Node = new (pool) AST::StatementList(sym(1).StatementList, sym(2).Statement);
} break;
-case 267: {
+case 270: {
sym(1).Node = 0;
} break;
-case 268: {
+case 271: {
sym(1).Node = sym(1).StatementList->finish ();
} break;
-case 270: {
+case 273: {
AST::VariableStatement *node = new (pool) AST::VariableStatement(
sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
node->declarationKindToken = loc(1);
@@ -1304,76 +1323,76 @@ case 270: {
sym(1).Node = node;
} break;
-case 271: {
+case 274: {
sym(1).ival = T_CONST;
} break;
-case 272: {
+case 275: {
sym(1).ival = T_VAR;
} break;
-case 273: {
+case 276: {
sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
} break;
-case 274: {
+case 277: {
AST::VariableDeclarationList *node = new (pool) AST::VariableDeclarationList(
sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 275: {
+case 278: {
sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
} break;
-case 276: {
+case 279: {
sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
} break;
-case 277: {
+case 280: {
AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 278: {
+case 281: {
AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 279: {
+case 282: {
// ### TODO: AST for initializer
sym(1) = sym(2);
} break;
-case 280: {
+case 283: {
sym(1).Node = 0;
} break;
-case 282: {
+case 285: {
// ### TODO: AST for initializer
sym(1) = sym(2);
} break;
-case 283: {
+case 286: {
sym(1).Node = 0;
} break;
-case 285: {
+case 288: {
AST::EmptyStatement *node = new (pool) AST::EmptyStatement();
node->semicolonToken = loc(1);
sym(1).Node = node;
} break;
-case 287: {
+case 290: {
AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(sym(1).Expression);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 288: {
+case 291: {
AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement, sym(7).Statement);
node->ifToken = loc(1);
node->lparenToken = loc(2);
@@ -1382,7 +1401,7 @@ case 288: {
sym(1).Node = node;
} break;
-case 289: {
+case 292: {
AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement);
node->ifToken = loc(1);
node->lparenToken = loc(2);
@@ -1390,7 +1409,7 @@ case 289: {
sym(1).Node = node;
} break;
-case 292: {
+case 295: {
AST::DoWhileStatement *node = new (pool) AST::DoWhileStatement(sym(2).Statement, sym(5).Expression);
node->doToken = loc(1);
node->whileToken = loc(3);
@@ -1400,7 +1419,7 @@ case 292: {
sym(1).Node = node;
} break;
-case 293: {
+case 296: {
AST::WhileStatement *node = new (pool) AST::WhileStatement(sym(3).Expression, sym(5).Statement);
node->whileToken = loc(1);
node->lparenToken = loc(2);
@@ -1408,7 +1427,7 @@ case 293: {
sym(1).Node = node;
} break;
-case 294: {
+case 297: {
AST::ForStatement *node = new (pool) AST::ForStatement(sym(3).Expression,
sym(5).Expression, sym(7).Expression, sym(9).Statement);
node->forToken = loc(1);
@@ -1419,7 +1438,7 @@ case 294: {
sym(1).Node = node;
} break;
-case 295: {
+case 298: {
AST::LocalForStatement *node = new (pool) AST::LocalForStatement(
sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
sym(8).Expression, sym(10).Statement);
@@ -1432,7 +1451,7 @@ case 295: {
sym(1).Node = node;
} break;
-case 296: {
+case 299: {
AST:: ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).Expression,
sym(5).Expression, sym(7).Statement);
node->forToken = loc(1);
@@ -1442,7 +1461,7 @@ case 296: {
sym(1).Node = node;
} break;
-case 297: {
+case 300: {
AST::LocalForEachStatement *node = new (pool) AST::LocalForEachStatement(
sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
node->forToken = loc(1);
@@ -1453,14 +1472,14 @@ case 297: {
sym(1).Node = node;
} break;
-case 299: {
+case 302: {
AST::ContinueStatement *node = new (pool) AST::ContinueStatement();
node->continueToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 301: {
+case 304: {
AST::ContinueStatement *node = new (pool) AST::ContinueStatement(stringRef(2));
node->continueToken = loc(1);
node->identifierToken = loc(2);
@@ -1468,14 +1487,14 @@ case 301: {
sym(1).Node = node;
} break;
-case 303: {
+case 306: {
AST::BreakStatement *node = new (pool) AST::BreakStatement(QStringRef());
node->breakToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 305: {
+case 308: {
AST::BreakStatement *node = new (pool) AST::BreakStatement(stringRef(2));
node->breakToken = loc(1);
node->identifierToken = loc(2);
@@ -1483,14 +1502,14 @@ case 305: {
sym(1).Node = node;
} break;
-case 307: {
+case 310: {
AST::ReturnStatement *node = new (pool) AST::ReturnStatement(sym(2).Expression);
node->returnToken = loc(1);
node->semicolonToken = loc(3);
sym(1).Node = node;
} break;
-case 308: {
+case 311: {
AST::WithStatement *node = new (pool) AST::WithStatement(sym(3).Expression, sym(5).Statement);
node->withToken = loc(1);
node->lparenToken = loc(2);
@@ -1498,7 +1517,7 @@ case 308: {
sym(1).Node = node;
} break;
-case 309: {
+case 312: {
AST::SwitchStatement *node = new (pool) AST::SwitchStatement(sym(3).Expression, sym(5).CaseBlock);
node->switchToken = loc(1);
node->lparenToken = loc(2);
@@ -1506,90 +1525,83 @@ case 309: {
sym(1).Node = node;
} break;
-case 310: {
+case 313: {
AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses);
node->lbraceToken = loc(1);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
-case 311: {
+case 314: {
AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
node->lbraceToken = loc(1);
node->rbraceToken = loc(5);
sym(1).Node = node;
} break;
-case 312: {
+case 315: {
sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClause);
} break;
-case 313: {
+case 316: {
sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClauses, sym(2).CaseClause);
} break;
-case 314: {
+case 317: {
sym(1).Node = 0;
} break;
-case 315: {
+case 318: {
sym(1).Node = sym(1).CaseClauses->finish ();
} break;
-case 316: {
+case 319: {
AST::CaseClause *node = new (pool) AST::CaseClause(sym(2).Expression, sym(4).StatementList);
node->caseToken = loc(1);
node->colonToken = loc(3);
sym(1).Node = node;
} break;
-case 317: {
+case 320: {
AST::DefaultClause *node = new (pool) AST::DefaultClause(sym(3).StatementList);
node->defaultToken = loc(1);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 318:
-case 319: {
- AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement);
- node->identifierToken = loc(1);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-case 320: {
+case 321: {
AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement);
node->identifierToken = loc(1);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 322: {
+case 323: {
AST::ThrowStatement *node = new (pool) AST::ThrowStatement(sym(2).Expression);
node->throwToken = loc(1);
node->semicolonToken = loc(3);
sym(1).Node = node;
} break;
-case 323: {
+case 324: {
AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 324: {
+case 325: {
AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Finally);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 325: {
+case 326: {
AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch, sym(4).Finally);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 326: {
+case 327: {
AST::Catch *node = new (pool) AST::Catch(stringRef(3), sym(5).Block);
node->catchToken = loc(1);
node->lparenToken = loc(2);
@@ -1598,20 +1610,20 @@ case 326: {
sym(1).Node = node;
} break;
-case 327: {
+case 328: {
AST::Finally *node = new (pool) AST::Finally(sym(2).Block);
node->finallyToken = loc(1);
sym(1).Node = node;
} break;
-case 329: {
+case 330: {
AST::DebuggerStatement *node = new (pool) AST::DebuggerStatement();
node->debuggerToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 330: {
+case 332: {
AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
node->functionToken = loc(1);
node->identifierToken = loc(2);
@@ -1622,7 +1634,7 @@ case 330: {
sym(1).Node = node;
} break;
-case 331: {
+case 333: {
AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
node->functionToken = loc(1);
if (! stringRef(2).isNull())
@@ -1634,60 +1646,66 @@ case 331: {
sym(1).Node = node;
} break;
-case 332: {
+case 334: {
+ AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).FunctionBody);
+ node->functionToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ node->lbraceToken = loc(5);
+ node->rbraceToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 335: {
AST::FormalParameterList *node = new (pool) AST::FormalParameterList(stringRef(1));
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 333: {
+case 336: {
AST::FormalParameterList *node = new (pool) AST::FormalParameterList(sym(1).FormalParameterList, stringRef(3));
node->commaToken = loc(2);
node->identifierToken = loc(3);
sym(1).Node = node;
} break;
-case 334: {
+case 337: {
sym(1).Node = 0;
} break;
-case 335: {
+case 338: {
sym(1).Node = sym(1).FormalParameterList->finish ();
} break;
-case 336: {
+case 339: {
sym(1).Node = 0;
} break;
-case 338: {
+case 341: {
sym(1).Node = new (pool) AST::FunctionBody(sym(1).SourceElements->finish ());
} break;
-case 340: {
+case 343: {
sym(1).Node = new (pool) AST::Program(sym(1).SourceElements->finish ());
} break;
-case 341: {
+case 344: {
sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElement);
} break;
-case 342: {
+case 345: {
sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElements, sym(2).SourceElement);
} break;
-case 343: {
+case 346: {
sym(1).Node = new (pool) AST::StatementSourceElement(sym(1).Statement);
} break;
-case 344: {
+case 347: {
sym(1).Node = new (pool) AST::FunctionSourceElement(sym(1).FunctionDeclaration);
} break;
-case 345: {
- stringRef(1) = QStringRef();
-} break;
-
-case 347: {
+case 348: {
sym(1).Node = 0;
} break;
diff --git a/src/qml/qml/parser/qqmljsparser_p.h b/src/qml/qml/parser/qqmljsparser_p.h
index 3da1b9a6a4..7becd5f5c8 100644
--- a/src/qml/qml/parser/qqmljsparser_p.h
+++ b/src/qml/qml/parser/qqmljsparser_p.h
@@ -101,7 +101,8 @@ public:
AST::FunctionDeclaration *FunctionDeclaration;
AST::Node *Node;
AST::PropertyName *PropertyName;
- AST::PropertyNameAndValueList *PropertyNameAndValueList;
+ AST::PropertyAssignment *PropertyAssignment;
+ AST::PropertyAssignmentList *PropertyAssignmentList;
AST::SourceElement *SourceElement;
AST::SourceElements *SourceElements;
AST::Statement *Statement;
@@ -244,9 +245,9 @@ protected:
-#define J_SCRIPT_REGEXPLITERAL_RULE1 79
+#define J_SCRIPT_REGEXPLITERAL_RULE1 81
-#define J_SCRIPT_REGEXPLITERAL_RULE2 80
+#define J_SCRIPT_REGEXPLITERAL_RULE2 82
QT_QML_END_NAMESPACE
diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri
index 20b46f0939..d3abd84fc8 100644
--- a/src/qml/qml/qml.pri
+++ b/src/qml/qml/qml.pri
@@ -1,7 +1,7 @@
SOURCES += \
$$PWD/qqmlinstruction.cpp \
- $$PWD/qquicklistmodel.cpp \
- $$PWD/qquicklistmodelworkeragent.cpp \
+ $$PWD/qqmllistmodel.cpp \
+ $$PWD/qqmllistmodelworkeragent.cpp \
$$PWD/qqmlopenmetaobject.cpp \
$$PWD/qqmlvmemetaobject.cpp \
$$PWD/qqmlengine.cpp \
@@ -55,14 +55,15 @@ SOURCES += \
$$PWD/qqmlmemoryprofiler.cpp \
$$PWD/qqmlconnections.cpp \
$$PWD/qqmltimer.cpp \
- $$PWD/qqmlbind.cpp
+ $$PWD/qqmlbind.cpp \
+ $$PWD/qqmlplatform.cpp
HEADERS += \
$$PWD/qqmlglobal_p.h \
$$PWD/qqmlinstruction_p.h \
- $$PWD/qquicklistmodel_p.h\
- $$PWD/qquicklistmodel_p_p.h\
- $$PWD/qquicklistmodelworkeragent_p.h \
+ $$PWD/qqmllistmodel_p.h\
+ $$PWD/qqmllistmodel_p_p.h\
+ $$PWD/qqmllistmodelworkeragent_p.h \
$$PWD/qqmlopenmetaobject_p.h \
$$PWD/qqmlvmemetaobject_p.h \
$$PWD/qqml.h \
@@ -131,7 +132,9 @@ HEADERS += \
$$PWD/qqmlmemoryprofiler_p.h \
$$PWD/qqmlconnections_p.h \
$$PWD/qqmltimer_p.h \
- $$PWD/qqmlbind_p.h
+ $$PWD/qqmlbind_p.h \
+ $$PWD/qqmlplatform_p.h \
+ $$PWD/qqmlextensionplugin_p.h
include(parser/parser.pri)
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h
index 597c59eeff..7e6e0d1d36 100644
--- a/src/qml/qml/qqml.h
+++ b/src/qml/qml/qqml.h
@@ -49,8 +49,7 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qmetaobject.h>
-
-QT_BEGIN_HEADER
+#include <QtCore/qdebug.h>
#define QML_VERSION 0x020000
#define QML_VERSION_STR "2.0"
@@ -465,11 +464,29 @@ inline int qmlRegisterSingletonType(const char *uri, int versionMajor, int versi
return QQmlPrivate::qmlregister(QQmlPrivate::SingletonRegistration, &api);
}
+
+inline int qmlRegisterType(const QUrl &url, const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+{
+ if (url.isRelative()) {
+ // User input check must go here, because QQmlPrivate::qmlregister is also used internally for composite types
+ qWarning() << "qmlRegisterType requires absolute URLs.";
+ return 0;
+ }
+
+ QQmlPrivate::RegisterCompositeType type = {
+ url,
+ uri,
+ versionMajor,
+ versionMinor,
+ qmlName
+ };
+
+ return QQmlPrivate::qmlregister(QQmlPrivate::CompositeRegistration, &type);
+}
+
QT_END_NAMESPACE
QML_DECLARE_TYPE(QObject)
Q_DECLARE_METATYPE(QVariant)
-QT_END_HEADER
-
#endif // QQML_H
diff --git a/src/qml/qml/qqmlaccessors_p.h b/src/qml/qml/qqmlaccessors_p.h
index 24b548c58c..6df624eaf1 100644
--- a/src/qml/qml/qqmlaccessors_p.h
+++ b/src/qml/qml/qqmlaccessors_p.h
@@ -52,8 +52,6 @@
#include <stdint.h>
#endif
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QObject;
@@ -167,6 +165,4 @@ QQmlAccessorProperties::Properties::Properties()
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLACCESSORS_P_H
diff --git a/src/qml/qml/qqmlbind.cpp b/src/qml/qml/qqmlbind.cpp
index 7eb182b034..fcb3079891 100644
--- a/src/qml/qml/qqmlbind.cpp
+++ b/src/qml/qml/qqmlbind.cpp
@@ -77,7 +77,7 @@ public:
/*!
\qmltype Binding
\instantiates QQmlBind
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\ingroup qtquick-interceptors
\brief Enables the arbitrary creation of property bindings
@@ -151,7 +151,7 @@ QQmlBind::~QQmlBind()
}
/*!
- \qmlproperty bool QtQuick2::Binding::when
+ \qmlproperty bool QtQml2::Binding::when
This property holds when the binding is active.
This should be set to an expression that evaluates to true when you want the binding to be active.
@@ -183,7 +183,7 @@ void QQmlBind::setWhen(bool v)
}
/*!
- \qmlproperty Object QtQuick2::Binding::target
+ \qmlproperty Object QtQml2::Binding::target
The object to be updated.
*/
@@ -210,7 +210,7 @@ void QQmlBind::setObject(QObject *obj)
}
/*!
- \qmlproperty string QtQuick2::Binding::property
+ \qmlproperty string QtQml2::Binding::property
The property to be updated.
*/
@@ -237,7 +237,7 @@ void QQmlBind::setProperty(const QString &p)
}
/*!
- \qmlproperty any QtQuick2::Binding::value
+ \qmlproperty any QtQml2::Binding::value
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.
diff --git a/src/qml/qml/qqmlbind_p.h b/src/qml/qml/qqmlbind_p.h
index 04dc72a4c0..1e29c257f0 100644
--- a/src/qml/qml/qqmlbind_p.h
+++ b/src/qml/qml/qqmlbind_p.h
@@ -46,8 +46,6 @@
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlBindPrivate;
@@ -91,6 +89,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQmlBind)
-QT_END_HEADER
-
#endif
diff --git a/src/qml/qml/qqmlcompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp
index 62150b1af1..7279762565 100644
--- a/src/qml/qml/qqmlcompileddata.cpp
+++ b/src/qml/qml/qqmlcompileddata.cpp
@@ -105,7 +105,7 @@ void QQmlCompiledData::destroy()
QQmlCompiledData::~QQmlCompiledData()
{
if (isRegisteredWithEngine)
- QQmlEnginePrivate::get(engine)->unregisterCompositeType(this);
+ QQmlEnginePrivate::get(engine)->unregisterInternalCompositeType(this);
clear();
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp
index 7a65515634..a5f1cc564f 100644
--- a/src/qml/qml/qqmlcompiler.cpp
+++ b/src/qml/qml/qqmlcompiler.cpp
@@ -815,7 +815,10 @@ bool QQmlCompiler::compile(QQmlEngine *engine,
const QQmlTypeData::TypeReference &tref = resolvedTypes.at(ii);
QQmlScript::TypeReference *parserRef = referencedTypes.at(ii);
- if (tref.type) {
+ if (tref.typeData) { //QML-based type
+ ref.component = tref.typeData->compiledData();
+ ref.component->addref();
+ } else if (tref.type) {//C++-based type
ref.type = tref.type;
if (!ref.type->isCreatable()) {
QString err = ref.type->noCreationReason();
@@ -823,21 +826,18 @@ bool QQmlCompiler::compile(QQmlEngine *engine,
err = tr( "Element is not creatable.");
COMPILE_EXCEPTION(parserRef->firstUse, err);
}
-
+
if (ref.type->containsRevisionedAttributes()) {
QQmlError cacheError;
ref.typePropertyCache = enginePrivate->cache(ref.type,
resolvedTypes.at(ii).minorVersion,
cacheError);
- if (!ref.typePropertyCache)
+ if (!ref.typePropertyCache)
COMPILE_EXCEPTION(parserRef->firstUse, cacheError.description());
ref.typePropertyCache->addref();
}
-
- } else if (tref.typeData) {
- ref.component = tref.typeData->compiledData();
- ref.component->addref();
}
+
out->types << ref;
}
@@ -944,7 +944,7 @@ void QQmlCompiler::compileTree(QQmlScript::Object *tree)
Q_ASSERT(tree->metatype);
if (!tree->synthdata.isEmpty()) {
- enginePrivate->registerCompositeType(output);
+ enginePrivate->registerInternalCompositeType(output);
} else if (output->types.at(tree->type).component) {
output->metaTypeId = output->types.at(tree->type).component->metaTypeId;
output->listMetaTypeId = output->types.at(tree->type).component->listMetaTypeId;
@@ -954,7 +954,7 @@ void QQmlCompiler::compileTree(QQmlScript::Object *tree)
output->listMetaTypeId = output->types.at(tree->type).type->qListTypeId();
}
if (!tree->synthdata.isEmpty())
- enginePrivate->registerCompositeType(output);
+ enginePrivate->registerInternalCompositeType(output);
}
static bool QStringList_contains(const QStringList &list, const QHashedStringRef &string)
@@ -1752,7 +1752,7 @@ bool QQmlCompiler::buildProperty(QQmlScript::Property *prop,
QQmlType *type = 0;
QQmlImportNamespace *typeNamespace = 0;
- unit->imports().resolveType(prop->name(), &type, 0, 0, 0, &typeNamespace);
+ unit->imports().resolveType(prop->name(), &type, 0, 0, &typeNamespace);
if (typeNamespace) {
COMPILE_CHECK(buildPropertyInNamespace(typeNamespace, prop, obj,
@@ -1874,7 +1874,7 @@ bool QQmlCompiler::buildPropertyInNamespace(QQmlImportNamespace *ns,
// Setup attached property data
QQmlType *type = 0;
- unit->imports().resolveType(ns, prop->name(), &type, 0, 0, 0);
+ unit->imports().resolveType(ns, prop->name(), &type, 0, 0);
if (!type || !type->attachedPropertiesType())
COMPILE_EXCEPTION(prop, tr("Non-existent attached object"));
@@ -2572,10 +2572,12 @@ bool QQmlCompiler::testQualifiedEnumAssignment(QQmlScript::Property *prop,
}
QQmlType *type = 0;
- unit->imports().resolveType(typeName, &type, 0, 0, 0, 0);
+ unit->imports().resolveType(typeName, &type, 0, 0, 0);
if (!type && typeName != QLatin1String("Qt"))
return true;
+ if (type && type->isComposite()) //No enums on composite types
+ return true;
int value = 0;
bool ok = false;
@@ -2619,7 +2621,7 @@ int QQmlCompiler::evaluateEnum(const QHashedStringRef &scope, const QByteArray&
if (scope != QLatin1String("Qt")) {
QQmlType *type = 0;
- unit->imports().resolveType(scope, &type, 0, 0, 0, 0);
+ unit->imports().resolveType(scope, &type, 0, 0, 0);
return type ? type->enumValue(QHashedCStringRef(enumValue.constData(), enumValue.length()), ok) : -1;
}
@@ -2636,7 +2638,7 @@ int QQmlCompiler::evaluateEnum(const QHashedStringRef &scope, const QByteArray&
const QMetaObject *QQmlCompiler::resolveType(const QString& name) const
{
QQmlType *qmltype = 0;
- if (!unit->imports().resolveType(name, &qmltype, 0, 0, 0, 0))
+ if (!unit->imports().resolveType(name, &qmltype, 0, 0, 0))
return 0;
if (!qmltype)
return 0;
@@ -3024,12 +3026,11 @@ bool QQmlCompiler::buildDynamicMeta(QQmlScript::Object *obj, DynamicMetaMode mod
// lazily resolved type
Q_ASSERT(s->parameterTypes.at(i) == Object::DynamicProperty::Custom);
QQmlType *qmltype = 0;
- QString url;
- if (!unit->imports().resolveType(s->parameterTypeNames.at(i).toString(), &qmltype, &url, 0, 0, 0))
+ if (!unit->imports().resolveType(s->parameterTypeNames.at(i).toString(), &qmltype, 0, 0, 0))
COMPILE_EXCEPTION(s, tr("Invalid signal parameter type: %1").arg(s->parameterTypeNames.at(i).toString()));
- if (!qmltype) {
- QQmlTypeData *tdata = enginePrivate->typeLoader.getType(QUrl(url));
+ if (qmltype->isComposite()) {
+ QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype->sourceUrl());
Q_ASSERT(tdata);
Q_ASSERT(tdata->isComplete());
@@ -3121,12 +3122,12 @@ bool QQmlCompiler::buildDynamicMeta(QQmlScript::Object *obj, DynamicMetaMode mod
p->type == Object::DynamicProperty::Custom);
QQmlType *qmltype = 0;
- QString url;
- if (!unit->imports().resolveType(p->customType.toString(), &qmltype, &url, 0, 0, 0))
+ if (!unit->imports().resolveType(p->customType.toString(), &qmltype, 0, 0, 0))
COMPILE_EXCEPTION(p, tr("Invalid property type"));
- if (!qmltype) {
- QQmlTypeData *tdata = enginePrivate->typeLoader.getType(QUrl(url));
+ Q_ASSERT(qmltype);
+ if (qmltype->isComposite()) {
+ QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype->sourceUrl());
Q_ASSERT(tdata);
Q_ASSERT(tdata->isComplete());
@@ -3885,7 +3886,7 @@ QQmlType *QQmlCompiler::toQmlType(QQmlScript::Object *from)
type = QQmlMetaType::qmlType(mo);
mo = mo->superClass();
}
- return type;
+ return type;
}
QStringList QQmlCompiler::deferredProperties(QQmlScript::Object *obj)
diff --git a/src/qml/qml/qqmlcomponent.h b/src/qml/qml/qqmlcomponent.h
index e2d49b32db..aefad475b4 100644
--- a/src/qml/qml/qqmlcomponent.h
+++ b/src/qml/qml/qqmlcomponent.h
@@ -49,8 +49,6 @@
#include <QtCore/qstring.h>
#include <QtQml/qjsvalue.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -139,6 +137,4 @@ Q_DECLARE_METATYPE(QQmlComponent::Status)
QML_DECLARE_TYPE(QQmlComponent)
QML_DECLARE_TYPEINFO(QQmlComponent, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
-
#endif // QQMLCOMPONENT_H
diff --git a/src/qml/qml/qqmlcomponentattached_p.h b/src/qml/qml/qqmlcomponentattached_p.h
index 9901821b94..3c27e795c6 100644
--- a/src/qml/qml/qqmlcomponentattached_p.h
+++ b/src/qml/qml/qqmlcomponentattached_p.h
@@ -45,8 +45,6 @@
#include <QtQml/qqml.h>
#include <QtCore/QObject>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -80,6 +78,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLCOMPONENTATTACHED_P_H
diff --git a/src/qml/qml/qqmlconnections.cpp b/src/qml/qml/qqmlconnections.cpp
index f2d29bf393..286933e557 100644
--- a/src/qml/qml/qqmlconnections.cpp
+++ b/src/qml/qml/qqmlconnections.cpp
@@ -73,7 +73,7 @@ public:
/*!
\qmltype Connections
\instantiates QQmlConnections
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\ingroup qtquick-interceptors
\brief Describes generalized connections to signals
@@ -138,7 +138,7 @@ QQmlConnections::~QQmlConnections()
}
/*!
- \qmlproperty Object QtQuick2::Connections::target
+ \qmlproperty Object QtQml2::Connections::target
This property holds the object that sends the signal.
If this property is not set, the \c target defaults to the parent of the Connection.
@@ -183,7 +183,7 @@ void QQmlConnections::setTarget(QObject *obj)
}
/*!
- \qmlproperty bool QtQuick2::Connections::ignoreUnknownSignals
+ \qmlproperty bool QtQml2::Connections::ignoreUnknownSignals
Normally, a connection to a non-existent signal produces runtime errors.
diff --git a/src/qml/qml/qqmlconnections_p.h b/src/qml/qml/qqmlconnections_p.h
index 15fba24df8..9bc668e5f4 100644
--- a/src/qml/qml/qqmlconnections_p.h
+++ b/src/qml/qml/qqmlconnections_p.h
@@ -48,8 +48,6 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlBoundSignal;
@@ -95,6 +93,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQmlConnections)
-QT_END_HEADER
-
#endif
diff --git a/src/qml/qml/qqmlcontext.h b/src/qml/qml/qqmlcontext.h
index 5477b46e92..e191807cf4 100644
--- a/src/qml/qml/qqmlcontext.h
+++ b/src/qml/qml/qqmlcontext.h
@@ -48,8 +48,6 @@
#include <QtCore/qmetatype.h>
#include <QtCore/qvariant.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -107,6 +105,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QList<QObject*>)
-QT_END_HEADER
-
#endif // QQMLCONTEXT_H
diff --git a/src/qml/qml/qqmlcustomparser_p.h b/src/qml/qml/qqmlcustomparser_p.h
index 3114c52870..7a3fd47b46 100644
--- a/src/qml/qml/qqmlcustomparser_p.h
+++ b/src/qml/qml/qqmlcustomparser_p.h
@@ -61,8 +61,6 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qxmlstream.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -163,6 +161,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QQmlCustomParserProperty)
Q_DECLARE_METATYPE(QQmlCustomParserNode)
-QT_END_HEADER
-
#endif
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 145818aadf..b0b6f45fa9 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -55,7 +55,7 @@
#include "qqmlxmlhttprequest_p.h"
#include "qqmlscriptstring.h"
#include "qqmlglobal_p.h"
-#include "qquicklistmodel_p.h"
+#include "qqmllistmodel_p.h"
#include "qquickworkerscript_p.h"
#include "qqmlcomponent_p.h"
#include "qqmlnetworkaccessmanagerfactory.h"
@@ -92,6 +92,10 @@
#include "qqmlbind_p.h"
#include "qqmlconnections_p.h"
#include "qqmltimer_p.h"
+#include "qqmlplatform_p.h"
+#include <private/qquickpackage_p.h>
+#include <private/qqmldelegatemodel_p.h>
+#include <private/qqmlobjectmodel_p.h>
#ifdef Q_OS_WIN // for %APPDATA%
#include <qt_windows.h>
@@ -180,15 +184,20 @@ void QQmlEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int
qmlRegisterType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections");
qmlRegisterType<QQmlTimer>(uri, versionMajor, versionMinor,"Timer");
qmlRegisterCustomType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections", new QQmlConnectionsParser);
+ qmlRegisterType<QQmlListElement>(uri, versionMajor, versionMinor, "ListElement");
+ qmlRegisterCustomType<QQmlListModel>(uri, versionMajor, versionMinor, "ListModel", new QQmlListModelParser);
}
// These QtQuick types' implementation resides in the QtQml module
void QQmlEnginePrivate::registerQtQuick2Types(const char *uri, int versionMajor, int versionMinor)
{
- qmlRegisterType<QQuickListElement>(uri, versionMajor, versionMinor, "ListElement");
- qmlRegisterCustomType<QQuickListModel>(uri, versionMajor, versionMinor, "ListModel", new QQuickListModelParser);
qmlRegisterType<QQuickWorkerScript>(uri, versionMajor, versionMinor, "WorkerScript");
+ qmlRegisterType<QQuickPackage>(uri, versionMajor, versionMinor, "Package");
+ qmlRegisterType<QQmlDelegateModel>(uri, versionMajor, versionMinor, "VisualDataModel");
+ qmlRegisterType<QQmlDataGroup>(uri, versionMajor, versionMinor, "VisualDataGroup");
+ qmlRegisterType<QQmlObjectModel>(uri, versionMajor, versionMinor, "VisualItemModel");
+ qmlRegisterType<QQmlInstanceModel>();
}
void QQmlEnginePrivate::defineQtQuick2Module()
@@ -359,6 +368,36 @@ The following functions are also on the Qt object.
*/
/*!
+ \qmlproperty object Qt::platform
+ \since QtQml 2.1
+
+ The \c platform object provides info about the underlying platform.
+
+ Its properties are:
+
+ \table
+ \row
+ \li \c platform.os
+ \li
+
+ This read-only property contains the name of the operating system.
+
+ Possible values are:
+
+ \list
+ \li \c "android" - Android
+ \li \c "blackberry" - BlackBerry OS
+ \li \c "ios" - Apple iOS
+ \li \c "linux" - Linux
+ \li \c "mac" - Mac OS X
+ \li \c "unix" - Other Unix-based OS
+ \li \c "windows" - Windows
+ \li \c "wince" - Windows CE
+ \endlist
+ \endtable
+*/
+
+/*!
\qmlproperty object Qt::application
\since QtQuick 1.1
@@ -2023,7 +2062,7 @@ QQmlPropertyCache *QQmlEnginePrivate::rawPropertyCacheForType(int t)
}
}
-void QQmlEnginePrivate::registerCompositeType(QQmlCompiledData *data)
+void QQmlEnginePrivate::registerInternalCompositeType(QQmlCompiledData *data)
{
QByteArray name = data->rootPropertyCache->className();
@@ -2058,7 +2097,7 @@ void QQmlEnginePrivate::registerCompositeType(QQmlCompiledData *data)
m_compositeTypes.insert(ptr_type, data);
}
-void QQmlEnginePrivate::unregisterCompositeType(QQmlCompiledData *data)
+void QQmlEnginePrivate::unregisterInternalCompositeType(QQmlCompiledData *data)
{
int ptr_type = data->metaTypeId;
int lst_type = data->listMetaTypeId;
diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h
index 76e6ce1d75..9433fcbcb3 100644
--- a/src/qml/qml/qqmlengine.h
+++ b/src/qml/qml/qqmlengine.h
@@ -49,8 +49,6 @@
#include <QtQml/qqmlerror.h>
#include <QtQml/qqmldebug.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -157,6 +155,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLENGINE_H
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index 43bcc0390f..b5af0bb7cd 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -235,8 +235,8 @@ public:
QQmlMetaObject metaObjectForType(int) const;
QQmlPropertyCache *propertyCacheForType(int);
QQmlPropertyCache *rawPropertyCacheForType(int);
- void registerCompositeType(QQmlCompiledData *);
- void unregisterCompositeType(QQmlCompiledData *);
+ void registerInternalCompositeType(QQmlCompiledData *);
+ void unregisterInternalCompositeType(QQmlCompiledData *);
bool isTypeLoaded(const QUrl &url) const;
bool isScriptLoaded(const QUrl &url) const;
diff --git a/src/qml/qml/qqmlerror.h b/src/qml/qml/qqmlerror.h
index c95e0c50b9..cea9ee4cc0 100644
--- a/src/qml/qml/qqmlerror.h
+++ b/src/qml/qml/qqmlerror.h
@@ -47,8 +47,6 @@
#include <QtCore/qurl.h>
#include <QtCore/qstring.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -84,6 +82,4 @@ Q_DECLARE_TYPEINFO(QQmlError, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLERROR_H
diff --git a/src/qml/qml/qqmlexpression.h b/src/qml/qml/qqmlexpression.h
index 8c3bf38581..b04abc1b98 100644
--- a/src/qml/qml/qqmlexpression.h
+++ b/src/qml/qml/qqmlexpression.h
@@ -48,8 +48,6 @@
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -113,7 +111,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLEXPRESSION_H
diff --git a/src/qml/qml/qqmlextensioninterface.h b/src/qml/qml/qqmlextensioninterface.h
index 35facb0333..be2939d366 100644
--- a/src/qml/qml/qqmlextensioninterface.h
+++ b/src/qml/qml/qqmlextensioninterface.h
@@ -45,8 +45,6 @@
#include <QtQml/qtqmlglobal.h>
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -76,6 +74,4 @@ Q_DECLARE_INTERFACE(QQmlExtensionInterface, QQmlExtensionInterface_iid)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLEXTENSIONINTERFACE_H
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index bbc0fed768..edef5a91cd 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qqmlextensionplugin.h"
+#include "qqmlextensionplugin_p.h"
QT_BEGIN_NAMESPACE
@@ -144,7 +145,7 @@ QT_BEGIN_NAMESPACE
explicitly.
*/
QQmlExtensionPlugin::QQmlExtensionPlugin(QObject *parent)
- : QObject(parent)
+ : QObject(*(new QQmlExtensionPluginPrivate), parent)
{
}
@@ -155,6 +156,12 @@ QQmlExtensionPlugin::~QQmlExtensionPlugin()
{
}
+QUrl QQmlExtensionPlugin::baseUrl() const
+{
+ Q_D(const QQmlExtensionPlugin);
+ return d->baseUrl;
+}
+
/*!
\fn void QQmlExtensionPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
diff --git a/src/qml/qml/qqmlextensionplugin.h b/src/qml/qml/qqmlextensionplugin.h
index a7f5da137a..170c7915a5 100644
--- a/src/qml/qml/qqmlextensionplugin.h
+++ b/src/qml/qml/qqmlextensionplugin.h
@@ -43,35 +43,34 @@
#define QQMLEXTENSIONPLUGIN_H
#include <QtCore/qplugin.h>
-
+#include <QtCore/QUrl>
#include <QtQml/qqmlextensioninterface.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-
class QQmlEngine;
+class QQmlExtensionPluginPrivate;
-class Q_QML_EXPORT QQmlExtensionPlugin : public QObject,
- public QQmlExtensionInterface
+class Q_QML_EXPORT QQmlExtensionPlugin
+ : public QObject
+ , public QQmlExtensionInterface
{
Q_OBJECT
+ Q_DECLARE_PRIVATE(QQmlExtensionPlugin)
Q_INTERFACES(QQmlExtensionInterface)
Q_INTERFACES(QQmlTypesExtensionInterface)
public:
explicit QQmlExtensionPlugin(QObject *parent = 0);
~QQmlExtensionPlugin();
+ QUrl baseUrl() const;
+
virtual void registerTypes(const char *uri) = 0;
virtual void initializeEngine(QQmlEngine *engine, const char *uri);
-private:
Q_DISABLE_COPY(QQmlExtensionPlugin)
};
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLEXTENSIONPLUGIN_H
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h b/src/qml/qml/qqmlextensionplugin_p.h
index 4cc669fbb4..747bc78efb 100644
--- a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h
+++ b/src/qml/qml/qqmlextensionplugin_p.h
@@ -39,45 +39,36 @@
**
****************************************************************************/
-#ifndef QMLOSTPLUGIN_H
-#define QMLOSTPLUGIN_H
+#ifndef QQMLEXTENSIONPLUGIN_P_H
+#define QQMLEXTENSIONPLUGIN_P_H
-#include <QtWidgets/QStylePlugin>
-#include <QtQml/private/qqmldebugserverconnection_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.
+//
-QT_BEGIN_NAMESPACE
+#include <QtCore/private/qobject_p.h>
+#include "qqmlextensionplugin.h"
-class QQmlDebugServer;
-class QmlOstPluginPrivate;
+QT_BEGIN_NAMESPACE
-class QmlOstPlugin : public QObject, public QQmlDebugServerConnection
+class QQmlExtensionPluginPrivate : public QObjectPrivate
{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qml.QmlOstPlugin")
- Q_DECLARE_PRIVATE(QmlOstPlugin)
- Q_DISABLE_COPY(QmlOstPlugin)
- Q_INTERFACES(QQmlDebugServerConnection)
-
+ Q_DECLARE_PUBLIC(QQmlExtensionPlugin)
public:
- QmlOstPlugin();
- ~QmlOstPlugin();
-
- void setServer(QQmlDebugServer *server);
- void setPort(int port, bool bock, const QString &hostaddress);
-
- bool isConnected() const;
- void send(const QByteArray &message);
- void disconnect();
- bool waitForMessage();
+ static QQmlExtensionPluginPrivate* get(QQmlExtensionPlugin *e) { return e->d_func(); }
-private Q_SLOTS:
- void readyRead();
+ QUrl baseUrl;
-private:
- QmlOstPluginPrivate *d_ptr;
};
QT_END_NAMESPACE
-#endif // QMLOSTPLUGIN_H
+#endif // QQMLEXTENSIONPLUGIN_P_H
diff --git a/src/qml/qml/qqmlfile.h b/src/qml/qml/qqmlfile.h
index 777bc0db7b..5e7a42d6bd 100644
--- a/src/qml/qml/qqmlfile.h
+++ b/src/qml/qml/qqmlfile.h
@@ -44,8 +44,6 @@
#include <QtQml/qtqmlglobal.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QUrl;
@@ -119,6 +117,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLFILE_H
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index 2631fc459f..0ce026a558 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -48,8 +48,6 @@
#include <private/qmetaobject_p.h>
#include <private/qv8engine_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -316,6 +314,4 @@ Q_AUTOTEST_EXPORT QQmlGuiProvider *QQml_guiProvider();
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLGLOBAL_H
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 52d07b23ec..5374f2d1ad 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -49,6 +49,8 @@
#include <QtCore/qlibraryinfo.h>
#include <QtCore/qreadwritelock.h>
#include <QtQml/qqmlextensioninterface.h>
+#include <QtQml/qqmlextensionplugin.h>
+#include <private/qqmlextensionplugin_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmltypenamecache_p.h>
#include <private/qqmlengine_p.h>
@@ -124,6 +126,39 @@ bool isPathAbsolute(const QString &path)
#endif
}
+// If the type does not already exist as a file import, add the type and return the new type
+QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeName, QList<QQmlError> *errors)
+{
+ QUrl url(urlString);
+ QQmlType *ret = QQmlMetaType::qmlType(url);
+ if (!ret) { //QQmlType not yet existing for composite type
+ int dot = typeName.indexOf(QLatin1Char('.'));
+ QHashedStringRef unqualifiedtype = dot < 0 ? typeName : QHashedStringRef(typeName.constData() + dot + 1, typeName.length() - dot - 1);
+
+ //XXX: The constData of the string ref is pointing somewhere unsafe in qmlregister, so we need to create a temporary copy
+ QByteArray buf(unqualifiedtype.toUtf8().constData());
+
+ QQmlPrivate::RegisterCompositeType reg = {
+ url,
+ "", //Empty URI indicates loaded via file imports
+ -1,
+ -1,
+ buf.constData()
+ };
+ ret = QQmlMetaType::qmlTypeFromIndex(QQmlPrivate::qmlregister(QQmlPrivate::CompositeRegistration, &reg));
+ }
+ if (!ret) {//Usually when a type name is "found" but invalid
+ //qDebug() << ret << urlString << QQmlMetaType::qmlType(url);
+ if (!errors) // Cannot list errors properly, just quit
+ qFatal(QQmlMetaType::typeRegistrationFailures().join('\n').toLatin1().constData());
+ QQmlError error;
+ error.setDescription(QQmlMetaType::typeRegistrationFailures().join('\n'));
+ errors->prepend(error);
+ }
+ return ret;
+
+}
+
}
typedef QMap<QString, QString> StringStringMap;
@@ -150,8 +185,7 @@ public:
static QQmlDirScripts getVersionedScripts(const QQmlDirScripts &qmldirscripts, int vmaj, int vmin);
bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type,
- int *vmajor, int *vminor,
- QQmlType** type_return, QString* url_return,
+ int *vmajor, int *vminor, QQmlType** type_return,
QString *base = 0, bool *typeRecursionDetected = 0) const;
};
QList<Import *> imports;
@@ -159,8 +193,7 @@ public:
Import *findImport(const QString &uri);
bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef& type,
- int *vmajor, int *vminor,
- QQmlType** type_return, QString* url_return,
+ int *vmajor, int *vminor, QQmlType** type_return,
QString *base = 0, QList<QQmlError> *errors = 0);
// Prefix when used as a qualified import. Otherwise empty.
@@ -194,8 +227,7 @@ public:
QList<QQmlError> *errors);
bool resolveType(const QHashedStringRef &type, int *vmajor, int *vminor,
- QQmlType** type_return, QString* url_return,
- QList<QQmlError> *errors);
+ QQmlType** type_return, QList<QQmlError> *errors);
QUrl baseUrl;
QString base;
@@ -379,9 +411,8 @@ QString QQmlImports::completeQmldirPath(const QString &uri, const QString &base,
The given (namespace qualified) \a type is resolved to either
\list
- \li a QQmlImportNamespace stored at \a ns_return,
- \li a QQmlType stored at \a type_return, or
- \li a component located at \a url_return.
+ \li a QQmlImportNamespace stored at \a ns_return, or
+ \li a QQmlType stored at \a type_return,
\endlist
If any return pointer is 0, the corresponding search is not done.
@@ -389,7 +420,7 @@ QString QQmlImports::completeQmldirPath(const QString &uri, const QString &base,
\sa addFileImport(), addLibraryImport
*/
bool QQmlImports::resolveType(const QHashedStringRef &type,
- QQmlType** type_return, QString* url_return, int *vmaj, int *vmin,
+ QQmlType** type_return, int *vmaj, int *vmin,
QQmlImportNamespace** ns_return, QList<QQmlError> *errors) const
{
QQmlImportNamespace* ns = d->findQualifiedNamespace(type);
@@ -398,19 +429,16 @@ bool QQmlImports::resolveType(const QHashedStringRef &type,
*ns_return = ns;
return true;
}
- if (type_return || url_return) {
- if (d->resolveType(type,vmaj,vmin,type_return,url_return, errors)) {
+ if (type_return) {
+ if (d->resolveType(type,vmaj,vmin,type_return, errors)) {
if (qmlImportTrace()) {
#define RESOLVE_TYPE_DEBUG qDebug().nospace() << "QQmlImports(" << qPrintable(baseUrl().toString()) \
<< ')' << "::resolveType: " << type.toString() << " => "
- if (type_return && *type_return && url_return && !url_return->isEmpty())
- RESOLVE_TYPE_DEBUG << (*type_return)->typeName() << ' ' << *url_return << " TYPE/URL";
- if (type_return && *type_return)
+ if (type_return && *type_return && (*type_return)->isComposite())
+ RESOLVE_TYPE_DEBUG << (*type_return)->typeName() << ' ' << (*type_return)->sourceUrl() << " TYPE/URL";
+ else if (type_return && *type_return)
RESOLVE_TYPE_DEBUG << (*type_return)->typeName() << " TYPE";
- if (url_return && !url_return->isEmpty())
- RESOLVE_TYPE_DEBUG << *url_return << " URL";
-
#undef RESOLVE_TYPE_DEBUG
}
return true;
@@ -469,23 +497,21 @@ QQmlDirScripts QQmlImportNamespace::Import::getVersionedScripts(const QQmlDirScr
\internal
Searching \e only in the namespace \a ns (previously returned in a call to
- resolveType(), \a type is found and returned to either
- a QQmlType stored at \a type_return, or
- a component located at \a url_return.
+ resolveType(), \a type is found and returned to
+ a QQmlType stored at \a type_return. If the type is from a QML file, the returned
+ type will be a CompositeType.
- If either return pointer is 0, the corresponding search is not done.
+ If the return pointer is 0, the corresponding search is not done.
*/
bool QQmlImports::resolveType(QQmlImportNamespace* ns, const QHashedStringRef &type,
- QQmlType** type_return, QString* url_return,
- int *vmaj, int *vmin) const
+ QQmlType** type_return, int *vmaj, int *vmin) const
{
- return ns->resolveType(d->typeLoader,type,vmaj,vmin,type_return,url_return);
+ return ns->resolveType(d->typeLoader,type,vmaj,vmin,type_return);
}
bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader,
const QHashedStringRef& type, int *vmajor, int *vminor,
- QQmlType** type_return, QString* url_return,
- QString *base, bool *typeRecursionDetected) const
+ QQmlType** type_return, QString *base, bool *typeRecursionDetected) const
{
if (majversion >= 0 && minversion >= 0) {
QQmlType *t = QQmlMetaType::qmlType(type, uri, majversion, minversion);
@@ -530,9 +556,9 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader,
}
if (candidate != end) {
- if (url_return)
- *url_return = componentUrl;
- return true;
+ if (type_return)
+ *type_return = getTypeForUrl(componentUrl, type, 0);
+ return (*type_return != 0);
}
} else if (!isLibrary) {
QString qmlUrl = url + QString::fromRawData(type.constData(), type.length()) + dotqml_string;
@@ -550,9 +576,9 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader,
if (typeRecursionDetected)
*typeRecursionDetected = true;
} else {
- if (url_return)
- *url_return = qmlUrl;
- return true;
+ if (type_return)
+ *type_return = getTypeForUrl(qmlUrl, type, 0);
+ return (*type_return) != 0;
}
}
}
@@ -561,8 +587,7 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader,
}
bool QQmlImportsPrivate::resolveType(const QHashedStringRef& type, int *vmajor, int *vminor,
- QQmlType** type_return, QString* url_return,
- QList<QQmlError> *errors)
+ QQmlType** type_return, QList<QQmlError> *errors)
{
QQmlImportNamespace *s = 0;
int dot = type.indexOf(Dot);
@@ -591,12 +616,12 @@ bool QQmlImportsPrivate::resolveType(const QHashedStringRef& type, int *vmajor,
}
QHashedStringRef unqualifiedtype = dot < 0 ? type : QHashedStringRef(type.constData()+dot+1, type.length()-dot-1);
if (s) {
- if (s->resolveType(typeLoader,unqualifiedtype,vmajor,vminor,type_return,url_return, &base, errors))
+ if (s->resolveType(typeLoader,unqualifiedtype,vmajor,vminor,type_return, &base, errors))
return true;
- if (s->imports.count() == 1 && !s->imports.at(0)->isLibrary && url_return && s != &unqualifiedset) {
+ if (s->imports.count() == 1 && !s->imports.at(0)->isLibrary && type_return && s != &unqualifiedset) {
// qualified, and only 1 url
- *url_return = resolveLocalUrl(s->imports.at(0)->url, unqualifiedtype.toString() + QLatin1String(".qml"));
- return true;
+ *type_return = getTypeForUrl(resolveLocalUrl(s->imports.at(0)->url, unqualifiedtype.toString() + QLatin1String(".qml")), type, errors);
+ return (*type_return != 0);
}
}
@@ -615,18 +640,18 @@ QQmlImportNamespace::Import *QQmlImportNamespace::findImport(const QString &uri)
bool QQmlImportNamespace::resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type,
int *vmajor, int *vminor, QQmlType** type_return,
- QString* url_return, QString *base, QList<QQmlError> *errors)
+ QString *base, QList<QQmlError> *errors)
{
bool typeRecursionDetected = false;
for (int i=0; i<imports.count(); ++i) {
const Import *import = imports.at(i);
- if (import->resolveType(typeLoader, type, vmajor, vminor, type_return, url_return,
+ if (import->resolveType(typeLoader, type, vmajor, vminor, type_return,
base, &typeRecursionDetected)) {
if (qmlCheckTypes()) {
// check for type clashes
for (int j = i+1; j<imports.count(); ++j) {
const Import *import2 = imports.at(j);
- if (import2->resolveType(typeLoader, type, vmajor, vminor, 0, 0, base)) {
+ if (import2->resolveType(typeLoader, type, vmajor, vminor, 0, base)) {
if (errors) {
QString u1 = import->url;
QString u2 = import2->url;
@@ -1660,6 +1685,10 @@ bool QQmlImportDatabase::importPlugin(const QString &filePath, const QString &ur
QQmlMetaType::setTypeRegistrationNamespace(typeNamespace);
+ if (QQmlExtensionPlugin *plugin = qobject_cast<QQmlExtensionPlugin *>(instance)) {
+ // Set the directory, not the library file itself
+ QQmlExtensionPluginPrivate::get(plugin)->baseUrl = QUrl::fromLocalFile(fileInfo.absolutePath());
+ }
iface->registerTypes(moduleId);
registrationFailures = QQmlMetaType::typeRegistrationFailures();
diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h
index ad4b3dfee9..140ca6695e 100644
--- a/src/qml/qml/qqmlimport_p.h
+++ b/src/qml/qml/qqmlimport_p.h
@@ -85,14 +85,13 @@ public:
QUrl baseUrl() const;
bool resolveType(const QHashedStringRef &type,
- QQmlType** type_return, QString* url_return,
+ QQmlType** type_return,
int *version_major, int *version_minor,
QQmlImportNamespace** ns_return,
QList<QQmlError> *errors = 0) const;
bool resolveType(QQmlImportNamespace*,
const QHashedStringRef& type,
- QQmlType** type_return, QString* url_return,
- int *version_major, int *version_minor) const;
+ QQmlType** type_return, int *version_major, int *version_minor) const;
bool addImplicitImport(QQmlImportDatabase *importDb, QList<QQmlError> *errors);
diff --git a/src/qml/qml/qqmlincubator.h b/src/qml/qml/qqmlincubator.h
index bbb232bfa2..4d3287a394 100644
--- a/src/qml/qml/qqmlincubator.h
+++ b/src/qml/qml/qqmlincubator.h
@@ -45,8 +45,6 @@
#include <QtQml/qtqmlglobal.h>
#include <QtQml/qqmlerror.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -125,6 +123,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLINCUBATOR_H
diff --git a/src/qml/qml/qqmlinfo.h b/src/qml/qml/qqmlinfo.h
index c2b2cb353e..16fca9428e 100644
--- a/src/qml/qml/qqmlinfo.h
+++ b/src/qml/qml/qqmlinfo.h
@@ -46,8 +46,6 @@
#include <QtCore/qurl.h>
#include <QtQml/qqmlerror.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -98,6 +96,4 @@ 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/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h
index d2425bc6bf..a27a2da9ae 100644
--- a/src/qml/qml/qqmllist.h
+++ b/src/qml/qml/qqmllist.h
@@ -46,8 +46,6 @@
#include <QtCore/qlist.h>
#include <QtCore/qvariant.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -150,6 +148,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QQmlListReference)
-QT_END_HEADER
-
#endif // QQMLLIST_H
diff --git a/src/qml/qml/qquicklistmodel.cpp b/src/qml/qml/qqmllistmodel.cpp
index 91c1a9c476..5d64d37768 100644
--- a/src/qml/qml/qquicklistmodel.cpp
+++ b/src/qml/qml/qqmllistmodel.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qquicklistmodel_p_p.h"
-#include "qquicklistmodelworkeragent_p.h"
+#include "qqmllistmodel_p_p.h"
+#include "qqmllistmodelworkeragent_p.h"
#include "qqmlopenmetaobject_p.h"
#include <private/qqmljsast_p.h>
#include <private/qqmljsengine_p.h>
@@ -246,7 +246,7 @@ const ListLayout::Role *ListLayout::getExistingRole(v8::Handle<v8::String> key)
return r;
}
-ModelObject *ListModel::getOrCreateModelObject(QQuickListModel *model, int elementIndex)
+ModelObject *ListModel::getOrCreateModelObject(QQmlListModel *model, int elementIndex)
{
ListElement *e = elements[elementIndex];
if (e->m_objectCache == 0) {
@@ -326,7 +326,7 @@ void ListModel::sync(ListModel *src, ListModel *target, QHash<int, ListModel *>
}
}
-ListModel::ListModel(ListLayout *layout, QQuickListModel *modelCache, int uid) : m_layout(layout), m_modelCache(modelCache)
+ListModel::ListModel(ListLayout *layout, QQmlListModel *modelCache, int uid) : m_layout(layout), m_modelCache(modelCache)
{
if (uid == -1)
uid = uidCounter.fetchAndAddOrdered(1);
@@ -394,7 +394,7 @@ void ListModel::updateCacheIndices()
}
}
-QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQuickListModel *owner, QV8Engine *eng)
+QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQmlListModel *owner, QV8Engine *eng)
{
ListElement *e = elements[elementIndex];
const ListLayout::Role &r = m_layout->getExistingRole(roleIndex);
@@ -698,7 +698,7 @@ ListModel *ListElement::getListProperty(const ListLayout::Role &role)
return *value;
}
-QVariant ListElement::getProperty(const ListLayout::Role &role, const QQuickListModel *owner, QV8Engine *eng)
+QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListModel *owner, QV8Engine *eng)
{
char *mem = getPropertyMemory(role);
@@ -731,7 +731,7 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QQuickList
if (model) {
if (model->m_modelCache == 0) {
- model->m_modelCache = new QQuickListModel(owner, model, eng);
+ model->m_modelCache = new QQmlListModel(owner, model, eng);
QQmlEngine::setContextForObject(model->m_modelCache, QQmlEngine::contextForObject(owner));
}
@@ -1207,7 +1207,7 @@ int ListElement::setJsProperty(const ListLayout::Role &role, v8::Handle<v8::Valu
return roleIndex;
}
-ModelObject::ModelObject(QQuickListModel *model, int elementIndex)
+ModelObject::ModelObject(QQmlListModel *model, int elementIndex)
: m_model(model), m_elementIndex(elementIndex), m_meta(new ModelNodeMetaObject(this))
{
updateValues();
@@ -1269,12 +1269,12 @@ void ModelNodeMetaObject::propertyWritten(int index)
}
}
-DynamicRoleModelNode::DynamicRoleModelNode(QQuickListModel *owner, int uid) : m_owner(owner), m_uid(uid), m_meta(new DynamicRoleModelNodeMetaObject(this))
+DynamicRoleModelNode::DynamicRoleModelNode(QQmlListModel *owner, int uid) : m_owner(owner), m_uid(uid), m_meta(new DynamicRoleModelNodeMetaObject(this))
{
setNodeUpdatesEnabled(true);
}
-DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQuickListModel *owner)
+DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQmlListModel *owner)
{
DynamicRoleModelNode *object = new DynamicRoleModelNode(owner, uidCounter.fetchAndAddOrdered(1));
QVector<int> roles;
@@ -1282,20 +1282,20 @@ DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQuic
return object;
}
-void DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQuickListModel *> *targetModelHash)
+void DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQmlListModel *> *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);
- QQuickListModel *srcModel = qobject_cast<QQuickListModel *>(value.value<QObject *>());
- QQuickListModel *targetModel = qobject_cast<QQuickListModel *>(target->m_meta->value(i).value<QObject *>());
+ QQmlListModel *srcModel = qobject_cast<QQmlListModel *>(value.value<QObject *>());
+ QQmlListModel *targetModel = qobject_cast<QQmlListModel *>(target->m_meta->value(i).value<QObject *>());
if (srcModel) {
if (targetModel == 0)
- targetModel = QQuickListModel::createWithOwner(target->m_owner);
+ targetModel = QQmlListModel::createWithOwner(target->m_owner);
- QQuickListModel::sync(srcModel, targetModel, targetModelHash);
+ QQmlListModel::sync(srcModel, targetModel, targetModelHash);
QObject *targetModelObject = targetModel;
value = QVariant::fromValue(targetModelObject);
@@ -1326,7 +1326,7 @@ void DynamicRoleModelNode::updateValues(const QVariantMap &object, QVector<int>
QVariant value = object[key];
if (value.type() == QVariant::List) {
- QQuickListModel *subModel = QQuickListModel::createWithOwner(m_owner);
+ QQmlListModel *subModel = QQmlListModel::createWithOwner(m_owner);
QVariantList subArray = value.toList();
QVariantList::const_iterator subIt = subArray.begin();
@@ -1343,7 +1343,7 @@ void DynamicRoleModelNode::updateValues(const QVariantMap &object, QVector<int>
const QByteArray &keyUtf8 = key.toUtf8();
- QQuickListModel *existingModel = qobject_cast<QQuickListModel *>(m_meta->value(keyUtf8).value<QObject *>());
+ QQmlListModel *existingModel = qobject_cast<QQmlListModel *>(m_meta->value(keyUtf8).value<QObject *>());
if (existingModel)
delete existingModel;
@@ -1362,7 +1362,7 @@ DynamicRoleModelNodeMetaObject::DynamicRoleModelNodeMetaObject(DynamicRoleModelN
DynamicRoleModelNodeMetaObject::~DynamicRoleModelNodeMetaObject()
{
for (int i=0 ; i < count() ; ++i) {
- QQuickListModel *subModel = qobject_cast<QQuickListModel *>(value(i).value<QObject *>());
+ QQmlListModel *subModel = qobject_cast<QQmlListModel *>(value(i).value<QObject *>());
if (subModel)
delete subModel;
}
@@ -1374,7 +1374,7 @@ void DynamicRoleModelNodeMetaObject::propertyWrite(int index)
return;
QVariant v = value(index);
- QQuickListModel *model = qobject_cast<QQuickListModel *>(v.value<QObject *>());
+ QQmlListModel *model = qobject_cast<QQmlListModel *>(v.value<QObject *>());
if (model)
delete model;
}
@@ -1384,11 +1384,11 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index)
if (!m_enabled)
return;
- QQuickListModel *parentModel = m_owner->m_owner;
+ QQmlListModel *parentModel = m_owner->m_owner;
QVariant v = value(index);
if (v.type() == QVariant::List) {
- QQuickListModel *subModel = QQuickListModel::createWithOwner(parentModel);
+ QQmlListModel *subModel = QQmlListModel::createWithOwner(parentModel);
QVariantList subArray = v.toList();
QVariantList::const_iterator subIt = subArray.begin();
@@ -1417,14 +1417,14 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index)
}
}
-QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::instructions() const
+QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instructions() const
{
- return (QQuickListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData));
+ return (QQmlListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData));
}
/*!
\qmltype ListModel
- \instantiates QQuickListModel
+ \instantiates QQmlListModel
\inqmlmodule QtQuick 2
\brief Defines a free-form list data source
\ingroup qtquick-models
@@ -1515,7 +1515,7 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
\sa {qml-data-models}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, QtQml
*/
-QQuickListModel::QQuickListModel(QObject *parent)
+QQmlListModel::QQmlListModel(QObject *parent)
: QAbstractListModel(parent)
{
m_mainThread = true;
@@ -1530,7 +1530,7 @@ QQuickListModel::QQuickListModel(QObject *parent)
m_engine = 0;
}
-QQuickListModel::QQuickListModel(const QQuickListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent)
+QQmlListModel::QQmlListModel(const QQmlListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent)
: QAbstractListModel(parent)
{
m_mainThread = owner->m_mainThread;
@@ -1545,7 +1545,7 @@ QQuickListModel::QQuickListModel(const QQuickListModel *owner, ListModel *data,
m_engine = eng;
}
-QQuickListModel::QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAgent *agent)
+QQmlListModel::QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agent)
: QAbstractListModel(agent)
{
m_mainThread = false;
@@ -1564,7 +1564,7 @@ QQuickListModel::QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAge
m_engine = 0;
}
-QQuickListModel::~QQuickListModel()
+QQmlListModel::~QQmlListModel()
{
for (int i=0 ; i < m_modelObjects.count() ; ++i)
delete m_modelObjects[i];
@@ -1585,9 +1585,9 @@ QQuickListModel::~QQuickListModel()
m_layout = 0;
}
-QQuickListModel *QQuickListModel::createWithOwner(QQuickListModel *newOwner)
+QQmlListModel *QQmlListModel::createWithOwner(QQmlListModel *newOwner)
{
- QQuickListModel *model = new QQuickListModel;
+ QQmlListModel *model = new QQmlListModel;
model->m_mainThread = newOwner->m_mainThread;
model->m_engine = newOwner->m_engine;
@@ -1602,7 +1602,7 @@ QQuickListModel *QQuickListModel::createWithOwner(QQuickListModel *newOwner)
return model;
}
-QV8Engine *QQuickListModel::engine() const
+QV8Engine *QQmlListModel::engine() const
{
if (m_engine == 0) {
m_engine = QQmlEnginePrivate::getV8Engine(qmlEngine(this));
@@ -1611,7 +1611,7 @@ QV8Engine *QQuickListModel::engine() const
return m_engine;
}
-void QQuickListModel::sync(QQuickListModel *src, QQuickListModel *target, QHash<int, QQuickListModel *> *targetModelHash)
+void QQmlListModel::sync(QQmlListModel *src, QQmlListModel *target, QHash<int, QQmlListModel *> *targetModelHash)
{
Q_ASSERT(src->m_dynamicRoles && target->m_dynamicRoles);
@@ -1672,7 +1672,7 @@ void QQuickListModel::sync(QQuickListModel *src, QQuickListModel *target, QHash<
}
}
-void QQuickListModel::emitItemsChanged(int index, int count, const QVector<int> &roles)
+void QQmlListModel::emitItemsChanged(int index, int count, const QVector<int> &roles)
{
if (count <= 0)
return;
@@ -1685,7 +1685,7 @@ void QQuickListModel::emitItemsChanged(int index, int count, const QVector<int>
}
}
-void QQuickListModel::emitItemsRemoved(int index, int count)
+void QQmlListModel::emitItemsRemoved(int index, int count)
{
if (count <= 0)
return;
@@ -1702,7 +1702,7 @@ void QQuickListModel::emitItemsRemoved(int index, int count)
}
}
-void QQuickListModel::emitItemsInserted(int index, int count)
+void QQmlListModel::emitItemsInserted(int index, int count)
{
if (count <= 0)
return;
@@ -1717,7 +1717,7 @@ void QQuickListModel::emitItemsInserted(int index, int count)
}
}
-void QQuickListModel::emitItemsMoved(int from, int to, int n)
+void QQmlListModel::emitItemsMoved(int from, int to, int n)
{
if (n <= 0)
return;
@@ -1731,33 +1731,33 @@ void QQuickListModel::emitItemsMoved(int from, int to, int n)
}
}
-QQuickListModelWorkerAgent *QQuickListModel::agent()
+QQmlListModelWorkerAgent *QQmlListModel::agent()
{
if (m_agent)
return m_agent;
- m_agent = new QQuickListModelWorkerAgent(this);
+ m_agent = new QQmlListModelWorkerAgent(this);
return m_agent;
}
-QModelIndex QQuickListModel::index(int row, int column, const QModelIndex &parent) const
+QModelIndex QQmlListModel::index(int row, int column, const QModelIndex &parent) const
{
return row >= 0 && row < count() && column == 0 && !parent.isValid()
? createIndex(row, column)
: QModelIndex();
}
-int QQuickListModel::rowCount(const QModelIndex &parent) const
+int QQmlListModel::rowCount(const QModelIndex &parent) const
{
return !parent.isValid() ? count() : 0;
}
-QVariant QQuickListModel::data(const QModelIndex &index, int role) const
+QVariant QQmlListModel::data(const QModelIndex &index, int role) const
{
return data(index.row(), role);
}
-QVariant QQuickListModel::data(int index, int role) const
+QVariant QQmlListModel::data(int index, int role) const
{
QVariant v;
@@ -1772,7 +1772,7 @@ QVariant QQuickListModel::data(int index, int role) const
return v;
}
-QHash<int, QByteArray> QQuickListModel::roleNames() const
+QHash<int, QByteArray> QQmlListModel::roleNames() const
{
QHash<int, QByteArray> roleNames;
@@ -1790,7 +1790,7 @@ QHash<int, QByteArray> QQuickListModel::roleNames() const
}
/*!
- \qmlproperty bool QtQuick2::ListModel::dynamicRoles
+ \qmlproperty bool QtQml2::ListModel::dynamicRoles
By default, the type of a role is fixed the first time
the role is used. For example, if you create a role called
@@ -1815,7 +1815,7 @@ QHash<int, QByteArray> QQuickListModel::roleNames() const
Due to the performance cost of using dynamic roles,
they are disabled by default.
*/
-void QQuickListModel::setDynamicRoles(bool enableDynamicRoles)
+void QQmlListModel::setDynamicRoles(bool enableDynamicRoles)
{
if (m_mainThread && m_agent == 0) {
if (enableDynamicRoles) {
@@ -1836,10 +1836,10 @@ void QQuickListModel::setDynamicRoles(bool enableDynamicRoles)
}
/*!
- \qmlproperty int QtQuick2::ListModel::count
+ \qmlproperty int QtQml2::ListModel::count
The number of data entries in the model.
*/
-int QQuickListModel::count() const
+int QQmlListModel::count() const
{
int count;
@@ -1853,13 +1853,13 @@ int QQuickListModel::count() const
}
/*!
- \qmlmethod QtQuick2::ListModel::clear()
+ \qmlmethod QtQml2::ListModel::clear()
Deletes all content from the model.
\sa append(), remove()
*/
-void QQuickListModel::clear()
+void QQmlListModel::clear()
{
int cleared = count();
@@ -1875,13 +1875,13 @@ void QQuickListModel::clear()
}
/*!
- \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1)
+ \qmlmethod QtQml2::ListModel::remove(int index, int count = 1)
Deletes the content at \a index from the model.
\sa clear()
*/
-void QQuickListModel::remove(QQmlV8Function *args)
+void QQmlListModel::remove(QQmlV8Function *args)
{
int argLength = args->Length();
@@ -1909,7 +1909,7 @@ void QQuickListModel::remove(QQmlV8Function *args)
}
/*!
- \qmlmethod QtQuick2::ListModel::insert(int index, jsobject dict)
+ \qmlmethod QtQml2::ListModel::insert(int index, jsobject dict)
Adds a new item to the list model at position \a index, with the
values in \a dict.
@@ -1924,7 +1924,7 @@ void QQuickListModel::remove(QQmlV8Function *args)
\sa set(), append()
*/
-void QQuickListModel::insert(QQmlV8Function *args)
+void QQmlListModel::insert(QQmlV8Function *args)
{
if (args->Length() == 2) {
@@ -1970,7 +1970,7 @@ void QQuickListModel::insert(QQmlV8Function *args)
}
/*!
- \qmlmethod QtQuick2::ListModel::move(int from, int to, int n)
+ \qmlmethod QtQml2::ListModel::move(int from, int to, int n)
Moves \a n items \a from one position \a to another.
@@ -1983,7 +1983,7 @@ void QQuickListModel::insert(QQmlV8Function *args)
\sa append()
*/
-void QQuickListModel::move(int from, int to, int n)
+void QQmlListModel::move(int from, int to, int n)
{
if (n==0 || from==to)
return;
@@ -2023,7 +2023,7 @@ void QQuickListModel::move(int from, int to, int n)
}
/*!
- \qmlmethod QtQuick2::ListModel::append(jsobject dict)
+ \qmlmethod QtQml2::ListModel::append(jsobject dict)
Adds a new item to the end of the list model, with the
values in \a dict.
@@ -2034,7 +2034,7 @@ void QQuickListModel::move(int from, int to, int n)
\sa set(), remove()
*/
-void QQuickListModel::append(QQmlV8Function *args)
+void QQmlListModel::append(QQmlV8Function *args)
{
if (args->Length() == 1) {
v8::Handle<v8::Value> arg = (*args)[0];
@@ -2077,7 +2077,7 @@ void QQuickListModel::append(QQmlV8Function *args)
}
/*!
- \qmlmethod object QtQuick2::ListModel::get(int index)
+ \qmlmethod object QtQml2::ListModel::get(int index)
Returns the item at \a index in the list model. This allows the item
data to be accessed or modified from JavaScript:
@@ -2107,7 +2107,7 @@ void QQuickListModel::append(QQmlV8Function *args)
\sa append()
*/
-QQmlV8Handle QQuickListModel::get(int index) const
+QQmlV8Handle QQmlListModel::get(int index) const
{
v8::Handle<v8::Value> result = v8::Undefined();
@@ -2118,7 +2118,7 @@ QQmlV8Handle QQuickListModel::get(int index) const
DynamicRoleModelNode *object = m_modelObjects[index];
result = v8engine->newQObject(object);
} else {
- ModelObject *object = m_listModel->getOrCreateModelObject(const_cast<QQuickListModel *>(this), index);
+ ModelObject *object = m_listModel->getOrCreateModelObject(const_cast<QQmlListModel *>(this), index);
result = v8engine->newQObject(object);
}
}
@@ -2127,7 +2127,7 @@ QQmlV8Handle QQuickListModel::get(int index) const
}
/*!
- \qmlmethod QtQuick2::ListModel::set(int index, jsobject dict)
+ \qmlmethod QtQml2::ListModel::set(int index, jsobject dict)
Changes the item at \a index in the list model with the
values in \a dict. Properties not appearing in \a dict
@@ -2142,7 +2142,7 @@ QQmlV8Handle QQuickListModel::get(int index) const
\sa append()
*/
-void QQuickListModel::set(int index, const QQmlV8Handle &handle)
+void QQmlListModel::set(int index, const QQmlV8Handle &handle)
{
v8::Handle<v8::Value> valuemap = handle.toHandle();
@@ -2182,7 +2182,7 @@ void QQuickListModel::set(int index, const QQmlV8Handle &handle)
}
/*!
- \qmlmethod QtQuick2::ListModel::setProperty(int index, string property, variant value)
+ \qmlmethod QtQml2::ListModel::setProperty(int index, string property, variant value)
Changes the \a property of the item at \a index in the list model to \a value.
@@ -2194,7 +2194,7 @@ void QQuickListModel::set(int index, const QQmlV8Handle &handle)
\sa append()
*/
-void QQuickListModel::setProperty(int index, const QString& property, const QVariant& value)
+void QQmlListModel::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);
@@ -2225,20 +2225,20 @@ void QQuickListModel::setProperty(int index, const QString& property, const QVar
}
/*!
- \qmlmethod QtQuick2::ListModel::sync()
+ \qmlmethod QtQml2::ListModel::sync()
Writes any unsaved changes to the list model after it has been modified
from a worker script.
*/
-void QQuickListModel::sync()
+void QQmlListModel::sync()
{
// This is just a dummy method to make it look like sync() exists in
- // ListModel (and not just QQuickListModelWorkerAgent) and to let
+ // ListModel (and not just QQmlListModelWorkerAgent) and to let
// us document sync().
qmlInfo(this) << "List sync() can only be called from a WorkerScript";
}
-bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data)
+bool QQmlListModelParser::compileProperty(const QQmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data)
{
QList<QVariant> values = prop.assignedValues();
for(int ii = 0; ii < values.count(); ++ii) {
@@ -2250,8 +2250,8 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
if (node.name() != listElementTypeName) {
const QMetaObject *mo = resolveType(node.name());
- if (mo != &QQuickListElement::staticMetaObject) {
- error(node, QQuickListModel::tr("ListElement: cannot contain nested elements"));
+ if (mo != &QQmlListElement::staticMetaObject) {
+ error(node, QQmlListModel::tr("ListElement: cannot contain nested elements"));
return false;
}
listElementTypeName = node.name(); // cache right name for next time
@@ -2268,11 +2268,11 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
for(int jj = 0; jj < props.count(); ++jj) {
const QQmlCustomParserProperty &nodeProp = props.at(jj);
if (nodeProp.name().isEmpty()) {
- error(nodeProp, QQuickListModel::tr("ListElement: cannot contain nested elements"));
+ error(nodeProp, QQmlListModel::tr("ListElement: cannot contain nested elements"));
return false;
}
if (nodeProp.name() == QStringLiteral("id")) {
- error(nodeProp, QQuickListModel::tr("ListElement: cannot use reserved \"id\" property"));
+ error(nodeProp, QQmlListModel::tr("ListElement: cannot use reserved \"id\" property"));
return false;
}
@@ -2331,14 +2331,14 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
if (callExpr->arguments && !callExpr->arguments->next)
literal = AST::cast<AST::StringLiteral *>(callExpr->arguments->expression);
if (!literal) {
- error(prop, QQuickListModel::tr("ListElement: improperly specified %1").arg(idExpr->name.toString()));
+ error(prop, QQmlListModel::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, QQuickListModel::tr("ListElement: improperly specified QT_TRANSLATE_NOOP"));
+ error(prop, QQmlListModel::tr("ListElement: improperly specified QT_TRANSLATE_NOOP"));
return false;
}
}
@@ -2349,7 +2349,7 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
d[0] = char(QQmlScript::Variant::String);
d += literal->value.toUtf8();
} else {
- error(prop, QQuickListModel::tr("ListElement: cannot use script for property value"));
+ error(prop, QQmlListModel::tr("ListElement: cannot use script for property value"));
return false;
}
} else {
@@ -2371,7 +2371,7 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
return true;
}
-QByteArray QQuickListModelParser::compile(const QList<QQmlCustomParserProperty> &customProps)
+QByteArray QQmlListModelParser::compile(const QList<QQmlCustomParserProperty> &customProps)
{
QList<ListInstruction> instr;
QByteArray data;
@@ -2380,7 +2380,7 @@ QByteArray QQuickListModelParser::compile(const QList<QQmlCustomParserProperty>
for(int ii = 0; ii < customProps.count(); ++ii) {
const QQmlCustomParserProperty &prop = customProps.at(ii);
if(!prop.name().isEmpty()) { // isn't default property
- error(prop, QQuickListModel::tr("ListModel: undefined property '%1'").arg(prop.name()));
+ error(prop, QQmlListModel::tr("ListModel: undefined property '%1'").arg(prop.name()));
return QByteArray();
}
@@ -2407,9 +2407,9 @@ QByteArray QQuickListModelParser::compile(const QList<QQmlCustomParserProperty>
return rv;
}
-void QQuickListModelParser::setCustomData(QObject *obj, const QByteArray &d)
+void QQmlListModelParser::setCustomData(QObject *obj, const QByteArray &d)
{
- QQuickListModel *rv = static_cast<QQuickListModel *>(obj);
+ QQmlListModel *rv = static_cast<QQmlListModel *>(obj);
QV8Engine *engine = QQmlEnginePrivate::getV8Engine(qmlEngine(rv));
rv->m_engine = engine;
@@ -2508,7 +2508,7 @@ void QQuickListModelParser::setCustomData(QObject *obj, const QByteArray &d)
qmlInfo(obj) << "All ListElement declarations are empty, no roles can be created unless dynamicRoles is set.";
}
-bool QQuickListModelParser::definesEmptyList(const QString &s)
+bool QQmlListModelParser::definesEmptyList(const QString &s)
{
if (s.startsWith(QLatin1Char('[')) && s.endsWith(QLatin1Char(']'))) {
for (int i=1; i<s.length()-1; i++) {
@@ -2523,7 +2523,7 @@ bool QQuickListModelParser::definesEmptyList(const QString &s)
/*!
\qmltype ListElement
- \instantiates QQuickListElement
+ \instantiates QQmlListElement
\inqmlmodule QtQuick 2
\brief Defines a data item in a ListModel
\ingroup qtquick-models
diff --git a/src/qml/qml/qquicklistmodel_p.h b/src/qml/qml/qqmllistmodel_p.h
index 8649238b80..70477115bd 100644
--- a/src/qml/qml/qquicklistmodel_p.h
+++ b/src/qml/qml/qqmllistmodel_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QQUICKLISTMODEL_H
-#define QQUICKLISTMODEL_H
+#ifndef QQMLLISTMODEL_H
+#define QQMLLISTMODEL_H
#include <qqml.h>
#include <private/qqmlcustomparser_p.h>
@@ -55,24 +55,22 @@
#include <private/qv8engine_p.h>
#include <private/qpodvector_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-class QQuickListModelWorkerAgent;
+class QQmlListModelWorkerAgent;
class ListModel;
class ListLayout;
-class Q_QML_PRIVATE_EXPORT QQuickListModel : public QAbstractListModel
+class Q_QML_PRIVATE_EXPORT QQmlListModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_PROPERTY(bool dynamicRoles READ dynamicRoles WRITE setDynamicRoles)
public:
- QQuickListModel(QObject *parent=0);
- ~QQuickListModel();
+ QQmlListModel(QObject *parent=0);
+ ~QQmlListModel();
QModelIndex index(int row, int column, const QModelIndex &parent) const;
int rowCount(const QModelIndex &parent) const;
@@ -92,7 +90,7 @@ public:
Q_INVOKABLE void move(int from, int to, int count);
Q_INVOKABLE void sync();
- QQuickListModelWorkerAgent *agent();
+ QQmlListModelWorkerAgent *agent();
bool dynamicRoles() const { return m_dynamicRoles; }
void setDynamicRoles(bool enableDynamicRoles);
@@ -101,8 +99,8 @@ Q_SIGNALS:
void countChanged();
private:
- friend class QQuickListModelParser;
- friend class QQuickListModelWorkerAgent;
+ friend class QQmlListModelParser;
+ friend class QQmlListModelWorkerAgent;
friend class ModelObject;
friend class ModelNodeMetaObject;
friend class ListModel;
@@ -111,14 +109,14 @@ private:
friend class DynamicRoleModelNodeMetaObject;
// Constructs a flat list model for a worker agent
- QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAgent *agent);
- QQuickListModel(const QQuickListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent=0);
+ QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agent);
+ QQmlListModel(const QQmlListModel *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); }
- QQuickListModelWorkerAgent *m_agent;
+ QQmlListModelWorkerAgent *m_agent;
mutable QV8Engine *m_engine;
bool m_mainThread;
bool m_primary;
@@ -142,8 +140,8 @@ private:
int getUid() const { return m_uid; }
- static void sync(QQuickListModel *src, QQuickListModel *target, QHash<int, QQuickListModel *> *targetModelHash);
- static QQuickListModel *createWithOwner(QQuickListModel *newOwner);
+ static void sync(QQmlListModel *src, QQmlListModel *target, QHash<int, QQmlListModel *> *targetModelHash);
+ static QQmlListModel *createWithOwner(QQmlListModel *newOwner);
void emitItemsChanged(int index, int count, const QVector<int> &roles);
void emitItemsRemoved(int index, int count);
@@ -152,15 +150,15 @@ private:
};
// ### FIXME
-class QQuickListElement : public QObject
+class QQmlListElement : public QObject
{
Q_OBJECT
};
-class QQuickListModelParser : public QQmlCustomParser
+class QQmlListModelParser : public QQmlCustomParser
{
public:
- QQuickListModelParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {}
+ QQmlListModelParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {}
QByteArray compile(const QList<QQmlCustomParserProperty> &);
void setCustomData(QObject *, const QByteArray &);
@@ -194,9 +192,7 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickListModel)
-QML_DECLARE_TYPE(QQuickListElement)
-
-QT_END_HEADER
+QML_DECLARE_TYPE(QQmlListModel)
+QML_DECLARE_TYPE(QQmlListElement)
-#endif // QQUICKLISTMODEL_H
+#endif // QQMLLISTMODEL_H
diff --git a/src/qml/qml/qquicklistmodel_p_p.h b/src/qml/qml/qqmllistmodel_p_p.h
index ff312f98e5..f2720c6c39 100644
--- a/src/qml/qml/qquicklistmodel_p_p.h
+++ b/src/qml/qml/qqmllistmodel_p_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QQUICKLISTMODEL_P_P_H
-#define QQUICKLISTMODEL_P_P_H
+#ifndef QQMLLISTMODEL_P_P_H
+#define QQMLLISTMODEL_P_P_H
//
// W A R N I N G
@@ -53,13 +53,11 @@
// We mean it.
//
-#include "qquicklistmodel_p.h"
+#include "qqmllistmodel_p.h"
#include <private/qqmlengine_p.h>
#include "qqmlopenmetaobject_p.h"
#include <qqml.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -85,9 +83,9 @@ class DynamicRoleModelNode : public QObject
{
Q_OBJECT
public:
- DynamicRoleModelNode(QQuickListModel *owner, int uid);
+ DynamicRoleModelNode(QQmlListModel *owner, int uid);
- static DynamicRoleModelNode *create(const QVariantMap &obj, QQuickListModel *owner);
+ static DynamicRoleModelNode *create(const QVariantMap &obj, QQmlListModel *owner);
void updateValues(const QVariantMap &object, QVector<int> &roles);
@@ -111,10 +109,10 @@ public:
return m_uid;
}
- static void sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQuickListModel *> *targetModelHash);
+ static void sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQmlListModel *> *targetModelHash);
private:
- QQuickListModel *m_owner;
+ QQmlListModel *m_owner;
int m_uid;
DynamicRoleModelNodeMetaObject *m_meta;
@@ -143,7 +141,7 @@ class ModelObject : public QObject
{
Q_OBJECT
public:
- ModelObject(QQuickListModel *model, int elementIndex);
+ ModelObject(QQmlListModel *model, int elementIndex);
void setValue(const QByteArray &name, const QVariant &val, bool force)
{
@@ -164,7 +162,7 @@ public:
void updateValues();
void updateValues(const QVector<int> &roles);
- QQuickListModel *m_model;
+ QQmlListModel *m_model;
int m_elementIndex;
private:
@@ -273,7 +271,7 @@ private:
void clearProperty(const ListLayout::Role &role);
- QVariant getProperty(const ListLayout::Role &role, const QQuickListModel *owner, QV8Engine *eng);
+ QVariant getProperty(const ListLayout::Role &role, const QQmlListModel *owner, QV8Engine *eng);
ListModel *getListProperty(const ListLayout::Role &role);
QString *getStringProperty(const ListLayout::Role &role);
QObject *getQObjectProperty(const ListLayout::Role &role);
@@ -298,7 +296,7 @@ class ListModel
{
public:
- ListModel(ListLayout *layout, QQuickListModel *modelCache, int uid);
+ ListModel(ListLayout *layout, QQmlListModel *modelCache, int uid);
~ListModel() {}
void destroy();
@@ -306,7 +304,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 QQuickListModel *owner, QV8Engine *eng);
+ QVariant getProperty(int elementIndex, int roleIndex, const QQmlListModel *owner, QV8Engine *eng);
ListModel *getListProperty(int elementIndex, const ListLayout::Role &role);
int roleCount() const
@@ -347,14 +345,14 @@ public:
static void sync(ListModel *src, ListModel *target, QHash<int, ListModel *> *srcModelHash);
- ModelObject *getOrCreateModelObject(QQuickListModel *model, int elementIndex);
+ ModelObject *getOrCreateModelObject(QQmlListModel *model, int elementIndex);
private:
QPODVector<ListElement *, 4> elements;
ListLayout *m_layout;
int m_uid;
- QQuickListModel *m_modelCache;
+ QQmlListModel *m_modelCache;
struct ElementSync
{
@@ -369,14 +367,12 @@ private:
void updateCacheIndices();
friend class ListElement;
- friend class QQuickListModelWorkerAgent;
+ friend class QQmlListModelWorkerAgent;
};
QT_END_NAMESPACE
Q_DECLARE_METATYPE(ListModel *);
-QT_END_HEADER
-
#endif // QQUICKLISTMODEL_P_P_H
diff --git a/src/qml/qml/qquicklistmodelworkeragent.cpp b/src/qml/qml/qqmllistmodelworkeragent.cpp
index e0ab882b92..9554e6d1e5 100644
--- a/src/qml/qml/qquicklistmodelworkeragent.cpp
+++ b/src/qml/qml/qqmllistmodelworkeragent.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qquicklistmodelworkeragent_p.h"
-#include "qquicklistmodel_p_p.h"
+#include "qqmllistmodelworkeragent_p.h"
+#include "qqmllistmodel_p_p.h"
#include <private/qqmldata_p.h>
#include <private/qqmlengine_p.h>
#include <qqmlinfo.h>
@@ -53,7 +53,7 @@
QT_BEGIN_NAMESPACE
-void QQuickListModelWorkerAgent::Data::clearChange(int uid)
+void QQmlListModelWorkerAgent::Data::clearChange(int uid)
{
for (int i=0 ; i < changes.count() ; ++i) {
if (changes[i].modelUid == uid) {
@@ -63,53 +63,53 @@ void QQuickListModelWorkerAgent::Data::clearChange(int uid)
}
}
-void QQuickListModelWorkerAgent::Data::insertChange(int uid, int index, int count)
+void QQmlListModelWorkerAgent::Data::insertChange(int uid, int index, int count)
{
Change c = { uid, Change::Inserted, index, count, 0, QVector<int>() };
changes << c;
}
-void QQuickListModelWorkerAgent::Data::removeChange(int uid, int index, int count)
+void QQmlListModelWorkerAgent::Data::removeChange(int uid, int index, int count)
{
Change c = { uid, Change::Removed, index, count, 0, QVector<int>() };
changes << c;
}
-void QQuickListModelWorkerAgent::Data::moveChange(int uid, int index, int count, int to)
+void QQmlListModelWorkerAgent::Data::moveChange(int uid, int index, int count, int to)
{
Change c = { uid, Change::Moved, index, count, to, QVector<int>() };
changes << c;
}
-void QQuickListModelWorkerAgent::Data::changedChange(int uid, int index, int count, const QVector<int> &roles)
+void QQmlListModelWorkerAgent::Data::changedChange(int uid, int index, int count, const QVector<int> &roles)
{
Change c = { uid, Change::Changed, index, count, 0, roles };
changes << c;
}
-QQuickListModelWorkerAgent::QQuickListModelWorkerAgent(QQuickListModel *model)
-: m_ref(1), m_orig(model), m_copy(new QQuickListModel(model, this))
+QQmlListModelWorkerAgent::QQmlListModelWorkerAgent(QQmlListModel *model)
+: m_ref(1), m_orig(model), m_copy(new QQmlListModel(model, this))
{
}
-QQuickListModelWorkerAgent::~QQuickListModelWorkerAgent()
+QQmlListModelWorkerAgent::~QQmlListModelWorkerAgent()
{
mutex.lock();
syncDone.wakeAll();
mutex.unlock();
}
-void QQuickListModelWorkerAgent::setV8Engine(QV8Engine *eng)
+void QQmlListModelWorkerAgent::setV8Engine(QV8Engine *eng)
{
m_copy->m_engine = eng;
}
-void QQuickListModelWorkerAgent::addref()
+void QQmlListModelWorkerAgent::addref()
{
m_ref.ref();
}
-void QQuickListModelWorkerAgent::release()
+void QQmlListModelWorkerAgent::release()
{
bool del = !m_ref.deref();
@@ -117,57 +117,57 @@ void QQuickListModelWorkerAgent::release()
deleteLater();
}
-void QQuickListModelWorkerAgent::modelDestroyed()
+void QQmlListModelWorkerAgent::modelDestroyed()
{
m_orig = 0;
}
-int QQuickListModelWorkerAgent::count() const
+int QQmlListModelWorkerAgent::count() const
{
return m_copy->count();
}
-void QQuickListModelWorkerAgent::clear()
+void QQmlListModelWorkerAgent::clear()
{
m_copy->clear();
}
-void QQuickListModelWorkerAgent::remove(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::remove(QQmlV8Function *args)
{
m_copy->remove(args);
}
-void QQuickListModelWorkerAgent::append(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::append(QQmlV8Function *args)
{
m_copy->append(args);
}
-void QQuickListModelWorkerAgent::insert(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::insert(QQmlV8Function *args)
{
m_copy->insert(args);
}
-QQmlV8Handle QQuickListModelWorkerAgent::get(int index) const
+QQmlV8Handle QQmlListModelWorkerAgent::get(int index) const
{
return m_copy->get(index);
}
-void QQuickListModelWorkerAgent::set(int index, const QQmlV8Handle &value)
+void QQmlListModelWorkerAgent::set(int index, const QQmlV8Handle &value)
{
m_copy->set(index, value);
}
-void QQuickListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value)
+void QQmlListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value)
{
m_copy->setProperty(index, property, value);
}
-void QQuickListModelWorkerAgent::move(int from, int to, int count)
+void QQmlListModelWorkerAgent::move(int from, int to, int count)
{
m_copy->move(from, to, count);
}
-void QQuickListModelWorkerAgent::sync()
+void QQmlListModelWorkerAgent::sync()
{
Sync *s = new Sync;
s->data = data;
@@ -180,7 +180,7 @@ void QQuickListModelWorkerAgent::sync()
mutex.unlock();
}
-bool QQuickListModelWorkerAgent::event(QEvent *e)
+bool QQmlListModelWorkerAgent::event(QEvent *e)
{
if (e->type() == QEvent::User) {
bool cc = false;
@@ -191,19 +191,19 @@ bool QQuickListModelWorkerAgent::event(QEvent *e)
cc = m_orig->count() != s->list->count();
- QHash<int, QQuickListModel *> targetModelDynamicHash;
+ QHash<int, QQmlListModel *> targetModelDynamicHash;
QHash<int, ListModel *> targetModelStaticHash;
Q_ASSERT(m_orig->m_dynamicRoles == s->list->m_dynamicRoles);
if (m_orig->m_dynamicRoles)
- QQuickListModel::sync(s->list, m_orig, &targetModelDynamicHash);
+ QQmlListModel::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);
- QQuickListModel *model = 0;
+ QQmlListModel *model = 0;
if (m_orig->m_dynamicRoles) {
model = targetModelDynamicHash.value(change.modelUid);
} else {
diff --git a/src/qml/qml/qquicklistmodelworkeragent_p.h b/src/qml/qml/qqmllistmodelworkeragent_p.h
index 7cff9be8f4..614017069c 100644
--- a/src/qml/qml/qquicklistmodelworkeragent_p.h
+++ b/src/qml/qml/qqmllistmodelworkeragent_p.h
@@ -60,21 +60,19 @@
#include <private/qv8engine_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-class QQuickListModel;
+class QQmlListModel;
-class QQuickListModelWorkerAgent : public QObject
+class QQmlListModelWorkerAgent : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count)
public:
- QQuickListModelWorkerAgent(QQuickListModel *);
- ~QQuickListModelWorkerAgent();
+ QQmlListModelWorkerAgent(QQmlListModel *);
+ ~QQmlListModelWorkerAgent();
void setV8Engine(QV8Engine *eng);
void addref();
@@ -96,7 +94,7 @@ public:
{
VariantRef() : a(0) {}
VariantRef(const VariantRef &r) : a(r.a) { if (a) a->addref(); }
- VariantRef(QQuickListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); }
+ VariantRef(QQmlListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); }
~VariantRef() { if (a) a->release(); }
VariantRef &operator=(const VariantRef &o) {
@@ -105,7 +103,7 @@ public:
return *this;
}
- QQuickListModelWorkerAgent *a;
+ QQmlListModelWorkerAgent *a;
};
void modelDestroyed();
protected:
@@ -113,7 +111,7 @@ protected:
private:
friend class QQuickWorkerScriptEnginePrivate;
- friend class QQuickListModel;
+ friend class QQmlListModel;
struct Change
{
@@ -140,21 +138,19 @@ private:
struct Sync : public QEvent {
Sync() : QEvent(QEvent::User) {}
Data data;
- QQuickListModel *list;
+ QQmlListModel *list;
};
QAtomicInt m_ref;
- QQuickListModel *m_orig;
- QQuickListModel *m_copy;
+ QQmlListModel *m_orig;
+ QQmlListModel *m_copy;
QMutex mutex;
QWaitCondition syncDone;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QQuickListModelWorkerAgent::VariantRef)
-
-QT_END_HEADER
+Q_DECLARE_METATYPE(QQmlListModelWorkerAgent::VariantRef)
#endif // QQUICKLISTMODELWORKERAGENT_P_H
diff --git a/src/qml/qml/qqmllocale_p.h b/src/qml/qml/qqmllocale_p.h
index 8015ca2bbe..25f98d9168 100644
--- a/src/qml/qml/qqmllocale_p.h
+++ b/src/qml/qml/qqmllocale_p.h
@@ -49,8 +49,6 @@
#include <private/qv8engine_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -133,6 +131,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/qml/qml/qqmlmemoryprofiler_p.h b/src/qml/qml/qqmlmemoryprofiler_p.h
index d0d96f20f9..dfc26aa8fb 100644
--- a/src/qml/qml/qqmlmemoryprofiler_p.h
+++ b/src/qml/qml/qqmlmemoryprofiler_p.h
@@ -44,7 +44,6 @@
#include <private/qtqmlglobal_p.h>
-QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QUrl;
@@ -76,6 +75,4 @@ public:
#define QML_MEMORY_SCOPE_STRING(s) QQmlMemoryScope _qml_memory_scope(s)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLMEMORYPROFILER_H
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 2389c45574..372475d85c 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -75,6 +75,8 @@ struct QQmlMetaTypeData
Ids idToType;
typedef QHash<QHashedStringRef,QQmlType *> Names;
Names nameToType;
+ typedef QHash<QUrl, QQmlType *> Files; //For file imported composite types only
+ Files urlToType;
typedef QHash<const QMetaObject *, QQmlType *> MetaObjects;
MetaObjects metaObjectToType;
typedef QHash<int, QQmlMetaType::StringConverter> StringConverters;
@@ -148,48 +150,68 @@ QQmlMetaTypeData::~QQmlMetaTypeData()
class QQmlTypePrivate
{
public:
- QQmlTypePrivate();
+ QQmlTypePrivate(QQmlType::RegistrationType type);
~QQmlTypePrivate();
void init() const;
void initEnums() const;
void insertEnums(const QMetaObject *metaObject) const;
- bool m_isInterface : 1;
- const char *m_iid;
- QHashedString m_module;
- QString m_name;
- QString m_elementName;
- int m_version_maj;
- int m_version_min;
- int m_typeId; int m_listId;
- int m_revision;
- mutable bool m_containsRevisionedAttributes;
- mutable QQmlType *m_superType;
-
- int m_allocationSize;
- void (*m_newFunc)(void *);
- QString m_noCreationReason;
-
- const QMetaObject *m_baseMetaObject;
- QQmlAttachedPropertiesFunc m_attachedPropertiesFunc;
- const QMetaObject *m_attachedPropertiesType;
- int m_attachedPropertiesId;
- int m_parserStatusCast;
- int m_propertyValueSourceCast;
- int m_propertyValueInterceptorCast;
- QObject *(*m_extFunc)(QObject *);
- const QMetaObject *m_extMetaObject;
- int m_index;
- QQmlCustomParser *m_customParser;
- mutable volatile bool m_isSetup:1;
- mutable volatile bool m_isEnumSetup:1;
- mutable bool m_haveSuperType:1;
- mutable QList<QQmlProxyMetaObject::ProxyData> m_metaObjects;
- mutable QStringHash<int> m_enums;
- QQmlType::SingletonInstanceInfo *m_singletonInstanceInfo;
-
- static QHash<const QMetaObject *, int> m_attachedPropertyIds;
+ QQmlType::RegistrationType regType;
+
+ struct QQmlCppTypeData
+ {
+ int allocationSize;
+ void (*newFunc)(void *);
+ QString noCreationReason;
+ int parserStatusCast;
+ QObject *(*extFunc)(QObject *);
+ const QMetaObject *extMetaObject;
+ QQmlCustomParser *customParser;
+ QQmlAttachedPropertiesFunc attachedPropertiesFunc;
+ const QMetaObject *attachedPropertiesType;
+ int attachedPropertiesId;
+ int propertyValueSourceCast;
+ int propertyValueInterceptorCast;
+ };
+
+ struct QQmlSingletonTypeData
+ {
+ QQmlType::SingletonInstanceInfo *singletonInstanceInfo;
+ };
+
+ struct QQmlCompositeTypeData
+ {
+ QUrl url;
+ };
+
+ union extraData {
+ QQmlCppTypeData* cd;
+ QQmlSingletonTypeData* sd;
+ QQmlCompositeTypeData* fd;
+ } extraData;
+
+ const char *iid;
+ QHashedString module;
+ QString name;
+ QString elementName;
+ int version_maj;
+ int version_min;
+ int typeId;
+ int listId;
+ int revision;
+ mutable bool containsRevisionedAttributes;
+ mutable QQmlType *superType;
+ const QMetaObject *baseMetaObject;
+
+ int index;
+ mutable volatile bool isSetup:1;
+ mutable volatile bool isEnumSetup:1;
+ mutable bool haveSuperType:1;
+ mutable QList<QQmlProxyMetaObject::ProxyData> metaObjects;
+ mutable QStringHash<int> enums;
+
+ static QHash<const QMetaObject *, int> attachedPropertyIds;
};
// Avoid multiple fromUtf8(), copies and hashing of the module name.
@@ -250,147 +272,195 @@ QJSValue QQmlType::SingletonInstanceInfo::scriptApi(QQmlEngine *e) const
return scriptApis.value(e);
}
-QHash<const QMetaObject *, int> QQmlTypePrivate::m_attachedPropertyIds;
-
-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),
- m_propertyValueInterceptorCast(-1), m_extFunc(0), m_extMetaObject(0), m_index(-1), m_customParser(0),
- m_isSetup(false), m_isEnumSetup(false), m_haveSuperType(false), m_singletonInstanceInfo(0)
-{
+QHash<const QMetaObject *, int> QQmlTypePrivate::attachedPropertyIds;
+
+QQmlTypePrivate::QQmlTypePrivate(QQmlType::RegistrationType type)
+: regType(type), iid(0), typeId(0), listId(0), revision(0),
+ containsRevisionedAttributes(false), superType(0), baseMetaObject(0),
+ index(-1), isSetup(false), isEnumSetup(false), haveSuperType(false)
+{
+ switch (type) {
+ case QQmlType::CppType:
+ extraData.cd = new QQmlCppTypeData;
+ extraData.cd->allocationSize = 0;
+ extraData.cd->newFunc = 0;
+ extraData.cd->parserStatusCast = -1;
+ extraData.cd->extFunc = 0;
+ extraData.cd->extMetaObject = 0;
+ extraData.cd->customParser = 0;
+ extraData.cd->attachedPropertiesFunc = 0;
+ extraData.cd->attachedPropertiesType = 0;
+ extraData.cd->propertyValueSourceCast = -1;
+ extraData.cd->propertyValueInterceptorCast = -1;
+ break;
+ case QQmlType::SingletonType:
+ extraData.sd = new QQmlSingletonTypeData;
+ extraData.sd->singletonInstanceInfo = 0;
+ break;
+ case QQmlType::InterfaceType:
+ extraData.cd = 0;
+ break;
+ case QQmlType::CompositeType:
+ extraData.fd = new QQmlCompositeTypeData;
+ break;
+ default: qFatal("QQmlTypePrivate Internal Error.");
+ }
}
QQmlTypePrivate::~QQmlTypePrivate()
{
- delete m_singletonInstanceInfo;
+ switch (regType) {
+ case QQmlType::CppType:
+ delete extraData.cd->customParser;
+ delete extraData.cd;
+ break;
+ case QQmlType::SingletonType:
+ delete extraData.sd->singletonInstanceInfo;
+ delete extraData.sd;
+ break;
+ case QQmlType::CompositeType:
+ delete extraData.fd;
+ break;
+ default: //Also InterfaceType, because it has no extra data
+ break;
+ }
}
QQmlType::QQmlType(int index, const QQmlPrivate::RegisterInterface &interface)
-: d(new QQmlTypePrivate)
+: d(new QQmlTypePrivate(InterfaceType))
{
- d->m_isInterface = true;
- d->m_iid = interface.iid;
- d->m_typeId = interface.typeId;
- d->m_listId = interface.listId;
- d->m_newFunc = 0;
- d->m_index = index;
- d->m_isSetup = true;
- d->m_version_maj = 0;
- d->m_version_min = 0;
+ d->iid = interface.iid;
+ d->typeId = interface.typeId;
+ d->listId = interface.listId;
+ d->index = index;
+ d->isSetup = true;
+ d->version_maj = 0;
+ d->version_min = 0;
}
QQmlType::QQmlType(int index, const QString &elementName, const QQmlPrivate::RegisterSingletonType &type)
-: d(new QQmlTypePrivate)
+: d(new QQmlTypePrivate(SingletonType))
{
- d->m_elementName = elementName;
- d->m_module = moduleFromUtf8(type.uri);
+ d->elementName = elementName;
+ d->module = moduleFromUtf8(type.uri);
- d->m_version_maj = type.versionMajor;
- d->m_version_min = type.versionMinor;
+ d->version_maj = type.versionMajor;
+ d->version_min = type.versionMinor;
if (type.qobjectApi) {
if (type.version >= 1) // static metaobject added in version 1
- d->m_baseMetaObject = type.instanceMetaObject;
+ d->baseMetaObject = type.instanceMetaObject;
if (type.version >= 2) // typeId added in version 2
- d->m_typeId = type.typeId;
+ d->typeId = type.typeId;
if (type.version >= 2) // revisions added in version 2
- d->m_revision = type.revision;
+ d->revision = type.revision;
}
- d->m_newFunc = 0;
- d->m_index = index;
+ d->index = index;
- d->m_singletonInstanceInfo = new SingletonInstanceInfo;
- d->m_singletonInstanceInfo->scriptCallback = type.scriptApi;
- d->m_singletonInstanceInfo->qobjectCallback = type.qobjectApi;
- d->m_singletonInstanceInfo->typeName = QString::fromUtf8(type.typeName);
- d->m_singletonInstanceInfo->instanceMetaObject = (type.qobjectApi && type.version >= 1) ? type.instanceMetaObject : 0;
+ d->extraData.sd->singletonInstanceInfo = new SingletonInstanceInfo;
+ d->extraData.sd->singletonInstanceInfo->scriptCallback = type.scriptApi;
+ d->extraData.sd->singletonInstanceInfo->qobjectCallback = type.qobjectApi;
+ d->extraData.sd->singletonInstanceInfo->typeName = QString::fromUtf8(type.typeName);
+ d->extraData.sd->singletonInstanceInfo->instanceMetaObject
+ = (type.qobjectApi && type.version >= 1) ? type.instanceMetaObject : 0;
}
QQmlType::QQmlType(int index, const QString &elementName, const QQmlPrivate::RegisterType &type)
-: d(new QQmlTypePrivate)
+: d(new QQmlTypePrivate(CppType))
{
- d->m_elementName = elementName;
- d->m_module = moduleFromUtf8(type.uri);
+ d->elementName = elementName;
+ d->module = moduleFromUtf8(type.uri);
- d->m_version_maj = type.versionMajor;
- d->m_version_min = type.versionMinor;
+ d->version_maj = type.versionMajor;
+ d->version_min = type.versionMinor;
if (type.version >= 1) // revisions added in version 1
- d->m_revision = type.revision;
- d->m_typeId = type.typeId;
- d->m_listId = type.listId;
- d->m_allocationSize = type.objectSize;
- d->m_newFunc = type.create;
- d->m_noCreationReason = type.noCreationReason;
- d->m_baseMetaObject = type.metaObject;
- d->m_attachedPropertiesFunc = type.attachedPropertiesFunction;
- d->m_attachedPropertiesType = type.attachedPropertiesMetaObject;
- if (d->m_attachedPropertiesType) {
- QHash<const QMetaObject *, int>::Iterator iter = d->m_attachedPropertyIds.find(d->m_baseMetaObject);
- if (iter == d->m_attachedPropertyIds.end())
- iter = d->m_attachedPropertyIds.insert(d->m_baseMetaObject, index);
- d->m_attachedPropertiesId = *iter;
+ d->revision = type.revision;
+ d->typeId = type.typeId;
+ d->listId = type.listId;
+ d->extraData.cd->allocationSize = type.objectSize;
+ d->extraData.cd->newFunc = type.create;
+ d->extraData.cd->noCreationReason = type.noCreationReason;
+ d->baseMetaObject = type.metaObject;
+ d->extraData.cd->attachedPropertiesFunc = type.attachedPropertiesFunction;
+ d->extraData.cd->attachedPropertiesType = type.attachedPropertiesMetaObject;
+ if (d->extraData.cd->attachedPropertiesType) {
+ QHash<const QMetaObject *, int>::Iterator iter = d->attachedPropertyIds.find(d->baseMetaObject);
+ if (iter == d->attachedPropertyIds.end())
+ iter = d->attachedPropertyIds.insert(d->baseMetaObject, index);
+ d->extraData.cd->attachedPropertiesId = *iter;
} else {
- d->m_attachedPropertiesId = -1;
+ d->extraData.cd->attachedPropertiesId = -1;
}
- d->m_parserStatusCast = type.parserStatusCast;
- d->m_propertyValueSourceCast = type.valueSourceCast;
- d->m_propertyValueInterceptorCast = type.valueInterceptorCast;
- d->m_extFunc = type.extensionObjectCreate;
- d->m_index = index;
- d->m_customParser = type.customParser;
+ d->extraData.cd->parserStatusCast = type.parserStatusCast;
+ d->extraData.cd->propertyValueSourceCast = type.valueSourceCast;
+ d->extraData.cd->propertyValueInterceptorCast = type.valueInterceptorCast;
+ d->extraData.cd->extFunc = type.extensionObjectCreate;
+ d->extraData.cd->customParser = type.customParser;
+ d->index = index;
if (type.extensionMetaObject)
- d->m_extMetaObject = type.extensionMetaObject;
+ d->extraData.cd->extMetaObject = type.extensionMetaObject;
+}
+
+QQmlType::QQmlType(int index, const QString &elementName, const QQmlPrivate::RegisterCompositeType &type)
+: d(new QQmlTypePrivate(CompositeType))
+{
+ d->index = index;
+ d->elementName = elementName;
+
+ d->module = moduleFromUtf8(type.uri);
+ d->version_maj = type.versionMajor;
+ d->version_min = type.versionMinor;
+
+ d->extraData.fd->url = type.url;
}
QQmlType::~QQmlType()
{
- delete d->m_customParser;
delete d;
}
const QHashedString &QQmlType::module() const
{
- return d->m_module;
+ return d->module;
}
int QQmlType::majorVersion() const
{
- return d->m_version_maj;
+ return d->version_maj;
}
int QQmlType::minorVersion() const
{
- return d->m_version_min;
+ return d->version_min;
}
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;
+ return vmajor == d->version_maj && vminor >= d->version_min;
}
bool QQmlType::availableInVersion(const QHashedStringRef &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;
+ return module == d->module && vmajor == d->version_maj && vminor >= d->version_min;
}
// returns the nearest _registered_ super class
QQmlType *QQmlType::superType() const
{
- if (!d->m_haveSuperType && d->m_baseMetaObject) {
- const QMetaObject *mo = d->m_baseMetaObject->superClass();
- while (mo && !d->m_superType) {
- d->m_superType = QQmlMetaType::qmlType(mo, d->m_module, d->m_version_maj, d->m_version_min);
+ if (!d->haveSuperType && d->baseMetaObject) {
+ const QMetaObject *mo = d->baseMetaObject->superClass();
+ while (mo && !d->superType) {
+ d->superType = QQmlMetaType::qmlType(mo, d->module, d->version_maj, d->version_min);
mo = mo->superClass();
}
- d->m_haveSuperType = true;
+ d->haveSuperType = true;
}
- return d->m_superType;
+ return d->superType;
}
static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo,
@@ -481,92 +551,95 @@ static bool isPropertyRevisioned(const QMetaObject *mo, int index)
void QQmlTypePrivate::init() const
{
- if (m_isSetup) return;
+ if (isSetup)
+ return;
QWriteLocker lock(metaTypeDataLock());
- if (m_isSetup)
+ if (isSetup)
return;
- const QMetaObject *mo = m_baseMetaObject;
+ const QMetaObject *mo = baseMetaObject;
if (!mo) {
- // singleton type without metaobject information
+ // version 0 singleton type without metaobject information
return;
}
- // Setup extended meta object
- // XXX - very inefficient
- if (m_extFunc) {
- QMetaObjectBuilder builder;
- clone(builder, m_extMetaObject, m_extMetaObject, m_extMetaObject);
- builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
- QMetaObject *mmo = builder.toMetaObject();
- mmo->d.superdata = mo;
- QQmlProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0, 0 };
- m_metaObjects << data;
+ if (regType == QQmlType::CppType) {
+ // Setup extended meta object
+ // XXX - very inefficient
+ if (extraData.cd->extFunc) {
+ QMetaObjectBuilder builder;
+ clone(builder, extraData.cd->extMetaObject, extraData.cd->extMetaObject, extraData.cd->extMetaObject);
+ builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
+ QMetaObject *mmo = builder.toMetaObject();
+ mmo->d.superdata = mo;
+ QQmlProxyMetaObject::ProxyData data = { mmo, extraData.cd->extFunc, 0, 0 };
+ metaObjects << data;
+ }
}
mo = mo->d.superdata;
while(mo) {
QQmlType *t = metaTypeData()->metaObjectToType.value(mo);
if (t) {
- if (t->d->m_extFunc) {
+ if (t->d->extraData.cd->extFunc) {
QMetaObjectBuilder builder;
- clone(builder, t->d->m_extMetaObject, t->d->m_baseMetaObject, m_baseMetaObject);
+ clone(builder, t->d->extraData.cd->extMetaObject, t->d->baseMetaObject, baseMetaObject);
builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
QMetaObject *mmo = builder.toMetaObject();
- mmo->d.superdata = m_baseMetaObject;
- if (!m_metaObjects.isEmpty())
- m_metaObjects.last().metaObject->d.superdata = mmo;
- QQmlProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0, 0 };
- m_metaObjects << data;
+ mmo->d.superdata = baseMetaObject;
+ if (!metaObjects.isEmpty())
+ metaObjects.last().metaObject->d.superdata = mmo;
+ QQmlProxyMetaObject::ProxyData data = { mmo, t->d->extraData.cd->extFunc, 0, 0 };
+ metaObjects << data;
}
}
mo = mo->d.superdata;
}
- for (int ii = 0; ii < m_metaObjects.count(); ++ii) {
- m_metaObjects[ii].propertyOffset =
- m_metaObjects.at(ii).metaObject->propertyOffset();
- m_metaObjects[ii].methodOffset =
- m_metaObjects.at(ii).metaObject->methodOffset();
+ for (int ii = 0; ii < metaObjects.count(); ++ii) {
+ metaObjects[ii].propertyOffset =
+ metaObjects.at(ii).metaObject->propertyOffset();
+ metaObjects[ii].methodOffset =
+ metaObjects.at(ii).metaObject->methodOffset();
}
-
+
// Check for revisioned details
{
const QMetaObject *mo = 0;
- if (m_metaObjects.isEmpty())
- mo = m_baseMetaObject;
+ if (metaObjects.isEmpty())
+ mo = baseMetaObject;
else
- mo = m_metaObjects.first().metaObject;
+ mo = metaObjects.first().metaObject;
- for (int ii = 0; !m_containsRevisionedAttributes && ii < mo->propertyCount(); ++ii) {
+ for (int ii = 0; !containsRevisionedAttributes && ii < mo->propertyCount(); ++ii) {
if (isPropertyRevisioned(mo, ii))
- m_containsRevisionedAttributes = true;
+ containsRevisionedAttributes = true;
}
- for (int ii = 0; !m_containsRevisionedAttributes && ii < mo->methodCount(); ++ii) {
+ for (int ii = 0; !containsRevisionedAttributes && ii < mo->methodCount(); ++ii) {
if (mo->method(ii).revision() != 0)
- m_containsRevisionedAttributes = true;
+ containsRevisionedAttributes = true;
}
}
- m_isSetup = true;
+ isSetup = true;
lock.unlock();
}
void QQmlTypePrivate::initEnums() const
{
- if (m_isEnumSetup) return;
+ if (isEnumSetup) return;
init();
QWriteLocker lock(metaTypeDataLock());
- if (m_isEnumSetup) return;
+ if (isEnumSetup) return;
- if (m_baseMetaObject) // could be singleton type without metaobject
- insertEnums(m_baseMetaObject);
+ if (baseMetaObject) // could be singleton type without metaobject
+ insertEnums(baseMetaObject);
- m_isEnumSetup = true;
+ isEnumSetup = true;
}
void QQmlTypePrivate::insertEnums(const QMetaObject *metaObject) const
@@ -584,157 +657,182 @@ void QQmlTypePrivate::insertEnums(const QMetaObject *metaObject) const
for (int ii = 0; ii < metaObject->enumeratorCount(); ++ii) {
QMetaEnum e = metaObject->enumerator(ii);
for (int jj = 0; jj < e.keyCount(); ++jj)
- m_enums.insert(QString::fromUtf8(e.key(jj)), e.value(jj));
+ enums.insert(QString::fromUtf8(e.key(jj)), e.value(jj));
}
}
QByteArray QQmlType::typeName() const
{
- if (d->m_singletonInstanceInfo)
- return d->m_singletonInstanceInfo->typeName.toUtf8();
- if (d->m_baseMetaObject)
- return d->m_baseMetaObject->className();
+ if (d->regType == SingletonType)
+ return d->extraData.sd->singletonInstanceInfo->typeName.toUtf8();
+ else if (d->baseMetaObject)
+ return d->baseMetaObject->className();
else
return QByteArray();
}
const QString &QQmlType::elementName() const
{
- return d->m_elementName;
+ return d->elementName;
}
const QString &QQmlType::qmlTypeName() const
{
- if (d->m_name.isEmpty()) {
- if (!d->m_module.isEmpty())
- d->m_name = static_cast<QString>(d->m_module) + QLatin1Char('/') + d->m_elementName;
+ if (d->name.isEmpty()) {
+ if (!d->module.isEmpty())
+ d->name = static_cast<QString>(d->module) + QLatin1Char('/') + d->elementName;
else
- d->m_name = d->m_elementName;
+ d->name = d->elementName;
}
- return d->m_name;
+ return d->name;
}
QObject *QQmlType::create() const
{
+ if (!isCreatable())
+ return 0;
+
d->init();
- QObject *rv = (QObject *)operator new(d->m_allocationSize);
- d->m_newFunc(rv);
+ QObject *rv = (QObject *)operator new(d->extraData.cd->allocationSize);
+ d->extraData.cd->newFunc(rv);
- if (rv && !d->m_metaObjects.isEmpty())
- (void)new QQmlProxyMetaObject(rv, &d->m_metaObjects);
+ if (rv && !d->metaObjects.isEmpty())
+ (void)new QQmlProxyMetaObject(rv, &d->metaObjects);
return rv;
}
void QQmlType::create(QObject **out, void **memory, size_t additionalMemory) const
{
+ if (!isCreatable())
+ return;
+
d->init();
- QObject *rv = (QObject *)operator new(d->m_allocationSize + additionalMemory);
- d->m_newFunc(rv);
+ QObject *rv = (QObject *)operator new(d->extraData.cd->allocationSize + additionalMemory);
+ d->extraData.cd->newFunc(rv);
- if (rv && !d->m_metaObjects.isEmpty())
- (void)new QQmlProxyMetaObject(rv, &d->m_metaObjects);
+ if (rv && !d->metaObjects.isEmpty())
+ (void)new QQmlProxyMetaObject(rv, &d->metaObjects);
*out = rv;
- *memory = ((char *)rv) + d->m_allocationSize;
+ *memory = ((char *)rv) + d->extraData.cd->allocationSize;
}
QQmlType::SingletonInstanceInfo *QQmlType::singletonInstanceInfo() const
{
- return d->m_singletonInstanceInfo;
+ if (d->regType != SingletonType)
+ return 0;
+ return d->extraData.sd->singletonInstanceInfo;
}
QQmlCustomParser *QQmlType::customParser() const
{
- return d->m_customParser;
+ if (d->regType != CppType)
+ return 0;
+ return d->extraData.cd->customParser;
}
QQmlType::CreateFunc QQmlType::createFunction() const
{
- return d->m_newFunc;
+ if (d->regType != CppType)
+ return 0;
+ return d->extraData.cd->newFunc;
}
QString QQmlType::noCreationReason() const
{
- return d->m_noCreationReason;
+ if (d->regType != CppType)
+ return QString();
+ return d->extraData.cd->noCreationReason;
}
int QQmlType::createSize() const
{
- return d->m_allocationSize;
+ if (d->regType != CppType)
+ return 0;
+ return d->extraData.cd->allocationSize;
}
bool QQmlType::isCreatable() const
{
- return d->m_newFunc != 0;
+ return d->regType == CppType && d->extraData.cd->newFunc;
}
bool QQmlType::isExtendedType() const
{
d->init();
- return !d->m_metaObjects.isEmpty();
+ return !d->metaObjects.isEmpty();
}
bool QQmlType::isSingleton() const
{
- return d->m_singletonInstanceInfo != 0;
+ return d->regType == SingletonType;
}
bool QQmlType::isInterface() const
{
- return d->m_isInterface;
+ return d->regType == InterfaceType;
+}
+
+bool QQmlType::isComposite() const
+{
+ return d->regType == CompositeType;
}
int QQmlType::typeId() const
{
- return d->m_typeId;
+ return d->typeId;
}
int QQmlType::qListTypeId() const
{
- return d->m_listId;
+ return d->listId;
}
const QMetaObject *QQmlType::metaObject() const
{
d->init();
- if (d->m_metaObjects.isEmpty())
- return d->m_baseMetaObject;
+ if (d->metaObjects.isEmpty())
+ return d->baseMetaObject;
else
- return d->m_metaObjects.first().metaObject;
+ return d->metaObjects.first().metaObject;
}
const QMetaObject *QQmlType::baseMetaObject() const
{
- return d->m_baseMetaObject;
+ return d->baseMetaObject;
}
bool QQmlType::containsRevisionedAttributes() const
{
d->init();
- return d->m_containsRevisionedAttributes;
+ return d->containsRevisionedAttributes;
}
int QQmlType::metaObjectRevision() const
{
- return d->m_revision;
+ return d->revision;
}
QQmlAttachedPropertiesFunc QQmlType::attachedPropertiesFunction() const
{
- return d->m_attachedPropertiesFunc;
+ if (d->regType != CppType)
+ return 0;
+ return d->extraData.cd->attachedPropertiesFunc;
}
const QMetaObject *QQmlType::attachedPropertiesType() const
{
- return d->m_attachedPropertiesType;
+ if (d->regType != CppType)
+ return 0;
+ return d->extraData.cd->attachedPropertiesType;
}
/*
@@ -744,32 +842,49 @@ Qt 4.7 and QtQuick 1.0).
*/
int QQmlType::attachedPropertiesId() const
{
- return d->m_attachedPropertiesId;
+ if (d->regType != CppType)
+ return 0;
+ return d->extraData.cd->attachedPropertiesId;
}
int QQmlType::parserStatusCast() const
{
- return d->m_parserStatusCast;
+ if (d->regType != CppType)
+ return -1;
+ return d->extraData.cd->parserStatusCast;
}
int QQmlType::propertyValueSourceCast() const
{
- return d->m_propertyValueSourceCast;
+ if (d->regType != CppType)
+ return -1;
+ return d->extraData.cd->propertyValueSourceCast;
}
int QQmlType::propertyValueInterceptorCast() const
{
- return d->m_propertyValueInterceptorCast;
+ if (d->regType != CppType)
+ return -1;
+ return d->extraData.cd->propertyValueInterceptorCast;
}
const char *QQmlType::interfaceIId() const
{
- return d->m_iid;
+ if (d->regType != InterfaceType)
+ return 0;
+ return d->iid;
}
int QQmlType::index() const
{
- return d->m_index;
+ return d->index;
+}
+
+QUrl QQmlType::sourceUrl() const
+{
+ if (d->regType != CompositeType)
+ return QUrl();
+ return d->extraData.fd->url;
}
int QQmlType::enumValue(const QHashedStringRef &name, bool *ok) const
@@ -779,7 +894,7 @@ int QQmlType::enumValue(const QHashedStringRef &name, bool *ok) const
d->initEnums();
- int *rv = d->m_enums.value(name);
+ int *rv = d->enums.value(name);
if (rv)
return *rv;
@@ -794,7 +909,7 @@ int QQmlType::enumValue(const QHashedCStringRef &name, bool *ok) const
d->initEnums();
- int *rv = d->m_enums.value(name);
+ int *rv = d->enums.value(name);
if (rv)
return *rv;
@@ -809,7 +924,7 @@ int QQmlType::enumValue(const QHashedV8String &name, bool *ok) const
d->initEnums();
- int *rv = d->m_enums.value(name);
+ int *rv = d->enums.value(name);
if (rv)
return *rv;
@@ -998,6 +1113,8 @@ QString registrationTypeString(QQmlType::RegistrationType typeType)
typeStr = QStringLiteral("element");
else if (typeType == QQmlType::SingletonType)
typeStr = QStringLiteral("singleton type");
+ else
+ typeStr = QStringLiteral("type");
return typeStr;
}
@@ -1007,7 +1124,7 @@ bool checkRegistration(QQmlType::RegistrationType typeType, QQmlMetaTypeData *da
if (!typeName.isEmpty()) {
int typeNameLen = typeName.length();
for (int ii = 0; ii < typeNameLen; ++ii) {
- if (!typeName.at(ii).isLetterOrNumber()) {
+ if (!(typeName.at(ii).isLetterOrNumber() || typeName.at(ii) == '_')) {
QString failure(QCoreApplication::translate("qmlRegisterType", "Invalid QML %1 name \"%2\""));
data->typeRegistrationFailures.append(failure.arg(registrationTypeString(typeType)).arg(typeName));
return false;
@@ -1040,46 +1157,59 @@ bool checkRegistration(QQmlType::RegistrationType typeType, QQmlMetaTypeData *da
return true;
}
-int registerType(const QQmlPrivate::RegisterType &type)
+// NOTE: caller must hold a QWriteLocker on "data"
+void addTypeToData(QQmlType* type, QQmlMetaTypeData *data)
{
- QWriteLocker lock(metaTypeDataLock());
- QQmlMetaTypeData *data = metaTypeData();
- QString elementName = QString::fromUtf8(type.elementName);
- if (!checkRegistration(QQmlType::CppType, data, type.uri, elementName))
- return -1;
-
- int index = data->types.count();
-
- QQmlType *dtype = new QQmlType(index, elementName, type);
-
- data->types.append(dtype);
- data->idToType.insert(dtype->typeId(), dtype);
- if (dtype->qListTypeId()) data->idToType.insert(dtype->qListTypeId(), dtype);
+ if (!type->elementName().isEmpty())
+ data->nameToType.insertMulti(type->elementName(), type);
- if (!dtype->elementName().isEmpty())
- data->nameToType.insertMulti(dtype->elementName(), dtype);
+ if (type->baseMetaObject())
+ data->metaObjectToType.insertMulti(type->baseMetaObject(), type);
- data->metaObjectToType.insertMulti(dtype->baseMetaObject(), dtype);
+ if (type->typeId()) {
+ data->idToType.insert(type->typeId(), type);
+ if (data->objects.size() <= type->typeId())
+ data->objects.resize(type->typeId() + 16);
+ data->objects.setBit(type->typeId(), true);
+ }
- if (data->objects.size() <= type.typeId)
- data->objects.resize(type.typeId + 16);
- if (data->lists.size() <= type.listId)
- data->lists.resize(type.listId + 16);
- data->objects.setBit(type.typeId, true);
- if (type.listId) data->lists.setBit(type.listId, true);
+ if (type->qListTypeId()) {
+ if (data->lists.size() <= type->qListTypeId())
+ data->lists.resize(type->qListTypeId() + 16);
+ data->lists.setBit(type->qListTypeId(), true);
+ data->idToType.insert(type->qListTypeId(), type);
+ }
- if (!dtype->module().isEmpty()) {
- const QHashedString &mod = dtype->module();
+ if (!type->module().isEmpty()) {
+ const QHashedString &mod = type->module();
- QQmlMetaTypeData::VersionedUri versionedUri(mod, type.versionMajor);
+ QQmlMetaTypeData::VersionedUri versionedUri(mod, type->majorVersion());
QQmlTypeModule *module = data->uriToModule.value(versionedUri);
if (!module) {
module = new QQmlTypeModule;
module->d->uri = versionedUri;
data->uriToModule.insert(versionedUri, module);
}
- module->d->add(dtype);
+ module->d->add(type);
}
+}
+
+int registerType(const QQmlPrivate::RegisterType &type)
+{
+ QWriteLocker lock(metaTypeDataLock());
+ QQmlMetaTypeData *data = metaTypeData();
+ QString elementName = QString::fromUtf8(type.elementName);
+ if (!checkRegistration(QQmlType::CppType, data, type.uri, elementName))
+ return -1;
+
+ int index = data->types.count();
+
+ QQmlType *dtype = new QQmlType(index, elementName, type);
+
+ data->types.append(dtype);
+ addTypeToData(dtype, data);
+ if (!type.typeId)
+ data->idToType.insert(dtype->typeId(), dtype);
return index;
}
@@ -1097,32 +1227,31 @@ int registerSingletonType(const QQmlPrivate::RegisterSingletonType &type)
QQmlType *dtype = new QQmlType(index, typeName, type);
data->types.append(dtype);
- data->idToType.insert(dtype->typeId(), dtype);
+ addTypeToData(dtype, data);
- if (!dtype->elementName().isEmpty())
- data->nameToType.insertMulti(dtype->elementName(), dtype);
+ return index;
+}
- if (dtype->baseMetaObject())
- data->metaObjectToType.insertMulti(dtype->baseMetaObject(), dtype);
+int registerCompositeType(const QQmlPrivate::RegisterCompositeType &type)
+{
+ // Assumes URL is absolute and valid. Checking of user input should happen before the URL enters type.
+ QWriteLocker lock(metaTypeDataLock());
+ QQmlMetaTypeData *data = metaTypeData();
+ QString typeName = QString::fromUtf8(type.typeName);
+ bool fileImport = false;
+ if (*(type.uri) == '\0')
+ fileImport = true;
+ if (!checkRegistration(QQmlType::CompositeType, data, fileImport?0:type.uri, typeName))
+ return -1;
- if (type.typeId) {
- if (data->objects.size() <= type.typeId)
- data->objects.resize(type.typeId + 16);
- data->objects.setBit(type.typeId, true);
- }
+ int index = data->types.count();
- if (!dtype->module().isEmpty()) {
- const QHashedString &mod = dtype->module();
+ QQmlType *dtype = new QQmlType(index, typeName, type);
+ data->types.append(dtype);
+ addTypeToData(dtype, data);
- QQmlMetaTypeData::VersionedUri versionedUri(mod, type.versionMajor);
- QQmlTypeModule *module = data->uriToModule.value(versionedUri);
- if (!module) {
- module = new QQmlTypeModule;
- module->d->uri = versionedUri;
- data->uriToModule.insert(versionedUri, module);
- }
- module->d->add(dtype);
- }
+ if (fileImport)
+ data->urlToType.insertMulti(type.url, dtype);
return index;
}
@@ -1142,6 +1271,8 @@ int QQmlPrivate::qmlregister(RegistrationType type, void *data)
return registerAutoParentFunction(*reinterpret_cast<RegisterAutoParent *>(data));
} else if (type == SingletonRegistration) {
return registerSingletonType(*reinterpret_cast<RegisterSingletonType *>(data));
+ } else if (type == CompositeRegistration) {
+ return registerCompositeType(*reinterpret_cast<RegisterCompositeType *>(data));
}
return -1;
}
@@ -1455,10 +1586,10 @@ QQmlType *QQmlMetaType::qmlType(const QHashedStringRef &name, const QHashedStrin
QReadLocker lock(metaTypeDataLock());
QQmlMetaTypeData *data = metaTypeData();
- QQmlMetaTypeData::Names::ConstIterator it = data->nameToType.find(name);
+ QQmlMetaTypeData::Names::ConstIterator it = data->nameToType.constFind(name);
while (it != data->nameToType.end() && it.key() == name) {
// XXX version_major<0 just a kludge for QQmlPropertyPrivate::initProperty
- if (version_major < 0 || (*it)->availableInVersion(module, version_major,version_minor))
+ if (version_major < 0 || module.isEmpty() || (*it)->availableInVersion(module, version_major,version_minor))
return (*it);
++it;
}
@@ -1489,10 +1620,10 @@ QQmlType *QQmlMetaType::qmlType(const QMetaObject *metaObject, const QHashedStri
QReadLocker lock(metaTypeDataLock());
QQmlMetaTypeData *data = metaTypeData();
- QQmlMetaTypeData::MetaObjects::const_iterator it = data->metaObjectToType.find(metaObject);
+ QQmlMetaTypeData::MetaObjects::const_iterator it = data->metaObjectToType.constFind(metaObject);
while (it != data->metaObjectToType.end() && it.key() == metaObject) {
QQmlType *t = *it;
- if (version_major < 0 || t->availableInVersion(module, version_major,version_minor))
+ if (version_major < 0 || module.isEmpty() || t->availableInVersion(module, version_major,version_minor))
return t;
++it;
}
@@ -1517,6 +1648,39 @@ QQmlType *QQmlMetaType::qmlType(int userType)
}
/*!
+ Returns the type (if any) that corresponds to the given \a url in the set of
+ composite types added through file imports.
+
+ Returns null if no such type is registered.
+*/
+QQmlType *QQmlMetaType::qmlType(const QUrl &url)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QQmlMetaTypeData *data = metaTypeData();
+
+ QQmlType *type = data->urlToType.value(url);
+ if (type && type->sourceUrl() == url)
+ return type;
+ else
+ return 0;
+}
+
+/*!
+ Returns the type (if any) with the given \a index in the global type store.
+ This is for use when you just got the index back from a qmlRegister function.
+ Returns null if the index is out of bounds.
+*/
+QQmlType *QQmlMetaType::qmlTypeFromIndex(int idx)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QQmlMetaTypeData *data = metaTypeData();
+
+ if (idx < 0 || idx >= data->types.count())
+ return 0;
+ return data->types[idx];
+}
+
+/*!
Returns the list of registered QML type names.
*/
QList<QString> QQmlMetaType::qmlTypeNames()
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 474eac184c..497afffb5d 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -84,6 +84,8 @@ public:
static QQmlType *qmlType(const QMetaObject *);
static QQmlType *qmlType(const QMetaObject *metaObject, const QHashedStringRef &module, int version_major, int version_minor);
static QQmlType *qmlType(int);
+ static QQmlType *qmlType(const QUrl &url);
+ static QQmlType *qmlTypeFromIndex(int);
static QMetaProperty defaultProperty(const QMetaObject *);
static QMetaProperty defaultProperty(QObject *);
@@ -164,6 +166,7 @@ public:
bool isSingleton() const;
bool isInterface() const;
+ bool isComposite() const;
int typeId() const;
int qListTypeId() const;
@@ -206,6 +209,7 @@ public:
QHash<QQmlEngine *, QObject *> qobjectApis;
};
SingletonInstanceInfo *singletonInstanceInfo() const;
+ QUrl sourceUrl() const;
int enumValue(const QHashedStringRef &, bool *ok) const;
int enumValue(const QHashedCStringRef &, bool *ok) const;
@@ -217,17 +221,20 @@ private:
enum RegistrationType {
CppType = 0,
- SingletonType = 1
- // In the future, we should register all types via QQmlType, including Composite types.
+ SingletonType = 1,
+ InterfaceType = 2,
+ CompositeType = 3
};
friend QString registrationTypeString(RegistrationType);
friend bool checkRegistration(RegistrationType, QQmlMetaTypeData *, const char *, const QString &);
friend int registerType(const QQmlPrivate::RegisterType &);
friend int registerSingletonType(const QQmlPrivate::RegisterSingletonType &);
friend int registerInterface(const QQmlPrivate::RegisterInterface &);
+ friend int registerCompositeType(const QQmlPrivate::RegisterCompositeType &);
QQmlType(int, const QQmlPrivate::RegisterInterface &);
QQmlType(int, const QString &, const QQmlPrivate::RegisterSingletonType &);
QQmlType(int, const QString &, const QQmlPrivate::RegisterType &);
+ QQmlType(int, const QString &, const QQmlPrivate::RegisterCompositeType &);
~QQmlType();
QQmlTypePrivate *d;
@@ -249,8 +256,8 @@ public:
QList<QQmlType*> singletonTypes(int) const;
private:
- friend int registerType(const QQmlPrivate::RegisterType &);
- friend int registerSingletonType(const QQmlPrivate::RegisterSingletonType &);
+ //Used by register functions and creates the QQmlTypeModule for them
+ friend void addTypeToData(QQmlType* type, QQmlMetaTypeData *data);
friend struct QQmlMetaTypeData;
QQmlTypeModule();
diff --git a/src/qml/qml/qqmlnetworkaccessmanagerfactory.h b/src/qml/qml/qqmlnetworkaccessmanagerfactory.h
index 6a79118c50..4c12e00c09 100644
--- a/src/qml/qml/qqmlnetworkaccessmanagerfactory.h
+++ b/src/qml/qml/qqmlnetworkaccessmanagerfactory.h
@@ -45,8 +45,6 @@
#include <QtQml/qtqmlglobal.h>
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -61,6 +59,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLNETWORKACCESSMANAGERFACTORY_H
diff --git a/src/qml/qml/qqmlopenmetaobject_p.h b/src/qml/qml/qqmlopenmetaobject_p.h
index fd442e4ad9..a8c5744078 100644
--- a/src/qml/qml/qqmlopenmetaobject_p.h
+++ b/src/qml/qml/qqmlopenmetaobject_p.h
@@ -50,8 +50,6 @@
#include <private/qtqmlglobal_p.h>
#include <private/qobject_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -130,6 +128,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLOPENMETAOBJECT_H
diff --git a/src/qml/qml/qqmlparserstatus.h b/src/qml/qml/qqmlparserstatus.h
index 253fe64022..d3447e7752 100644
--- a/src/qml/qml/qqmlparserstatus.h
+++ b/src/qml/qml/qqmlparserstatus.h
@@ -45,8 +45,6 @@
#include <QtQml/qtqmlglobal.h>
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -72,6 +70,4 @@ Q_DECLARE_INTERFACE(QQmlParserStatus, QQmlParserStatus_iid)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLPARSERSTATUS_H
diff --git a/src/qml/qml/qqmlplatform.cpp b/src/qml/qml/qqmlplatform.cpp
new file mode 100644
index 0000000000..21145be89e
--- /dev/null
+++ b/src/qml/qml/qqmlplatform.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlplatform_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*
+ This object and its properties are documented as part of the Qt object,
+ in qqmlengine.cpp
+*/
+
+QQmlPlatform::QQmlPlatform(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlPlatform::~QQmlPlatform()
+{
+}
+
+QString QQmlPlatform::os()
+{
+#if defined(Q_OS_LINUX_ANDROID)
+ return QLatin1String("android");
+#elif defined(Q_OS_BLACKBERRY)
+ return QLatin1String("blackberry");
+#elif defined(Q_OS_IOS)
+ return QLatin1String("ios");
+#elif defined(Q_OS_MAC)
+ return QLatin1String("mac");
+#elif defined(Q_OS_WINCE)
+ return QLatin1String("wince");
+#elif defined(Q_OS_WIN)
+ return QLatin1String("windows");
+#elif defined(Q_OS_LINUX)
+ return QLatin1String("linux");
+#elif defined(Q_OS_UNIX)
+ return QLatin1String("unix");
+#else
+ return QLatin1String("unknown");
+#endif
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h b/src/qml/qml/qqmlplatform_p.h
index 0ddcdb0e61..7a212d5bdf 100644
--- a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h
+++ b/src/qml/qml/qqmlplatform_p.h
@@ -39,39 +39,32 @@
**
****************************************************************************/
-#ifndef QOSTDEVICE_H
-#define QOSTDEVICE_H
+#ifndef QQMLPLATFORM_P_H
+#define QQMLPLATFORM_P_H
-#include <QtCore/QIODevice>
+#include <QtCore/QObject>
+#include <qqml.h>
+#include <private/qtqmlglobal_p.h>
QT_BEGIN_NAMESPACE
-class QOstDevicePrivate;
-
-class QOstDevice : public QIODevice
+class Q_QML_PRIVATE_EXPORT QQmlPlatform : public QObject
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QOstDevice)
- Q_DISABLE_COPY(QOstDevice)
+ Q_PROPERTY(QString os READ os CONSTANT)
public:
- explicit QOstDevice(QObject *parent=0);
- ~QOstDevice();
-
- bool open(int ostProtocolId);
- void close();
+ explicit QQmlPlatform(QObject *parent = 0);
+ virtual ~QQmlPlatform();
- bool waitForReadyRead(int msecs);
- qint64 bytesAvailable() const;
-
-protected:
- qint64 readData(char *data, qint64 maxSize);
- qint64 writeData(const char *data, qint64 maxSize);
+ static QString os();
private:
- QOstDevicePrivate* d_ptr;
+ Q_DISABLE_COPY(QQmlPlatform)
};
QT_END_NAMESPACE
-#endif // QOSTDEVICE_H
+QML_DECLARE_TYPE(QQmlPlatform)
+
+#endif // QQMLPLATFORM_P_H
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index e548f860be..570435ae81 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -57,8 +57,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qvariant.h>
-
-QT_BEGIN_HEADER
+#include <QtCore/qurl.h>
QT_BEGIN_NAMESPACE
@@ -253,11 +252,20 @@ namespace QQmlPrivate
// If this is extended ensure "version" is bumped!!!
};
+ struct RegisterCompositeType {
+ const QUrl &url;
+ const char *uri;
+ int versionMajor;
+ int versionMinor;
+ const char *typeName;
+ };
+
enum RegistrationType {
- TypeRegistration = 0,
+ TypeRegistration = 0,
InterfaceRegistration = 1,
AutoParentRegistration = 2,
- SingletonRegistration = 3
+ SingletonRegistration = 3,
+ CompositeRegistration = 4
};
int Q_QML_EXPORT qmlregister(RegistrationType, void *);
@@ -265,6 +273,4 @@ namespace QQmlPrivate
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLPRIVATE_H
diff --git a/src/qml/qml/qqmlproperty.h b/src/qml/qml/qqmlproperty.h
index 0079fed09a..c3322c0048 100644
--- a/src/qml/qml/qqmlproperty.h
+++ b/src/qml/qml/qqmlproperty.h
@@ -45,8 +45,6 @@
#include <QtQml/qtqmlglobal.h>
#include <QtCore/qmetaobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -140,6 +138,4 @@ Q_DECLARE_TYPEINFO(QQmlProperty, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLPROPERTY_H
diff --git a/src/qml/qml/qqmlpropertyvaluesource.h b/src/qml/qml/qqmlpropertyvaluesource.h
index 38f06d0b02..ccf40eb6f8 100644
--- a/src/qml/qml/qqmlpropertyvaluesource.h
+++ b/src/qml/qml/qqmlpropertyvaluesource.h
@@ -45,8 +45,6 @@
#include <QtQml/qtqmlglobal.h>
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -65,6 +63,4 @@ Q_DECLARE_INTERFACE(QQmlPropertyValueSource, QQmlPropertyValueSource_iid)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLPROPERTYVALUESOURCE_H
diff --git a/src/qml/qml/qqmlproxymetaobject_p.h b/src/qml/qml/qqmlproxymetaobject_p.h
index 9f9c346d9f..c7b266835d 100644
--- a/src/qml/qml/qqmlproxymetaobject_p.h
+++ b/src/qml/qml/qqmlproxymetaobject_p.h
@@ -61,8 +61,6 @@
#include <private/qobject_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -93,7 +91,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQMLPROXYMETAOBJECT_P_H
diff --git a/src/qml/qml/qqmlscript.cpp b/src/qml/qml/qqmlscript.cpp
index 2f8750ee0f..613ff24f20 100644
--- a/src/qml/qml/qqmlscript.cpp
+++ b/src/qml/qml/qqmlscript.cpp
@@ -651,7 +651,7 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const
QString s;
for (AST::UiQualifiedId *it = node; it; it = it->next) {
- s.append(it->name.toString());
+ s.append(it->name);
if (it->next)
s.append(QLatin1Char('.'));
diff --git a/src/qml/qml/qqmlscript_p.h b/src/qml/qml/qqmlscript_p.h
index 20cec3703d..54e7a67b65 100644
--- a/src/qml/qml/qqmlscript_p.h
+++ b/src/qml/qml/qqmlscript_p.h
@@ -62,8 +62,6 @@
#include <QtCore/QList>
#include <QtCore/QUrl>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -520,6 +518,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QQmlScript::Variant)
-QT_END_HEADER
-
#endif // QQMLSCRIPT_P_H
diff --git a/src/qml/qml/qqmlscriptstring.h b/src/qml/qml/qqmlscriptstring.h
index fc732877ab..5421ef95fc 100644
--- a/src/qml/qml/qqmlscriptstring.h
+++ b/src/qml/qml/qqmlscriptstring.h
@@ -47,8 +47,6 @@
#include <QtCore/qshareddata.h>
#include <QtCore/qmetatype.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -86,7 +84,5 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QQmlScriptString)
-QT_END_HEADER
-
#endif // QQMLSCRIPTSTRING_H
diff --git a/src/qml/qml/qqmltimer.cpp b/src/qml/qml/qqmltimer.cpp
index c9f6bc7982..a1cb8532f7 100644
--- a/src/qml/qml/qqmltimer.cpp
+++ b/src/qml/qml/qqmltimer.cpp
@@ -75,7 +75,7 @@ public:
/*!
\qmltype Timer
\instantiates QQmlTimer
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\ingroup qtquick-interceptors
\brief Triggers a handler at a specified interval
@@ -122,7 +122,7 @@ QQmlTimer::QQmlTimer(QObject *parent)
}
/*!
- \qmlproperty int QtQuick2::Timer::interval
+ \qmlproperty int QtQml2::Timer::interval
Sets the \a interval between triggers, in milliseconds.
@@ -145,7 +145,7 @@ int QQmlTimer::interval() const
}
/*!
- \qmlproperty bool QtQuick2::Timer::running
+ \qmlproperty bool QtQml2::Timer::running
If set to true, starts the timer; otherwise stops the timer.
For a non-repeating timer, \a running is set to false after the
@@ -173,7 +173,7 @@ void QQmlTimer::setRunning(bool running)
}
/*!
- \qmlproperty bool QtQuick2::Timer::repeat
+ \qmlproperty bool QtQml2::Timer::repeat
If \a repeat is true the timer is triggered repeatedly at the
specified interval; otherwise, the timer will trigger once at the
@@ -200,7 +200,7 @@ void QQmlTimer::setRepeating(bool repeating)
}
/*!
- \qmlproperty bool QtQuick2::Timer::triggeredOnStart
+ \qmlproperty bool QtQml2::Timer::triggeredOnStart
When a timer is started, the first trigger is usually after the specified
interval has elapsed. It is sometimes desirable to trigger immediately
@@ -233,7 +233,7 @@ void QQmlTimer::setTriggeredOnStart(bool triggeredOnStart)
}
/*!
- \qmlmethod QtQuick2::Timer::start()
+ \qmlmethod QtQml2::Timer::start()
\brief Starts the timer
If the timer is already running, calling this method has no effect. The
@@ -245,7 +245,7 @@ void QQmlTimer::start()
}
/*!
- \qmlmethod QtQuick2::Timer::stop()
+ \qmlmethod QtQml2::Timer::stop()
\brief Stops the timer
If the timer is not running, calling this method has no effect. The
@@ -257,7 +257,7 @@ void QQmlTimer::stop()
}
/*!
- \qmlmethod QtQuick2::Timer::restart()
+ \qmlmethod QtQml2::Timer::restart()
\brief Restarts the timer
If the Timer is not running it will be started, otherwise it will be
@@ -302,7 +302,7 @@ void QQmlTimer::componentComplete()
}
/*!
- \qmlsignal QtQuick2::Timer::onTriggered()
+ \qmlsignal QtQml2::Timer::onTriggered()
This handler is called when the Timer is triggered.
*/
diff --git a/src/qml/qml/qqmltimer_p.h b/src/qml/qml/qqmltimer_p.h
index ff6d6207ff..c625522851 100644
--- a/src/qml/qml/qqmltimer_p.h
+++ b/src/qml/qml/qqmltimer_p.h
@@ -48,8 +48,6 @@
#include <private/qtqmlglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlTimerPrivate;
@@ -106,6 +104,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQmlTimer)
-QT_END_HEADER
-
#endif
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index aa7a2d95c7..5910f60667 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2135,12 +2135,12 @@ void QQmlTypeData::resolveTypes()
TypeReference ref;
QString url;
- int majorVersion;
- int minorVersion;
+ int majorVersion = -1;
+ int minorVersion = -1;
QQmlImportNamespace *typeNamespace = 0;
QList<QQmlError> errors;
- if (!m_imports.resolveType(parserRef->name, &ref.type, &url, &majorVersion, &minorVersion,
+ if (!m_imports.resolveType(parserRef->name, &ref.type, &majorVersion, &minorVersion,
&typeNamespace, &errors) || typeNamespace) {
// Known to not be a type:
// - known to be a namespace (Namespace {})
@@ -2169,13 +2169,12 @@ void QQmlTypeData::resolveTypes()
return;
}
- if (ref.type) {
- ref.majorVersion = majorVersion;
- ref.minorVersion = minorVersion;
- } else {
- ref.typeData = typeLoader()->getType(QUrl(url));
+ if (ref.type->isComposite()) {
+ ref.typeData = typeLoader()->getType(ref.type->sourceUrl());
addDependency(ref.typeData);
}
+ ref.majorVersion = majorVersion;
+ ref.minorVersion = minorVersion;
Q_ASSERT(parserRef->firstUse);
ref.location = parserRef->firstUse->location.start;
diff --git a/src/qml/qml/qqmltypenotavailable_p.h b/src/qml/qml/qqmltypenotavailable_p.h
index f2e829e2ac..2529db3e5f 100644
--- a/src/qml/qml/qqmltypenotavailable_p.h
+++ b/src/qml/qml/qqmltypenotavailable_p.h
@@ -44,8 +44,6 @@
#include <qqml.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -59,6 +57,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQmlTypeNotAvailable)
-QT_END_HEADER
-
#endif // QQMLTYPENOTAVAILABLE_H
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 4abc6f46fa..8198eeca66 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -558,6 +558,11 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
QObject *o = 0;
void *memory = 0;
type.type->create(&o, &memory, sizeof(QQmlData));
+
+ if (!o)
+ VME_EXCEPTION(tr("Unable to create object of type %1").arg(type.type->elementName()),
+ instr.line);
+
QQmlData *ddata = new (memory) QQmlData;
ddata->ownMemory = false;
QObjectPrivate::get(o)->declarativeData = ddata;
@@ -572,10 +577,6 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
ddata->propertyCache->addref();
}
- if (!o)
- VME_EXCEPTION(tr("Unable to create object of type %1").arg(type.type->elementName()),
- instr.line);
-
if (states.count() == 1) {
// Keep a reference to the compiled data we rely on
ddata->compiledData = states[0].compiledData;
diff --git a/src/qml/qml/qquickworkerscript.cpp b/src/qml/qml/qquickworkerscript.cpp
index f7559f1d36..b9b027f6ad 100644
--- a/src/qml/qml/qquickworkerscript.cpp
+++ b/src/qml/qml/qquickworkerscript.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include "qquickworkerscript_p.h"
-#include "qquicklistmodel_p.h"
-#include "qquicklistmodelworkeragent_p.h"
+#include "qqmllistmodel_p.h"
+#include "qqmllistmodelworkeragent_p.h"
#include "qqmlengine_p.h"
#include "qqmlexpression_p.h"
@@ -484,7 +484,7 @@ QQuickWorkerScriptEngine::~QQuickWorkerScriptEngine()
//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 (QQuickListModelWorkerAgent::sync() for example).
+ //some worker script/agent are waiting for (QQmlListModelWorkerAgent::sync() for example).
while (!isFinished()) {
// We can't simply wait here, because the worker thread will not terminate
// until the main thread processes the last data event it generates
diff --git a/src/qml/qml/qquickworkerscript_p.h b/src/qml/qml/qquickworkerscript_p.h
index e643751953..d568e58d0e 100644
--- a/src/qml/qml/qquickworkerscript_p.h
+++ b/src/qml/qml/qquickworkerscript_p.h
@@ -60,8 +60,6 @@
#include <QtQml/qjsvalue.h>
#include <QtCore/qurl.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -125,6 +123,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickWorkerScript)
-QT_END_HEADER
-
#endif // QQUICKWORKERSCRIPT_P_H
diff --git a/src/qml/qml/rewriter/textwriter_p.h b/src/qml/qml/rewriter/textwriter_p.h
index 5c22a62a02..fdfd955d9f 100644
--- a/src/qml/qml/rewriter/textwriter_p.h
+++ b/src/qml/qml/rewriter/textwriter_p.h
@@ -47,7 +47,6 @@
#include <QtCore/QString>
#include <QtCore/QList>
-QT_BEGIN_HEADER
QT_QML_BEGIN_NAMESPACE
namespace QQmlJS {
@@ -92,6 +91,4 @@ public:
} // end of namespace QQmlJS
QT_QML_END_NAMESPACE
-QT_END_HEADER
-
#endif // TEXTWRITER_H
diff --git a/src/qml/qml/v4/qv4bindings_p.h b/src/qml/qml/v4/qv4bindings_p.h
index 6ea548c642..adb05ba1f4 100644
--- a/src/qml/qml/v4/qv4bindings_p.h
+++ b/src/qml/qml/v4/qv4bindings_p.h
@@ -59,8 +59,6 @@
#include "private/qv4instruction_p.h"
#include "private/qpointervaluepair_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
struct QV4Program;
@@ -170,7 +168,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV4BINDINGS_P_H
diff --git a/src/qml/qml/v4/qv4compiler_p.h b/src/qml/qml/v4/qv4compiler_p.h
index c5175b2bbd..5b6cee2a55 100644
--- a/src/qml/qml/v4/qv4compiler_p.h
+++ b/src/qml/qml/v4/qv4compiler_p.h
@@ -61,8 +61,6 @@
Q_DECLARE_METATYPE(v8::Handle<v8::Value>)
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlTypeNameCache;
@@ -103,7 +101,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV4COMPILER_P_H
diff --git a/src/qml/qml/v4/qv4compiler_p_p.h b/src/qml/qml/v4/qv4compiler_p_p.h
index c2d6b8c362..58ec521a97 100644
--- a/src/qml/qml/v4/qv4compiler_p_p.h
+++ b/src/qml/qml/v4/qv4compiler_p_p.h
@@ -59,8 +59,6 @@
#include <private/qqmlimport_p.h>
#include <private/qqmlengine_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
template <typename _Key, typename _Value>
@@ -243,7 +241,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV4COMPILER_P_P_H
diff --git a/src/qml/qml/v4/qv4instruction_p.h b/src/qml/qml/v4/qv4instruction_p.h
index be3b4bef1e..9797abf69d 100644
--- a/src/qml/qml/v4/qv4instruction_p.h
+++ b/src/qml/qml/v4/qv4instruction_p.h
@@ -60,8 +60,6 @@
#include <private/qqmlpropertycache_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
#define FOR_EACH_V4_INSTR(F) \
@@ -481,7 +479,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV4INSTRUCTION_P_H
diff --git a/src/qml/qml/v4/qv4ir_p.h b/src/qml/qml/v4/qv4ir_p.h
index 08cfe43091..701f76d9e4 100644
--- a/src/qml/qml/v4/qv4ir_p.h
+++ b/src/qml/qml/v4/qv4ir_p.h
@@ -69,8 +69,6 @@
# undef CONST
#endif
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QTextStream;
@@ -614,6 +612,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV4IR_P_H
diff --git a/src/qml/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp
index 50d799c8d9..4aa257d54a 100644
--- a/src/qml/qml/v4/qv4irbuilder.cpp
+++ b/src/qml/qml/v4/qv4irbuilder.cpp
@@ -358,7 +358,19 @@ bool QV4IRBuilder::visit(AST::StatementSourceElement *)
}
// object literals
-bool QV4IRBuilder::visit(AST::PropertyNameAndValueList *)
+bool QV4IRBuilder::visit(AST::PropertyAssignmentList *)
+{
+ Q_ASSERT(!"unreachable");
+ return false;
+}
+
+bool QV4IRBuilder::visit(AST::PropertyNameAndValue *)
+{
+ Q_ASSERT(!"unreachable");
+ return false;
+}
+
+bool QV4IRBuilder::visit(AST::PropertyGetterSetter *)
{
Q_ASSERT(!"unreachable");
return false;
diff --git a/src/qml/qml/v4/qv4irbuilder_p.h b/src/qml/qml/v4/qv4irbuilder_p.h
index 3aee38b269..86baae463d 100644
--- a/src/qml/qml/v4/qv4irbuilder_p.h
+++ b/src/qml/qml/v4/qv4irbuilder_p.h
@@ -46,8 +46,6 @@
#include "qv4ir_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QV4IRBuilder : public QQmlJS::AST::Visitor
@@ -139,7 +137,9 @@ protected:
virtual bool visit(QQmlJS::AST::StatementSourceElement *ast);
// object literals
- virtual bool visit(QQmlJS::AST::PropertyNameAndValueList *ast);
+ virtual bool visit(QQmlJS::AST::PropertyAssignmentList *ast);
+ virtual bool visit(QQmlJS::AST::PropertyNameAndValue *ast);
+ virtual bool visit(QQmlJS::AST::PropertyGetterSetter *ast);
virtual bool visit(QQmlJS::AST::IdentifierPropertyName *ast);
virtual bool visit(QQmlJS::AST::StringLiteralPropertyName *ast);
virtual bool visit(QQmlJS::AST::NumericLiteralPropertyName *ast);
@@ -236,6 +236,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV4IRBUILDER_P_H
diff --git a/src/qml/qml/v4/qv4program_p.h b/src/qml/qml/v4/qv4program_p.h
index d04ada487e..fb23e863af 100644
--- a/src/qml/qml/v4/qv4program_p.h
+++ b/src/qml/qml/v4/qv4program_p.h
@@ -60,8 +60,6 @@
# pragma warning( disable : 4200 )
#endif
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
struct QV4Program {
@@ -126,7 +124,5 @@ QV4Program::BindingReferenceList *QV4Program::signalTable(int signalIndex) const
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV4PROGRAM_P_H
diff --git a/src/qml/qml/v8/qjsengine.h b/src/qml/qml/v8/qjsengine.h
index 23ee289d6c..0a575f84e9 100644
--- a/src/qml/qml/v8/qjsengine.h
+++ b/src/qml/qml/v8/qjsengine.h
@@ -49,8 +49,6 @@
#include <QtCore/qobject.h>
#include <QtQml/qjsvalue.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -137,6 +135,4 @@ inline QVariant qjsvalue_cast<QVariant>(const QJSValue &value)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QJSENGINE_H
diff --git a/src/qml/qml/v8/qjsvalue.h b/src/qml/qml/v8/qjsvalue.h
index 0a57e3533e..efd52ce880 100644
--- a/src/qml/qml/v8/qjsvalue.h
+++ b/src/qml/qml/v8/qjsvalue.h
@@ -48,8 +48,6 @@
#include <QtCore/qsharedpointer.h>
#include <QtCore/qshareddata.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -157,6 +155,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QJSValue)
-QT_END_HEADER
-
#endif
diff --git a/src/qml/qml/v8/qjsvalueiterator.h b/src/qml/qml/v8/qjsvalueiterator.h
index e9a67738ab..b4f90a44b7 100644
--- a/src/qml/qml/v8/qjsvalueiterator.h
+++ b/src/qml/qml/v8/qjsvalueiterator.h
@@ -46,8 +46,6 @@
#include <QtQml/qjsvalue.h>
#include <QtCore/qscopedpointer.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -77,6 +75,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSCRIPTVALUEITERATOR_H
diff --git a/src/qml/qml/v8/qv8bindings_p.h b/src/qml/qml/v8/qv8bindings_p.h
index f3e62faa3b..98b367ac72 100644
--- a/src/qml/qml/v8/qv8bindings_p.h
+++ b/src/qml/qml/v8/qv8bindings_p.h
@@ -61,8 +61,6 @@
#include <private/qflagpointer_p.h>
#include <private/qqmlbinding_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlCompiledData;
@@ -158,8 +156,6 @@ void QV8Bindings::release()
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV8BINDINGS_P_H
diff --git a/src/qml/qml/v8/qv8domerrors_p.h b/src/qml/qml/v8/qv8domerrors_p.h
index 0542863c32..8fd1ccb6d6 100644
--- a/src/qml/qml/v8/qv8domerrors_p.h
+++ b/src/qml/qml/v8/qv8domerrors_p.h
@@ -55,8 +55,6 @@
#include <QtCore/qglobal.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
// From DOM-Level-3-Core spec
// http://www.w3.org/TR/DOM-Level-3-Core/core.html
@@ -89,6 +87,4 @@ void qt_add_domexceptions(QV8Engine *engine);
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV8DOMERRORS_P_H
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index 2619c1a484..15611f3428 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -54,6 +54,7 @@
#include <private/qqmllocale_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlmemoryprofiler_p.h>
+#include <private/qqmlplatform_p.h>
#include "qscript_impl_p.h"
#include "qv8domerrors_p.h"
@@ -125,6 +126,7 @@ QV8Engine::QV8Engine(QJSEngine* qq, ContextOwnership ownership)
, m_ownsV8Context(ownership == CreateNewContext)
, m_xmlHttpRequestData(0)
, m_listModelData(0)
+ , m_platform(0)
, m_application(0)
{
QML_MEMORY_SCOPE_STRING("QV8Engine::QV8Engine");
@@ -629,6 +631,7 @@ void QV8Engine::initializeGlobal(v8::Handle<v8::Object> global)
qt->Set(v8::String::New("binding"), V8FUNCTION(binding, this));
if (m_engine) {
+ qt->SetAccessor(v8::String::New("platform"), getPlatform, 0, v8::External::New(this));
qt->SetAccessor(v8::String::New("application"), getApplication, 0, v8::External::New(this));
#ifndef QT_NO_IM
qt->SetAccessor(v8::String::New("inputMethod"), getInputMethod, 0, v8::External::New(this));
@@ -1446,6 +1449,16 @@ int QV8Engine::consoleCountHelper(const QString &file, quint16 line, quint16 col
return number;
}
+v8::Handle<v8::Value> QV8Engine::getPlatform(v8::Local<v8::String>, const v8::AccessorInfo &info)
+{
+ QV8Engine *engine = reinterpret_cast<QV8Engine*>(v8::External::Unwrap(info.Data()));
+ if (!engine->m_platform) {
+ // Only allocate a platform object once
+ engine->m_platform = new QQmlPlatform(engine->m_engine);
+ }
+ return engine->newQObject(engine->m_platform);
+}
+
v8::Handle<v8::Value> QV8Engine::getApplication(v8::Local<v8::String>, const v8::AccessorInfo &info)
{
QV8Engine *engine = reinterpret_cast<QV8Engine*>(v8::External::Unwrap(info.Data()));
diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h
index 43c978c757..9c3eb22e1c 100644
--- a/src/qml/qml/v8/qv8engine_p.h
+++ b/src/qml/qml/v8/qv8engine_p.h
@@ -427,6 +427,7 @@ public:
void addRelationshipForGC(QObject *object, v8::Persistent<v8::Value> handle);
void addRelationshipForGC(QObject *object, QObject *other);
+ static v8::Handle<v8::Value> getPlatform(v8::Local<v8::String> property, const v8::AccessorInfo &info);
static v8::Handle<v8::Value> getApplication(v8::Local<v8::String> property, const v8::AccessorInfo &info);
#ifndef QT_NO_IM
static v8::Handle<v8::Value> getInputMethod(v8::Local<v8::String> property, const v8::AccessorInfo &info);
@@ -480,6 +481,7 @@ protected:
QHash<QString, quint32> m_consoleCount;
+ QObject *m_platform;
QObject *m_application;
QVariant toBasicVariant(v8::Handle<v8::Value>);
diff --git a/src/qml/qml/v8/qv8sqlerrors_p.h b/src/qml/qml/v8/qv8sqlerrors_p.h
index b2ffbf9233..8a612d69ab 100644
--- a/src/qml/qml/v8/qv8sqlerrors_p.h
+++ b/src/qml/qml/v8/qv8sqlerrors_p.h
@@ -55,8 +55,6 @@
#include <QtCore/qglobal.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
#define SQLEXCEPTION_UNKNOWN_ERR 1
#define SQLEXCEPTION_DATABASE_ERR 2
@@ -72,6 +70,4 @@ void qt_add_sqlexceptions(QV8Engine *engine);
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QV8SQLERRORS_P_H
diff --git a/src/qml/qml/v8/qv8worker.cpp b/src/qml/qml/v8/qv8worker.cpp
index bf3379b312..9556e146ef 100644
--- a/src/qml/qml/v8/qv8worker.cpp
+++ b/src/qml/qml/v8/qv8worker.cpp
@@ -41,8 +41,8 @@
#include "qv8worker_p.h"
-#include <private/qquicklistmodel_p.h>
-#include <private/qquicklistmodelworkeragent_p.h>
+#include <private/qqmllistmodel_p.h>
+#include <private/qqmllistmodelworkeragent_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.
- QQuickListModel *lm = qobject_cast<QQuickListModel *>(engine->toQObject(v));
+ QQmlListModel *lm = qobject_cast<QQmlListModel *>(engine->toQObject(v));
if (lm && lm->agent()) {
- QQuickListModelWorkerAgent *agent = lm->agent();
+ QQmlListModelWorkerAgent *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);
- QQuickListModelWorkerAgent *agent = (QQuickListModelWorkerAgent *)ptr;
+ QQmlListModelWorkerAgent *agent = (QQmlListModelWorkerAgent *)ptr;
v8::Handle<v8::Value> rv = engine->newQObject(agent);
if (rv->IsObject()) {
- QQuickListModelWorkerAgent::VariantRef ref(agent);
+ QQmlListModelWorkerAgent::VariantRef ref(agent);
QVariant var = qVariantFromValue(ref);
rv->ToObject()->SetHiddenValue(v8::String::New("qml::ref"), engine->fromVariant(var));
}
diff --git a/src/qml/qtqmlglobal.h b/src/qml/qtqmlglobal.h
index e0668dfb90..07a4136e3a 100644
--- a/src/qml/qtqmlglobal.h
+++ b/src/qml/qtqmlglobal.h
@@ -44,7 +44,6 @@
#include <QtCore/qglobal.h>
-QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef QT_STATIC
@@ -58,6 +57,4 @@ QT_BEGIN_NAMESPACE
#endif
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QTQMLGLOBAL_H
diff --git a/src/quick/items/qquickvisualadaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index b57f4bbe76..5b6ef79338 100644
--- a/src/quick/items/qquickvisualadaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#include "qquickvisualadaptormodel_p.h"
-#include "qquickvisualdatamodel_p_p.h"
+#include "qqmladaptormodel_p.h"
+#include <private/qqmldelegatemodel_p_p.h>
#include <private/qmetaobjectbuilder_p.h>
#include <private/qqmlproperty_p.h>
#include <private/qv8engine_p.h>
QT_BEGIN_NAMESPACE
-class QQuickVisualAdaptorModelEngineData : public QV8Engine::Deletable
+class QQmlAdaptorModelEngineData : public QV8Engine::Deletable
{
public:
enum
@@ -59,8 +59,8 @@ public:
StringCount
};
- QQuickVisualAdaptorModelEngineData(QV8Engine *engine);
- ~QQuickVisualAdaptorModelEngineData();
+ QQmlAdaptorModelEngineData(QV8Engine *engine);
+ ~QQmlAdaptorModelEngineData();
v8::Local<v8::String> index() { return strings->Get(Index)->ToString(); }
v8::Local<v8::String> modelData() { return strings->Get(ModelData)->ToString(); }
@@ -70,11 +70,11 @@ public:
v8::Persistent<v8::Array> strings;
};
-V8_DEFINE_EXTENSION(QQuickVisualAdaptorModelEngineData, engineData)
+V8_DEFINE_EXTENSION(QQmlAdaptorModelEngineData, engineData)
static v8::Handle<v8::Value> get_index(v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *data = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *data = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(data, "Not a valid VisualData object");
return v8::Int32::New(data->index);
@@ -99,11 +99,11 @@ static void addProperty(QMetaObjectBuilder *builder, int propertyId, const QByte
class VDMModelDelegateDataType;
-class QQuickVDMCachedModelData : public QQuickVisualDataModelItem
+class QQmlDMCachedModelData : public QQmlDelegateModelItem
{
public:
- QQuickVDMCachedModelData(
- QQuickVisualDataModelItemMetaType *metaType,
+ QQmlDMCachedModelData(
+ QQmlDelegateModelItemMetaType *metaType,
VDMModelDelegateDataType *dataType,
int index);
@@ -113,7 +113,7 @@ public:
virtual void setValue(int role, const QVariant &value) = 0;
void setValue(const QString &role, const QVariant &value);
- bool resolveIndex(const QQuickVisualAdaptorModel &model, int idx);
+ bool resolveIndex(const QQmlAdaptorModel &model, int idx);
static v8::Handle<v8::Value> get_property(v8::Local<v8::String>, const v8::AccessorInfo &info);
static void set_property(
@@ -125,11 +125,11 @@ public:
class VDMModelDelegateDataType
: public QQmlRefCount
- , public QQuickVisualAdaptorModel::Accessors
+ , public QQmlAdaptorModel::Accessors
, public QAbstractDynamicMetaObject
{
public:
- VDMModelDelegateDataType(QQuickVisualAdaptorModel *model)
+ VDMModelDelegateDataType(QQmlAdaptorModel *model)
: model(model)
, metaObject(0)
, propertyCache(0)
@@ -149,8 +149,8 @@ public:
}
bool notify(
- const QQuickVisualAdaptorModel &,
- const QList<QQuickVisualDataModelItem *> &items,
+ const QQmlAdaptorModel &,
+ const QList<QQmlDelegateModelItem *> &items,
int index,
int count,
const QVector<int> &roles) const
@@ -182,7 +182,7 @@ public:
}
for (int i = 0, c = items.count(); i < c; ++i) {
- QQuickVisualDataModelItem *item = items.at(i);
+ QQmlDelegateModelItem *item = items.at(i);
const int idx = item->modelIndex();
if (idx >= index && idx < index + count) {
for (int i = 0; i < signalIndexes.count(); ++i)
@@ -193,7 +193,7 @@ public:
}
void replaceWatchedRoles(
- QQuickVisualAdaptorModel &,
+ QQmlAdaptorModel &,
const QList<QByteArray> &oldRoles,
const QList<QByteArray> &newRoles) const
{
@@ -205,7 +205,7 @@ public:
dataType->watchedRoles += newRoles;
}
- void initializeConstructor(QQuickVisualAdaptorModelEngineData *const data)
+ void initializeConstructor(QQmlAdaptorModelEngineData *const data)
{
constructor = qPersistentNew(v8::ObjectTemplate::New());
constructor->SetHasExternalResource(true);
@@ -218,8 +218,8 @@ public:
constructor->SetAccessor(
v8::String::New(propertyName.constData(), propertyName.length()),
- QQuickVDMCachedModelData::get_property,
- QQuickVDMCachedModelData::set_property,
+ QQmlDMCachedModelData::get_property,
+ QQmlDMCachedModelData::set_property,
v8::Int32::New(propertyId));
}
}
@@ -233,7 +233,7 @@ public:
int metaCall(QObject *object, QMetaObject::Call call, int id, void **arguments)
{
- return static_cast<QQuickVDMCachedModelData *>(object)->metaCall(call, id, arguments);
+ return static_cast<QQmlDMCachedModelData *>(object)->metaCall(call, id, arguments);
}
v8::Persistent<v8::ObjectTemplate> constructor;
@@ -241,7 +241,7 @@ public:
QList<int> watchedRoleIds;
QList<QByteArray> watchedRoles;
QHash<QByteArray, int> roleNames;
- QQuickVisualAdaptorModel *model;
+ QQmlAdaptorModel *model;
QMetaObject *metaObject;
QQmlPropertyCache *propertyCache;
int propertyOffset;
@@ -249,9 +249,9 @@ public:
bool hasModelData;
};
-QQuickVDMCachedModelData::QQuickVDMCachedModelData(
- QQuickVisualDataModelItemMetaType *metaType, VDMModelDelegateDataType *dataType, int index)
- : QQuickVisualDataModelItem(metaType, index)
+QQmlDMCachedModelData::QQmlDMCachedModelData(
+ QQmlDelegateModelItemMetaType *metaType, VDMModelDelegateDataType *dataType, int index)
+ : QQmlDelegateModelItem(metaType, index)
, type(dataType)
{
if (index == -1)
@@ -266,7 +266,7 @@ QQuickVDMCachedModelData::QQuickVDMCachedModelData(
qmldata->propertyCache->addref();
}
-int QQuickVDMCachedModelData::metaCall(QMetaObject::Call call, int id, void **arguments)
+int QQmlDMCachedModelData::metaCall(QMetaObject::Call call, int id, void **arguments)
{
if (call == QMetaObject::ReadProperty && id >= type->propertyOffset) {
const int propertyIndex = id - type->propertyOffset;
@@ -300,7 +300,7 @@ int QQuickVDMCachedModelData::metaCall(QMetaObject::Call call, int id, void **ar
}
}
-void QQuickVDMCachedModelData::setValue(const QString &role, const QVariant &value)
+void QQmlDMCachedModelData::setValue(const QString &role, const QVariant &value)
{
QHash<QByteArray, int>::iterator it = type->roleNames.find(role.toUtf8());
if (it != type->roleNames.end()) {
@@ -313,7 +313,7 @@ void QQuickVDMCachedModelData::setValue(const QString &role, const QVariant &val
}
}
-bool QQuickVDMCachedModelData::resolveIndex(const QQuickVisualAdaptorModel &, int idx)
+bool QQmlDMCachedModelData::resolveIndex(const QQmlAdaptorModel &, int idx)
{
if (index == -1) {
Q_ASSERT(idx >= 0);
@@ -330,13 +330,13 @@ bool QQuickVDMCachedModelData::resolveIndex(const QQuickVisualAdaptorModel &, in
}
}
-v8::Handle<v8::Value> QQuickVDMCachedModelData::get_property(
+v8::Handle<v8::Value> QQmlDMCachedModelData::get_property(
v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *data = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *data = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(data, "Not a valid VisualData object");
- QQuickVDMCachedModelData *modelData = static_cast<QQuickVDMCachedModelData *>(data);
+ QQmlDMCachedModelData *modelData = static_cast<QQmlDMCachedModelData *>(data);
const int propertyId = info.Data()->Int32Value();
if (data->index == -1) {
if (!modelData->cachedData.isEmpty()) {
@@ -350,15 +350,15 @@ v8::Handle<v8::Value> QQuickVDMCachedModelData::get_property(
return v8::Undefined();
}
-void QQuickVDMCachedModelData::set_property(
+void QQmlDMCachedModelData::set_property(
v8::Local<v8::String>, v8::Local<v8::Value> value, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *data = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *data = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE_SETTER(data, "Not a valid VisualData object");
const int propertyId = info.Data()->Int32Value();
if (data->index == -1) {
- QQuickVDMCachedModelData *modelData = static_cast<QQuickVDMCachedModelData *>(data);
+ QQmlDMCachedModelData *modelData = static_cast<QQmlDMCachedModelData *>(data);
if (!modelData->cachedData.isEmpty()) {
if (modelData->cachedData.count() > 1) {
modelData->cachedData[propertyId] = data->engine->toVariant(value, QVariant::Invalid);
@@ -376,16 +376,16 @@ void QQuickVDMCachedModelData::set_property(
// QAbstractItemModel
//-----------------------------------------------------------------
-class QQuickVDMAbstractItemModelData : public QQuickVDMCachedModelData
+class QQmlDMAbstractItemModelData : public QQmlDMCachedModelData
{
Q_OBJECT
Q_PROPERTY(bool hasModelChildren READ hasModelChildren CONSTANT)
public:
- QQuickVDMAbstractItemModelData(
- QQuickVisualDataModelItemMetaType *metaType,
+ QQmlDMAbstractItemModelData(
+ QQmlDelegateModelItemMetaType *metaType,
VDMModelDelegateDataType *dataType,
int index)
- : QQuickVDMCachedModelData(metaType, dataType, index)
+ : QQmlDMCachedModelData(metaType, dataType, index)
{
}
@@ -413,7 +413,7 @@ public:
v8::Handle<v8::Value> get()
{
if (type->constructor.IsEmpty()) {
- QQuickVisualAdaptorModelEngineData * const data = engineData(engine);
+ QQmlAdaptorModelEngineData * const data = engineData(engine);
v8::HandleScope handleScope;
v8::Context::Scope contextScope(engine->context());
type->initializeConstructor(data);
@@ -427,10 +427,10 @@ public:
static v8::Handle<v8::Value> get_hasModelChildren(v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *data = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *data = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(data, "Not a valid VisualData object");
- const QQuickVisualAdaptorModel *const model = static_cast<QQuickVDMCachedModelData *>(data)->type->model;
+ const QQmlAdaptorModel *const model = static_cast<QQmlDMCachedModelData *>(data)->type->model;
if (data->index >= 0 && *model) {
const QAbstractItemModel * const aim = model->aim();
return v8::Boolean::New(aim->hasChildren(aim->index(data->index, 0, model->rootIndex)));
@@ -443,17 +443,17 @@ public:
class VDMAbstractItemModelDataType : public VDMModelDelegateDataType
{
public:
- VDMAbstractItemModelDataType(QQuickVisualAdaptorModel *model)
+ VDMAbstractItemModelDataType(QQmlAdaptorModel *model)
: VDMModelDelegateDataType(model)
{
}
- int count(const QQuickVisualAdaptorModel &model) const
+ int count(const QQmlAdaptorModel &model) const
{
return model.aim()->rowCount(model.rootIndex);
}
- void cleanup(QQuickVisualAdaptorModel &model, QQuickVisualDataModel *vdm) const
+ void cleanup(QQmlAdaptorModel &model, QQmlDelegateModel *vdm) const
{
QAbstractItemModel * const aim = model.aim();
if (aim && vdm) {
@@ -476,7 +476,7 @@ public:
const_cast<VDMAbstractItemModelDataType *>(this)->release();
}
- QVariant value(const QQuickVisualAdaptorModel &model, int index, const QString &role) const
+ QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const
{
QHash<QByteArray, int>::const_iterator it = roleNames.find(role.toUtf8());
if (it != roleNames.end()) {
@@ -488,47 +488,47 @@ public:
}
}
- QVariant parentModelIndex(const QQuickVisualAdaptorModel &model) const
+ QVariant parentModelIndex(const QQmlAdaptorModel &model) const
{
return model
? QVariant::fromValue(model.aim()->parent(model.rootIndex))
: QVariant();
}
- QVariant modelIndex(const QQuickVisualAdaptorModel &model, int index) const
+ QVariant modelIndex(const QQmlAdaptorModel &model, int index) const
{
return model
? QVariant::fromValue(model.aim()->index(index, 0, model.rootIndex))
: QVariant();
}
- bool canFetchMore(const QQuickVisualAdaptorModel &model) const
+ bool canFetchMore(const QQmlAdaptorModel &model) const
{
return model && model.aim()->canFetchMore(model.rootIndex);
}
- void fetchMore(QQuickVisualAdaptorModel &model) const
+ void fetchMore(QQmlAdaptorModel &model) const
{
if (model)
model.aim()->fetchMore(model.rootIndex);
}
- QQuickVisualDataModelItem *createItem(
- QQuickVisualAdaptorModel &model,
- QQuickVisualDataModelItemMetaType *metaType,
+ QQmlDelegateModelItem *createItem(
+ QQmlAdaptorModel &model,
+ QQmlDelegateModelItemMetaType *metaType,
QQmlEngine *engine,
int index) const
{
VDMAbstractItemModelDataType *dataType = const_cast<VDMAbstractItemModelDataType *>(this);
if (!metaObject)
dataType->initializeMetaType(model, engine);
- return new QQuickVDMAbstractItemModelData(metaType, dataType, index);
+ return new QQmlDMAbstractItemModelData(metaType, dataType, index);
}
- void initializeMetaType(QQuickVisualAdaptorModel &model, QQmlEngine *engine)
+ void initializeMetaType(QQmlAdaptorModel &model, QQmlEngine *engine)
{
QMetaObjectBuilder builder;
- setModelDataType<QQuickVDMAbstractItemModelData>(&builder, this);
+ setModelDataType<QQmlDMAbstractItemModelData>(&builder, this);
const QByteArray propertyType = QByteArrayLiteral("QVariant");
const QHash<int, QByteArray> names = model.aim()->roleNames();
@@ -555,16 +555,16 @@ public:
};
//-----------------------------------------------------------------
-// QQuickListAccessor
+// QQmlListAccessor
//-----------------------------------------------------------------
-class QQuickVDMListAccessorData : public QQuickVisualDataModelItem
+class QQmlDMListAccessorData : public QQmlDelegateModelItem
{
Q_OBJECT
Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData NOTIFY modelDataChanged)
public:
- QQuickVDMListAccessorData(QQuickVisualDataModelItemMetaType *metaType, int index, const QVariant &value)
- : QQuickVisualDataModelItem(metaType, index)
+ QQmlDMListAccessorData(QQmlDelegateModelItemMetaType *metaType, int index, const QVariant &value)
+ : QQmlDelegateModelItem(metaType, index)
, cachedData(value)
{
}
@@ -584,18 +584,18 @@ public:
static v8::Handle<v8::Value> get_modelData(v8::Local<v8::String>, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *data = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *data = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE(data, "Not a valid VisualData object");
- return data->engine->fromVariant(static_cast<QQuickVDMListAccessorData *>(data)->cachedData);
+ return data->engine->fromVariant(static_cast<QQmlDMListAccessorData *>(data)->cachedData);
}
static void set_modelData(v8::Local<v8::String>, v8::Local<v8::Value> value, const v8::AccessorInfo &info)
{
- QQuickVisualDataModelItem *data = v8_resource_cast<QQuickVisualDataModelItem>(info.This());
+ QQmlDelegateModelItem *data = v8_resource_cast<QQmlDelegateModelItem>(info.This());
V8ASSERT_TYPE_SETTER(data, "Not a valid VisualData object");
- static_cast<QQuickVDMListAccessorData *>(data)->setModelData(
+ static_cast<QQmlDMListAccessorData *>(data)->setModelData(
data->engine->toVariant(value, QVariant::Invalid));
}
@@ -613,7 +613,7 @@ public:
cachedData = value;
}
- bool resolveIndex(const QQuickVisualAdaptorModel &model, int idx)
+ bool resolveIndex(const QQmlAdaptorModel &model, int idx)
{
if (index == -1) {
index = idx;
@@ -635,30 +635,30 @@ private:
};
-class VDMListDelegateDataType : public QQuickVisualAdaptorModel::Accessors
+class VDMListDelegateDataType : public QQmlAdaptorModel::Accessors
{
public:
inline VDMListDelegateDataType() {}
- int count(const QQuickVisualAdaptorModel &model) const
+ int count(const QQmlAdaptorModel &model) const
{
return model.list.count();
}
- QVariant value(const QQuickVisualAdaptorModel &model, int index, const QString &role) const
+ QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const
{
return role == QLatin1String("modelData")
? model.list.at(index)
: QVariant();
}
- QQuickVisualDataModelItem *createItem(
- QQuickVisualAdaptorModel &model,
- QQuickVisualDataModelItemMetaType *metaType,
+ QQmlDelegateModelItem *createItem(
+ QQmlAdaptorModel &model,
+ QQmlDelegateModelItemMetaType *metaType,
QQmlEngine *,
int index) const
{
- return new QQuickVDMListAccessorData(
+ return new QQmlDMListAccessorData(
metaType,
index,
index >= 0 && index < model.list.count() ? model.list.at(index) : QVariant());
@@ -670,14 +670,14 @@ public:
//-----------------------------------------------------------------
class VDMObjectDelegateDataType;
-class QQuickVDMObjectData : public QQuickVisualDataModelItem, public QQuickVisualAdaptorModelProxyInterface
+class QQmlDMObjectData : public QQmlDelegateModelItem, public QQmlAdaptorModelProxyInterface
{
Q_OBJECT
Q_PROPERTY(QObject *modelData READ modelData CONSTANT)
- Q_INTERFACES(QQuickVisualAdaptorModelProxyInterface)
+ Q_INTERFACES(QQmlAdaptorModelProxyInterface)
public:
- QQuickVDMObjectData(
- QQuickVisualDataModelItemMetaType *metaType,
+ QQmlDMObjectData(
+ QQmlDelegateModelItemMetaType *metaType,
VDMObjectDelegateDataType *dataType,
int index,
QObject *object);
@@ -688,7 +688,7 @@ public:
QQmlGuard<QObject> object;
};
-class VDMObjectDelegateDataType : public QQmlRefCount, public QQuickVisualAdaptorModel::Accessors
+class VDMObjectDelegateDataType : public QQmlRefCount, public QQmlAdaptorModel::Accessors
{
public:
QMetaObject *metaObject;
@@ -707,7 +707,7 @@ public:
VDMObjectDelegateDataType(const VDMObjectDelegateDataType &type)
: QQmlRefCount()
- , QQuickVisualAdaptorModel::Accessors()
+ , QQmlAdaptorModel::Accessors()
, metaObject(0)
, propertyOffset(type.propertyOffset)
, signalOffset(type.signalOffset)
@@ -725,21 +725,21 @@ public:
free(metaObject);
}
- int count(const QQuickVisualAdaptorModel &model) const
+ int count(const QQmlAdaptorModel &model) const
{
return model.list.count();
}
- QVariant value(const QQuickVisualAdaptorModel &model, int index, const QString &role) const
+ QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const
{
if (QObject *object = model.list.at(index).value<QObject *>())
return object->property(role.toUtf8());
return QVariant();
}
- QQuickVisualDataModelItem *createItem(
- QQuickVisualAdaptorModel &model,
- QQuickVisualDataModelItemMetaType *metaType,
+ QQmlDelegateModelItem *createItem(
+ QQmlAdaptorModel &model,
+ QQmlDelegateModelItemMetaType *metaType,
QQmlEngine *,
int index) const
{
@@ -747,27 +747,27 @@ public:
if (!metaObject)
dataType->initializeMetaType(model);
return index >= 0 && index < model.list.count()
- ? new QQuickVDMObjectData(metaType, dataType, index, qvariant_cast<QObject *>(model.list.at(index)))
+ ? new QQmlDMObjectData(metaType, dataType, index, qvariant_cast<QObject *>(model.list.at(index)))
: 0;
}
- void initializeMetaType(QQuickVisualAdaptorModel &)
+ void initializeMetaType(QQmlAdaptorModel &)
{
- setModelDataType<QQuickVDMObjectData>(&builder, this);
+ setModelDataType<QQmlDMObjectData>(&builder, this);
metaObject = builder.toMetaObject();
}
- void cleanup(QQuickVisualAdaptorModel &, QQuickVisualDataModel *) const
+ void cleanup(QQmlAdaptorModel &, QQmlDelegateModel *) const
{
const_cast<VDMObjectDelegateDataType *>(this)->release();
}
};
-class QQuickVDMObjectDataMetaObject : public QAbstractDynamicMetaObject
+class QQmlDMObjectDataMetaObject : public QAbstractDynamicMetaObject
{
public:
- QQuickVDMObjectDataMetaObject(QQuickVDMObjectData *data, VDMObjectDelegateDataType *type)
+ QQmlDMObjectDataMetaObject(QQmlDMObjectData *data, VDMObjectDelegateDataType *type)
: m_data(data)
, m_type(type)
{
@@ -777,7 +777,7 @@ public:
m_type->addref();
}
- ~QQuickVDMObjectDataMetaObject()
+ ~QQmlDMObjectDataMetaObject()
{
m_type->release();
}
@@ -854,43 +854,43 @@ public:
return propertyIndex + m_type->propertyOffset - objectPropertyOffset;
}
- QQuickVDMObjectData *m_data;
+ QQmlDMObjectData *m_data;
VDMObjectDelegateDataType *m_type;
};
-QQuickVDMObjectData::QQuickVDMObjectData(
- QQuickVisualDataModelItemMetaType *metaType,
+QQmlDMObjectData::QQmlDMObjectData(
+ QQmlDelegateModelItemMetaType *metaType,
VDMObjectDelegateDataType *dataType,
int index,
QObject *object)
- : QQuickVisualDataModelItem(metaType, index)
+ : QQmlDelegateModelItem(metaType, index)
, object(object)
{
- new QQuickVDMObjectDataMetaObject(this, dataType);
+ new QQmlDMObjectDataMetaObject(this, dataType);
}
//-----------------------------------------------------------------
-// QQuickVisualAdaptorModel
+// QQmlAdaptorModel
//-----------------------------------------------------------------
-static const QQuickVisualAdaptorModel::Accessors qt_vdm_null_accessors;
+static const QQmlAdaptorModel::Accessors qt_vdm_null_accessors;
static const VDMListDelegateDataType qt_vdm_list_accessors;
-QQuickVisualAdaptorModel::Accessors::~Accessors()
+QQmlAdaptorModel::Accessors::~Accessors()
{
}
-QQuickVisualAdaptorModel::QQuickVisualAdaptorModel()
+QQmlAdaptorModel::QQmlAdaptorModel()
: accessors(&qt_vdm_null_accessors)
{
}
-QQuickVisualAdaptorModel::~QQuickVisualAdaptorModel()
+QQmlAdaptorModel::~QQmlAdaptorModel()
{
accessors->cleanup(*this);
}
-void QQuickVisualAdaptorModel::setModel(const QVariant &variant, QQuickVisualDataModel *vdm, QQmlEngine *engine)
+void QQmlAdaptorModel::setModel(const QVariant &variant, QQmlDelegateModel *vdm, QQmlEngine *engine)
{
accessors->cleanup(*this, vdm);
@@ -902,27 +902,27 @@ void QQuickVisualAdaptorModel::setModel(const QVariant &variant, QQuickVisualDat
accessors = new VDMAbstractItemModelDataType(this);
qmlobject_connect(model, QAbstractItemModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
- vdm, QQuickVisualDataModel, SLOT(_q_rowsInserted(QModelIndex,int,int)));
+ vdm, QQmlDelegateModel, SLOT(_q_rowsInserted(QModelIndex,int,int)));
qmlobject_connect(model, QAbstractItemModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
- vdm, QQuickVisualDataModel, SLOT(_q_rowsRemoved(QModelIndex,int,int)));
+ vdm, QQmlDelegateModel, SLOT(_q_rowsRemoved(QModelIndex,int,int)));
qmlobject_connect(model, QAbstractItemModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
- vdm, QQuickVisualDataModel, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int)));
+ vdm, QQmlDelegateModel, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int)));
qmlobject_connect(model, QAbstractItemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
- vdm, QQuickVisualDataModel, SLOT(_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)));
+ vdm, QQmlDelegateModel, SLOT(_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)));
qmlobject_connect(model, QAbstractItemModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
- vdm, QQuickVisualDataModel, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)));
+ vdm, QQmlDelegateModel, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)));
qmlobject_connect(model, QAbstractItemModel, SIGNAL(modelReset()),
- vdm, QQuickVisualDataModel, SLOT(_q_modelReset()));
+ vdm, QQmlDelegateModel, SLOT(_q_modelReset()));
qmlobject_connect(model, QAbstractItemModel, SIGNAL(layoutChanged()),
- vdm, QQuickVisualDataModel, SLOT(_q_layoutChanged()));
+ vdm, QQmlDelegateModel, SLOT(_q_layoutChanged()));
} else {
accessors = new VDMObjectDelegateDataType;
}
- } else if (list.type() == QQuickListAccessor::ListProperty) {
+ } else if (list.type() == QQmlListAccessor::ListProperty) {
setObject(static_cast<const QQmlListReference *>(variant.constData())->object());
accessors = new VDMObjectDelegateDataType;
- } else if (list.type() != QQuickListAccessor::Invalid) {
- Q_ASSERT(list.type() != QQuickListAccessor::Instance); // Should have cast to QObject.
+ } else if (list.type() != QQmlListAccessor::Invalid) {
+ Q_ASSERT(list.type() != QQmlListAccessor::Instance); // Should have cast to QObject.
setObject(0);
accessors = &qt_vdm_list_accessors;
} else {
@@ -931,7 +931,7 @@ void QQuickVisualAdaptorModel::setModel(const QVariant &variant, QQuickVisualDat
}
}
-void QQuickVisualAdaptorModel::invalidateModel(QQuickVisualDataModel *vdm)
+void QQmlAdaptorModel::invalidateModel(QQmlDelegateModel *vdm)
{
accessors->cleanup(*this, vdm);
accessors = &qt_vdm_null_accessors;
@@ -939,17 +939,17 @@ void QQuickVisualAdaptorModel::invalidateModel(QQuickVisualDataModel *vdm)
// object is destroyed.
}
-bool QQuickVisualAdaptorModel::isValid() const
+bool QQmlAdaptorModel::isValid() const
{
return accessors != &qt_vdm_null_accessors;
}
-void QQuickVisualAdaptorModel::objectDestroyed(QObject *)
+void QQmlAdaptorModel::objectDestroyed(QObject *)
{
setModel(QVariant(), 0, 0);
}
-QQuickVisualAdaptorModelEngineData::QQuickVisualAdaptorModelEngineData(QV8Engine *)
+QQmlAdaptorModelEngineData::QQmlAdaptorModelEngineData(QV8Engine *)
{
strings = qPersistentNew(v8::Array::New(StringCount));
strings->Set(Index, v8::String::New("index"));
@@ -961,12 +961,12 @@ QQuickVisualAdaptorModelEngineData::QQuickVisualAdaptorModelEngineData(QV8Engine
listItem->InstanceTemplate()->SetAccessor(index(), get_index);
listItem->InstanceTemplate()->SetAccessor(
modelData(),
- QQuickVDMListAccessorData::get_modelData,
- QQuickVDMListAccessorData::set_modelData);
+ QQmlDMListAccessorData::get_modelData,
+ QQmlDMListAccessorData::set_modelData);
constructorListItem = qPersistentNew(listItem->GetFunction());
}
-QQuickVisualAdaptorModelEngineData::~QQuickVisualAdaptorModelEngineData()
+QQmlAdaptorModelEngineData::~QQmlAdaptorModelEngineData()
{
qPersistentDispose(constructorListItem);
qPersistentDispose(strings);
@@ -974,4 +974,4 @@ QQuickVisualAdaptorModelEngineData::~QQuickVisualAdaptorModelEngineData()
QT_END_NAMESPACE
-#include <qquickvisualadaptormodel.moc>
+#include <qqmladaptormodel.moc>
diff --git a/src/quick/items/qquickvisualadaptormodel_p.h b/src/qml/util/qqmladaptormodel_p.h
index 40890f8560..399350d725 100644
--- a/src/quick/items/qquickvisualadaptormodel_p.h
+++ b/src/qml/util/qqmladaptormodel_p.h
@@ -39,26 +39,24 @@
**
****************************************************************************/
-#ifndef QQUICKVISUALADAPTORMODEL_P_H
-#define QQUICKVISUALADAPTORMODEL_P_H
+#ifndef QQMLADAPTORMODEL_P_H
+#define QQMLADAPTORMODEL_P_H
#include <QtCore/qabstractitemmodel.h>
-#include "private/qquicklistaccessor_p.h"
+#include "private/qqmllistaccessor_p.h"
#include <private/qqmlguard_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlEngine;
-class QQuickVisualDataModel;
-class QQuickVisualDataModelItem;
-class QQuickVisualDataModelItemMetaType;
+class QQmlDelegateModel;
+class QQmlDelegateModelItem;
+class QQmlDelegateModelItemMetaType;
-class QQuickVisualAdaptorModel : public QQmlGuard<QObject>
+class QQmlAdaptorModel : public QQmlGuard<QObject>
{
public:
class Accessors
@@ -66,46 +64,46 @@ public:
public:
inline Accessors() {}
virtual ~Accessors();
- virtual int count(const QQuickVisualAdaptorModel &) const { return 0; }
- virtual void cleanup(QQuickVisualAdaptorModel &, QQuickVisualDataModel * = 0) const {}
+ virtual int count(const QQmlAdaptorModel &) const { return 0; }
+ virtual void cleanup(QQmlAdaptorModel &, QQmlDelegateModel * = 0) const {}
- virtual QVariant value(const QQuickVisualAdaptorModel &, int, const QString &) const {
+ virtual QVariant value(const QQmlAdaptorModel &, int, const QString &) const {
return QVariant(); }
- virtual QQuickVisualDataModelItem *createItem(
- QQuickVisualAdaptorModel &,
- QQuickVisualDataModelItemMetaType *,
+ virtual QQmlDelegateModelItem *createItem(
+ QQmlAdaptorModel &,
+ QQmlDelegateModelItemMetaType *,
QQmlEngine *,
int) const { return 0; }
virtual bool notify(
- const QQuickVisualAdaptorModel &,
- const QList<QQuickVisualDataModelItem *> &,
+ const QQmlAdaptorModel &,
+ const QList<QQmlDelegateModelItem *> &,
int,
int,
const QVector<int> &) const { return false; }
virtual void replaceWatchedRoles(
- QQuickVisualAdaptorModel &,
+ QQmlAdaptorModel &,
const QList<QByteArray> &,
const QList<QByteArray> &) const {}
- virtual QVariant parentModelIndex(const QQuickVisualAdaptorModel &) const {
+ virtual QVariant parentModelIndex(const QQmlAdaptorModel &) const {
return QVariant(); }
- virtual QVariant modelIndex(const QQuickVisualAdaptorModel &, int) const {
+ virtual QVariant modelIndex(const QQmlAdaptorModel &, int) const {
return QVariant(); }
- virtual bool canFetchMore(const QQuickVisualAdaptorModel &) const { return false; }
- virtual void fetchMore(QQuickVisualAdaptorModel &) const {}
+ virtual bool canFetchMore(const QQmlAdaptorModel &) const { return false; }
+ virtual void fetchMore(QQmlAdaptorModel &) const {}
};
const Accessors *accessors;
QPersistentModelIndex rootIndex;
- QQuickListAccessor list;
+ QQmlListAccessor list;
- QQuickVisualAdaptorModel();
- ~QQuickVisualAdaptorModel();
+ QQmlAdaptorModel();
+ ~QQmlAdaptorModel();
inline QVariant model() const { return list.list(); }
- void setModel(const QVariant &variant, QQuickVisualDataModel *vdm, QQmlEngine *engine);
- void invalidateModel(QQuickVisualDataModel *vdm);
+ void setModel(const QVariant &variant, QQmlDelegateModel *vdm, QQmlEngine *engine);
+ void invalidateModel(QQmlDelegateModel *vdm);
bool isValid() const;
@@ -115,13 +113,13 @@ public:
inline int count() const { return qMax(0, accessors->count(*this)); }
inline QVariant value(int index, const QString &role) const {
return accessors->value(*this, index, role); }
- inline QQuickVisualDataModelItem *createItem(QQuickVisualDataModelItemMetaType *metaType, QQmlEngine *engine, int index) {
+ inline QQmlDelegateModelItem *createItem(QQmlDelegateModelItemMetaType *metaType, QQmlEngine *engine, int index) {
return accessors->createItem(*this, metaType, engine, index); }
inline bool hasProxyObject() const {
- return list.type() == QQuickListAccessor::Instance || list.type() == QQuickListAccessor::ListProperty; }
+ return list.type() == QQmlListAccessor::Instance || list.type() == QQmlListAccessor::ListProperty; }
inline bool notify(
- const QList<QQuickVisualDataModelItem *> &items,
+ const QList<QQmlDelegateModelItem *> &items,
int index,
int count,
const QVector<int> &roles) const {
@@ -139,17 +137,17 @@ protected:
void objectDestroyed(QObject *);
};
-class QQuickVisualAdaptorModelProxyInterface
+class QQmlAdaptorModelProxyInterface
{
public:
- virtual ~QQuickVisualAdaptorModelProxyInterface() {}
+ virtual ~QQmlAdaptorModelProxyInterface() {}
virtual QObject *proxiedObject() = 0;
};
-#define QQuickVisualAdaptorModelProxyInterface_iid "org.qt-project.Qt.QQuickVisualAdaptorModelProxyInterface"
+#define QQmlAdaptorModelProxyInterface_iid "org.qt-project.Qt.QQmlAdaptorModelProxyInterface"
-Q_DECLARE_INTERFACE(QQuickVisualAdaptorModelProxyInterface, QQuickVisualAdaptorModelProxyInterface_iid)
+Q_DECLARE_INTERFACE(QQmlAdaptorModelProxyInterface, QQmlAdaptorModelProxyInterface_iid)
QT_END_NAMESPACE
diff --git a/src/quick/util/qquickchangeset.cpp b/src/qml/util/qqmlchangeset.cpp
index d416749d52..831cb063a5 100644
--- a/src/quick/util/qquickchangeset.cpp
+++ b/src/qml/util/qqmlchangeset.cpp
@@ -39,18 +39,18 @@
**
****************************************************************************/
-#include "qquickchangeset_p.h"
+#include "qqmlchangeset_p.h"
QT_BEGIN_NAMESPACE
/*!
- \class QQuickChangeSet
- \brief The QQuickChangeSet class stores an ordered list of notifications about
+ \class QQmlChangeSet
+ \brief The QQmlChangeSet class stores an ordered list of notifications about
changes to a linear data set.
\internal
- QQuickChangeSet can be used to record a series of notications about items in an indexed list
+ QQmlChangeSet can be used to record a series of notifications about items in an indexed list
being inserted, removed, moved, and changed. Notifications in the set are re-ordered so that
all notifications of a single type are grouped together and sorted in order of ascending index,
with remove notifications preceding all others, followed by insert notification, and then
@@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE
Constructs an empty change set.
*/
-QQuickChangeSet::QQuickChangeSet()
+QQmlChangeSet::QQmlChangeSet()
: m_difference(0)
{
}
@@ -76,7 +76,7 @@ QQuickChangeSet::QQuickChangeSet()
Constructs a copy of a \a changeSet.
*/
-QQuickChangeSet::QQuickChangeSet(const QQuickChangeSet &changeSet)
+QQmlChangeSet::QQmlChangeSet(const QQmlChangeSet &changeSet)
: m_removes(changeSet.m_removes)
, m_inserts(changeSet.m_inserts)
, m_changes(changeSet.m_changes)
@@ -88,7 +88,7 @@ QQuickChangeSet::QQuickChangeSet(const QQuickChangeSet &changeSet)
Destroys a change set.
*/
-QQuickChangeSet::~QQuickChangeSet()
+QQmlChangeSet::~QQmlChangeSet()
{
}
@@ -96,7 +96,7 @@ QQuickChangeSet::~QQuickChangeSet()
Assigns the value of a \a changeSet to another.
*/
-QQuickChangeSet &QQuickChangeSet::operator =(const QQuickChangeSet &changeSet)
+QQmlChangeSet &QQmlChangeSet::operator =(const QQmlChangeSet &changeSet)
{
m_removes = changeSet.m_removes;
m_inserts = changeSet.m_inserts;
@@ -109,7 +109,7 @@ QQuickChangeSet &QQuickChangeSet::operator =(const QQuickChangeSet &changeSet)
Appends a notification that \a count items were inserted at \a index.
*/
-void QQuickChangeSet::insert(int index, int count)
+void QQmlChangeSet::insert(int index, int count)
{
insert(QVector<Insert>() << Insert(index, count));
}
@@ -118,7 +118,7 @@ void QQuickChangeSet::insert(int index, int count)
Appends a notification that \a count items were removed at \a index.
*/
-void QQuickChangeSet::remove(int index, int count)
+void QQmlChangeSet::remove(int index, int count)
{
QVector<Remove> removes;
removes.append(Remove(index, count));
@@ -132,7 +132,7 @@ void QQuickChangeSet::remove(int index, int count)
change sets.
*/
-void QQuickChangeSet::move(int from, int to, int count, int moveId)
+void QQmlChangeSet::move(int from, int to, int count, int moveId)
{
QVector<Remove> removes;
removes.append(Remove(from, count, moveId));
@@ -146,7 +146,7 @@ void QQuickChangeSet::move(int from, int to, int count, int moveId)
Appends a notification that \a count items were changed at \a index.
*/
-void QQuickChangeSet::change(int index, int count)
+void QQmlChangeSet::change(int index, int count)
{
QVector<Change> changes;
changes.append(Change(index, count));
@@ -157,7 +157,7 @@ void QQuickChangeSet::change(int index, int count)
Applies the changes in a \a changeSet to another.
*/
-void QQuickChangeSet::apply(const QQuickChangeSet &changeSet)
+void QQmlChangeSet::apply(const QQmlChangeSet &changeSet)
{
QVector<Remove> r = changeSet.m_removes;
QVector<Insert> i = changeSet.m_inserts;
@@ -174,13 +174,13 @@ void QQuickChangeSet::apply(const QQuickChangeSet &changeSet)
corresponding intersection in the optional \a inserts list.
*/
-void QQuickChangeSet::remove(const QVector<Remove> &removes, QVector<Insert> *inserts)
+void QQmlChangeSet::remove(const QVector<Remove> &removes, QVector<Insert> *inserts)
{
QVector<Remove> r = removes;
remove(&r, inserts);
}
-void QQuickChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
+void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
{
int removeCount = 0;
int insertCount = 0;
@@ -395,7 +395,7 @@ void QQuickChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
Applies a list of \a inserts to a change set.
*/
-void QQuickChangeSet::insert(const QVector<Insert> &inserts)
+void QQmlChangeSet::insert(const QVector<Insert> &inserts)
{
int insertCount = 0;
QVector<Insert>::iterator insert = m_inserts.begin();
@@ -487,7 +487,7 @@ void QQuickChangeSet::insert(const QVector<Insert> &inserts)
calling \l remove() followed by \l insert() with the same lists.
*/
-void QQuickChangeSet::move(const QVector<Remove> &removes, const QVector<Insert> &inserts)
+void QQmlChangeSet::move(const QVector<Remove> &removes, const QVector<Insert> &inserts)
{
QVector<Remove> r = removes;
QVector<Insert> i = inserts;
@@ -499,13 +499,13 @@ void QQuickChangeSet::move(const QVector<Remove> &removes, const QVector<Insert>
Applies a list of \a changes to a change set.
*/
-void QQuickChangeSet::change(const QVector<Change> &changes)
+void QQmlChangeSet::change(const QVector<Change> &changes)
{
QVector<Change> c = changes;
change(&c);
}
-void QQuickChangeSet::change(QVector<Change> *changes)
+void QQmlChangeSet::change(QVector<Change> *changes)
{
QVector<Insert>::iterator insert = m_inserts.begin();
QVector<Change>::iterator change = m_changes.begin();
@@ -557,12 +557,12 @@ void QQuickChangeSet::change(QVector<Change> *changes)
Prints the contents of a change \a set to the \a debug stream.
*/
-QDebug operator <<(QDebug debug, const QQuickChangeSet &set)
+QDebug operator <<(QDebug debug, const QQmlChangeSet &set)
{
- 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;
+ debug.nospace() << "QQmlChangeSet(";
+ foreach (const QQmlChangeSet::Remove &remove, set.removes()) debug << remove;
+ foreach (const QQmlChangeSet::Insert &insert, set.inserts()) debug << insert;
+ foreach (const QQmlChangeSet::Change &change, set.changes()) debug << change;
return debug.nospace() << ')';
}
@@ -570,7 +570,7 @@ QDebug operator <<(QDebug debug, const QQuickChangeSet &set)
Prints a \a remove to the \a debug stream.
*/
-QDebug operator <<(QDebug debug, const QQuickChangeSet::Remove &remove)
+QDebug operator <<(QDebug debug, const QQmlChangeSet::Remove &remove)
{
if (remove.moveId == -1) {
return (debug.nospace()
@@ -591,7 +591,7 @@ QDebug operator <<(QDebug debug, const QQuickChangeSet::Remove &remove)
Prints an \a insert to the \a debug stream.
*/
-QDebug operator <<(QDebug debug, const QQuickChangeSet::Insert &insert)
+QDebug operator <<(QDebug debug, const QQmlChangeSet::Insert &insert)
{
if (insert.moveId == -1) {
return (debug.nospace()
@@ -612,7 +612,7 @@ QDebug operator <<(QDebug debug, const QQuickChangeSet::Insert &insert)
Prints a \a change to the \a debug stream.
*/
-QDebug operator <<(QDebug debug, const QQuickChangeSet::Change &change)
+QDebug operator <<(QDebug debug, const QQmlChangeSet::Change &change)
{
return (debug.nospace() << "Change(" << change.index << ',' << change.count << ')').space();
}
diff --git a/src/quick/util/qquickchangeset_p.h b/src/qml/util/qqmlchangeset_p.h
index 83b9023309..acafbd4eec 100644
--- a/src/quick/util/qquickchangeset_p.h
+++ b/src/qml/util/qqmlchangeset_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QQUICKCHANGESET_P_H
-#define QQUICKCHANGESET_P_H
+#ifndef QQMLCHANGESET_P_H
+#define QQMLCHANGESET_P_H
//
// W A R N I N G
@@ -55,10 +55,11 @@
#include <QtCore/qdebug.h>
#include <QtCore/qvector.h>
+#include <QtQml/private/qtqmlglobal_p.h>
QT_BEGIN_NAMESPACE
-class Q_AUTOTEST_EXPORT QQuickChangeSet
+class Q_QML_PRIVATE_EXPORT QQmlChangeSet
{
public:
struct MoveKey
@@ -104,11 +105,11 @@ public:
: Change(index, count, moveId, offset) {}
};
- QQuickChangeSet();
- QQuickChangeSet(const QQuickChangeSet &changeSet);
- ~QQuickChangeSet();
+ QQmlChangeSet();
+ QQmlChangeSet(const QQmlChangeSet &changeSet);
+ ~QQmlChangeSet();
- QQuickChangeSet &operator =(const QQuickChangeSet &changeSet);
+ QQmlChangeSet &operator =(const QQmlChangeSet &changeSet);
const QVector<Remove> &removes() const { return m_removes; }
const QVector<Insert> &inserts() const { return m_inserts; }
@@ -123,7 +124,7 @@ public:
void remove(const QVector<Remove> &removes, QVector<Insert> *inserts = 0);
void move(const QVector<Remove> &removes, const QVector<Insert> &inserts);
void change(const QVector<Change> &changes);
- void apply(const QQuickChangeSet &changeSet);
+ void apply(const QQmlChangeSet &changeSet);
bool isEmpty() const { return m_removes.empty() && m_inserts.empty() && m_changes.isEmpty(); }
@@ -147,19 +148,19 @@ private:
int m_difference;
};
-Q_DECLARE_TYPEINFO(QQuickChangeSet::Change, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(QQuickChangeSet::Remove, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(QQuickChangeSet::Insert, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(QQuickChangeSet::MoveKey, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlChangeSet::Change, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlChangeSet::Remove, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlChangeSet::Insert, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlChangeSet::MoveKey, Q_PRIMITIVE_TYPE);
-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) {
+inline uint qHash(const QQmlChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); }
+inline bool operator ==(const QQmlChangeSet::MoveKey &l, const QQmlChangeSet::MoveKey &r) {
return l.moveId == r.moveId && l.offset == r.offset; }
-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);
-Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickChangeSet &change);
+Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet::Remove &remove);
+Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet::Insert &insert);
+Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet::Change &change);
+Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet &change);
QT_END_NAMESPACE
diff --git a/src/quick/util/qquicklistaccessor.cpp b/src/qml/util/qqmllistaccessor.cpp
index 5cd6c77770..2a2bd74a54 100644
--- a/src/quick/util/qquicklistaccessor.cpp
+++ b/src/qml/util/qqmllistaccessor.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qquicklistaccessor_p.h"
+#include "qqmllistaccessor_p.h"
#include <private/qqmlmetatype_p.h>
@@ -51,21 +51,21 @@
QT_BEGIN_NAMESPACE
-QQuickListAccessor::QQuickListAccessor()
+QQmlListAccessor::QQmlListAccessor()
: m_type(Invalid)
{
}
-QQuickListAccessor::~QQuickListAccessor()
+QQmlListAccessor::~QQmlListAccessor()
{
}
-QVariant QQuickListAccessor::list() const
+QVariant QQmlListAccessor::list() const
{
return d;
}
-void QQuickListAccessor::setList(const QVariant &v, QQmlEngine *engine)
+void QQmlListAccessor::setList(const QVariant &v, QQmlEngine *engine)
{
d = v;
@@ -91,7 +91,7 @@ void QQuickListAccessor::setList(const QVariant &v, QQmlEngine *engine)
}
}
-int QQuickListAccessor::count() const
+int QQmlListAccessor::count() const
{
switch(m_type) {
case StringList:
@@ -110,7 +110,7 @@ int QQuickListAccessor::count() const
}
}
-QVariant QQuickListAccessor::at(int idx) const
+QVariant QQmlListAccessor::at(int idx) const
{
Q_ASSERT(idx >= 0 && idx < count());
switch(m_type) {
@@ -130,7 +130,7 @@ QVariant QQuickListAccessor::at(int idx) const
}
}
-bool QQuickListAccessor::isValid() const
+bool QQmlListAccessor::isValid() const
{
return m_type != Invalid;
}
diff --git a/src/quick/util/qquicklistaccessor_p.h b/src/qml/util/qqmllistaccessor_p.h
index 0a2957a9cc..8f3fb41186 100644
--- a/src/quick/util/qquicklistaccessor_p.h
+++ b/src/qml/util/qqmllistaccessor_p.h
@@ -39,21 +39,19 @@
**
****************************************************************************/
-#ifndef QQUICKLISTACCESSOR_H
-#define QQUICKLISTACCESSOR_H
+#ifndef QQMLLISTACCESSOR_H
+#define QQMLLISTACCESSOR_H
#include <QtCore/QVariant>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlEngine;
-class Q_AUTOTEST_EXPORT QQuickListAccessor
+class Q_AUTOTEST_EXPORT QQmlListAccessor
{
public:
- QQuickListAccessor();
- ~QQuickListAccessor();
+ QQmlListAccessor();
+ ~QQmlListAccessor();
QVariant list() const;
void setList(const QVariant &, QQmlEngine * = 0);
@@ -73,6 +71,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
-#endif // QQUICKLISTACCESSOR_H
+#endif // QQMLLISTACCESSOR_H
diff --git a/src/quick/util/qquicklistcompositor.cpp b/src/qml/util/qqmllistcompositor.cpp
index a9e9acee23..75d2f67b51 100644
--- a/src/quick/util/qquicklistcompositor.cpp
+++ b/src/qml/util/qqmllistcompositor.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qquicklistcompositor_p.h"
+#include "qqmllistcompositor_p.h"
#include <QtCore/qvarlengtharray.h>
@@ -49,12 +49,12 @@
QT_BEGIN_NAMESPACE
/*!
- \class QQuickListCompositor
- \brief The QQuickListCompositor class provides a lookup table for filtered, or re-ordered list
+ \class QQmlListCompositor
+ \brief The QQmlListCompositor class provides a lookup table for filtered, or re-ordered list
indexes.
\internal
- QQuickListCompositor is intended as an aid for developing proxy models. It doesn't however
+ QQmlListCompositor is intended as an aid for developing proxy models. It doesn't however
directly proxy a list or model, instead a range of indexes from one or many lists can be
inserted into the compositor and then categorized and shuffled around and it will manage the
task of translating from an index in the combined space into an index in a particular list.
@@ -118,15 +118,15 @@ QT_BEGIN_NAMESPACE
*/
static bool qt_verifyMinimal(
- const QQuickListCompositor::iterator &begin,
- const QQuickListCompositor::iterator &end)
+ const QQmlListCompositor::iterator &begin,
+ const QQmlListCompositor::iterator &end)
{
bool minimal = true;
int index = 0;
- for (const QQuickListCompositor::Range *range = begin->next; range != *end; range = range->next, ++index) {
+ for (const QQmlListCompositor::Range *range = begin->next; range != *end; range = range->next, ++index) {
if (range->previous->list == range->list
- && range->previous->flags == (range->flags & ~QQuickListCompositor::AppendFlag)
+ && range->previous->flags == (range->flags & ~QQmlListCompositor::AppendFlag)
&& range->previous->end() == range->index) {
qWarning() << index << "Consecutive ranges";
qWarning() << *range->previous;
@@ -141,7 +141,7 @@ static bool qt_verifyMinimal(
#endif
#ifdef QT_QML_VERIFY_INTEGRITY
-static bool qt_printInfo(const QQuickListCompositor &compositor)
+static bool qt_printInfo(const QQmlListCompositor &compositor)
{
qWarning() << compositor;
return true;
@@ -158,14 +158,14 @@ static bool qt_printInfo(const QQuickListCompositor &compositor)
*/
static bool qt_verifyIntegrity(
- const QQuickListCompositor::iterator &begin,
- const QQuickListCompositor::iterator &end,
- const QQuickListCompositor::iterator &cachedIt)
+ const QQmlListCompositor::iterator &begin,
+ const QQmlListCompositor::iterator &end,
+ const QQmlListCompositor::iterator &cachedIt)
{
bool valid = true;
int index = 0;
- QQuickListCompositor::iterator it;
+ QQmlListCompositor::iterator it;
for (it = begin; *it != *end; *it = it->next) {
if (it->count == 0 && !it->append()) {
qWarning() << index << "Empty non-append range";
@@ -175,7 +175,7 @@ static bool qt_verifyIntegrity(
qWarning() << index << "Negative count";
valid = false;
}
- if (it->list && it->flags != QQuickListCompositor::CacheFlag && it->index < 0) {
+ if (it->list && it->flags != QQmlListCompositor::CacheFlag && it->index < 0) {
qWarning() << index <<"Negative index";
valid = false;
}
@@ -195,7 +195,7 @@ static bool qt_verifyIntegrity(
if (groupIndex != cachedIt.index[i]) {
qWarning() << index
<< "invalid cached index"
- << QQuickListCompositor::Group(i)
+ << QQmlListCompositor::Group(i)
<< "Expected:"
<< groupIndex
<< "Actual"
@@ -233,7 +233,7 @@ static bool qt_verifyIntegrity(
//#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)
-QQuickListCompositor::iterator &QQuickListCompositor::iterator::operator +=(int difference)
+QQmlListCompositor::iterator &QQmlListCompositor::iterator::operator +=(int difference)
{
// Update all indexes to the start of the range.
decrementIndexes(offset);
@@ -267,7 +267,7 @@ QQuickListCompositor::iterator &QQuickListCompositor::iterator::operator +=(int
return *this;
}
-QQuickListCompositor::insert_iterator &QQuickListCompositor::insert_iterator::operator +=(int difference)
+QQmlListCompositor::insert_iterator &QQmlListCompositor::insert_iterator::operator +=(int difference)
{
iterator::operator +=(difference);
@@ -286,7 +286,7 @@ QQuickListCompositor::insert_iterator &QQuickListCompositor::insert_iterator::op
Constructs an empty list compositor.
*/
-QQuickListCompositor::QQuickListCompositor()
+QQmlListCompositor::QQmlListCompositor()
: m_end(m_ranges.next, 0, Default, 2)
, m_cacheIt(m_end)
, m_groupCount(2)
@@ -300,7 +300,7 @@ QQuickListCompositor::QQuickListCompositor()
Destroys a list compositor.
*/
-QQuickListCompositor::~QQuickListCompositor()
+QQmlListCompositor::~QQmlListCompositor()
{
for (Range *next, *range = m_ranges.next; range != &m_ranges; range = next) {
next = range->next;
@@ -313,7 +313,7 @@ QQuickListCompositor::~QQuickListCompositor()
of the existing range \a before.
*/
-inline QQuickListCompositor::Range *QQuickListCompositor::insert(
+inline QQmlListCompositor::Range *QQmlListCompositor::insert(
Range *before, void *list, int index, int count, uint flags)
{
return new Range(before, list, index, count, flags);
@@ -325,7 +325,7 @@ inline QQuickListCompositor::Range *QQuickListCompositor::insert(
Returns a pointer to the next range in the compositor.
*/
-inline QQuickListCompositor::Range *QQuickListCompositor::erase(
+inline QQmlListCompositor::Range *QQmlListCompositor::erase(
Range *range)
{
Range *next = range->next;
@@ -339,7 +339,7 @@ inline QQuickListCompositor::Range *QQuickListCompositor::erase(
Sets the number (\a count) of possible groups that items may belong to in a compositor.
*/
-void QQuickListCompositor::setGroupCount(int count)
+void QQmlListCompositor::setGroupCount(int count)
{
m_groupCount = count;
m_end = iterator(&m_ranges, 0, Default, m_groupCount);
@@ -350,7 +350,7 @@ void QQuickListCompositor::setGroupCount(int count)
Returns the number of items that belong to a \a group.
*/
-int QQuickListCompositor::count(Group group) const
+int QQmlListCompositor::count(Group group) const
{
return m_end.index[group];
}
@@ -361,7 +361,7 @@ int QQuickListCompositor::count(Group group) const
The index must be between 0 and count(group) - 1.
*/
-QQuickListCompositor::iterator QQuickListCompositor::find(Group group, int index)
+QQmlListCompositor::iterator QQmlListCompositor::find(Group group, int index)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< group << index)
Q_ASSERT(index >=0 && index < count(group));
@@ -385,9 +385,9 @@ QQuickListCompositor::iterator QQuickListCompositor::find(Group group, int index
The index must be between 0 and count(group) - 1.
*/
-QQuickListCompositor::iterator QQuickListCompositor::find(Group group, int index) const
+QQmlListCompositor::iterator QQmlListCompositor::find(Group group, int index) const
{
- return const_cast<QQuickListCompositor *>(this)->find(group, index);
+ return const_cast<QQmlListCompositor *>(this)->find(group, index);
}
/*!
@@ -402,7 +402,7 @@ QQuickListCompositor::iterator QQuickListCompositor::find(Group group, int index
The index must be between 0 and count(group) - 1.
*/
-QQuickListCompositor::insert_iterator QQuickListCompositor::findInsertPosition(Group group, int index)
+QQmlListCompositor::insert_iterator QQmlListCompositor::findInsertPosition(Group group, int index)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< group << index)
Q_ASSERT(index >=0 && index <= count(group));
@@ -428,7 +428,7 @@ QQuickListCompositor::insert_iterator QQuickListCompositor::findInsertPosition(G
in each group.
*/
-void QQuickListCompositor::append(
+void QQmlListCompositor::append(
void *list, int index, int count, uint flags, QVector<Insert> *inserts)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count << flags)
@@ -443,7 +443,7 @@ void QQuickListCompositor::append(
each group.
*/
-void QQuickListCompositor::insert(
+void QQmlListCompositor::insert(
Group group, int before, void *list, int index, int count, uint flags, QVector<Insert> *inserts)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< group << before << list << index << count << flags)
@@ -458,7 +458,7 @@ void QQuickListCompositor::insert(
each group.
*/
-QQuickListCompositor::iterator QQuickListCompositor::insert(
+QQmlListCompositor::iterator QQmlListCompositor::insert(
iterator before, void *list, int index, int count, uint flags, QVector<Insert> *inserts)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< before << list << index << count << flags)
@@ -512,7 +512,7 @@ QQuickListCompositor::iterator QQuickListCompositor::insert(
If supplied the \a inserts list will be populated with insert notifications for affected groups.
*/
-void QQuickListCompositor::setFlags(
+void QQmlListCompositor::setFlags(
Group fromGroup, int from, int count, Group group, int flags, QVector<Insert> *inserts)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< fromGroup << from << count << group << flags)
@@ -526,7 +526,7 @@ void QQuickListCompositor::setFlags(
If supplied the \a inserts list will be populated with insert notifications for affected groups.
*/
-void QQuickListCompositor::setFlags(
+void QQmlListCompositor::setFlags(
iterator from, int count, Group group, uint flags, QVector<Insert> *inserts)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< from << count << flags)
@@ -622,7 +622,7 @@ void QQuickListCompositor::setFlags(
If supplied the \a removes list will be populated with remove notifications for affected groups.
*/
-void QQuickListCompositor::clearFlags(
+void QQmlListCompositor::clearFlags(
Group fromGroup, int from, int count, Group group, uint flags, QVector<Remove> *removes)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< fromGroup << from << count << group << flags)
@@ -636,7 +636,7 @@ void QQuickListCompositor::clearFlags(
If supplied the \a removes list will be populated with remove notifications for affected groups.
*/
-void QQuickListCompositor::clearFlags(
+void QQmlListCompositor::clearFlags(
iterator from, int count, Group group, uint flags, QVector<Remove> *removes)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< from << count << flags)
@@ -730,7 +730,7 @@ void QQuickListCompositor::clearFlags(
QT_QML_VERIFY_LISTCOMPOSITOR
}
-bool QQuickListCompositor::verifyMoveTo(
+bool QQmlListCompositor::verifyMoveTo(
Group fromGroup, int from, Group toGroup, int to, int count, Group group) const
{
if (group != toGroup) {
@@ -765,7 +765,7 @@ bool QQuickListCompositor::verifyMoveTo(
of the items moved.
*/
-void QQuickListCompositor::move(
+void QQmlListCompositor::move(
Group fromGroup,
int from,
Group toGroup,
@@ -940,7 +940,7 @@ void QQuickListCompositor::move(
Clears the contents of a compositor.
*/
-void QQuickListCompositor::clear()
+void QQmlListCompositor::clear()
{
QT_QML_TRACE_LISTCOMPOSITOR( )
for (Range *range = m_ranges.next; range != &m_ranges; range = erase(range)) {}
@@ -948,10 +948,10 @@ void QQuickListCompositor::clear()
m_cacheIt = m_end;
}
-void QQuickListCompositor::listItemsInserted(
+void QQmlListCompositor::listItemsInserted(
QVector<Insert> *translatedInsertions,
void *list,
- const QVector<QQuickChangeSet::Insert> &insertions,
+ const QVector<QQmlChangeSet::Insert> &insertions,
const QVector<MovedFlags> *movedFlags)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << insertions)
@@ -966,7 +966,7 @@ void QQuickListCompositor::listItemsInserted(
it.incrementIndexes(it->count);
continue;
}
- foreach (const QQuickChangeSet::Insert &insertion, insertions) {
+ foreach (const QQmlChangeSet::Insert &insertion, insertions) {
int offset = insertion.index - it->index;
if ((offset > 0 && offset < it->count)
|| (offset == 0 && it->prepend())
@@ -1058,23 +1058,23 @@ void QQuickListCompositor::listItemsInserted(
groups.
*/
-void QQuickListCompositor::listItemsInserted(
+void QQmlListCompositor::listItemsInserted(
void *list, int index, int count, QVector<Insert> *translatedInsertions)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count)
Q_ASSERT(count > 0);
- QVector<QQuickChangeSet::Insert> insertions;
- insertions.append(QQuickChangeSet::Insert(index, count));
+ QVector<QQmlChangeSet::Insert> insertions;
+ insertions.append(QQmlChangeSet::Insert(index, count));
listItemsInserted(translatedInsertions, list, insertions);
}
-void QQuickListCompositor::listItemsRemoved(
+void QQmlListCompositor::listItemsRemoved(
QVector<Remove> *translatedRemovals,
void *list,
- QVector<QQuickChangeSet::Remove> *removals,
- QVector<QQuickChangeSet::Insert> *insertions,
+ QVector<QQmlChangeSet::Remove> *removals,
+ QVector<QQmlChangeSet::Insert> *insertions,
QVector<MovedFlags> *movedFlags)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << *removals)
@@ -1086,7 +1086,7 @@ void QQuickListCompositor::listItemsRemoved(
continue;
}
bool removed = false;
- for (QVector<QQuickChangeSet::Remove>::iterator removal = removals->begin();
+ for (QVector<QQmlChangeSet::Remove>::iterator removal = removals->begin();
!removed && removal != removals->end();
++removal) {
int relativeIndex = removal->index - it->index;
@@ -1104,7 +1104,7 @@ void QQuickListCompositor::listItemsRemoved(
}
if (removal->isMove()) {
// If the removal was part of a move find the corresponding insert.
- QVector<QQuickChangeSet::Insert>::iterator insertion = insertions->begin();
+ QVector<QQmlChangeSet::Insert>::iterator insertion = insertions->begin();
for (; insertion != insertions->end() && insertion->moveId != removal->moveId;
++insertion) {}
Q_ASSERT(insertion != insertions->end());
@@ -1114,11 +1114,11 @@ void QQuickListCompositor::listItemsRemoved(
// If the remove started before the current range, split it and the
// corresponding insert so we're only working with intersecting part.
int splitMoveId = ++m_moveId;
- removal = removals->insert(removal, QQuickChangeSet::Remove(
+ removal = removals->insert(removal, QQmlChangeSet::Remove(
removal->index, -relativeIndex, splitMoveId));
++removal;
removal->count -= -relativeIndex;
- insertion = insertions->insert(insertion, QQuickChangeSet::Insert(
+ insertion = insertions->insert(insertion, QQmlChangeSet::Insert(
insertion->index, -relativeIndex, splitMoveId));
++insertion;
insertion->index += -relativeIndex;
@@ -1135,10 +1135,10 @@ void QQuickListCompositor::listItemsRemoved(
if (removeCount < removal->count) {
// If the remove doesn't encompass all of the current range,
// split it and the corresponding insert.
- removal = removals->insert(removal, QQuickChangeSet::Remove(
+ removal = removals->insert(removal, QQmlChangeSet::Remove(
removal->index, removeCount, translatedRemoval.moveId));
++removal;
- insertion = insertions->insert(insertion, QQuickChangeSet::Insert(
+ insertion = insertions->insert(insertion, QQmlChangeSet::Insert(
insertion->index, removeCount, translatedRemoval.moveId));
++insertion;
@@ -1247,14 +1247,14 @@ void QQuickListCompositor::listItemsRemoved(
*/
-void QQuickListCompositor::listItemsRemoved(
+void QQmlListCompositor::listItemsRemoved(
void *list, int index, int count, QVector<Remove> *translatedRemovals)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count)
Q_ASSERT(count >= 0);
- QVector<QQuickChangeSet::Remove> removals;
- removals.append(QQuickChangeSet::Remove(index, count));
+ QVector<QQmlChangeSet::Remove> removals;
+ removals.append(QQmlChangeSet::Remove(index, count));
listItemsRemoved(translatedRemovals, list, &removals, 0, 0);
}
@@ -1269,7 +1269,7 @@ void QQuickListCompositor::listItemsRemoved(
notifications for the affected groups.
*/
-void QQuickListCompositor::listItemsMoved(
+void QQmlListCompositor::listItemsMoved(
void *list,
int from,
int to,
@@ -1280,20 +1280,20 @@ void QQuickListCompositor::listItemsMoved(
QT_QML_TRACE_LISTCOMPOSITOR(<< list << from << to << count)
Q_ASSERT(count >= 0);
- QVector<QQuickChangeSet::Remove> removals;
- QVector<QQuickChangeSet::Insert> insertions;
+ QVector<QQmlChangeSet::Remove> removals;
+ QVector<QQmlChangeSet::Insert> insertions;
QVector<MovedFlags> movedFlags;
- removals.append(QQuickChangeSet::Remove(from, count, 0));
- insertions.append(QQuickChangeSet::Insert(to, count, 0));
+ removals.append(QQmlChangeSet::Remove(from, count, 0));
+ insertions.append(QQmlChangeSet::Insert(to, count, 0));
listItemsRemoved(translatedRemovals, list, &removals, &insertions, &movedFlags);
listItemsInserted(translatedInsertions, list, insertions, &movedFlags);
}
-void QQuickListCompositor::listItemsChanged(
+void QQmlListCompositor::listItemsChanged(
QVector<Change> *translatedChanges,
void *list,
- const QVector<QQuickChangeSet::Change> &changes)
+ const QVector<QQmlChangeSet::Change> &changes)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << changes)
for (iterator it(m_ranges.next, 0, Default, m_groupCount); *it != &m_ranges; *it = it->next) {
@@ -1303,7 +1303,7 @@ void QQuickListCompositor::listItemsChanged(
} else if (!it->inGroup()) {
continue;
}
- foreach (const QQuickChangeSet::Change &change, changes) {
+ foreach (const QQmlChangeSet::Change &change, changes) {
const int offset = change.index - it->index;
if (offset + change.count > 0 && offset < it->count) {
const int changeOffset = qMax(0, offset);
@@ -1329,29 +1329,29 @@ void QQuickListCompositor::listItemsChanged(
affected groups.
*/
-void QQuickListCompositor::listItemsChanged(
+void QQmlListCompositor::listItemsChanged(
void *list, int index, int count, QVector<Change> *translatedChanges)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count)
Q_ASSERT(count >= 0);
- QVector<QQuickChangeSet::Change> changes;
- changes.append(QQuickChangeSet::Change(index, count));
+ QVector<QQmlChangeSet::Change> changes;
+ changes.append(QQmlChangeSet::Change(index, count));
listItemsChanged(translatedChanges, list, changes);
}
-void QQuickListCompositor::transition(
+void QQmlListCompositor::transition(
Group from,
Group to,
- QVector<QQuickChangeSet::Remove> *removes,
- QVector<QQuickChangeSet::Insert> *inserts)
+ QVector<QQmlChangeSet::Remove> *removes,
+ QVector<QQmlChangeSet::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(QQuickChangeSet::Remove(it.index[from]- removeCount, it->count));
+ removes->append(QQmlChangeSet::Remove(it.index[from]- removeCount, it->count));
removeCount += it->count;
} else if (it != from && it == to) {
- inserts->append(QQuickChangeSet::Insert(it.index[to], it->count));
+ inserts->append(QQmlChangeSet::Insert(it.index[to], it->count));
}
it.incrementIndexes(it->count);
}
@@ -1362,11 +1362,11 @@ void QQuickListCompositor::transition(
Writes the name of \a group to \a debug.
*/
-QDebug operator <<(QDebug debug, const QQuickListCompositor::Group &group)
+QDebug operator <<(QDebug debug, const QQmlListCompositor::Group &group)
{
switch (group) {
- case QQuickListCompositor::Cache: return debug << "Cache";
- case QQuickListCompositor::Default: return debug << "Default";
+ case QQmlListCompositor::Cache: return debug << "Cache";
+ case QQmlListCompositor::Default: return debug << "Default";
default: return (debug.nospace() << "Group" << int(group)).space();
}
@@ -1377,7 +1377,7 @@ QDebug operator <<(QDebug debug, const QQuickListCompositor::Group &group)
Writes the contents of \a range to \a debug.
*/
-QDebug operator <<(QDebug debug, const QQuickListCompositor::Range &range)
+QDebug operator <<(QDebug debug, const QQmlListCompositor::Range &range)
{
(debug.nospace()
<< "Range("
@@ -1387,11 +1387,11 @@ QDebug operator <<(QDebug debug, const QQuickListCompositor::Range &range)
<< (range.isUnresolved() ? 'U' : '0')
<< (range.append() ? 'A' : '0')
<< (range.prepend() ? 'P' : '0');
- for (int i = QQuickListCompositor::MaximumGroupCount - 1; i >= 2; --i)
+ for (int i = QQmlListCompositor::MaximumGroupCount - 1; i >= 2; --i)
debug << (range.inGroup(i) ? '1' : '0');
return (debug
- << (range.inGroup(QQuickListCompositor::Default) ? 'D' : '0')
- << (range.inGroup(QQuickListCompositor::Cache) ? 'C' : '0'));
+ << (range.inGroup(QQmlListCompositor::Default) ? 'D' : '0')
+ << (range.inGroup(QQmlListCompositor::Cache) ? 'C' : '0'));
}
static void qt_print_indexes(QDebug &debug, int count, const int *indexes)
@@ -1405,21 +1405,21 @@ static void qt_print_indexes(QDebug &debug, int count, const int *indexes)
Writes the contents of \a it to \a debug.
*/
-QDebug operator <<(QDebug debug, const QQuickListCompositor::iterator &it)
+QDebug operator <<(QDebug debug, const QQmlListCompositor::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 QQuickListCompositor::Change &change)
+static QDebug qt_print_change(QDebug debug, const char *name, const QQmlListCompositor::Change &change)
{
debug.nospace() << name << '(' << change.moveId << ' ' << change.count << ' ';
- for (int i = QQuickListCompositor::MaximumGroupCount - 1; i >= 2; --i)
+ for (int i = QQmlListCompositor::MaximumGroupCount - 1; i >= 2; --i)
debug << (change.inGroup(i) ? '1' : '0');
- debug << (change.inGroup(QQuickListCompositor::Default) ? 'D' : '0')
- << (change.inGroup(QQuickListCompositor::Cache) ? 'C' : '0');
- int i = QQuickListCompositor::MaximumGroupCount - 1;
+ debug << (change.inGroup(QQmlListCompositor::Default) ? 'D' : '0')
+ << (change.inGroup(QQmlListCompositor::Cache) ? 'C' : '0');
+ int i = QQmlListCompositor::MaximumGroupCount - 1;
for (; i >= 0 && !change.inGroup(i); --i) {}
for (; i >= 0; --i)
debug << ' ' << change.index[i];
@@ -1431,7 +1431,7 @@ static QDebug qt_print_change(QDebug debug, const char *name, const QQuickListCo
Writes the contents of \a change to \a debug.
*/
-QDebug operator <<(QDebug debug, const QQuickListCompositor::Change &change)
+QDebug operator <<(QDebug debug, const QQmlListCompositor::Change &change)
{
return qt_print_change(debug, "Change", change);
}
@@ -1441,7 +1441,7 @@ QDebug operator <<(QDebug debug, const QQuickListCompositor::Change &change)
Writes the contents of \a remove to \a debug.
*/
-QDebug operator <<(QDebug debug, const QQuickListCompositor::Remove &remove)
+QDebug operator <<(QDebug debug, const QQmlListCompositor::Remove &remove)
{
return qt_print_change(debug, "Remove", remove);
}
@@ -1451,7 +1451,7 @@ QDebug operator <<(QDebug debug, const QQuickListCompositor::Remove &remove)
Writes the contents of \a insert to \a debug.
*/
-QDebug operator <<(QDebug debug, const QQuickListCompositor::Insert &insert)
+QDebug operator <<(QDebug debug, const QQmlListCompositor::Insert &insert)
{
return qt_print_change(debug, "Insert", insert);
}
@@ -1461,14 +1461,14 @@ QDebug operator <<(QDebug debug, const QQuickListCompositor::Insert &insert)
Writes the contents of \a list to \a debug.
*/
-QDebug operator <<(QDebug debug, const QQuickListCompositor &list)
+QDebug operator <<(QDebug debug, const QQmlListCompositor &list)
{
- int indexes[QQuickListCompositor::MaximumGroupCount];
- for (int i = 0; i < QQuickListCompositor::MaximumGroupCount; ++i)
+ int indexes[QQmlListCompositor::MaximumGroupCount];
+ for (int i = 0; i < QQmlListCompositor::MaximumGroupCount; ++i)
indexes[i] = 0;
- debug.nospace() << "QQuickListCompositor(";
+ debug.nospace() << "QQmlListCompositor(";
qt_print_indexes(debug, list.m_groupCount, list.m_end.index);
- for (QQuickListCompositor::Range *range = list.m_ranges.next; range != &list.m_ranges; range = range->next) {
+ for (QQmlListCompositor::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/qquicklistcompositor_p.h b/src/qml/util/qqmllistcompositor_p.h
index b2fe69d6a2..5d87051582 100644
--- a/src/quick/util/qquicklistcompositor_p.h
+++ b/src/qml/util/qqmllistcompositor_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QQUICKLISTCOMPOSITOR_P_H
-#define QQUICKLISTCOMPOSITOR_P_H
+#ifndef QQMLLISTCOMPOSITOR_P_H
+#define QQMLLISTCOMPOSITOR_P_H
//
// W A R N I N G
@@ -56,13 +56,13 @@
#include <QtCore/qglobal.h>
#include <QtCore/qvector.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmlchangeset_p.h>
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
-class Q_AUTOTEST_EXPORT QQuickListCompositor
+class Q_AUTOTEST_EXPORT QQmlListCompositor
{
public:
enum { MinimumGroupCount = 3, MaximumGroupCount = 11 };
@@ -207,8 +207,8 @@ public:
: Change(it, count, flags, moveId) {}
};
- QQuickListCompositor();
- ~QQuickListCompositor();
+ QQmlListCompositor();
+ ~QQmlListCompositor();
int defaultGroups() const { return m_defaultFlags & ~PrependFlag; }
void setDefaultGroups(int groups) { m_defaultFlags = groups | PrependFlag; }
@@ -263,8 +263,8 @@ public:
void transition(
Group from,
Group to,
- QVector<QQuickChangeSet::Remove> *removes,
- QVector<QQuickChangeSet::Insert> *inserts);
+ QVector<QQmlChangeSet::Remove> *removes,
+ QVector<QQmlChangeSet::Insert> *inserts);
private:
Range m_ranges;
@@ -290,29 +290,29 @@ private:
void listItemsRemoved(
QVector<Remove> *translatedRemovals,
void *list,
- QVector<QQuickChangeSet::Remove> *removals,
- QVector<QQuickChangeSet::Insert> *insertions = 0,
+ QVector<QQmlChangeSet::Remove> *removals,
+ QVector<QQmlChangeSet::Insert> *insertions = 0,
QVector<MovedFlags> *movedFlags = 0);
void listItemsInserted(
QVector<Insert> *translatedInsertions,
void *list,
- const QVector<QQuickChangeSet::Insert> &insertions,
+ const QVector<QQmlChangeSet::Insert> &insertions,
const QVector<MovedFlags> *movedFlags = 0);
void listItemsChanged(
QVector<Change> *translatedChanges,
void *list,
- const QVector<QQuickChangeSet::Change> &changes);
+ const QVector<QQmlChangeSet::Change> &changes);
- friend Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor &list);
+ friend Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor &list);
};
-Q_DECLARE_TYPEINFO(QQuickListCompositor::Change, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(QQuickListCompositor::Remove, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(QQuickListCompositor::Insert, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlListCompositor::Change, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlListCompositor::Remove, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQmlListCompositor::Insert, Q_PRIMITIVE_TYPE);
-inline QQuickListCompositor::iterator::iterator()
+inline QQmlListCompositor::iterator::iterator()
: range(0), offset(0), group(Default), groupCount(0) {}
-inline QQuickListCompositor::iterator::iterator(const iterator &it)
+inline QQmlListCompositor::iterator::iterator(const iterator &it)
: range(it.range)
, offset(it.offset)
, group(it.group)
@@ -323,7 +323,7 @@ inline QQuickListCompositor::iterator::iterator(const iterator &it)
index[i] = it.index[i];
}
-inline QQuickListCompositor::iterator::iterator(
+inline QQmlListCompositor::iterator::iterator(
Range *range, int offset, Group group, int groupCount)
: range(range)
, offset(offset)
@@ -335,7 +335,7 @@ inline QQuickListCompositor::iterator::iterator(
index[i] = 0;
}
-inline void QQuickListCompositor::iterator::incrementIndexes(int difference, uint flags)
+inline void QQmlListCompositor::iterator::incrementIndexes(int difference, uint flags)
{
for (int i = 0; i < groupCount; ++i) {
if (flags & (1 << i))
@@ -343,7 +343,7 @@ inline void QQuickListCompositor::iterator::incrementIndexes(int difference, uin
}
}
-inline void QQuickListCompositor::iterator::decrementIndexes(int difference, uint flags)
+inline void QQmlListCompositor::iterator::decrementIndexes(int difference, uint flags)
{
for (int i = 0; i < groupCount; ++i) {
if (flags & (1 << i))
@@ -351,24 +351,24 @@ inline void QQuickListCompositor::iterator::decrementIndexes(int difference, uin
}
}
-inline QQuickListCompositor::insert_iterator::insert_iterator(
+inline QQmlListCompositor::insert_iterator::insert_iterator(
Range *range, int offset, Group group, int groupCount)
: iterator(range, offset, group, groupCount) {}
-inline QQuickListCompositor::Change::Change(iterator it, int count, uint flags, int moveId)
+inline QQmlListCompositor::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 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);
+Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor::Group &group);
+Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor::Range &range);
+Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor::iterator &it);
+Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor::Change &change);
+Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor::Remove &remove);
+Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor::Insert &insert);
+Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQmlListCompositor &list);
QT_END_NAMESPACE
diff --git a/src/qml/util/qqmlpropertymap.h b/src/qml/util/qqmlpropertymap.h
index 5c79f08926..f963e9074a 100644
--- a/src/qml/util/qqmlpropertymap.h
+++ b/src/qml/util/qqmlpropertymap.h
@@ -49,8 +49,6 @@
#include <QtCore/QStringList>
#include <QtCore/QVariant>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -100,6 +98,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/qml/util/util.pri b/src/qml/util/util.pri
index 3b121ba3cb..a9c5ffe9b7 100644
--- a/src/qml/util/util.pri
+++ b/src/qml/util/util.pri
@@ -1,5 +1,13 @@
SOURCES += \
+ $$PWD/qqmlchangeset.cpp \
+ $$PWD/qqmllistaccessor.cpp \
+ $$PWD/qqmllistcompositor.cpp \
+ $$PWD/qqmladaptormodel.cpp \
$$PWD/qqmlpropertymap.cpp
HEADERS += \
+ $$PWD/qqmlchangeset_p.h \
+ $$PWD/qqmllistaccessor_p.h \
+ $$PWD/qqmllistcompositor_p.h \
+ $$PWD/qqmladaptormodel_p.h \
$$PWD/qqmlpropertymap.h
diff --git a/src/qmltest/qtestoptions_p.h b/src/qmltest/qtestoptions_p.h
index 36706b2e31..ac2d428b4e 100644
--- a/src/qmltest/qtestoptions_p.h
+++ b/src/qmltest/qtestoptions_p.h
@@ -47,8 +47,6 @@
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -61,6 +59,4 @@ namespace QTest
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/qmltest/quicktest.h b/src/qmltest/quicktest.h
index d20d71aec4..d6ffcf86a8 100644
--- a/src/qmltest/quicktest.h
+++ b/src/qmltest/quicktest.h
@@ -44,8 +44,6 @@
#include <QtQuickTest/quicktestglobal.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
Q_QUICK_TEST_EXPORT int quick_test_main(int argc, char **argv, const char *name, const char *sourceDir);
@@ -82,6 +80,4 @@ Q_QUICK_TEST_EXPORT int quick_test_main(int argc, char **argv, const char *name,
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/qmltest/quicktestglobal.h b/src/qmltest/quicktestglobal.h
index d9a3b001d3..32461fd9a7 100644
--- a/src/qmltest/quicktestglobal.h
+++ b/src/qmltest/quicktestglobal.h
@@ -44,7 +44,6 @@
#include <QtCore/qglobal.h>
-QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef QT_STATIC
@@ -58,6 +57,5 @@ QT_BEGIN_NAMESPACE
#endif
QT_END_NAMESPACE
-QT_END_HEADER
#endif
diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp
index 220478c42e..7f75857fe4 100644
--- a/src/quick/designer/designersupport.cpp
+++ b/src/quick/designer/designersupport.cpp
@@ -47,7 +47,7 @@
#include <QtQml/private/qabstractanimationjob_p.h>
#include <private/qqmlengine_p.h>
#include <private/qquickview_p.h>
-#include <private/qquickwindowmanager_p.h>
+#include <private/qsgrenderloop_p.h>
#include <QtQuick/private/qquickstategroup_p.h>
#include <QtGui/QImage>
#include <private/qqmlvme_p.h>
@@ -429,7 +429,7 @@ void DesignerSupport::updateDirtyNode(QQuickItem *item)
void DesignerSupport::activateDesignerWindowManager()
{
- QQuickWindowManager::setInstance(new DesignerWindowManager);
+ QSGRenderLoop::setInstance(new DesignerWindowManager);
}
void DesignerSupport::activateDesignerMode()
diff --git a/src/quick/designer/designersupport.h b/src/quick/designer/designersupport.h
index 63809c3c3b..c93cffa7fa 100644
--- a/src/quick/designer/designersupport.h
+++ b/src/quick/designer/designersupport.h
@@ -59,8 +59,6 @@
#include <QtCore/QHash>
#include <QtCore/QRectF>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItem;
@@ -157,6 +155,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // DESIGNERSUPPORT_H
diff --git a/src/quick/designer/designerwindowmanager_p.h b/src/quick/designer/designerwindowmanager_p.h
index 0e95b06197..02aacf06bd 100644
--- a/src/quick/designer/designerwindowmanager_p.h
+++ b/src/quick/designer/designerwindowmanager_p.h
@@ -55,13 +55,11 @@
#include <QtCore/QScopedPointer>
-#include <private/qquickwindowmanager_p.h>
+#include <private/qsgrenderloop_p.h>
#include <private/qtquickglobal_p.h>
#include <QtQuick/private/qsgcontext_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickWindow;
@@ -69,7 +67,7 @@ class QSGContext;
class QAnimationDriver;
class QOpenGLContext;
-class DesignerWindowManager : public QObject, public QQuickWindowManager
+class DesignerWindowManager : public QObject, public QSGRenderLoop
{
Q_OBJECT
public:
@@ -88,7 +86,7 @@ public:
void maybeUpdate(QQuickWindow *window);
void update(QQuickWindow *window); // identical for this implementation.
- void releaseResources() { }
+ void releaseResources(QQuickWindow *) { }
QAnimationDriver *animationDriver() const { return 0; }
@@ -103,5 +101,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
#endif // DESIGNERWINDOWMANAGER_P_H
diff --git a/src/quick/doc/images/gridLayout_aligncenter.png b/src/quick/doc/images/gridLayout_aligncenter.png
new file mode 100644
index 0000000000..f31ed25e79
--- /dev/null
+++ b/src/quick/doc/images/gridLayout_aligncenter.png
Binary files differ
diff --git a/src/quick/doc/images/gridLayout_aligntop.png b/src/quick/doc/images/gridLayout_aligntop.png
new file mode 100644
index 0000000000..5b752b1d19
--- /dev/null
+++ b/src/quick/doc/images/gridLayout_aligntop.png
Binary files differ
diff --git a/src/quick/doc/images/gridLayout_aligntopleft.png b/src/quick/doc/images/gridLayout_aligntopleft.png
new file mode 100644
index 0000000000..5a4a2fe211
--- /dev/null
+++ b/src/quick/doc/images/gridLayout_aligntopleft.png
Binary files differ
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index 9604b927a8..a627cfe7b5 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -285,6 +285,19 @@ Data Storage
*/
/*!
+\qmlmodule QtQuick 2
+\brief The QtQuick 2 module provides graphical primitives for use in QML.
+
+The QtQuick 2 module provides graphical primitive types. They can be used with the following import
+\code
+import QtQuick 2.1
+\endcode
+
+For a more detailed listing of types in the QtQuick 2 import, see the \l{qtquick-qmltypereference.html}{QtQuick 2 type reference page}.
+For more details about the QtQuick 2 module, see the \l{QtQuick} module page.
+*/
+
+/*!
\qmlbasictype color
\ingroup qtquickbasictypes
\brief an ARGB color value.
diff --git a/src/quick/items/context2d/qquickcanvascontext_p.h b/src/quick/items/context2d/qquickcanvascontext_p.h
index bfea0e5d5b..d15f5d945d 100644
--- a/src/quick/items/context2d/qquickcanvascontext_p.h
+++ b/src/quick/items/context2d/qquickcanvascontext_p.h
@@ -46,8 +46,6 @@
#include <private/qv8engine_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickCanvasItem;
@@ -83,6 +81,4 @@ Q_SIGNALS:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif //QQUICKCANVASCONTEXT_P_H
diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h
index d2a907554e..c53e4f952a 100644
--- a/src/quick/items/context2d/qquickcanvasitem_p.h
+++ b/src/quick/items/context2d/qquickcanvasitem_p.h
@@ -47,8 +47,6 @@
#include <QtCore/QThread>
#include <QtGui/QImage>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickCanvasContext;
@@ -207,6 +205,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickCanvasItem)
-QT_END_HEADER
-
#endif //QQUICKCANVASITEM_P_H
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 2f37c7f109..17115ae8c4 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -62,7 +62,6 @@
#include <private/qv8domerrors_p.h>
#include <QtCore/qnumeric.h>
#include <private/qquickwindow_p.h>
-#include <private/qquickwindowmanager_p.h>
#if defined(Q_OS_QNX) || defined(Q_OS_LINUX_ANDROID)
#include <ctype.h>
@@ -3348,7 +3347,6 @@ QQuickContext2D::QQuickContext2D(QObject *parent)
: QQuickCanvasContext(parent)
, m_buffer(new QQuickContext2DCommandBuffer)
, m_v8engine(0)
- , m_windowManager(0)
, m_surface(0)
, m_glContext(0)
, m_thread(0)
@@ -3380,7 +3378,6 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
m_renderTarget = canvasItem->renderTarget();
QQuickWindow *window = canvasItem->window();
- m_windowManager = QQuickWindowPrivate::get(window)->windowManager;
m_renderStrategy = canvasItem->renderStrategy();
switch (m_renderTarget) {
diff --git a/src/quick/items/context2d/qquickcontext2d_p.h b/src/quick/items/context2d/qquickcontext2d_p.h
index 2124c731b2..24f5c44f18 100644
--- a/src/quick/items/context2d/qquickcontext2d_p.h
+++ b/src/quick/items/context2d/qquickcontext2d_p.h
@@ -62,15 +62,12 @@
#include <QElapsedTimer>
#endif
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickContext2DCommandBuffer;
class QQuickContext2DTexture;
class QQuickPixmap;
class QSGTexture;
-class QQuickWindowManager;
class QSurface;
class QOpenGLContext;
@@ -240,7 +237,6 @@ public:
v8::Local<v8::Value> m_strokeStyle;
v8::Handle<v8::Value> m_v8path;
QV8Engine *m_v8engine;
- QQuickWindowManager *m_windowManager;
QSurface *m_surface;
QOpenGLContext *m_glContext;
v8::Persistent<v8::Object> m_v8value;
@@ -259,6 +255,4 @@ public:
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickContext2D)
-QT_END_HEADER
-
#endif // QQUICKCONTEXT2D_P_H
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h
index 0247a9e286..ff0a3a4e20 100644
--- a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h
+++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h
@@ -45,8 +45,6 @@
#include <QtCore/qmutex.h>
#include "qquickcontext2d_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickCanvasItem;
@@ -266,8 +264,6 @@ private:
QMutex queueLock;
};
-QT_END_HEADER
-
QT_END_NAMESPACE
#endif // QQUICKCONTEXT2DCOMMANDBUFFER_P_H
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h
index 8fe3168533..df96a0eda1 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h
@@ -53,8 +53,6 @@
#include <QtCore/QWaitCondition>
#include <QtCore/QThread>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickContext2DTile;
@@ -180,8 +178,6 @@ private:
QSGPlainTexture* m_texture;
};
-QT_END_HEADER
-
QT_END_NAMESPACE
#endif // QQUICKCONTEXT2DTEXTURE_P_H
diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h
index 60415ee63d..22cbbe6a30 100644
--- a/src/quick/items/context2d/qquickcontext2dtile_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtile_p.h
@@ -45,8 +45,6 @@
#include "qquickcontext2d_p.h"
#include <QOpenGLFramebufferObject>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickContext2DTexture;
@@ -103,8 +101,6 @@ public:
private:
QImage m_image;
};
-QT_END_HEADER
-
QT_END_NAMESPACE
#endif // QQUICKCONTEXT2DTILE_P_H
diff --git a/src/quick/items/items.pri b/src/quick/items/items.pri
index 13abf7b958..fe406ecaac 100644
--- a/src/quick/items/items.pri
+++ b/src/quick/items/items.pri
@@ -21,6 +21,7 @@ HEADERS += \
$$PWD/qquicktextinput_p_p.h \
$$PWD/qquicktextcontrol_p.h \
$$PWD/qquicktextcontrol_p_p.h \
+ $$PWD/qquicktextdocument.h \
$$PWD/qquicktextedit_p.h \
$$PWD/qquicktextedit_p_p.h \
$$PWD/qquicktextutil_p.h \
@@ -38,10 +39,6 @@ HEADERS += \
$$PWD/qquickflickable_p.h \
$$PWD/qquickflickable_p_p.h \
$$PWD/qquicklistview_p.h \
- $$PWD/qquickvisualadaptormodel_p.h \
- $$PWD/qquickvisualdatamodel_p.h \
- $$PWD/qquickvisualdatamodel_p_p.h \
- $$PWD/qquickvisualitemmodel_p.h \
$$PWD/qquickrepeater_p.h \
$$PWD/qquickrepeater_p_p.h \
$$PWD/qquickgridview_p.h \
@@ -74,9 +71,7 @@ HEADERS += \
$$PWD/qquickitemview_p_p.h \
$$PWD/qquickitemviewtransition_p.h \
$$PWD/qquickscreen_p.h \
- $$PWD/qquickwindowmodule_p.h \
- $$PWD/qquickwindowmanager_p.h \
- $$PWD/qquickthreadedwindowmanager_p.h
+ $$PWD/qquickwindowmodule_p.h
SOURCES += \
$$PWD/qquickevents.cpp \
@@ -91,6 +86,7 @@ SOURCES += \
$$PWD/qquicktextnode.cpp \
$$PWD/qquicktextinput.cpp \
$$PWD/qquicktextcontrol.cpp \
+ $$PWD/qquicktextdocument.cpp \
$$PWD/qquicktextedit.cpp \
$$PWD/qquicktextutil.cpp \
$$PWD/qquickimagebase.cpp \
@@ -101,9 +97,6 @@ SOURCES += \
$$PWD/qquickpincharea.cpp \
$$PWD/qquickflickable.cpp \
$$PWD/qquicklistview.cpp \
- $$PWD/qquickvisualadaptormodel.cpp \
- $$PWD/qquickvisualdatamodel.cpp \
- $$PWD/qquickvisualitemmodel.cpp \
$$PWD/qquickrepeater.cpp \
$$PWD/qquickgridview.cpp \
$$PWD/qquickpathview.cpp \
@@ -128,9 +121,7 @@ SOURCES += \
$$PWD/qquickitemview.cpp \
$$PWD/qquickitemviewtransition.cpp \
$$PWD/qquickwindowmodule.cpp \
- $$PWD/qquickscreen.cpp \
- $$PWD/qquickwindowmanager.cpp \
- $$PWD/qquickthreadedwindowmanager.cpp
+ $$PWD/qquickscreen.cpp
SOURCES += \
$$PWD/qquickshadereffect.cpp \
diff --git a/src/quick/items/qquickaccessibleattached_p.h b/src/quick/items/qquickaccessibleattached_p.h
index 15261232b2..2124356a70 100644
--- a/src/quick/items/qquickaccessibleattached_p.h
+++ b/src/quick/items/qquickaccessibleattached_p.h
@@ -52,8 +52,6 @@
#include <QtGui/qaccessible.h>
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -165,8 +163,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickAccessibleAttached)
QML_DECLARE_TYPEINFO(QQuickAccessibleAttached, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
-
#endif // QT_NO_ACCESSIBILITY
#endif
diff --git a/src/quick/items/qquickanchors_p.h b/src/quick/items/qquickanchors_p.h
index df3577c42d..1f18961caf 100644
--- a/src/quick/items/qquickanchors_p.h
+++ b/src/quick/items/qquickanchors_p.h
@@ -48,8 +48,6 @@
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItem;
@@ -200,6 +198,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickAnchors)
-QT_END_HEADER
-
#endif // QQUICKANCHORS_P_H
diff --git a/src/quick/items/qquickanimatedimage_p.h b/src/quick/items/qquickanimatedimage_p.h
index 83bae59af8..2775023d4e 100644
--- a/src/quick/items/qquickanimatedimage_p.h
+++ b/src/quick/items/qquickanimatedimage_p.h
@@ -46,8 +46,6 @@
#ifndef QT_NO_MOVIE
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QMovie;
@@ -108,8 +106,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickAnimatedImage)
-QT_END_HEADER
-
#endif // QT_NO_MOVIE
#endif // QQUICKANIMATEDIMAGE_P_H
diff --git a/src/quick/items/qquickanimatedsprite_p.h b/src/quick/items/qquickanimatedsprite_p.h
index 47dd51c3ee..6d0a821a47 100644
--- a/src/quick/items/qquickanimatedsprite_p.h
+++ b/src/quick/items/qquickanimatedsprite_p.h
@@ -46,8 +46,6 @@
#include <private/qquicksprite_p.h>
#include <QTime>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGContext;
@@ -378,6 +376,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKANIMATEDSPRITE_P_H
diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h
index 1cc86bc832..2ba69a383d 100644
--- a/src/quick/items/qquickborderimage_p.h
+++ b/src/quick/items/qquickborderimage_p.h
@@ -44,7 +44,6 @@
#include "qquickimagebase_p.h"
-QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QQuickScaleGrid;
@@ -102,6 +101,5 @@ private:
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickBorderImage)
-QT_END_HEADER
#endif // QQUICKBORDERIMAGE_P_H
diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h
index 5e1448aab6..c1835d9504 100644
--- a/src/quick/items/qquickdrag_p.h
+++ b/src/quick/items/qquickdrag_p.h
@@ -51,8 +51,6 @@
#ifndef QT_NO_DRAGANDDROP
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItem;
@@ -205,8 +203,6 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QT_NO_DRAGANDDROP
#endif
diff --git a/src/quick/items/qquickdroparea_p.h b/src/quick/items/qquickdroparea_p.h
index 14921a2d28..bfc3f922b5 100644
--- a/src/quick/items/qquickdroparea_p.h
+++ b/src/quick/items/qquickdroparea_p.h
@@ -51,8 +51,6 @@
#ifndef QT_NO_DRAGANDDROP
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickDropAreaPrivate;
@@ -162,8 +160,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickDropEvent)
QML_DECLARE_TYPE(QQuickDropArea)
-QT_END_HEADER
-
#endif // QT_NO_DRAGANDDROP
#endif // QQUICKDROPAREA_P_H
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h
index 2e16f11882..5d36ea01ac 100644
--- a/src/quick/items/qquickflickable_p.h
+++ b/src/quick/items/qquickflickable_p.h
@@ -45,8 +45,6 @@
#include "qquickitem.h"
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickFlickablePrivate;
@@ -278,6 +276,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickFlickable)
-QT_END_HEADER
-
#endif // QQUICKFLICKABLE_P_H
diff --git a/src/quick/items/qquickflipable_p.h b/src/quick/items/qquickflipable_p.h
index 1bc6f4113d..795dc4f809 100644
--- a/src/quick/items/qquickflipable_p.h
+++ b/src/quick/items/qquickflipable_p.h
@@ -48,8 +48,6 @@
#include <QtGui/qvector3d.h>
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickFlipablePrivate;
@@ -96,6 +94,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickFlipable)
-QT_END_HEADER
-
#endif // QQUICKFLIPABLE_P_H
diff --git a/src/quick/items/qquickfocusscope_p.h b/src/quick/items/qquickfocusscope_p.h
index d72eae0805..965c7538bf 100644
--- a/src/quick/items/qquickfocusscope_p.h
+++ b/src/quick/items/qquickfocusscope_p.h
@@ -44,8 +44,6 @@
#include "qquickitem.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QQuickFocusScope : public QQuickItem
@@ -60,6 +58,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickFocusScope)
-QT_END_HEADER
-
#endif // QQUICKFOCUSSCOPE_P_H
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
index fd9ce9ffcd..ea8badb584 100644
--- a/src/quick/items/qquickgridview.cpp
+++ b/src/quick/items/qquickgridview.cpp
@@ -40,10 +40,10 @@
****************************************************************************/
#include "qquickgridview_p.h"
-#include "qquickvisualitemmodel_p.h"
#include "qquickflickable_p_p.h"
#include "qquickitemview_p_p.h"
+#include <private/qqmlobjectmodel_p.h>
#include <private/qquicksmoothedanimation_p_p.h>
#include <QtGui/qevent.h>
@@ -209,7 +209,7 @@ public:
virtual void setPosition(qreal pos);
virtual void layoutVisibleItems(int fromModelIndex = 0);
- virtual bool applyInsertionChange(const QQuickChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView);
+ virtual bool applyInsertionChange(const QQmlChangeSet::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;
@@ -2105,13 +2105,16 @@ void QQuickGridView::geometryChanged(const QRectF &newGeometry, const QRectF &ol
QQuickItemView::geometryChanged(newGeometry, oldGeometry);
}
-void QQuickGridView::initItem(int index, QQuickItem *item)
+void QQuickGridView::initItem(int index, QObject *obj)
{
- QQuickItemView::initItem(index, item);
- QQuickGridViewAttached *attached = static_cast<QQuickGridViewAttached *>(
- qmlAttachedPropertiesObject<QQuickGridView>(item));
- if (attached)
- attached->setView(this);
+ QQuickItemView::initItem(index, obj);
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(obj);
+ if (item) {
+ QQuickGridViewAttached *attached = static_cast<QQuickGridViewAttached *>(
+ qmlAttachedPropertiesObject<QQuickGridView>(item));
+ if (attached)
+ attached->setView(this);
+ }
}
/*!
@@ -2286,7 +2289,7 @@ void QQuickGridView::moveCurrentIndexRight()
}
}
-bool QQuickGridViewPrivate::applyInsertionChange(const QQuickChangeSet::Insert &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView)
+bool QQuickGridViewPrivate::applyInsertionChange(const QQmlChangeSet::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 64cb814f8c..d98de1050f 100644
--- a/src/quick/items/qquickgridview_p.h
+++ b/src/quick/items/qquickgridview_p.h
@@ -46,11 +46,8 @@
#include <private/qqmlguard_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-class QQuickVisualModel;
class QQuickGridViewAttached;
class QQuickGridViewPrivate;
class Q_AUTOTEST_EXPORT QQuickGridView : public QQuickItemView
@@ -112,7 +109,7 @@ protected:
virtual void viewportMoved(Qt::Orientations);
virtual void keyPressEvent(QKeyEvent *);
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
- virtual void initItem(int index, QQuickItem *item);
+ virtual void initItem(int index, QObject *item);
};
class QQuickGridViewAttached : public QQuickItemViewAttached
@@ -145,6 +142,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickGridView)
QML_DECLARE_TYPEINFO(QQuickGridView, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
-
#endif // QQUICKGRIDVIEW_P_H
diff --git a/src/quick/items/qquickimage_p.h b/src/quick/items/qquickimage_p.h
index 9437b47635..b1f27a64ba 100644
--- a/src/quick/items/qquickimage_p.h
+++ b/src/quick/items/qquickimage_p.h
@@ -45,8 +45,6 @@
#include "qquickimagebase_p.h"
#include <QtQuick/qsgtextureprovider.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickImagePrivate;
@@ -114,6 +112,4 @@ private:
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickImage)
-QT_END_HEADER
-
#endif // QQUICKIMAGE_P_H
diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h
index f5ed69129d..388873b4d3 100644
--- a/src/quick/items/qquickimagebase_p.h
+++ b/src/quick/items/qquickimagebase_p.h
@@ -45,8 +45,6 @@
#include "qquickimplicitsizeitem_p.h"
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickImageBasePrivate;
@@ -114,6 +112,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKIMAGEBASE_P_H
diff --git a/src/quick/items/qquickimplicitsizeitem_p.h b/src/quick/items/qquickimplicitsizeitem_p.h
index 6e306d8375..54b94dd183 100644
--- a/src/quick/items/qquickimplicitsizeitem_p.h
+++ b/src/quick/items/qquickimplicitsizeitem_p.h
@@ -45,8 +45,6 @@
#include "qquickpainteditem.h"
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickImplicitSizeItemPrivate;
@@ -70,6 +68,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKIMPLICITSIZEITEM_H
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index d72a7b1a1d..ad8a9d90af 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -78,6 +78,10 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DEBUG
+static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty();
+#endif
+
#ifdef FOCUS_DEBUG
void printFocusTree(QQuickItem *item, QQuickItem *scope = 0, int depth = 1);
void printFocusTree(QQuickItem *item, QQuickItem *scope, int depth)
@@ -739,7 +743,12 @@ void QQuickKeyNavigationAttached::setFocusNavigation(QQuickItem *currentItem, co
while (currentItem != initialItem && isNextItem);
}
-const QQuickKeysAttached::SigMap QQuickKeysAttached::sigMap[] = {
+struct SigMap {
+ int key;
+ const char *sig;
+};
+
+const SigMap sigMap[] = {
{ Qt::Key_Left, "leftPressed" },
{ Qt::Key_Right, "rightPressed" },
{ Qt::Key_Up, "upPressed" },
@@ -771,6 +780,21 @@ const QQuickKeysAttached::SigMap QQuickKeysAttached::sigMap[] = {
{ 0, 0 }
};
+const QByteArray QQuickKeysAttached::keyToSignal(int key)
+{
+ QByteArray keySignal;
+ if (key >= Qt::Key_0 && key <= Qt::Key_9) {
+ keySignal = "digit0Pressed";
+ keySignal[5] = '0' + (key - Qt::Key_0);
+ } else {
+ int i = 0;
+ while (sigMap[i].key && sigMap[i].key != key)
+ ++i;
+ keySignal = sigMap[i].sig;
+ }
+ return keySignal;
+}
+
bool QQuickKeysAttached::isConnected(const char *signalName)
{
Q_D(QQuickKeysAttached);
@@ -1945,9 +1969,11 @@ static void qt_print_item_count()
QQuickItem::~QQuickItem()
{
#ifndef QT_NO_DEBUG
- --qt_item_count;
- if (qt_item_count < 0)
- qDebug("Item destroyed after qt_print_item_count() was called.");
+ if (qsg_leak_check) {
+ --qt_item_count;
+ if (qt_item_count < 0)
+ qDebug("Item destroyed after qt_print_item_count() was called.");
+ }
#endif
Q_D(QQuickItem);
@@ -2526,11 +2552,13 @@ QQuickItemPrivate::~QQuickItemPrivate()
void QQuickItemPrivate::init(QQuickItem *parent)
{
#ifndef QT_NO_DEBUG
- ++qt_item_count;
- static bool atexit_registered = false;
- if (!atexit_registered) {
- atexit(qt_print_item_count);
- atexit_registered = true;
+ if (qsg_leak_check) {
+ ++qt_item_count;
+ static bool atexit_registered = false;
+ if (!atexit_registered) {
+ atexit(qt_print_item_count);
+ atexit_registered = true;
+ }
}
#endif
@@ -3788,14 +3816,15 @@ void QQuickItem::forceActiveFocus()
*/
QQuickItem *QQuickItem::childAt(qreal x, qreal y) const
{
- // XXX todo - should this include transform etc.?
const QList<QQuickItem *> children = childItems();
for (int i = children.count()-1; i >= 0; --i) {
QQuickItem *child = children.at(i);
- if (child->isVisible() && child->x() <= x
- && child->x() + child->width() >= x
- && child->y() <= y
- && child->y() + child->height() >= y)
+ // Map coordinates to the child element's coordinate space
+ QPointF point = mapToItem(child, QPointF(x, y));
+ if (child->isVisible() && point.x() >= 0
+ && child->width() >= point.x()
+ && point.y() >= 0
+ && child->height() >= point.y())
return child;
}
return 0;
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index b3ac9339a6..e9c817a580 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -52,8 +52,6 @@
#include <QtGui/qfont.h>
#include <QtGui/qaccessible.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItem;
@@ -446,6 +444,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickItem)
QML_DECLARE_TYPE(QQuickTransform)
-QT_END_HEADER
-
#endif // QQUICKITEM_H
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index c238477d6f..8f6865b40b 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -819,28 +819,9 @@ private:
virtual void inputMethodEvent(QInputMethodEvent *, bool post);
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
#endif
- const QByteArray keyToSignal(int key) {
- QByteArray keySignal;
- if (key >= Qt::Key_0 && key <= Qt::Key_9) {
- keySignal = "digit0Pressed";
- keySignal[5] = '0' + (key - Qt::Key_0);
- } else {
- int i = 0;
- while (sigMap[i].key && sigMap[i].key != key)
- ++i;
- keySignal = sigMap[i].sig;
- }
- return keySignal;
- }
+ const QByteArray keyToSignal(int key);
bool isConnected(const char *signalName);
-
- struct SigMap {
- int key;
- const char *sig;
- };
-
- static const SigMap sigMap[];
};
Qt::MouseButtons QQuickItemPrivate::acceptedMouseButtons() const
diff --git a/src/quick/items/qquickitemanimation_p.h b/src/quick/items/qquickitemanimation_p.h
index 1dfce5233c..796f6c8ade 100644
--- a/src/quick/items/qquickitemanimation_p.h
+++ b/src/quick/items/qquickitemanimation_p.h
@@ -46,8 +46,6 @@
#include <QtQuick/private/qquickanimation_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParentAnimationPrivate;
@@ -198,6 +196,4 @@ QML_DECLARE_TYPE(QQuickParentAnimation)
QML_DECLARE_TYPE(QQuickAnchorAnimation)
QML_DECLARE_TYPE(QQuickPathAnimation)
-QT_END_HEADER
-
#endif // QQUICKITEMANIMATION_H
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index c04807168f..5321f5e588 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -49,6 +49,7 @@
#include "qquicktext_p.h"
#include "qquicktextinput_p.h"
#include "qquicktextedit_p.h"
+#include "qquicktextdocument.h"
#include "qquickimage_p.h"
#include "qquickborderimage_p.h"
#include "qquickscalegrid_p_p.h"
@@ -57,8 +58,6 @@
#include "qquickflickable_p.h"
#include "qquickflickable_p_p.h"
#include "qquicklistview_p.h"
-#include "qquickvisualitemmodel_p.h"
-#include "qquickvisualdatamodel_p.h"
#include "qquickgridview_p.h"
#include "qquickpathview_p.h"
#include "qquickitemviewtransition_p.h"
@@ -161,9 +160,6 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickTextEdit>(uri,major,minor,"TextEdit");
qmlRegisterType<QQuickTextInput>(uri,major,minor,"TextInput");
qmlRegisterType<QQuickViewSection>(uri,major,minor,"ViewSection");
- qmlRegisterType<QQuickVisualDataModel>(uri,major,minor,"VisualDataModel");
- qmlRegisterType<QQuickVisualDataGroup>(uri,major,minor,"VisualDataGroup");
- qmlRegisterType<QQuickVisualItemModel>(uri,major,minor,"VisualItemModel");
qmlRegisterType<QQuickItemLayer>();
qmlRegisterType<QQuickAnchors>();
@@ -178,12 +174,14 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
#ifndef QT_NO_VALIDATOR
qmlRegisterType<QValidator>();
#endif
- qmlRegisterType<QQuickVisualModel>();
qmlRegisterType<QQuickPen>();
qmlRegisterType<QQuickFlickableVisibleArea>();
qRegisterMetaType<QQuickAnchorLine>("QQuickAnchorLine");
QQmlMetaType::setQQuickAnchorLineCompareFunction(compareQQuickAnchorLines);
+ qmlRegisterType<QQuickTextDocument>();
+
+
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"));
qmlRegisterUncreatableType<QQuickLayoutMirroringAttached>(uri,major,minor,"LayoutMirroring", QQuickLayoutMirroringAttached::tr("LayoutMirroring is only available via attached properties"));
@@ -228,6 +226,8 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
#ifndef QT_NO_ACCESSIBILITY
qmlRegisterUncreatableType<QQuickAccessibleAttached>("QtQuick", 2, 0, "Accessible",QQuickAccessibleAttached::tr("Accessible is only available via attached properties"));
#endif
+
+ qmlRegisterType<QQuickGrid, 1>(uri, 2, 1, "Grid");
}
void QQuickItemsModule::defineModule()
diff --git a/src/quick/items/qquickitemsmodule_p.h b/src/quick/items/qquickitemsmodule_p.h
index d21f182cc6..bbc7c5c9e2 100644
--- a/src/quick/items/qquickitemsmodule_p.h
+++ b/src/quick/items/qquickitemsmodule_p.h
@@ -44,8 +44,6 @@
#include <qqml.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItemsModule
@@ -56,7 +54,5 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKITEMSMODULE_P_H
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index b73fb8c5b6..198052b939 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -41,6 +41,7 @@
#include "qquickitemview_p_p.h"
#include <QtQuick/private/qquicktransition_p.h>
+#include <QtQml/QQmlInfo>
#include "qplatformdefs.h"
QT_BEGIN_NAMESPACE
@@ -147,14 +148,14 @@ bool QQuickItemViewChangeSet::hasPendingChanges() const
return !pendingChanges.isEmpty();
}
-void QQuickItemViewChangeSet::applyChanges(const QQuickChangeSet &changeSet)
+void QQuickItemViewChangeSet::applyChanges(const QQmlChangeSet &changeSet)
{
pendingChanges.apply(changeSet);
int moveId = -1;
int moveOffset = 0;
- foreach (const QQuickChangeSet::Remove &r, changeSet.removes()) {
+ foreach (const QQmlChangeSet::Remove &r, changeSet.removes()) {
itemCount -= r.count;
if (moveId == -1 && newCurrentIndex >= r.index + r.count) {
newCurrentIndex -= r.count;
@@ -173,7 +174,7 @@ void QQuickItemViewChangeSet::applyChanges(const QQuickChangeSet &changeSet)
currentChanged = true;
}
}
- foreach (const QQuickChangeSet::Insert &i, changeSet.inserts()) {
+ foreach (const QQmlChangeSet::Insert &i, changeSet.inserts()) {
if (moveId == -1) {
if (itemCount && newCurrentIndex >= i.index) {
newCurrentIndex += i.count;
@@ -266,14 +267,14 @@ void QQuickItemView::setModel(const QVariant &model)
if (d->modelVariant == model)
return;
if (d->model) {
- 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*)));
+ disconnect(d->model, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
+ this, SLOT(modelUpdated(QQmlChangeSet,bool)));
+ disconnect(d->model, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)));
+ disconnect(d->model, SIGNAL(createdItem(int,QObject*)), this, SLOT(createdItem(int,QObject*)));
+ disconnect(d->model, SIGNAL(destroyingItem(QObject*)), this, SLOT(destroyingItem(QObject*)));
}
- QQuickVisualModel *oldModel = d->model;
+ QQmlInstanceModel *oldModel = d->model;
d->clear();
d->model = 0;
@@ -281,8 +282,8 @@ void QQuickItemView::setModel(const QVariant &model)
d->modelVariant = model;
QObject *object = qvariant_cast<QObject*>(model);
- QQuickVisualModel *vim = 0;
- if (object && (vim = qobject_cast<QQuickVisualModel *>(object))) {
+ QQmlInstanceModel *vim = 0;
+ if (object && (vim = qobject_cast<QQmlInstanceModel *>(object))) {
if (d->ownModel) {
delete oldModel;
d->ownModel = false;
@@ -290,22 +291,22 @@ void QQuickItemView::setModel(const QVariant &model)
d->model = vim;
} else {
if (!d->ownModel) {
- d->model = new QQuickVisualDataModel(qmlContext(this), this);
+ d->model = new QQmlDelegateModel(qmlContext(this), this);
d->ownModel = true;
if (isComponentComplete())
- static_cast<QQuickVisualDataModel *>(d->model.data())->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
} else {
d->model = oldModel;
}
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
dataModel->setModel(model);
}
if (d->model) {
d->bufferMode = QQuickItemViewPrivate::BufferBefore | QQuickItemViewPrivate::BufferAfter;
- 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*)));
+ connect(d->model, SIGNAL(createdItem(int,QObject*)), this, SLOT(createdItem(int,QObject*)));
+ connect(d->model, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)));
+ connect(d->model, SIGNAL(destroyingItem(QObject*)), this, SLOT(destroyingItem(QObject*)));
if (isComponentComplete()) {
d->updateSectionCriteria();
d->refill();
@@ -319,8 +320,8 @@ void QQuickItemView::setModel(const QVariant &model)
}
}
- connect(d->model, SIGNAL(modelUpdated(QQuickChangeSet,bool)),
- this, SLOT(modelUpdated(QQuickChangeSet,bool)));
+ connect(d->model, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
+ this, SLOT(modelUpdated(QQmlChangeSet,bool)));
emit countChanged();
}
emit modelChanged();
@@ -330,7 +331,7 @@ QQmlComponent *QQuickItemView::delegate() const
{
Q_D(const QQuickItemView);
if (d->model) {
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
return dataModel->delegate();
}
@@ -343,10 +344,10 @@ void QQuickItemView::setDelegate(QQmlComponent *delegate)
if (delegate == this->delegate())
return;
if (!d->ownModel) {
- d->model = new QQuickVisualDataModel(qmlContext(this));
+ d->model = new QQmlDelegateModel(qmlContext(this));
d->ownModel = true;
}
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model)) {
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)) {
int oldCount = dataModel->count();
dataModel->setDelegate(delegate);
if (isComponentComplete()) {
@@ -371,6 +372,7 @@ void QQuickItemView::setDelegate(QQmlComponent *delegate)
emit countChanged();
}
emit delegateChanged();
+ d->delegateValidated = false;
}
@@ -972,7 +974,7 @@ void QQuickItemViewPrivate::applyPendingChanges()
layout();
}
-int QQuickItemViewPrivate::findMoveKeyIndex(QQuickChangeSet::MoveKey key, const QVector<QQuickChangeSet::Remove> &changes) const
+int QQuickItemViewPrivate::findMoveKeyIndex(QQmlChangeSet::MoveKey key, const QVector<QQmlChangeSet::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++) {
@@ -1152,7 +1154,7 @@ void QQuickItemView::destroyRemoved()
d->forceLayoutPolish();
}
-void QQuickItemView::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
+void QQuickItemView::modelUpdated(const QQmlChangeSet &changeSet, bool reset)
{
Q_D(QQuickItemView);
if (reset) {
@@ -1388,7 +1390,7 @@ void QQuickItemView::componentComplete()
{
Q_D(QQuickItemView);
if (d->model && d->ownModel)
- static_cast<QQuickVisualDataModel *>(d->model.data())->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
QQuickFlickable::componentComplete();
@@ -1440,7 +1442,7 @@ QQuickItemViewPrivate::QQuickItemViewPrivate()
, inLayout(false), inViewportMoved(false), forceLayout(false), currentIndexCleared(false)
, haveHighlightRange(false), autoHighlight(true), highlightRangeStartValid(false), highlightRangeEndValid(false)
, fillCacheBuffer(false), inRequest(false)
- , runDelayedRemoveTransition(false)
+ , runDelayedRemoveTransition(false), delegateValidated(false)
{
bufferPause.addAnimationChangeListener(this, QAbstractAnimationJob::Completion);
bufferPause.setLoopCount(1);
@@ -1874,8 +1876,8 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult
totalInsertionResult->visiblePos = prevViewPos;
totalRemovalResult->visiblePos = prevViewPos;
- const QVector<QQuickChangeSet::Remove> &removals = currentChanges.pendingChanges.removes();
- const QVector<QQuickChangeSet::Insert> &insertions = currentChanges.pendingChanges.inserts();
+ const QVector<QQmlChangeSet::Remove> &removals = currentChanges.pendingChanges.removes();
+ const QVector<QQmlChangeSet::Insert> &insertions = currentChanges.pendingChanges.inserts();
ChangeResult insertionResult(prevViewPos);
ChangeResult removalResult(prevViewPos);
@@ -1895,7 +1897,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult
}
}
if (runDelayedRemoveTransition) {
- QQuickChangeSet::Remove removal;
+ QQmlChangeSet::Remove removal;
for (QList<FxViewItem*>::Iterator it = visibleItems.begin(); it != visibleItems.end();) {
FxViewItem *item = *it;
if (item->index == -1 && !item->attached->delayRemove()) {
@@ -1963,7 +1965,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult
// Whatever removed/moved items remain are no longer visible items.
prepareRemoveTransitions(&currentChanges.removedItems);
- for (QHash<QQuickChangeSet::MoveKey, FxViewItem *>::Iterator it = currentChanges.removedItems.begin();
+ for (QHash<QQmlChangeSet::MoveKey, FxViewItem *>::Iterator it = currentChanges.removedItems.begin();
it != currentChanges.removedItems.end(); ++it) {
releaseItem(it.value());
}
@@ -1992,7 +1994,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult
return visibleAffected;
}
-bool QQuickItemViewPrivate::applyRemovalChange(const QQuickChangeSet::Remove &removal, ChangeResult *removeResult, int *removedCount)
+bool QQuickItemViewPrivate::applyRemovalChange(const QQmlChangeSet::Remove &removal, ChangeResult *removeResult, int *removedCount)
{
Q_Q(QQuickItemView);
bool visibleAffected = false;
@@ -2042,7 +2044,7 @@ bool QQuickItemViewPrivate::applyRemovalChange(const QQuickChangeSet::Remove &re
return visibleAffected;
}
-void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQuickChangeSet::Remove &removal, ChangeResult *removeResult)
+void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQmlChangeSet::Remove &removal, ChangeResult *removeResult)
{
if (removeResult->visiblePos.isValid()) {
if (item->position() < removeResult->visiblePos)
@@ -2055,7 +2057,7 @@ void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQuickChangeSet::
item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::MoveTransition, true);
} else {
// track item so it is released later
- currentChanges.removedItems.insertMulti(QQuickChangeSet::MoveKey(), item);
+ currentChanges.removedItems.insertMulti(QQmlChangeSet::MoveKey(), item);
}
if (!removeResult->changedFirstItem && item == *visibleItems.constBegin())
removeResult->changedFirstItem = true;
@@ -2120,14 +2122,14 @@ void QQuickItemViewPrivate::prepareVisibleItemTransitions()
visibleItems[i]->prepareTransition(transitioner, viewBounds);
}
-void QQuickItemViewPrivate::prepareRemoveTransitions(QHash<QQuickChangeSet::MoveKey, FxViewItem *> *removedItems)
+void QQuickItemViewPrivate::prepareRemoveTransitions(QHash<QQmlChangeSet::MoveKey, FxViewItem *> *removedItems)
{
if (!transitioner)
return;
if (transitioner->canTransition(QQuickItemViewTransitioner::RemoveTransition, true)
|| transitioner->canTransition(QQuickItemViewTransitioner::RemoveTransition, false)) {
- for (QHash<QQuickChangeSet::MoveKey, FxViewItem *>::Iterator it = removedItems->begin();
+ for (QHash<QQmlChangeSet::MoveKey, FxViewItem *>::Iterator it = removedItems->begin();
it != removedItems->end(); ) {
bool isRemove = it.key().moveId < 0;
if (isRemove) {
@@ -2197,7 +2199,20 @@ FxViewItem *QQuickItemViewPrivate::createItem(int modelIndex, bool asynchronous)
requestedIndex = modelIndex;
inRequest = true;
- if (QQuickItem *item = model->item(modelIndex, asynchronous)) {
+ QObject* object = model->object(modelIndex, asynchronous);
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
+ if (!item) {
+ if (object) {
+ model->release(object);
+ if (!delegateValidated) {
+ delegateValidated = true;
+ QObject* delegate = q->delegate();
+ qmlInfo(delegate ? delegate : q) << q->tr("Delegate must be of Item type");
+ }
+ }
+ inRequest = false;
+ return 0;
+ } else {
item->setParentItem(q->contentItem());
if (requestedIndex == modelIndex)
requestedIndex = -1;
@@ -2212,15 +2227,13 @@ FxViewItem *QQuickItemViewPrivate::createItem(int modelIndex, bool asynchronous)
inRequest = false;
return viewItem;
}
-
- inRequest = false;
- return 0;
}
-void QQuickItemView::createdItem(int index, QQuickItem *item)
+void QQuickItemView::createdItem(int index, QObject* object)
{
Q_D(QQuickItemView);
+ QQuickItem* item = qmlobject_cast<QQuickItem*>(object);
if (!d->inRequest) {
d->unrequestedItems.insert(item, index);
d->requestedIndex = -1;
@@ -2235,16 +2248,21 @@ void QQuickItemView::createdItem(int index, QQuickItem *item)
}
}
-void QQuickItemView::initItem(int, QQuickItem *item)
+void QQuickItemView::initItem(int, QObject *object)
{
- item->setZ(1);
- item->setParentItem(contentItem());
- QQuickItemPrivate::get(item)->setCulled(true);
+ QQuickItem* item = qmlobject_cast<QQuickItem*>(object);
+ if (item) {
+ item->setZ(1);
+ item->setParentItem(contentItem());
+ QQuickItemPrivate::get(item)->setCulled(true);
+ }
}
-void QQuickItemView::destroyingItem(QQuickItem *item)
+void QQuickItemView::destroyingItem(QObject *object)
{
Q_D(QQuickItemView);
+ QQuickItem* item = qmlobject_cast<QQuickItem*>(object);
+ item->setParentItem(0);
d->unrequestedItems.remove(item);
}
@@ -2257,14 +2275,16 @@ bool QQuickItemViewPrivate::releaseItem(FxViewItem *item)
trackedItem = 0;
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item->item);
itemPrivate->removeItemChangeListener(this, QQuickItemPrivate::Geometry);
- QQuickVisualModel::ReleaseFlags flags = model->release(item->item);
+ QQmlInstanceModel::ReleaseFlags flags = model->release(item->item);
if (flags == 0) {
// item was not destroyed, and we no longer reference it.
QQuickItemPrivate::get(item->item)->setCulled(true);
unrequestedItems.insert(item->item, model->indexOf(item->item, q));
+ } else if (flags & QQmlInstanceModel::Destroyed) {
+ item->item->setParentItem(0);
}
delete item;
- return flags != QQuickVisualModel::Referenced;
+ return flags != QQmlInstanceModel::Referenced;
}
QQuickItem *QQuickItemViewPrivate::createHighlightItem()
diff --git a/src/quick/items/qquickitemview_p.h b/src/quick/items/qquickitemview_p.h
index 82180a2e13..b0f910680a 100644
--- a/src/quick/items/qquickitemview_p.h
+++ b/src/quick/items/qquickitemview_p.h
@@ -44,11 +44,9 @@
#include "qquickflickable_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-class QQuickChangeSet;
+class QQmlChangeSet;
class QQuickItemViewPrivate;
@@ -257,10 +255,10 @@ protected:
protected slots:
void destroyRemoved();
- void createdItem(int index, QQuickItem *item);
- virtual void initItem(int index, QQuickItem *item);
- void modelUpdated(const QQuickChangeSet &changeSet, bool reset);
- void destroyingItem(QQuickItem *item);
+ void createdItem(int index, QObject *item);
+ virtual void initItem(int index, QObject *item);
+ void modelUpdated(const QQmlChangeSet &changeSet, bool reset);
+ void destroyingItem(QObject *item);
void animStopped();
void trackedPositionChanged();
@@ -352,7 +350,5 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKITEMVIEW_P_H
diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h
index 0efc458c3d..1fa933ebd1 100644
--- a/src/quick/items/qquickitemview_p_p.h
+++ b/src/quick/items/qquickitemview_p_p.h
@@ -45,13 +45,11 @@
#include "qquickitemview_p.h"
#include "qquickitemviewtransition_p.h"
#include "qquickflickable_p_p.h"
-#include "qquickvisualdatamodel_p.h"
-#include "qquickvisualitemmodel_p.h"
-#include <private/qquickchangeset_p.h>
+#include <QtQml/private/qqmlobjectmodel_p.h>
+#include <QtQml/private/qqmldelegatemodel_p.h>
+#include <QtQml/private/qqmlchangeset_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -103,14 +101,14 @@ public:
void prepare(int currentIndex, int count);
void reset();
- void applyChanges(const QQuickChangeSet &changeSet);
+ void applyChanges(const QQmlChangeSet &changeSet);
void applyBufferedChanges(const QQuickItemViewChangeSet &other);
int itemCount;
int newCurrentIndex;
- QQuickChangeSet pendingChanges;
- QHash<QQuickChangeSet::MoveKey, FxViewItem *> removedItems;
+ QQmlChangeSet pendingChanges;
+ QHash<QQmlChangeSet::MoveKey, FxViewItem *> removedItems;
bool active : 1;
bool currentChanged : 1;
@@ -209,18 +207,18 @@ public:
void applyPendingChanges();
bool applyModelChanges(ChangeResult *insertionResult, ChangeResult *removalResult);
- bool applyRemovalChange(const QQuickChangeSet::Remove &removal, ChangeResult *changeResult, int *removedCount);
- void removeItem(FxViewItem *item, const QQuickChangeSet::Remove &removal, ChangeResult *removeResult);
+ bool applyRemovalChange(const QQmlChangeSet::Remove &removal, ChangeResult *changeResult, int *removedCount);
+ void removeItem(FxViewItem *item, const QQmlChangeSet::Remove &removal, ChangeResult *removeResult);
void repositionFirstItem(FxViewItem *prevVisibleItemsFirst, qreal prevVisibleItemsFirstPos,
FxViewItem *prevFirstVisible, ChangeResult *insertionResult, ChangeResult *removalResult);
void createTransitioner();
void prepareVisibleItemTransitions();
- void prepareRemoveTransitions(QHash<QQuickChangeSet::MoveKey, FxViewItem *> *removedItems);
+ void prepareRemoveTransitions(QHash<QQmlChangeSet::MoveKey, FxViewItem *> *removedItems);
bool prepareNonVisibleItemTransition(FxViewItem *item, const QRectF &viewBounds);
virtual void viewItemTransitionFinished(QQuickItemViewTransitionableItem *item);
- int findMoveKeyIndex(QQuickChangeSet::MoveKey key, const QVector<QQuickChangeSet::Remove> &changes) const;
+ int findMoveKeyIndex(QQmlChangeSet::MoveKey key, const QVector<QQmlChangeSet::Remove> &changes) const;
void checkVisible() const;
void showVisibleItems() const;
@@ -251,7 +249,7 @@ public:
q->polish();
}
- QQmlGuard<QQuickVisualModel> model;
+ QQmlGuard<QQmlInstanceModel> model;
QVariant modelVariant;
int itemCount;
int buffer;
@@ -286,8 +284,8 @@ public:
struct MovedItem {
FxViewItem *item;
- QQuickChangeSet::MoveKey moveKey;
- MovedItem(FxViewItem *i, QQuickChangeSet::MoveKey k)
+ QQmlChangeSet::MoveKey moveKey;
+ MovedItem(FxViewItem *i, QQmlChangeSet::MoveKey k)
: item(i), moveKey(k) {}
};
QQuickItemViewTransitioner *transitioner;
@@ -309,6 +307,7 @@ public:
bool fillCacheBuffer : 1;
bool inRequest : 1;
bool runDelayedRemoveTransition : 1;
+ bool delegateValidated : 1;
protected:
virtual Qt::Orientation layoutOrientation() const = 0;
@@ -346,7 +345,7 @@ protected:
virtual void layoutVisibleItems(int fromModelIndex = 0) = 0;
virtual void changedVisibleIndex(int newIndex) = 0;
- virtual bool applyInsertionChange(const QQuickChangeSet::Insert &insert, ChangeResult *changeResult,
+ virtual bool applyInsertionChange(const QQmlChangeSet::Insert &insert, ChangeResult *changeResult,
QList<FxViewItem *> *newItems, QList<MovedItem> *movingIntoView) = 0;
virtual bool needsRefillForAddedOrRemovedIndex(int) const { return false; }
@@ -363,6 +362,4 @@ protected:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKITEMVIEW_P_P_H
diff --git a/src/quick/items/qquickitemviewtransition_p.h b/src/quick/items/qquickitemviewtransition_p.h
index 2667971fd7..4fb4386c57 100644
--- a/src/quick/items/qquickitemviewtransition_p.h
+++ b/src/quick/items/qquickitemviewtransition_p.h
@@ -44,8 +44,6 @@
#include <private/qquicktransitionmanager_p_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItem;
@@ -211,6 +209,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickViewTransitionAttached)
QML_DECLARE_TYPEINFO(QQuickViewTransitionAttached, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
-
#endif // QQUICKITEMVIEWTRANSITION_P_P_H
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 63528ff702..53dc715469 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -41,8 +41,8 @@
#include "qquicklistview_p.h"
#include "qquickitemview_p_p.h"
-#include "qquickvisualitemmodel_p.h"
+#include <private/qqmlobjectmodel_p.h>
#include <QtQml/qqmlexpression.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlinfo.h>
@@ -106,7 +106,7 @@ public:
virtual void setPosition(qreal pos);
virtual void layoutVisibleItems(int fromModelIndex = 0);
- virtual bool applyInsertionChange(const QQuickChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView);
+ virtual bool applyInsertionChange(const QQmlChangeSet::Insert &insert, ChangeResult *changeResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView);
virtual void translateAndTransitionItemsAfter(int afterIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult);
virtual void updateSectionCriteria();
@@ -2805,13 +2805,16 @@ void QQuickListView::geometryChanged(const QRectF &newGeometry, const QRectF &ol
QQuickItemView::geometryChanged(newGeometry, oldGeometry);
}
-void QQuickListView::initItem(int index, QQuickItem *item)
+void QQuickListView::initItem(int index, QObject *object)
{
- QQuickItemView::initItem(index, item);
- QQuickListViewAttached *attached = static_cast<QQuickListViewAttached *>(
- qmlAttachedPropertiesObject<QQuickListView>(item));
- if (attached)
- attached->setView(this);
+ QQuickItemView::initItem(index, object);
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
+ if (item) {
+ QQuickListViewAttached *attached = static_cast<QQuickListViewAttached *>(
+ qmlAttachedPropertiesObject<QQuickListView>(item));
+ if (attached)
+ attached->setView(this);
+ }
}
@@ -2869,7 +2872,7 @@ void QQuickListViewPrivate::updateSectionCriteria()
}
}
-bool QQuickListViewPrivate::applyInsertionChange(const QQuickChangeSet::Insert &change, ChangeResult *insertResult, QList<FxViewItem *> *addedItems, QList<MovedItem> *movingIntoView)
+bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::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 f6c405e86b..3e766f8068 100644
--- a/src/quick/items/qquicklistview_p.h
+++ b/src/quick/items/qquicklistview_p.h
@@ -46,8 +46,6 @@
#include <private/qqmlguard_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickListView;
@@ -96,7 +94,7 @@ private:
};
-class QQuickVisualModel;
+class QQmlInstanceModel;
class QQuickListViewAttached;
class Q_AUTOTEST_EXPORT QQuickListView : public QQuickItemView
{
@@ -169,7 +167,7 @@ protected:
virtual void viewportMoved(Qt::Orientations orient);
virtual void keyPressEvent(QKeyEvent *);
virtual void geometryChanged(const QRectF &newGeometry,const QRectF &oldGeometry);
- virtual void initItem(int index, QQuickItem *item);
+ virtual void initItem(int index, QObject *item);
};
class QQuickListViewAttached : public QQuickItemViewAttached
@@ -205,6 +203,4 @@ QML_DECLARE_TYPEINFO(QQuickListView, QML_HAS_ATTACHED_PROPERTIES)
QML_DECLARE_TYPE(QQuickListView)
QML_DECLARE_TYPE(QQuickViewSection)
-QT_END_HEADER
-
#endif // QQUICKLISTVIEW_P_H
diff --git a/src/quick/items/qquickloader_p.h b/src/quick/items/qquickloader_p.h
index ebf9e16c1e..6a69ccd32f 100644
--- a/src/quick/items/qquickloader_p.h
+++ b/src/quick/items/qquickloader_p.h
@@ -44,8 +44,6 @@
#include "qquickimplicitsizeitem_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickLoaderPrivate;
@@ -115,6 +113,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickLoader)
-QT_END_HEADER
-
#endif // QQUICKLOADER_P_H
diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h
index eb49535d95..ad15167b10 100644
--- a/src/quick/items/qquickmousearea_p.h
+++ b/src/quick/items/qquickmousearea_p.h
@@ -46,8 +46,6 @@
#include <private/qtquickglobal_p.h>
#include <QtCore/qstringlist.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickMouseEvent;
@@ -252,6 +250,4 @@ QML_DECLARE_TYPEINFO(QQuickDrag, QML_HAS_ATTACHED_PROPERTIES)
#endif
QML_DECLARE_TYPE(QQuickMouseArea)
-QT_END_HEADER
-
#endif // QQUICKMOUSEAREA_P_H
diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h
index 1ab934e06d..e2ae5ed24e 100644
--- a/src/quick/items/qquickmultipointtoucharea_p.h
+++ b/src/quick/items/qquickmultipointtoucharea_p.h
@@ -50,8 +50,6 @@
#include <QtGui/qguiapplication.h>
#include <QtGui/qstylehints.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickMultiPointTouchArea;
@@ -271,6 +269,4 @@ QML_DECLARE_TYPE(QQuickTouchPoint)
QML_DECLARE_TYPE(QQuickGrabGestureEvent)
QML_DECLARE_TYPE(QQuickMultiPointTouchArea)
-QT_END_HEADER
-
#endif // QQUICKMULTIPOINTTOUCHAREA_H
diff --git a/src/quick/items/qquickpainteditem.h b/src/quick/items/qquickpainteditem.h
index d2d7a54467..88924003b8 100644
--- a/src/quick/items/qquickpainteditem.h
+++ b/src/quick/items/qquickpainteditem.h
@@ -45,8 +45,6 @@
#include <QtQuick/qquickitem.h>
#include <QtGui/qcolor.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickPaintedItemPrivate;
@@ -125,6 +123,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPaintedItem::PerformanceHints)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKPAINTEDITEM_P_H
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index a7be50bc11..e9aa6985fc 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -46,8 +46,9 @@
#include <QtQuick/private/qquickstate_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlopenmetaobject_p.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmlchangeset_p.h>
+#include <QtQml/qqmlinfo.h>
#include <QtGui/qevent.h>
#include <QtGui/qevent.h>
#include <QtGui/qguiapplication.h>
@@ -117,7 +118,7 @@ QQuickPathViewPrivate::QQuickPathViewPrivate()
, offset(0.0), offsetAdj(0.0), mappedRange(1.0), mappedCache(0.0)
, stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true)
, autoHighlight(true), highlightUp(false), layoutScheduled(false)
- , moving(false), flicking(false), dragging(false), inRequest(false)
+ , moving(false), flicking(false), dragging(false), inRequest(false), delegateValidated(false)
, dragMargin(0), deceleration(100), maximumFlickVelocity(QML_FLICK_DEFAULTMAXVELOCITY)
, moveOffset(this, &QQuickPathViewPrivate::setAdjustedOffset), flickDuration(0)
, firstIndex(-1), pathItems(-1), requestedIndex(-1), cacheSize(0), requestedZ(0)
@@ -150,8 +151,18 @@ QQuickItem *QQuickPathViewPrivate::getItem(int modelIndex, qreal z, bool async)
requestedIndex = modelIndex;
requestedZ = z;
inRequest = true;
- QQuickItem *item = model->item(modelIndex, async);
- if (item) {
+ QObject *object = model->object(modelIndex, async);
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
+ if (!item) {
+ if (object) {
+ model->release(object);
+ if (!delegateValidated) {
+ delegateValidated = true;
+ QObject* delegate = q->delegate();
+ qmlInfo(delegate ? delegate : q) << q->tr("Delegate must be of Item type");
+ }
+ }
+ } else {
item->setParentItem(q);
requestedIndex = -1;
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
@@ -161,9 +172,10 @@ QQuickItem *QQuickPathViewPrivate::getItem(int modelIndex, qreal z, bool async)
return item;
}
-void QQuickPathView::createdItem(int index, QQuickItem *item)
+void QQuickPathView::createdItem(int index, QObject *object)
{
Q_D(QQuickPathView);
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
if (d->requestedIndex != index) {
qPathViewAttachedType = d->attachedType();
QQuickPathViewAttached *att = static_cast<QQuickPathViewAttached *>(qmlAttachedPropertiesObject<QQuickPathView>(item));
@@ -181,10 +193,11 @@ void QQuickPathView::createdItem(int index, QQuickItem *item)
}
}
-void QQuickPathView::initItem(int index, QQuickItem *item)
+void QQuickPathView::initItem(int index, QObject *object)
{
Q_D(QQuickPathView);
- if (d->requestedIndex == index) {
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
+ if (item && d->requestedIndex == index) {
QQuickItemPrivate::get(item)->setCulled(true);
item->setParentItem(this);
qPathViewAttachedType = d->attachedType();
@@ -209,10 +222,14 @@ void QQuickPathViewPrivate::releaseItem(QQuickItem *item)
return;
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
itemPrivate->removeItemChangeListener(this, QQuickItemPrivate::Geometry);
- if (model->release(item) == 0) {
+ QQmlInstanceModel::ReleaseFlags flags = model->release(item);
+ if (!flags) {
// item was not destroyed, and we no longer reference it.
if (QQuickPathViewAttached *att = attached(item))
att->setOnPath(false);
+ } else if (flags & QQmlInstanceModel::Destroyed) {
+ // but we still reference it
+ item->setParentItem(0);
}
}
@@ -619,19 +636,19 @@ void QQuickPathView::setModel(const QVariant &model)
return;
if (d->model) {
- qmlobject_disconnect(d->model, QQuickVisualModel, SIGNAL(modelUpdated(QQuickChangeSet,bool)),
- this, QQuickPathView, SLOT(modelUpdated(QQuickChangeSet,bool)));
- qmlobject_disconnect(d->model, QQuickVisualModel, SIGNAL(createdItem(int,QQuickItem*)),
- this, QQuickPathView, SLOT(createdItem(int,QQuickItem*)));
- qmlobject_disconnect(d->model, QQuickVisualModel, SIGNAL(initItem(int,QQuickItem*)),
- this, QQuickPathView, SLOT(initItem(int,QQuickItem*)));
+ qmlobject_disconnect(d->model, QQmlInstanceModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
+ this, QQuickPathView, SLOT(modelUpdated(QQmlChangeSet,bool)));
+ qmlobject_disconnect(d->model, QQmlInstanceModel, SIGNAL(createdItem(int,QObject*)),
+ this, QQuickPathView, SLOT(createdItem(int,QObject*)));
+ qmlobject_disconnect(d->model, QQmlInstanceModel, SIGNAL(initItem(int,QObject*)),
+ this, QQuickPathView, SLOT(initItem(int,QObject*)));
d->clear();
}
d->modelVariant = model;
QObject *object = qvariant_cast<QObject*>(model);
- QQuickVisualModel *vim = 0;
- if (object && (vim = qobject_cast<QQuickVisualModel *>(object))) {
+ QQmlInstanceModel *vim = 0;
+ if (object && (vim = qobject_cast<QQmlInstanceModel *>(object))) {
if (d->ownModel) {
delete d->model;
d->ownModel = false;
@@ -639,23 +656,23 @@ void QQuickPathView::setModel(const QVariant &model)
d->model = vim;
} else {
if (!d->ownModel) {
- d->model = new QQuickVisualDataModel(qmlContext(this));
+ d->model = new QQmlDelegateModel(qmlContext(this));
d->ownModel = true;
if (isComponentComplete())
- static_cast<QQuickVisualDataModel *>(d->model.data())->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
}
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
dataModel->setModel(model);
}
int oldModelCount = d->modelCount;
d->modelCount = 0;
if (d->model) {
- qmlobject_connect(d->model, QQuickVisualModel, SIGNAL(modelUpdated(QQuickChangeSet,bool)),
- this, QQuickPathView, SLOT(modelUpdated(QQuickChangeSet,bool)));
- qmlobject_connect(d->model, QQuickVisualModel, SIGNAL(createdItem(int,QQuickItem*)),
- this, QQuickPathView, SLOT(createdItem(int,QQuickItem*)));
- qmlobject_connect(d->model, QQuickVisualModel, SIGNAL(initItem(int,QQuickItem*)),
- this, QQuickPathView, SLOT(initItem(int,QQuickItem*)));
+ qmlobject_connect(d->model, QQmlInstanceModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
+ this, QQuickPathView, SLOT(modelUpdated(QQmlChangeSet,bool)));
+ qmlobject_connect(d->model, QQmlInstanceModel, SIGNAL(createdItem(int,QObject*)),
+ this, QQuickPathView, SLOT(createdItem(int,QObject*)));
+ qmlobject_connect(d->model, QQmlInstanceModel, SIGNAL(initItem(int,QObject*)),
+ this, QQuickPathView, SLOT(initItem(int,QObject*)));
d->modelCount = d->model->count();
}
if (isComponentComplete()) {
@@ -1210,7 +1227,7 @@ QQmlComponent *QQuickPathView::delegate() const
{
Q_D(const QQuickPathView);
if (d->model) {
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
return dataModel->delegate();
}
@@ -1223,10 +1240,10 @@ void QQuickPathView::setDelegate(QQmlComponent *delegate)
if (delegate == this->delegate())
return;
if (!d->ownModel) {
- d->model = new QQuickVisualDataModel(qmlContext(this));
+ d->model = new QQmlDelegateModel(qmlContext(this));
d->ownModel = true;
}
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model)) {
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)) {
int oldCount = dataModel->count();
dataModel->setDelegate(delegate);
d->modelCount = dataModel->count();
@@ -1234,6 +1251,7 @@ void QQuickPathView::setDelegate(QQmlComponent *delegate)
if (oldCount != dataModel->count())
emit countChanged();
emit delegateChanged();
+ d->delegateValidated = false;
}
}
@@ -1821,7 +1839,7 @@ void QQuickPathView::componentComplete()
{
Q_D(QQuickPathView);
if (d->model && d->ownModel)
- static_cast<QQuickVisualDataModel *>(d->model.data())->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
QQuickItem::componentComplete();
@@ -1983,7 +2001,7 @@ void QQuickPathView::refill()
d->releaseItem(d->itemCache.takeLast());
}
-void QQuickPathView::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
+void QQuickPathView::modelUpdated(const QQmlChangeSet &changeSet, bool reset)
{
Q_D(QQuickPathView);
if (!d->model || !d->model->isValid() || !d->path || !isComponentComplete())
@@ -2004,7 +2022,7 @@ void QQuickPathView::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
int moveOffset;
bool currentChanged = false;
bool changedOffset = false;
- foreach (const QQuickChangeSet::Remove &r, changeSet.removes()) {
+ foreach (const QQmlChangeSet::Remove &r, changeSet.removes()) {
if (moveId == -1 && d->currentIndex >= r.index + r.count) {
d->currentIndex -= r.count;
currentChanged = true;
@@ -2030,7 +2048,7 @@ void QQuickPathView::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
}
d->modelCount -= r.count;
}
- foreach (const QQuickChangeSet::Insert &i, changeSet.inserts()) {
+ foreach (const QQmlChangeSet::Insert &i, changeSet.inserts()) {
if (d->modelCount) {
if (moveId == -1 && i.index <= d->currentIndex) {
d->currentIndex += i.count;
@@ -2082,7 +2100,7 @@ void QQuickPathView::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
emit countChanged();
}
-void QQuickPathView::destroyingItem(QQuickItem *item)
+void QQuickPathView::destroyingItem(QObject *item)
{
Q_UNUSED(item);
}
diff --git a/src/quick/items/qquickpathview_p.h b/src/quick/items/qquickpathview_p.h
index 9cb6b881a0..998707aa41 100644
--- a/src/quick/items/qquickpathview_p.h
+++ b/src/quick/items/qquickpathview_p.h
@@ -46,11 +46,9 @@
#include <private/qquickpath_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-class QQuickChangeSet;
+class QQmlChangeSet;
class QQuickPathViewPrivate;
class QQuickPathViewAttached;
@@ -216,10 +214,10 @@ private Q_SLOTS:
void refill();
void ticked();
void movementEnding();
- void modelUpdated(const QQuickChangeSet &changeSet, bool reset);
- void createdItem(int index, QQuickItem *item);
- void initItem(int index, QQuickItem *item);
- void destroyingItem(QQuickItem *item);
+ void modelUpdated(const QQmlChangeSet &changeSet, bool reset);
+ void createdItem(int index, QObject *item);
+ void initItem(int index, QObject *item);
+ void destroyingItem(QObject *item);
void pathUpdated();
private:
@@ -281,6 +279,5 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickPathView)
QML_DECLARE_TYPEINFO(QQuickPathView, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
#endif // QQUICKPATHVIEW_P_H
diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h
index 9f504db22f..26533057d1 100644
--- a/src/quick/items/qquickpathview_p_p.h
+++ b/src/quick/items/qquickpathview_p_p.h
@@ -55,7 +55,6 @@
#include "qquickpathview_p.h"
#include "qquickitem_p.h"
-#include "qquickvisualdatamodel_p.h"
#include <QtQml/qqml.h>
#include <QtCore/qdatetime.h>
@@ -63,6 +62,7 @@
#include <private/qquickanimation_p_p.h>
#include <private/qqmlguard_p.h>
+#include <private/qqmldelegatemodel_p.h>
#include <private/qquicktimeline_p_p.h>
QT_BEGIN_NAMESPACE
@@ -152,6 +152,7 @@ public:
bool dragging : 1;
bool requestedOnPath : 1;
bool inRequest : 1;
+ bool delegateValidated : 1;
QElapsedTimer timer;
qint64 lastPosTime;
QPointF lastPos;
@@ -168,7 +169,7 @@ public:
qreal requestedZ;
QList<QQuickItem *> items;
QList<QQuickItem *> itemCache;
- QQmlGuard<QQuickVisualModel> model;
+ QQmlGuard<QQmlInstanceModel> model;
QVariant modelVariant;
enum MovementReason { Other, SetIndex, Mouse };
MovementReason moveReason;
diff --git a/src/quick/items/qquickpincharea_p.h b/src/quick/items/qquickpincharea_p.h
index 2f22b4e4a7..4fc77d7f9c 100644
--- a/src/quick/items/qquickpincharea_p.h
+++ b/src/quick/items/qquickpincharea_p.h
@@ -44,8 +44,6 @@
#include "qquickitem.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QQuickPinch : public QObject
@@ -301,7 +299,5 @@ QML_DECLARE_TYPE(QQuickPinch)
QML_DECLARE_TYPE(QQuickPinchEvent)
QML_DECLARE_TYPE(QQuickPinchArea)
-QT_END_HEADER
-
#endif // QQUICKPINCHAREA_H
diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp
index 2b03ed2dc4..df80e77bfa 100644
--- a/src/quick/items/qquickpositioners.cpp
+++ b/src/quick/items/qquickpositioners.cpp
@@ -1102,6 +1102,8 @@ QQuickGrid::QQuickGrid(QQuickItem *parent)
, m_useRowSpacing(false)
, m_useColumnSpacing(false)
, m_flow(LeftToRight)
+ , m_hItemAlign(AlignLeft)
+ , m_vItemAlign(AlignTop)
{
}
@@ -1248,6 +1250,7 @@ void QQuickGrid::setLayoutDirection(Qt::LayoutDirection layoutDirection)
prePositioning();
emit layoutDirectionChanged();
emit effectiveLayoutDirectionChanged();
+ emit effectiveHorizontalAlignmentChanged(effectiveHAlign());
}
}
@@ -1266,6 +1269,97 @@ Qt::LayoutDirection QQuickGrid::effectiveLayoutDirection() const
return QQuickBasePositionerPrivate::getEffectiveLayoutDirection(this);
}
+/*!
+ \qmlproperty enumeration QtQuick2::Grid::horizontalItmeAlignment
+ \qmlproperty enumeration QtQuick2::Grid::verticalItemAlignment
+ \qmlproperty enumeration QtQuick2::Grid::effectiveHorizontalItemAlignment
+
+ Sets the horizontal and vertical alignment of items in the Grid. By default,
+ the items are vertically aligned to the top. Horizontal
+ alignment follows the layoutDirection of the Grid, for example when having a layoutDirection
+ from LeftToRight, the items will be aligned on the left.
+
+ The valid values for \c horizontalItemAlignment are, \c Grid.AlignLeft, \c Grid.AlignRight and
+ \c Grid.AlignHCenter.
+
+ The valid values for \c verticalItemAlignment are \c Grid.AlignTop, \c Grid.AlignBottom
+ and \c Grid.AlignVCenter.
+
+ The below images show three examples of how to align items.
+
+ \table
+ \row
+ \li
+ \li \inlineimage gridLayout_aligntopleft.png
+ \li \inlineimage gridLayout_aligntop.png
+ \li \inlineimage gridLayout_aligncenter.png
+ \row
+ \li Horizontal alignment
+ \li AlignLeft
+ \li AlignHCenter
+ \li AlignHCenter
+ \row
+ \li Vertical alignment
+ \li AlignTop
+ \li AlignTop
+ \li AlignVCenter
+ \endtable
+
+
+ When mirroring the layout using either the attached property LayoutMirroring::enabled or
+ by setting the layoutDirection, the horizontal alignment of items will be mirrored as well.
+ However, the property \c horizontalItemAlignment will remain unchanged.
+ To query the effective horizontal alignment of items, use the read-only property
+ \c effectiveHorizontalItemAlignment.
+
+ \sa Grid::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+QQuickGrid::HAlignment QQuickGrid::hItemAlign() const
+{
+ return m_hItemAlign;
+}
+void QQuickGrid::setHItemAlign(HAlignment align)
+{
+ if (m_hItemAlign != align) {
+ m_hItemAlign = align;
+ prePositioning();
+ emit horizontalAlignmentChanged(align);
+ emit effectiveHorizontalAlignmentChanged(effectiveHAlign());
+ }
+}
+
+QQuickGrid::HAlignment QQuickGrid::effectiveHAlign() const
+{
+ HAlignment effectiveAlignment = m_hItemAlign;
+ if (effectiveLayoutDirection() == Qt::RightToLeft) {
+ switch (hItemAlign()) {
+ case AlignLeft:
+ effectiveAlignment = AlignRight;
+ break;
+ case AlignRight:
+ effectiveAlignment = AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+
+QQuickGrid::VAlignment QQuickGrid::vItemAlign() const
+{
+ return m_vItemAlign;
+}
+void QQuickGrid::setVItemAlign(VAlignment align)
+{
+ if (m_vItemAlign != align) {
+ m_vItemAlign = align;
+ prePositioning();
+ emit verticalAlignmentChanged(align);
+ }
+}
+
void QQuickGrid::doPositioning(QSizeF *contentSize)
{
//Precondition: All items in the positioned list have a valid item pointer and should be positioned
@@ -1362,9 +1456,22 @@ void QQuickGrid::doPositioning(QSizeF *contentSize)
for (int i = 0; i < positionedItems.count(); ++i) {
PositionedItem &child = positionedItems[i];
qreal childXOffset = xoffset;
+
+ if (effectiveHAlign() == AlignRight)
+ childXOffset += maxColWidth[curCol] - child.item->width();
+ else if (hItemAlign() == AlignHCenter)
+ childXOffset += (maxColWidth[curCol] - child.item->width())/2.0;
+
if (!d->isLeftToRight())
- childXOffset -= child.item->width();
- positionItem(childXOffset, yoffset, &child);
+ childXOffset -= maxColWidth[curCol];
+
+ qreal alignYOffset = yoffset;
+ if (m_vItemAlign == AlignVCenter)
+ alignYOffset += (maxRowHeight[curRow] - child.item->height())/2.0;
+ else if (m_vItemAlign == AlignBottom)
+ alignYOffset += maxRowHeight[curRow] - child.item->height();
+
+ positionItem(childXOffset, alignYOffset, &child);
if (m_flow == LeftToRight) {
if (d->isLeftToRight())
diff --git a/src/quick/items/qquickpositioners_p.h b/src/quick/items/qquickpositioners_p.h
index 784efea510..1ff5a7a74c 100644
--- a/src/quick/items/qquickpositioners_p.h
+++ b/src/quick/items/qquickpositioners_p.h
@@ -51,8 +51,6 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickBasePositionerPrivate;
@@ -222,6 +220,9 @@ class Q_AUTOTEST_EXPORT QQuickGrid : public QQuickBasePositioner
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged)
Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged)
+ Q_PROPERTY(HAlignment horizontalItemAlignment READ hItemAlign WRITE setHItemAlign NOTIFY horizontalAlignmentChanged REVISION 1)
+ Q_PROPERTY(HAlignment effectiveHorizontalItemAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
+ Q_PROPERTY(VAlignment verticalItemAlignment READ vItemAlign WRITE setVItemAlign NOTIFY verticalAlignmentChanged REVISION 1)
public:
QQuickGrid(QQuickItem *parent=0);
@@ -249,6 +250,22 @@ public:
void setLayoutDirection (Qt::LayoutDirection);
Qt::LayoutDirection effectiveLayoutDirection() const;
+ Q_ENUMS(HAlignment)
+ Q_ENUMS(VAlignment)
+ enum HAlignment { AlignLeft = Qt::AlignLeft,
+ AlignRight = Qt::AlignRight,
+ AlignHCenter = Qt::AlignHCenter};
+ enum VAlignment { AlignTop = Qt::AlignTop,
+ AlignBottom = Qt::AlignBottom,
+ AlignVCenter = Qt::AlignVCenter };
+
+ HAlignment hItemAlign() const;
+ void setHItemAlign(HAlignment align);
+ HAlignment effectiveHAlign() const;
+
+ VAlignment vItemAlign() const;
+ void setVItemAlign(VAlignment align);
+
Q_SIGNALS:
void rowsChanged();
void columnsChanged();
@@ -257,6 +274,9 @@ Q_SIGNALS:
void effectiveLayoutDirectionChanged();
void rowSpacingChanged();
void columnSpacingChanged();
+ Q_REVISION(1) void horizontalAlignmentChanged(HAlignment alignment);
+ Q_REVISION(1) void effectiveHorizontalAlignmentChanged(HAlignment alignment);
+ Q_REVISION(1) void verticalAlignmentChanged(VAlignment alignment);
protected:
virtual void doPositioning(QSizeF *contentSize);
@@ -270,6 +290,8 @@ private:
bool m_useRowSpacing;
bool m_useColumnSpacing;
Flow m_flow;
+ HAlignment m_hItemAlign;
+ VAlignment m_vItemAlign;
Q_DISABLE_COPY(QQuickGrid)
};
@@ -318,6 +340,4 @@ QML_DECLARE_TYPE(QQuickFlow)
QML_DECLARE_TYPE(QQuickBasePositioner)
QML_DECLARE_TYPEINFO(QQuickBasePositioner, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
-
#endif // QQUICKPOSITIONERS_P_H
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index 2a8c1a3bb9..3c3bd8897b 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -475,7 +475,7 @@ QSGNode *QQuickRectangle::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
}
rectangle->setRadius(d->radius);
- rectangle->setAntialiasing(d->antialiasing);
+ rectangle->setAntialiasing(d->antialiasing || d->radius > 0);
QGradientStops stops;
if (d->gradient) {
diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h
index 911c3fdf8b..2ad144aafd 100644
--- a/src/quick/items/qquickrectangle_p.h
+++ b/src/quick/items/qquickrectangle_p.h
@@ -48,8 +48,6 @@
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QQuickPen : public QObject
@@ -178,6 +176,4 @@ QML_DECLARE_TYPE(QQuickGradientStop)
QML_DECLARE_TYPE(QQuickGradient)
QML_DECLARE_TYPE(QQuickRectangle)
-QT_END_HEADER
-
#endif // QQUICKRECTANGLE_P_H
diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp
index 4c43b4bf72..35e37d1246 100644
--- a/src/quick/items/qquickrepeater.cpp
+++ b/src/quick/items/qquickrepeater.cpp
@@ -41,16 +41,18 @@
#include "qquickrepeater_p.h"
#include "qquickrepeater_p_p.h"
-#include "qquickvisualdatamodel_p.h"
#include <private/qqmlglobal_p.h>
-#include <private/qquicklistaccessor_p.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmllistaccessor_p.h>
+#include <private/qqmlchangeset_p.h>
+#include <private/qqmldelegatemodel_p.h>
+
+#include <QtQml/QQmlInfo>
QT_BEGIN_NAMESPACE
QQuickRepeaterPrivate::QQuickRepeaterPrivate()
- : model(0), ownModel(false), inRequest(false), dataSourceIsObject(false), itemCount(0), createFrom(-1)
+ : model(0), ownModel(false), inRequest(false), dataSourceIsObject(false), delegateValidated(false), itemCount(0), createFrom(-1)
{
}
@@ -193,18 +195,18 @@ void QQuickRepeater::setModel(const QVariant &model)
clear();
if (d->model) {
- 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*)));
+ disconnect(d->model, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
+ this, SLOT(modelUpdated(QQmlChangeSet,bool)));
+ disconnect(d->model, SIGNAL(createdItem(int,QObject*)), this, SLOT(createdItem(int,QObject*)));
+ disconnect(d->model, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)));
+// disconnect(d->model, SIGNAL(destroyingItem(QObject*)), this, SLOT(destroyingItem(QObject*)));
}
d->dataSource = model;
QObject *object = qvariant_cast<QObject*>(model);
d->dataSourceAsObject = object;
d->dataSourceIsObject = object != 0;
- QQuickVisualModel *vim = 0;
- if (object && (vim = qobject_cast<QQuickVisualModel *>(object))) {
+ QQmlInstanceModel *vim = 0;
+ if (object && (vim = qobject_cast<QQmlInstanceModel *>(object))) {
if (d->ownModel) {
delete d->model;
d->ownModel = false;
@@ -212,20 +214,20 @@ void QQuickRepeater::setModel(const QVariant &model)
d->model = vim;
} else {
if (!d->ownModel) {
- d->model = new QQuickVisualDataModel(qmlContext(this));
+ d->model = new QQmlDelegateModel(qmlContext(this));
d->ownModel = true;
if (isComponentComplete())
- static_cast<QQuickVisualDataModel *>(d->model)->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model)->componentComplete();
}
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
dataModel->setModel(model);
}
if (d->model) {
- 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*)));
+ connect(d->model, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
+ this, SLOT(modelUpdated(QQmlChangeSet,bool)));
+ connect(d->model, SIGNAL(createdItem(int,QObject*)), this, SLOT(createdItem(int,QObject*)));
+ connect(d->model, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)));
+// connect(d->model, SIGNAL(destroyingItem(QObject*)), this, SLOT(destroyingItem(QObject*)));
regenerate();
}
emit modelChanged();
@@ -269,7 +271,7 @@ QQmlComponent *QQuickRepeater::delegate() const
{
Q_D(const QQuickRepeater);
if (d->model) {
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
return dataModel->delegate();
}
@@ -279,18 +281,20 @@ QQmlComponent *QQuickRepeater::delegate() const
void QQuickRepeater::setDelegate(QQmlComponent *delegate)
{
Q_D(QQuickRepeater);
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
if (delegate == dataModel->delegate())
return;
if (!d->ownModel) {
- d->model = new QQuickVisualDataModel(qmlContext(this));
+ d->model = new QQmlDelegateModel(qmlContext(this));
d->ownModel = true;
}
- if (QQuickVisualDataModel *dataModel = qobject_cast<QQuickVisualDataModel*>(d->model)) {
+
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model)) {
dataModel->setDelegate(delegate);
regenerate();
emit delegateChanged();
+ d->delegateValidated = false;
}
}
@@ -325,7 +329,7 @@ void QQuickRepeater::componentComplete()
{
Q_D(QQuickRepeater);
if (d->model && d->ownModel)
- static_cast<QQuickVisualDataModel *>(d->model)->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model)->componentComplete();
QQuickItem::componentComplete();
regenerate();
if (d->model && d->model->count())
@@ -350,6 +354,7 @@ void QQuickRepeater::clear()
QQuickItem *item = d->deletables.at(i);
if (complete)
emit itemRemoved(i, item);
+ item->setParentItem(0);
d->model->release(item);
}
}
@@ -382,8 +387,17 @@ void QQuickRepeaterPrivate::createItems()
inRequest = true;
for (int ii = createFrom; ii < itemCount; ++ii) {
if (!deletables.at(ii)) {
- QQuickItem *item = model->item(ii, false);
+ QObject *object = model->object(ii, false);
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
if (!item) {
+ if (object) {
+ model->release(object);
+ if (!delegateValidated) {
+ delegateValidated = true;
+ QObject* delegate = q->delegate();
+ qmlInfo(delegate ? delegate : q) << q->tr("Delegate must be of Item type");
+ }
+ }
createFrom = ii;
break;
}
@@ -407,19 +421,21 @@ void QQuickRepeaterPrivate::createItems()
inRequest = false;
}
-void QQuickRepeater::createdItem(int, QQuickItem *)
+void QQuickRepeater::createdItem(int, QObject *)
{
Q_D(QQuickRepeater);
if (!d->inRequest)
d->createItems();
}
-void QQuickRepeater::initItem(int, QQuickItem *item)
+void QQuickRepeater::initItem(int, QObject *object)
{
- item->setParentItem(parentItem());
+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
+ if (item)
+ item->setParentItem(parentItem());
}
-void QQuickRepeater::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
+void QQuickRepeater::modelUpdated(const QQmlChangeSet &changeSet, bool reset)
{
Q_D(QQuickRepeater);
@@ -435,7 +451,7 @@ void QQuickRepeater::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
int difference = 0;
QHash<int, QVector<QPointer<QQuickItem> > > moved;
- foreach (const QQuickChangeSet::Remove &remove, changeSet.removes()) {
+ foreach (const QQmlChangeSet::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,8 +463,10 @@ void QQuickRepeater::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
QQuickItem *item = d->deletables.at(index);
d->deletables.remove(index);
emit itemRemoved(index, item);
- if (item)
+ if (item) {
+ item->setParentItem(0);
d->model->release(item);
+ }
--d->itemCount;
}
@@ -456,7 +474,7 @@ void QQuickRepeater::modelUpdated(const QQuickChangeSet &changeSet, bool reset)
}
d->createFrom = -1;
- foreach (const QQuickChangeSet::Insert &insert, changeSet.inserts()) {
+ foreach (const QQmlChangeSet::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 17153694c9..be9ed7266d 100644
--- a/src/quick/items/qquickrepeater_p.h
+++ b/src/quick/items/qquickrepeater_p.h
@@ -44,11 +44,9 @@
#include "qquickitem.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
-class QQuickChangeSet;
+class QQmlChangeSet;
class QQuickRepeaterPrivate;
class Q_AUTOTEST_EXPORT QQuickRepeater : public QQuickItem
@@ -91,9 +89,9 @@ protected:
void itemChange(ItemChange change, const ItemChangeData &value);
private Q_SLOTS:
- void createdItem(int index, QQuickItem *item);
- void initItem(int, QQuickItem *item);
- void modelUpdated(const QQuickChangeSet &changeSet, bool reset);
+ void createdItem(int index, QObject *item);
+ void initItem(int, QObject *item);
+ void modelUpdated(const QQmlChangeSet &changeSet, bool reset);
private:
Q_DISABLE_COPY(QQuickRepeater)
@@ -104,6 +102,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickRepeater)
-QT_END_HEADER
-
#endif // QQUICKREPEATER_P_H
diff --git a/src/quick/items/qquickrepeater_p_p.h b/src/quick/items/qquickrepeater_p_p.h
index a187aea39c..f220eb4fcb 100644
--- a/src/quick/items/qquickrepeater_p_p.h
+++ b/src/quick/items/qquickrepeater_p_p.h
@@ -61,7 +61,7 @@
QT_BEGIN_NAMESPACE
class QQmlContext;
-class QQuickVisualModel;
+class QQmlInstanceModel;
class QQuickRepeaterPrivate : public QQuickItemPrivate
{
Q_DECLARE_PUBLIC(QQuickRepeater)
@@ -73,12 +73,13 @@ public:
private:
void createItems();
- QQuickVisualModel *model;
+ QQmlInstanceModel *model;
QVariant dataSource;
QQmlGuard<QObject> dataSourceAsObject;
bool ownModel : 1;
bool inRequest : 1;
bool dataSourceIsObject : 1;
+ bool delegateValidated : 1;
int itemCount;
int createFrom;
diff --git a/src/quick/items/qquickscalegrid_p_p.h b/src/quick/items/qquickscalegrid_p_p.h
index b10785f60e..264c444229 100644
--- a/src/quick/items/qquickscalegrid_p_p.h
+++ b/src/quick/items/qquickscalegrid_p_p.h
@@ -50,8 +50,6 @@
#include <QtQuick/private/qquickpixmapcache_p.h>
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickScaleGrid : public QObject
@@ -126,6 +124,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickScaleGrid)
-QT_END_HEADER
-
#endif // QQUICKSCALEGRID_P_P_H
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp
index 7c7d8a6eab..3ab93e6d0f 100644
--- a/src/quick/items/qquickscreen.cpp
+++ b/src/quick/items/qquickscreen.cpp
@@ -112,6 +112,10 @@ QQuickScreenAttached::QQuickScreenAttached(QObject* attachee)
if (m_attachee->window()) //It might not be assigned to a window yet
windowChanged(m_attachee->window());
+ } else {
+ QQuickWindow *window = qobject_cast<QQuickWindow*>(attachee);
+ if (window)
+ windowChanged(window);
}
}
diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h
index 014fc0709b..98f38b7154 100644
--- a/src/quick/items/qquickscreen_p.h
+++ b/src/quick/items/qquickscreen_p.h
@@ -47,8 +47,6 @@
#include <QSize>
#include <private/qqmlglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -104,6 +102,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPEINFO(QQuickScreen, QML_HAS_ATTACHED_PROPERTIES)
-QT_END_HEADER
-
#endif
diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h
index 6abb41b737..5c3dcf4e41 100644
--- a/src/quick/items/qquickshadereffect_p.h
+++ b/src/quick/items/qquickshadereffect_p.h
@@ -52,8 +52,6 @@
#include <QtCore/qpointer.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
const char *qtPositionAttributeName();
@@ -193,6 +191,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKSHADEREFFECT_P_H
diff --git a/src/quick/items/qquickshadereffectmesh_p.h b/src/quick/items/qquickshadereffectmesh_p.h
index 15f4d02c12..9c19b8e6e6 100644
--- a/src/quick/items/qquickshadereffectmesh_p.h
+++ b/src/quick/items/qquickshadereffectmesh_p.h
@@ -51,8 +51,6 @@
#ifndef QQUICKSHADEREFFECTMESH_P_H
#define QQUICKSHADEREFFECTMESH_P_H
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGGeometry;
@@ -101,6 +99,4 @@ inline QColor qt_premultiply_color(const QColor &c)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKSHADEREFFECTMESH_P_H
diff --git a/src/quick/items/qquickshadereffectnode_p.h b/src/quick/items/qquickshadereffectnode_p.h
index db21d06f58..a6854526fa 100644
--- a/src/quick/items/qquickshadereffectnode_p.h
+++ b/src/quick/items/qquickshadereffectnode_p.h
@@ -51,8 +51,6 @@
#include <QtCore/qsharedpointer.h>
#include <QtCore/qpointer.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
struct QQuickShaderEffectMaterialKey {
@@ -147,6 +145,4 @@ private Q_SLOTS:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKSHADEREFFECTNODE_P_H
diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h
index 5c9427adde..57aba314aa 100644
--- a/src/quick/items/qquickshadereffectsource_p.h
+++ b/src/quick/items/qquickshadereffectsource_p.h
@@ -55,8 +55,6 @@
#define QSG_DEBUG_FBO_OVERLAY
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGNode;
@@ -257,6 +255,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKSHADEREFFECTSOURCE_P_H
diff --git a/src/quick/items/qquicksprite_p.h b/src/quick/items/qquicksprite_p.h
index dce28e888b..a85059e8d6 100644
--- a/src/quick/items/qquicksprite_p.h
+++ b/src/quick/items/qquicksprite_p.h
@@ -50,8 +50,6 @@
#include "qquickspriteengine_p.h"
#include <QDebug>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickSprite : public QQuickStochasticState
@@ -316,5 +314,4 @@ private:
};
QT_END_NAMESPACE
-QT_END_HEADER
#endif // QQUICKSPRITE_P_H
diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp
index 6dc4cf4436..4c7be3bce9 100644
--- a/src/quick/items/qquickspriteengine.cpp
+++ b/src/quick/items/qquickspriteengine.cpp
@@ -429,7 +429,7 @@ QImage QQuickSpriteEngine::assembledImage()
}
//maxFrames is max number in a line of the texture
- QImage image(w, h, QImage::Format_ARGB32);
+ QImage image(w, h, QImage::Format_ARGB32_Premultiplied);
image.fill(0);
QPainter p(&image);
int y = 0;
diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h
index 612a2b4c2d..768b5e4a6e 100644
--- a/src/quick/items/qquickspriteengine_p.h
+++ b/src/quick/items/qquickspriteengine_p.h
@@ -53,8 +53,6 @@
#include <private/qquickpixmapcache_p.h>
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickSprite;
@@ -323,6 +321,4 @@ inline int spriteCount(QQmlListProperty<QQuickSprite> *p)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKSPRITEENGINE_P_H
diff --git a/src/quick/items/qquickspritesequence_p.h b/src/quick/items/qquickspritesequence_p.h
index b07d177745..b954a4464f 100644
--- a/src/quick/items/qquickspritesequence_p.h
+++ b/src/quick/items/qquickspritesequence_p.h
@@ -45,8 +45,6 @@
#include <QtQuick/QQuickItem>
#include <QTime>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGContext;
@@ -145,6 +143,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKSPRITESEQUENCE_P_H
diff --git a/src/quick/items/qquickstateoperations_p.h b/src/quick/items/qquickstateoperations_p.h
index d43420f266..9ee0d591da 100644
--- a/src/quick/items/qquickstateoperations_p.h
+++ b/src/quick/items/qquickstateoperations_p.h
@@ -49,8 +49,6 @@
#include <QtQml/qqmlscriptstring.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickParentChangePrivate;
@@ -213,7 +211,5 @@ QML_DECLARE_TYPE(QQuickParentChange)
QML_DECLARE_TYPE(QQuickAnchorSet)
QML_DECLARE_TYPE(QQuickAnchorChanges)
-QT_END_HEADER
-
#endif // QQUICKSTATEOPERATIONS_P_H
diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h
index ba0260c5c7..03b436b3fb 100644
--- a/src/quick/items/qquicktext_p.h
+++ b/src/quick/items/qquicktext_p.h
@@ -46,8 +46,6 @@
#include <private/qtquickglobal_p.h>
#include <QtGui/qtextoption.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickTextPrivate;
@@ -295,6 +293,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickText)
QML_DECLARE_TYPE(QQuickTextLine)
-QT_END_HEADER
-
#endif // QQUICKTEXT_P_H
diff --git a/src/quick/items/qquicktextcontrol_p.h b/src/quick/items/qquicktextcontrol_p.h
index 84d6fcce52..94eae81f4e 100644
--- a/src/quick/items/qquicktextcontrol_p.h
+++ b/src/quick/items/qquicktextcontrol_p.h
@@ -63,8 +63,6 @@
#include <QtGui/qclipboard.h>
#include <QtCore/qmimedata.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -196,6 +194,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQuickTextControl_H
diff --git a/src/quick/items/qquicktextdocument.cpp b/src/quick/items/qquicktextdocument.cpp
new file mode 100644
index 0000000000..e29e48c5d0
--- /dev/null
+++ b/src/quick/items/qquicktextdocument.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquicktextdocument.h"
+
+#include "qquicktextedit_p.h"
+#include "qquicktextedit_p_p.h"
+#include "qquicktext_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QQuickTextDocumentPrivate : public QObjectPrivate
+{
+public:
+ QPointer<QTextDocument> document;
+};
+
+QQuickTextDocument::QQuickTextDocument(QQuickItem *parent)
+ : QObject(*(new QQuickTextDocumentPrivate), parent)
+{
+ Q_D(QQuickTextDocument);
+ Q_ASSERT(parent);
+ Q_ASSERT(qobject_cast<QQuickTextEdit*>(parent));
+ d->document = QPointer<QTextDocument>(qobject_cast<QQuickTextEdit*>(parent)->d_func()->document);
+}
+
+QTextDocument* QQuickTextDocument::textDocument() const
+{
+ Q_D(const QQuickTextDocument);
+ return d->document.data();
+}
+
+QT_END_NAMESPACE
diff --git a/src/quick/items/qquicktextdocument.h b/src/quick/items/qquicktextdocument.h
new file mode 100644
index 0000000000..25d3bbeaf0
--- /dev/null
+++ b/src/quick/items/qquicktextdocument.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKTEXTDOCUMENT_H
+#define QQUICKTEXTDOCUMENT_H
+
+#include <QtGui/QTextDocument>
+#include <QtQuick/QQuickItem>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QQuickTextDocument
+ \since 5.1
+ \brief The QQuickTextDocument class provides access to the QTextDocument of QQuickTextEdit
+ \inmodule QtQuick
+
+ This class provides access to the QTextDocument of QQuickTextEdit elements.
+ This is provided to allow usage of the \l{Rich Text Processing} functionalities of Qt.
+ You are not allowed to modify the document, but it can be used to output content, for example with \l{QTextDocumentWriter}),
+ or provide additional formatting, for example with \l{QSyntaxHighlighter}.
+
+ The class has to be used from C++ directly, using the property of the \l TextEdit.
+
+ Warning: The QTextDocument provided is used internally by QtQuick elements to provide text manipulation primitives.
+ You are not allowed to perform any modification of the internal state of the QTextDocument. If you do, the element
+ in question may stop functioning or crash.
+*/
+
+class QQuickTextDocumentPrivate;
+class Q_QUICK_EXPORT QQuickTextDocument : public QObject
+{
+ Q_OBJECT
+
+public:
+ QQuickTextDocument(QQuickItem *parent);
+ QTextDocument *textDocument() const;
+
+private:
+ Q_DISABLE_COPY(QQuickTextDocument)
+ Q_DECLARE_PRIVATE(QQuickTextDocument)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickTextDocument)
+
+#endif
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index d543b6bd41..e051b5202c 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -61,6 +61,7 @@
#include <private/qtextengine_p.h>
#include <private/qsgadaptationlayer_p.h>
+#include "qquicktextdocument.h"
QT_BEGIN_NAMESPACE
@@ -2179,4 +2180,23 @@ void QQuickTextEdit::remove(int start, int end)
d->control->updateCursorRectangle(false);
}
+/*!
+ \qmlproperty TextDocument QtQuick2::TextEdit::textDocument
+ \since 5.1
+
+ Returns the QQuickTextDocument of this TextEdit.
+ It can be used to implement syntax highlighting using
+ \l QSyntaxHighlighter.
+
+ \sa QQuickTextDocument
+*/
+
+QQuickTextDocument *QQuickTextEdit::textDocument()
+{
+ Q_D(QQuickTextEdit);
+ if (!d->quickDocument)
+ d->quickDocument = new QQuickTextDocument(this);
+ return d->quickDocument;
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h
index e88ca16c0e..744a7e290d 100644
--- a/src/quick/items/qquicktextedit_p.h
+++ b/src/quick/items/qquicktextedit_p.h
@@ -46,10 +46,9 @@
#include <QtGui/qtextoption.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
+class QQuickTextDocument;
class QQuickTextEditPrivate;
class Q_QUICK_PRIVATE_EXPORT QQuickTextEdit : public QQuickImplicitSizeItem
{
@@ -101,6 +100,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickTextEdit : public QQuickImplicitSizeItem
#endif
Q_PROPERTY(QUrl baseUrl READ baseUrl WRITE setBaseUrl RESET resetBaseUrl NOTIFY baseUrlChanged)
Q_PROPERTY(RenderType renderType READ renderType WRITE setRenderType NOTIFY renderTypeChanged)
+ Q_PROPERTY(QQuickTextDocument *textDocument READ textDocument FINAL)
public:
QQuickTextEdit(QQuickItem *parent=0);
@@ -249,6 +249,8 @@ public:
Q_INVOKABLE QString getText(int start, int end) const;
Q_INVOKABLE QString getFormattedText(int start, int end) const;
+ QQuickTextDocument *textDocument();
+
Q_SIGNALS:
void textChanged();
void contentSizeChanged();
@@ -341,6 +343,7 @@ protected:
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData);
friend class QQuickTextUtil;
+ friend class QQuickTextDocument;
private:
Q_DISABLE_COPY(QQuickTextEdit)
@@ -351,6 +354,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickTextEdit)
-QT_END_HEADER
-
#endif // QQUICKTEXTEDIT_P_H
diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h
index 597874d864..e4819e4d2d 100644
--- a/src/quick/items/qquicktextedit_p_p.h
+++ b/src/quick/items/qquicktextedit_p_p.h
@@ -73,6 +73,7 @@ public:
QQuickTextEditPrivate()
: color(QRgb(0xFF000000)), selectionColor(QRgb(0xFF000080)), selectedTextColor(QRgb(0xFFFFFFFF))
, textMargin(0.0), xoff(0), yoff(0), font(sourceFont), cursorComponent(0), cursorItem(0), document(0), control(0)
+ , quickDocument(0)
, lastSelectionStart(0), lastSelectionEnd(0), lineCount(0)
, hAlign(QQuickTextEdit::AlignLeft), vAlign(QQuickTextEdit::AlignTop)
, format(QQuickTextEdit::PlainText), wrapMode(QQuickTextEdit::NoWrap)
@@ -124,6 +125,7 @@ public:
QQuickItem* cursorItem;
QQuickTextDocumentWithImageResources *document;
QQuickTextControl *control;
+ QQuickTextDocument *quickDocument;
int lastSelectionStart;
int lastSelectionEnd;
diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h
index 83bc125dee..602e9dc87b 100644
--- a/src/quick/items/qquicktextinput_p.h
+++ b/src/quick/items/qquicktextinput_p.h
@@ -46,8 +46,6 @@
#include <QtGui/qtextoption.h>
#include <QtGui/qvalidator.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickTextInputPrivate;
@@ -415,6 +413,4 @@ QML_DECLARE_TYPE(QQuickDoubleValidator)
QML_DECLARE_TYPE(QRegExpValidator)
#endif
-QT_END_HEADER
-
#endif // QQUICKTEXTINPUT_P_H
diff --git a/src/quick/items/qquickthreadedwindowmanager.cpp b/src/quick/items/qquickthreadedwindowmanager.cpp
deleted file mode 100644
index 6c7b9c0448..0000000000
--- a/src/quick/items/qquickthreadedwindowmanager.cpp
+++ /dev/null
@@ -1,910 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwindowmanager_p.h"
-#include "qquickthreadedwindowmanager_p.h"
-
-#include <QtCore/QTime>
-#include <QtCore/QDebug>
-
-#include <QtGui/QOpenGLContext>
-#include <QtGui/private/qguiapplication_p.h>
-#include <qpa/qplatformintegration.h>
-
-#include <QtQml/private/qqmlglobal_p.h>
-
-#include <QtQuick/QQuickWindow>
-#include <QtQuick/private/qquickwindow_p.h>
-
-QT_BEGIN_NAMESPACE
-
-//#define THREAD_DEBUG
-extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
-
-const QEvent::Type QEvent_Sync = QEvent::Type(QEvent::User);
-const QEvent::Type QEvent_DeferredUpdate = QEvent::Type(QEvent::User + 1);
-
-#define QQUICK_RENDER_TIMING
-#ifdef QQUICK_RENDER_TIMING
-DEFINE_BOOL_CONFIG_OPTION(qquick_render_timing, QML_RENDER_TIMING)
-static QTime threadTimer;
-static int syncTime;
-static int renderTime;
-static int swapTime;
-#endif
-
-
-/*
- Threaded Rendering
- ==================
-
- The threaded rendering uses a number of different variables to track potential
- states used to handle resizing, initial paint, grabbing and driving animations
- while ALWAYS keeping the GL context in the rendering thread and keeping the
- overhead of normal one-shot paints and vblank driven animations at a minimum.
-
- Resize, initial show and grab suffer slightly in this model as they are locked
- to the rendering in the rendering thread, but this is a necessary evil for
- the system to work.
-
- Variables that are used:
-
- Private::animationRunning: This is true while the animations are running, and only
- written to inside locks.
-
- RenderThread::isGuiLocked: This is used to indicate that the GUI thread owns the
- lock. This variable is an integer to allow for recursive calls to lockInGui()
- without using a recursive mutex. See isPostingSyncEvent.
-
- RenderThread::isPostingSyncEvent: This variable is set in the render thread just
- before the sync event is sent to the GUI thread. It is used to avoid deadlocks
- in the case where render thread waits while waiting for GUI to pick up the sync
- event and GUI thread gets a resizeEvent, the initial paintEvent or a grab.
- When this happens, we use the
- exhaustSyncEvent() function to do the sync right there and mark the coming
- sync event to be discarded. There can only ever be one sync incoming.
-
- RenderThread::isRenderBlock: This variable is true when animations are not
- running and the render thread has gone to sleep, waiting for more to do.
-
- RenderThread::isExternalUpdatePending: This variable is set to false when
- a new render pass is started and to true in maybeUpdate(). It is an
- indication to the render thread that another render pass needs to take
- place, rather than the render thread going to sleep after completing its swap.
-
- RenderThread::doGrab: This variable is set by the grab() function and
- tells the renderer to do a grab after rendering is complete and before
- swapping happens.
-
- RenderThread::shouldExit: This variable is used to determine if the render
- thread should do a nother pass. It is typically set as a result of show()
- and unset as a result of hide() or during shutdown()
-
- RenderThread::hasExited: Used by the GUI thread to synchronize the shutdown
- after shouldExit has been set to true.
- */
-
-
-void QQuickRenderThreadSingleContextWindowManager::initialize()
-{
- Q_ASSERT(m_rendered_windows.size());
-
- QQuickWindow *win = 0;
- for (QHash<QQuickWindow *, WindowData *>::const_iterator it = m_rendered_windows.constBegin();
- it != m_rendered_windows.constEnd() && !win; ++it) {
- if (QQuickWindowPrivate::get(it.key())->isRenderable())
- win = it.key();
- }
- if (!win)
- return;
-
- gl = new QOpenGLContext();
- // Pick up the surface format from one of them
- gl->setFormat(win->requestedFormat());
- gl->create();
- if (!gl->makeCurrent(win))
- qWarning("QQuickWindow: makeCurrent() failed...");
-
- Q_ASSERT(!sg->isReady());
- sg->initialize(gl);
-}
-
-
-/*!
- This function is called when the window is created to register the window with
- the window manager.
-
- Called on GUI Thread.
- */
-
-void QQuickRenderThreadSingleContextWindowManager::show(QQuickWindow *window)
-{
-#ifdef THREAD_DEBUG
- printf("GUI: Window added to windowing system, %p, %dx%d\n", window, window->width(), window->height());
-#endif
-
- WindowTracker tracker;
- tracker.window = window;
- tracker.isVisible = false;
- tracker.toBeRemoved = false;
- m_tracked_windows << tracker;
-
- connect(window, SIGNAL(widthChanged(int)), this, SLOT(windowVisibilityChanged()), Qt::DirectConnection);
- connect(window, SIGNAL(heightChanged(int)), this, SLOT(windowVisibilityChanged()), Qt::DirectConnection);
-
- windowVisibilityChanged();
-}
-
-
-void QQuickRenderThreadSingleContextWindowManager::handleAddedWindow(QQuickWindow *window)
-{
-#ifdef THREAD_DEBUG
- printf(" RenderThread: adding window: %p\n", window);
-#endif
-
- WindowData *data = new WindowData;
- data->sizeWasChanged = false;
- data->windowSize = window->size();
- data->isVisible = window->isVisible();
- data->isRenderable = QQuickWindowPrivate::get(window)->isRenderable();
- m_rendered_windows[window] = data;
-
- isExternalUpdatePending = true;
-}
-
-
-/*!
- Called on Render Thread
- */
-void QQuickRenderThreadSingleContextWindowManager::handleAddedWindows()
-{
-#ifdef THREAD_DEBUG
- printf(" RenderThread: about to add %d\n", m_added_windows.size());
-#endif
-
- while (m_added_windows.size()) {
- QQuickWindow *window = m_added_windows.takeLast();
- handleAddedWindow(window);
- }
-}
-
-
-/*!
- Called on the GUI Thread, from the window' destructor
- */
-
-void QQuickRenderThreadSingleContextWindowManager::windowDestroyed(QQuickWindow *window)
-{
-#ifdef THREAD_DEBUG
- printf("GUI: Window destroyed: %p\n", window);
-#endif
-
- hide(window);
-}
-
-
-/*!
- Called on GUI Thread
- */
-
-void QQuickRenderThreadSingleContextWindowManager::hide(QQuickWindow *window)
-{
-#ifdef THREAD_DEBUG
- printf("GUI: Window hidden: %p\n", window);
-#endif
-
- int position = -1;
- for (int i=0; i<m_tracked_windows.size(); ++i) {
- if (m_tracked_windows.at(i).window == window) {
- m_tracked_windows[i].toBeRemoved = true;
- position = i;
- break;
- }
- }
-
- if (position >= 0) {
- disconnect(window, SIGNAL(widthChanged(int)), this, SLOT(windowVisibilityChanged()));
- disconnect(window, SIGNAL(heightChanged(int)), this, SLOT(windowVisibilityChanged()));
- windowVisibilityChanged();
- m_tracked_windows.removeAt(position);
- }
-
-#ifdef THREAD_DEBUG
- printf("GUI: Window removal completed... %p\n", window);
-#endif
-}
-
-/*!
- Called on Render Thread
- */
-void QQuickRenderThreadSingleContextWindowManager::handleRemovedWindows(bool clearGLContext)
-{
-#ifdef THREAD_DEBUG
- printf(" RenderThread: about to remove %d\n", m_removed_windows.size());
-#endif
-
- bool removedAnything = false;
- while (m_removed_windows.size()) {
- QQuickWindow *window = m_removed_windows.takeLast();
-#ifdef THREAD_DEBUG
- printf(" RenderThread: removing %p\n", window);
-#endif
-
- QQuickWindowPrivate::get(window)->cleanupNodesOnShutdown();
- delete m_rendered_windows.take(window);
- removedAnything = true;
- }
-
- // If a window is removed because it has been hidden it will take with it
- // the gl context (at least on Mac) if bound, so disconnect the gl context
- // from anything
- if (removedAnything && clearGLContext)
- gl->doneCurrent();
-}
-
-
-
-/*!
- Called on GUI Thread
- */
-
-void QQuickRenderThreadSingleContextWindowManager::windowVisibilityChanged()
-{
- bool anyoneShowing = false;
- QList<QQuickWindow *> toAdd, toRemove;
-
- // Not optimal, but also not frequently used...
- for (int i=0; i<m_tracked_windows.size(); ++i) {
- WindowTracker &t = const_cast<WindowTracker &>(m_tracked_windows.at(i));
- QQuickWindow *win = t.window;
-
- Q_ASSERT(win->isVisible() || QQuickWindowPrivate::get(win)->renderWithoutShowing || t.toBeRemoved);
- bool windowVisible = win->width() > 0 && win->height() > 0;
- anyoneShowing |= (windowVisible && !t.toBeRemoved);
-
- if ((!windowVisible && t.isVisible) || t.toBeRemoved) {
- toRemove << win;
- } else if (windowVisible && !t.isVisible) {
- toAdd << win;
- }
- t.isVisible = windowVisible;
- }
-
- if (isRunning()) {
- if (!anyoneShowing) {
- stopRendering();
- } else {
- lockInGui();
- exhaustSyncEvent();
- m_added_windows << toAdd;
- m_removed_windows << toRemove;
- while (isRunning() && (m_added_windows.size() || m_removed_windows.size())) {
- if (isRenderBlocked)
- wake();
- wait();
- }
- unlockInGui();
- }
-
- } else if (anyoneShowing) {
- Q_ASSERT(toRemove.isEmpty()); // since loop is not running, nothing is showing now
- for (int i=0; i<toAdd.size(); ++i)
- handleAddedWindow(toAdd.at(i));
- startRendering();
- }
-
-}
-
-
-void QQuickRenderThreadSingleContextWindowManager::run()
-{
-#ifdef THREAD_DEBUG
- printf("QML Rendering Thread Started\n");
-#endif
-
- lock();
- Q_ASSERT(!gl);
- initialize();
- // Wake GUI as it is waiting for the GL context to have appeared, as
- // an indication that the render thread is now running.
- wake();
- unlock();
-
- if (!gl)
- return;
-
- while (!shouldExit) {
- lock();
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: *** NEW FRAME ***\n");
-#endif
-
- isExternalUpdatePending = false;
- handleAddedWindows();
-
- if (!isGuiLocked) {
- isPostingSyncEvent = true;
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: acquired sync lock...\n");
-#endif
- QCoreApplication::postEvent(this, new QEvent(QEvent_Sync));
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: going to sleep...\n");
-#endif
- wake(); // In case the event got through all the way to wait() before this thread got to wait.
- wait();
-
-
- isPostingSyncEvent = false;
- }
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: Doing locked sync\n");
-#endif
-#ifdef QQUICK_RENDER_TIMING
- if (qquick_render_timing())
- threadTimer.start();
-#endif
- inSync = true;
- for (QHash<QQuickWindow *, WindowData *>::const_iterator it = m_rendered_windows.constBegin();
- it != m_rendered_windows.constEnd(); ++it) {
- QQuickWindow *window = it.key();
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: Syncing window: %p\n", window);
-#endif
-
- WindowData *windowData = it.value();
- QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(window);
-
- windowData->isRenderable = windowPrivate->isRenderable();
-
- if (windowData->isRenderable) {
- gl->makeCurrent(window);
-
- if (windowData->viewportSize != windowData->windowSize) {
-#ifdef THREAD_DEBUG
- printf(" RenderThread: --- window has changed size...\n");
-#endif
- windowData->viewportSize = windowData->windowSize;
- windowData->sizeWasChanged = true;
- glViewport(0, 0, windowData->viewportSize.width(), windowData->viewportSize.height());
- }
-
- windowPrivate->syncSceneGraph();
- }
- }
- inSync = false;
-
- // Wake GUI after sync to let it continue animating and event processing.
- wake();
- unlock();
-#ifdef THREAD_DEBUG
- printf(" RenderThread: sync done\n");
-#endif
-#ifdef QQUICK_RENDER_TIMING
- if (qquick_render_timing())
- syncTime = threadTimer.elapsed();
-#endif
-
- for (QHash<QQuickWindow *, WindowData *>::const_iterator it = m_rendered_windows.constBegin();
- it != m_rendered_windows.constEnd(); ++it) {
- QQuickWindow *window = it.key();
- WindowData *windowData = it.value();
- QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(window);
-
- if (!windowData->isRenderable)
- continue;
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: Rendering window %p\n", window);
-#endif
-
- Q_ASSERT(windowData->windowSize.width() > 0 && windowData->windowSize.height() > 0);
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: --- rendering at size %dx%d\n",
- windowData->viewportSize.width(), windowData->viewportSize.height()
- );
-#endif
-
- // We only need to re-makeCurrent when we have multiple surfaces.
- if (m_rendered_windows.size() > 1)
- gl->makeCurrent(window);
-
- windowPrivate->renderSceneGraph(windowData->viewportSize);
-#ifdef QQUICK_RENDER_TIMING
- if (qquick_render_timing())
- renderTime = threadTimer.elapsed() - syncTime;
-#endif
-
- // The content of the target buffer is undefined after swap() so grab needs
- // to happen before swap();
- if (window == windowToGrab) {
-#ifdef THREAD_DEBUG
- printf(" RenderThread: --- grabbing...\n");
-#endif
- grabContent = qt_gl_read_framebuffer(windowData->windowSize, false, false);
- windowToGrab = 0;
- }
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: --- wait for swap...\n");
-#endif
-
- if (windowData->isVisible && window->isExposed())
- gl->swapBuffers(window);
-
- windowPrivate->fireFrameSwapped();
-#ifdef THREAD_DEBUG
- printf(" RenderThread: --- swap complete...\n");
-#endif
-
- }
-
-#ifdef QQUICK_RENDER_TIMING
- if (qquick_render_timing()) {
- static QTime lastFrameTime = QTime::currentTime();
- swapTime = threadTimer.elapsed() - renderTime - syncTime;
- qDebug() << "- Breakdown of frame time; sync:" << syncTime
- << "ms render:" << renderTime << "ms swap:" << swapTime
- << "ms total:" << swapTime + renderTime + syncTime
- << "ms time since last frame:" << (lastFrameTime.msecsTo(QTime::currentTime()))
- << "ms";
- lastFrameTime = QTime::currentTime();
- }
-#endif
-
- lock();
-
- handleRemovedWindows();
-
- // Update sizes...
- for (QHash<QQuickWindow *, WindowData *>::const_iterator it = m_rendered_windows.constBegin();
- it != m_rendered_windows.constEnd(); ++it) {
- WindowData *windowData = it.value();
- if (windowData->sizeWasChanged) {
- windowData->renderedSize = windowData->viewportSize;
- windowData->sizeWasChanged = false;
- }
- }
-
-
- // Wake the GUI thread now that rendering is complete, to signal that painting
- // is done, resizing is done or grabbing is completed. For grabbing, we're
- // signalling this much later than needed (we could have done it before swap)
- // but we don't want to lock an extra time.
- wake();
-
- if (!animationRunning && !isExternalUpdatePending && !shouldExit && !windowToGrab) {
-#ifdef THREAD_DEBUG
- printf(" RenderThread: nothing to do, going to sleep...\n");
-#endif
- isRenderBlocked = true;
- wait();
- isRenderBlocked = false;
- }
-
- unlock();
-
- QCoreApplication::processEvents();
-
- // Process any "deleteLater" objects...
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- }
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: deleting all outstanding nodes\n");
-#endif
-
- m_removed_windows << m_rendered_windows.keys();
- handleRemovedWindows(false);
-
- sg->invalidate();
-
- gl->doneCurrent();
- delete gl;
- gl = 0;
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: render loop exited... Good Night!\n");
-#endif
-
- lock();
- hasExited = true;
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: waking GUI for final sleep..\n");
-#endif
- wake();
- unlock();
-
-#ifdef THREAD_DEBUG
- printf(" RenderThread: All done...\n");
-#endif
-}
-
-bool QQuickRenderThreadSingleContextWindowManager::event(QEvent *e)
-{
- Q_ASSERT(QThread::currentThread() == qApp->thread());
-
- if (e->type() == QEvent_Sync) {
-
- // If all windowes have been hidden, ignore the event
- if (!isRunning())
- return true;
-
- if (!syncAlreadyHappened)
- sync(false);
-
- syncAlreadyHappened = false;
-
- if (animationRunning) {
-#ifdef THREAD_DEBUG
- printf("GUI: Advancing animations...\n");
-#endif
-
- animDriver->advance();
-
-#ifdef THREAD_DEBUG
- printf("GUI: Animations advanced...\n");
-#endif
- }
-
- return true;
- } else if (e->type() == QEvent_DeferredUpdate) {
- handleDeferredUpdate();
-
- } else if (e->type() == QEvent::Timer) {
-#ifdef THREAD_DEBUG
- printf("GUI: Animations advanced via timer...\n");
-#endif
- animDriver->advance();
- }
-
- return QThread::event(e);
-}
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::exhaustSyncEvent()
-{
- if (isPostingSyncEvent) {
- sync(true);
- syncAlreadyHappened = true;
- }
-}
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::sync(bool guiAlreadyLocked)
-{
-#ifdef THREAD_DEBUG
- printf("GUI: sync - %s\n", guiAlreadyLocked ? "outside event" : "inside event");
-#endif
- if (!guiAlreadyLocked)
- lockInGui();
-
- for (QHash<QQuickWindow *, WindowData *>::const_iterator it = m_rendered_windows.constBegin();
- it != m_rendered_windows.constEnd(); ++it) {
- QQuickWindowPrivate::get(it.key())->polishItems();
- }
-
- wake();
- wait();
-
- if (!guiAlreadyLocked)
- unlockInGui();
-}
-
-
-
-
-/*!
- Acquires the mutex for the GUI thread. The function uses the isGuiLocked
- variable to keep track of how many recursion levels the gui is locked with.
- We only actually acquire the mutex for the first level to avoid deadlocking
- ourselves.
- */
-
-void QQuickRenderThreadSingleContextWindowManager::lockInGui()
-{
- if (++isGuiLocked == 1)
- lock();
-
-#ifdef THREAD_DEBUG
- printf("GUI: acquired lock... level=%d\n", isGuiLocked);
-#endif
-}
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::unlockInGui()
-{
-#ifdef THREAD_DEBUG
- printf("GUI: releasing lock... level=%d\n", isGuiLocked);
-#endif
-
- if (--isGuiLocked == 0)
- unlock();
-}
-
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::animationStarted()
-{
-#ifdef THREAD_DEBUG
- printf("GUI: animationStarted()\n");
-#endif
-
- if (!isRunning()) {
- animationTimer = startTimer(1000/60);
- return;
- }
-
- lockInGui();
-
- animationRunning = true;
-
- if (isRenderBlocked)
- wake();
-
- unlockInGui();
-}
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::animationStopped()
-{
-#ifdef THREAD_DEBUG
- printf("GUI: animationStopped()...\n");
-#endif
-
- if (!isRunning()) {
- killTimer(animationTimer);
- animationTimer = -1;
- return;
- }
-
- lockInGui();
- animationRunning = false;
- unlockInGui();
-}
-
-
-void QQuickRenderThreadSingleContextWindowManager::exposureChanged(QQuickWindow *window)
-{
- Q_UNUSED(window);
-#ifdef THREAD_DEBUG
- printf("GUI: exposure changed: %p\n", window);
-#endif
-
- if (window->isExposed())
- maybeUpdate(window);
-
-#ifdef THREAD_DEBUG
- printf("GUI: exposure changed done: %p\n", window);
-#endif
-}
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::resize(QQuickWindow *window, const QSize &size)
-{
-#ifdef THREAD_DEBUG
- printf("GUI: Resize Event: %p = %dx%d\n", window, size.width(), size.height());
-#endif
-
- // If the rendering thread is not running we do not need to do anything.
- // Also if the window is being resized to an invalid size, it will be removed
- // by the windowVisibilityChanged slot as result of width/heightcChanged()
- if (!isRunning() || size.width() <= 0 || size.height() <= 0)
- return;
-
- lockInGui();
- exhaustSyncEvent();
-
- WindowData *windowData = m_rendered_windows.value(window);
- if (windowData) {
- windowData->windowSize = size;
- while (isRunning() && windowData->renderedSize != size && size.width() > 0 && size.height() > 0) {
- if (isRenderBlocked)
- wake();
- wait();
- }
- }
- unlockInGui();
-
-#ifdef THREAD_DEBUG
- printf("GUI: Resize done: %p\n", window);
-#endif
-}
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::startRendering()
-{
-#ifdef THREAD_DEBUG
- printf("GUI: Starting Render Thread\n");
-#endif
- hasExited = false;
- shouldExit = false;
- isGuiLocked = 0;
- isPostingSyncEvent = false;
- syncAlreadyHappened = false;
- inSync = false;
-
- lockInGui();
- animationRunning = animDriver->isRunning();
- start(); // Start the render thread...
- wait();
- unlockInGui();
-
- // Animations will now be driven from the rendering thread.
- if (animationTimer >= 0) {
- killTimer(animationTimer);
- animationTimer = -1;
- }
-
-
-}
-
-
-
-void QQuickRenderThreadSingleContextWindowManager::stopRendering()
-{
-#ifdef THREAD_DEBUG
- printf("GUI: stopping render thread\n");
-#endif
-
- lockInGui();
- exhaustSyncEvent();
- shouldExit = true;
-
- if (isRenderBlocked) {
-#ifdef THREAD_DEBUG
- printf("GUI: waking up render thread\n");
-#endif
- wake();
- }
-
- while (!hasExited) {
-#ifdef THREAD_DEBUG
- printf("GUI: waiting for render thread to have exited..\n");
-#endif
- wait();
- }
-
- unlockInGui();
-
-#ifdef THREAD_DEBUG
- printf("GUI: waiting for render thread to terminate..\n");
-#endif
- // Actually wait for the thread to terminate. Otherwise we can delete it
- // too early and crash.
- QThread::wait();
-
-#ifdef THREAD_DEBUG
- printf("GUI: thread has terminated and we're all good..\n");
-#endif
-
- // Activate timer to keep animations running
- if (animDriver->isRunning())
- animationTimer = startTimer(1000/60);
-}
-
-
-
-QImage QQuickRenderThreadSingleContextWindowManager::grab(QQuickWindow *window)
-{
- if (!isRunning())
- return QImage();
-
- if (QThread::currentThread() != qApp->thread()) {
- qWarning("QQuickWindow::grabFrameBuffer: can only be called from the GUI thread");
- return QImage();
- } else if (window->size().width() <= 0 || window->size().height() <= 0 ) {
- qWarning("QQuickWindow::grabFrameBuffer: Can't grab a Window with size %dx%d", window->size().width(), window->size().height());
- return QImage();
- }
-
-#ifdef THREAD_DEBUG
- printf("GUI: doing a pixelwise grab..\n");
-#endif
-
- lockInGui();
- exhaustSyncEvent();
-
- windowToGrab = window;
- while (isRunning() && windowToGrab) {
- if (isRenderBlocked)
- wake();
- wait();
- }
-
- QImage grabbed = grabContent;
- grabContent = QImage();
-
- unlockInGui();
-
- return grabbed;
-}
-
-
-void QQuickRenderThreadSingleContextWindowManager::handleDeferredUpdate()
-{
-#ifdef THREAD_DEBUG
- printf("GUI: handling update to ourselves...\n");
-#endif
-
- isDeferredUpdatePosted = false;
-
- lockInGui();
- isExternalUpdatePending = true;
- if (isRenderBlocked)
- wake();
- unlockInGui();
-}
-
-void QQuickRenderThreadSingleContextWindowManager::maybeUpdate(QQuickWindow *)
-{
- Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread() || inSync,
- "QQuickWindow::update",
- "Function can only be called from GUI thread or during QQuickItem::updatePaintNode()");
-
- if (inSync) {
- isExternalUpdatePending = true;
-
- } else if (!isDeferredUpdatePosted) {
-#ifdef THREAD_DEBUG
- printf("GUI: posting update to ourselves...\n");
-#endif
- isDeferredUpdatePosted = true;
- QCoreApplication::postEvent(this, new QEvent(QEvent_DeferredUpdate));
- }
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/quick/items/qquickthreadedwindowmanager_p.h b/src/quick/items/qquickthreadedwindowmanager_p.h
deleted file mode 100644
index 76325e2d4f..0000000000
--- a/src/quick/items/qquickthreadedwindowmanager_p.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKTHREADEDWINDOWMANAGER_P_H
-#define QQUICKTHREADEDWINDOWMANAGER_P_H
-
-#include "qquickwindowmanager_p.h"
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QMutex>
-#include <QtCore/QWaitCondition>
-#include <QtCore/private/qabstractanimation_p.h>
-
-#include <QtGui/QOpenGLContext>
-#include <QtQuick/private/qsgcontext_p.h>
-#include <private/qtquickglobal_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickRenderThreadSingleContextWindowManager : public QThread, public QQuickWindowManager
-{
- Q_OBJECT
-public:
- QQuickRenderThreadSingleContextWindowManager()
- : sg(QSGContext::createDefaultContext())
- , gl(0)
- , animationTimer(-1)
- , isGuiLocked(0)
- , animationRunning(false)
- , isPostingSyncEvent(false)
- , isRenderBlocked(false)
- , isExternalUpdatePending(false)
- , syncAlreadyHappened(false)
- , inSync(false)
- , shouldExit(false)
- , hasExited(false)
- , isDeferredUpdatePosted(false)
- , windowToGrab(0)
- {
- sg->moveToThread(this);
-
- animDriver = sg->createAnimationDriver(this);
- animDriver->install();
- connect(animDriver, SIGNAL(started()), this, SLOT(animationStarted()));
- connect(animDriver, SIGNAL(stopped()), this, SLOT(animationStopped()));
- }
-
- QSGContext *sceneGraphContext() const { return sg; }
-
- void releaseResources() { }
-
- void show(QQuickWindow *window);
- void hide(QQuickWindow *window);
-
- void windowDestroyed(QQuickWindow *window);
-
- void exposureChanged(QQuickWindow *window);
- QImage grab(QQuickWindow *window);
- void resize(QQuickWindow *window, const QSize &size);
- void handleDeferredUpdate();
- void maybeUpdate(QQuickWindow *window);
- void update(QQuickWindow *window) { maybeUpdate(window); } // identical for this implementation
-
- void startRendering();
- void stopRendering();
-
- void exhaustSyncEvent();
- void sync(bool guiAlreadyLocked);
-
- void initialize();
-
- bool event(QEvent *);
-
- inline void lock() { mutex.lock(); }
- inline void unlock() { mutex.unlock(); }
- inline void wait() { condition.wait(&mutex); }
- inline void wake() { condition.wakeOne(); }
- void lockInGui();
- void unlockInGui();
-
- void run();
-
- QAnimationDriver *animationDriver() const { return animDriver; }
-
-public slots:
- void animationStarted();
- void animationStopped();
- void windowVisibilityChanged();
-
-private:
- void handleAddedWindows();
- void handleAddedWindow(QQuickWindow *window);
- void handleRemovedWindows(bool clearGLContext = true);
-
- QSGContext *sg;
- QOpenGLContext *gl;
- QAnimationDriver *animDriver;
- int animationTimer;
-
- QMutex mutex;
- QWaitCondition condition;
-
- int isGuiLocked;
- uint animationRunning: 1;
- uint isPostingSyncEvent : 1;
- uint isRenderBlocked : 1;
- uint isExternalUpdatePending : 1;
- uint syncAlreadyHappened : 1;
- uint inSync : 1;
- uint shouldExit : 1;
- uint hasExited : 1;
- uint isDeferredUpdatePosted : 1;
-
- QQuickWindow *windowToGrab;
- QImage grabContent;
-
- struct WindowData {
- QSize renderedSize;
- QSize windowSize;
- QSize viewportSize;
-
- uint sizeWasChanged : 1;
- uint isVisible : 1;
- uint isRenderable : 1;
- };
-
- QHash<QQuickWindow *, WindowData *> m_rendered_windows;
-
- struct WindowTracker {
- QQuickWindow *window;
- uint isVisible : 1;
- uint toBeRemoved : 1;
- };
-
- QList<WindowTracker> m_tracked_windows;
-
- QList<QQuickWindow *> m_removed_windows;
- QList<QQuickWindow *> m_added_windows;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKTHREADEDWINDOWMANAGER_P_H
diff --git a/src/quick/items/qquicktranslate_p.h b/src/quick/items/qquicktranslate_p.h
index 8c3438c937..4181f5af79 100644
--- a/src/quick/items/qquicktranslate_p.h
+++ b/src/quick/items/qquicktranslate_p.h
@@ -46,8 +46,6 @@
#include <QtGui/qmatrix4x4.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickTranslatePrivate;
@@ -154,6 +152,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickTranslate)
-QT_END_HEADER
-
#endif
diff --git a/src/quick/items/qquickview.h b/src/quick/items/qquickview.h
index 10bad4c615..3e8883ddfb 100644
--- a/src/quick/items/qquickview.h
+++ b/src/quick/items/qquickview.h
@@ -46,8 +46,6 @@
#include <QtCore/qurl.h>
#include <QtQml/qqmldebug.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlEngine;
@@ -115,6 +113,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKVIEW_H
diff --git a/src/quick/items/qquickview_p.h b/src/quick/items/qquickview_p.h
index 4b78d8b270..43b17e5bed 100644
--- a/src/quick/items/qquickview_p.h
+++ b/src/quick/items/qquickview_p.h
@@ -55,8 +55,6 @@
#include "qquickitemchangelistener_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlContext;
@@ -100,6 +98,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKVIEW_P_H
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 469ea4225c..9acd24cae3 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -50,7 +50,7 @@
#include <QtQuick/private/qsgtexture_p.h>
#include <QtQuick/private/qsgflashnode_p.h>
-#include <private/qquickwindowmanager_p.h>
+#include <private/qsgrenderloop_p.h>
#include <private/qguiapplication_p.h>
#include <QtGui/QInputMethod>
@@ -366,8 +366,8 @@ QQuickWindowPrivate::QQuickWindowPrivate()
, windowManager(0)
, clearColor(Qt::white)
, clearBeforeRendering(true)
- , persistentGLContext(false)
- , persistentSceneGraph(false)
+ , persistentGLContext(true)
+ , persistentSceneGraph(true)
, lastWheelEventAccepted(false)
, renderTarget(0)
, renderTargetId(0)
@@ -392,13 +392,7 @@ void QQuickWindowPrivate::init(QQuickWindow *c)
contentItemPrivate->windowRefCount = 1;
contentItemPrivate->flags |= QQuickItem::ItemIsFocusScope;
- // In the absence of a focus in event on some platforms assume the window will
- // be activated immediately and set focus on the contentItem
- // ### Remove when QTBUG-22415 is resolved.
- //It is important that this call happens after the contentItem has a window..
- contentItem->setFocus(true);
-
- windowManager = QQuickWindowManager::instance();
+ windowManager = QSGRenderLoop::instance();
context = windowManager->sceneGraphContext();
q->setSurfaceType(QWindow::OpenGLSurface);
q->setFormat(context->defaultSurfaceFormat());
@@ -676,10 +670,10 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, F
}
if (!(options & DontChangeFocusProperty)) {
-// if (item != contentItem || QGuiApplication::focusWindow() == q) { // QTBUG-22415
+ if (item != contentItem || QGuiApplication::focusWindow() == q) {
itemPrivate->focus = true;
changed << item;
-// }
+ }
}
if (newActiveFocusItem && contentItem->hasFocus()) {
@@ -929,6 +923,8 @@ QQuickWindow::QQuickWindow(QWindow *parent)
d->init(this);
}
+
+
/*!
\internal
*/
@@ -972,20 +968,32 @@ QQuickWindow::~QQuickWindow()
void QQuickWindow::releaseResources()
{
Q_D(QQuickWindow);
- d->windowManager->releaseResources();
+ d->windowManager->releaseResources(this);
QQuickPixmap::purgeCache();
}
/*!
- Sets whether the OpenGL context can be released as a part of a call to
- releaseResources() to \a persistent.
+ Sets whether the OpenGL context can be released to \a
+ persistent. The default value is true.
- The OpenGL context might still be released when the user makes an explicit
- call to hide().
+ The OpenGL context can be released to free up graphics resources
+ when the window is obscured, hidden or not rendering. When this
+ happens is implementation specific.
- \sa setPersistentSceneGraph()
+ The QOpenGLContext::aboutToBeDestroyed() signal is emitted from
+ the QQuickWindow::openglContext() when the OpenGL context is about
+ to be released. The QQuickWindow::sceneGraphInitialized() signal
+ is emitted when a new OpenGL context is created for this
+ window. Make a Qt::DirectConnection to these signals to be
+ notified.
+
+ The OpenGL context is still released when the last QQuickWindow is
+ deleted.
+
+ \sa setPersistentSceneGraph(),
+ QOpenGLContext::aboutToBeDestroyed(), sceneGraphInitialized()
*/
void QQuickWindow::setPersistentOpenGLContext(bool persistent)
@@ -995,9 +1003,13 @@ void QQuickWindow::setPersistentOpenGLContext(bool persistent)
}
+
/*!
- Returns whether the OpenGL context can be released as a part of a call to
- releaseResources().
+ Returns whether the OpenGL context can be released during the
+ lifetime of the QQuickWindow.
+
+ \note This is a hint. When and how this happens is implementation
+ specific.
*/
bool QQuickWindow::isPersistentOpenGLContext() const
@@ -1009,13 +1021,24 @@ bool QQuickWindow::isPersistentOpenGLContext() const
/*!
- Sets whether the scene graph nodes and resources can be released as a
- part of a call to releaseResources() to \a persistent.
+ Sets whether the scene graph nodes and resources can be released
+ to \a persistent. The default value is true.
- The scene graph nodes and resources might still be released when the user
- makes an explicit call to hide().
+ The scene graph nodes and resources can be released to free up
+ graphics resources when the window is obscured, hidden or not
+ rendering. When this happens is implementation specific.
- \sa setPersistentOpenGLContext()
+ The QQuickWindow::sceneGraphInvalidated() signal is emitted when
+ cleanup occurs. The QQuickWindow::sceneGraphInitialized() signal
+ is emitted when a new scene graph is recreated for this
+ window. Make a Qt::DirectConnection to these signals to be
+ notified.
+
+ The scene graph nodes and resources are still released when the
+ last QQuickWindow is deleted.
+
+ \sa setPersistentOpenGLContext(),
+ sceneGraphInvalidated(), sceneGraphInitialized()
*/
void QQuickWindow::setPersistentSceneGraph(bool persistent)
@@ -1027,8 +1050,11 @@ void QQuickWindow::setPersistentSceneGraph(bool persistent)
/*!
- Returns whether the scene graph nodes and resources can be released as a part
- of a call to releaseResources().
+ Returns whether the scene graph nodes and resources can be
+ released during the lifetime of this QQuickWindow.
+
+ \note This is a hint. When and how this happens is implementation
+ specific.
*/
bool QQuickWindow::isPersistentSceneGraph() const
@@ -1161,6 +1187,12 @@ void QQuickWindow::keyPressEvent(QKeyEvent *e)
{
Q_D(QQuickWindow);
+#ifndef QT_NO_SHORTCUT
+ // Try looking for a Shortcut before sending key events
+ if (QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(this, e))
+ return;
+#endif
+
if (d->activeFocusItem)
sendEvent(d->activeFocusItem, e);
}
@@ -2783,6 +2815,14 @@ void QQuickWindow::setColor(const QColor &color)
if (color == d->clearColor)
return;
+ if (color.alpha() != d->clearColor.alpha()) {
+ QSurfaceFormat fmt = format();
+ if (color.alpha() < 255)
+ fmt.setAlphaBufferSize(8);
+ else
+ fmt.setAlphaBufferSize(-1);
+ setFormat(fmt);
+ }
d->clearColor = color;
emit colorChanged(color);
d->dirtyItem(contentItem());
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index a98f3a695f..959c52b37c 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -48,8 +48,6 @@
#include <QtGui/qwindow.h>
#include <QtGui/qevent.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickItem;
@@ -173,7 +171,5 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QQuickWindow *)
-QT_END_HEADER
-
#endif // QQUICKWINDOW_H
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index da2ae8284d..f272f30f8e 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
//Make it easy to identify and customize the root item if needed
-class QQuickWindowManager;
+class QSGRenderLoop;
class QQuickRootItem : public QQuickItem
{
@@ -200,7 +200,7 @@ public:
QSGContext *context;
QSGRenderer *renderer;
- QQuickWindowManager *windowManager;
+ QSGRenderLoop *windowManager;
QColor clearColor;
diff --git a/src/quick/items/qquickwindowmodule_p.h b/src/quick/items/qquickwindowmodule_p.h
index 10f0c630b9..4afc45751f 100644
--- a/src/quick/items/qquickwindowmodule_p.h
+++ b/src/quick/items/qquickwindowmodule_p.h
@@ -44,8 +44,6 @@
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -57,6 +55,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/qtquick2_p.h b/src/quick/qtquick2_p.h
index ad624e66a8..47f4939820 100644
--- a/src/quick/qtquick2_p.h
+++ b/src/quick/qtquick2_p.h
@@ -44,8 +44,6 @@
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_PRIVATE_EXPORT QQmlQtQuick2Module
@@ -56,6 +54,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QTQUICK2_P_H
diff --git a/src/quick/qtquickglobal.h b/src/quick/qtquickglobal.h
index 7ac75b2682..4cbeb4a00b 100644
--- a/src/quick/qtquickglobal.h
+++ b/src/quick/qtquickglobal.h
@@ -44,7 +44,6 @@
#include <QtCore/qglobal.h>
-QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef QT_STATIC
@@ -58,6 +57,5 @@ QT_BEGIN_NAMESPACE
#endif
QT_END_NAMESPACE
-QT_END_HEADER
#endif // QTQUICKGLOBAL_H
diff --git a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp
index e662c2bcba..448ec55a82 100644
--- a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp
@@ -131,13 +131,12 @@ QSGDefaultRenderer::QSGDefaultRenderer(QSGContext *context)
, m_transparentNodes(64)
, m_renderGroups(4)
, m_rebuild_lists(false)
- , m_needs_sorting(false)
, m_sort_front_to_back(false)
, m_render_node_added(false)
, m_currentRenderOrder(1)
{
- QStringList args = qApp->arguments();
#if defined(QML_RUNTIME_TESTING)
+ QStringList args = qApp->arguments();
m_render_opaque_nodes = !args.contains(QLatin1String("--no-opaque-nodes"));
m_render_alpha_nodes = !args.contains(QLatin1String("--no-alpha-nodes"));
#endif
@@ -212,6 +211,8 @@ void QSGDefaultRenderer::render()
m_currentProgram = 0;
m_currentMatrix = 0;
+ bool sortNodes = m_rebuild_lists;
+
if (m_rebuild_lists) {
m_opaqueNodes.reset();
m_transparentNodes.reset();
@@ -228,7 +229,7 @@ void QSGDefaultRenderer::render()
int debugtimeLists = debugTimer.elapsed();
#endif
- if (m_needs_sorting) {
+ if (sortNodes) {
if (!m_opaqueNodes.isEmpty()) {
bool (*lessThan)(QSGNode *, QSGNode *);
lessThan = m_sort_front_to_back ? nodeLessThanWithRenderOrder : nodeLessThan;
@@ -240,7 +241,6 @@ void QSGDefaultRenderer::render()
start = end;
}
}
- m_needs_sorting = false;
}
#ifdef RENDERER_DEBUG
diff --git a/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h b/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h
index 5bd6eeeb1e..ae759c0b24 100644
--- a/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgdefaultrenderer_p.h
@@ -47,8 +47,6 @@
#include <QtGui/private/qdatabuffer_p.h>
#include "qsgrendernode_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_PRIVATE_EXPORT QSGDefaultRenderer : public QSGRenderer
@@ -78,7 +76,6 @@ private:
QDataBuffer<RenderGroup> m_renderGroups;
bool m_rebuild_lists;
- bool m_needs_sorting;
bool m_sort_front_to_back;
bool m_render_node_added;
int m_currentRenderOrder;
@@ -91,6 +88,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QMLRENDERER_H
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.h b/src/quick/scenegraph/coreapi/qsggeometry.h
index c9b44e86b0..679b773fc8 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.h
+++ b/src/quick/scenegraph/coreapi/qsggeometry.h
@@ -46,8 +46,6 @@
#include <QtGui/qopengl.h>
#include <QRectF>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGGeometryData;
@@ -295,6 +293,4 @@ int QSGGeometry::sizeOfIndex() const
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSGGEOMETRY_H
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
index 0e40a01311..f678504344 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
@@ -44,6 +44,10 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DEBUG
+static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty();
+#endif
+
/*!
\group qtquick-scenegraph-materials
\title Qt Quick Scene Graph Material Classes
@@ -538,11 +542,13 @@ QSGMaterial::QSGMaterial()
: m_flags(0)
{
#ifndef QT_NO_DEBUG
- ++qt_material_count;
- static bool atexit_registered = false;
- if (!atexit_registered) {
- atexit(qt_print_material_count);
- atexit_registered = true;
+ if (qsg_leak_check) {
+ ++qt_material_count;
+ static bool atexit_registered = false;
+ if (!atexit_registered) {
+ atexit(qt_print_material_count);
+ atexit_registered = true;
+ }
}
#endif
}
@@ -555,9 +561,11 @@ QSGMaterial::QSGMaterial()
QSGMaterial::~QSGMaterial()
{
#ifndef QT_NO_DEBUG
- --qt_material_count;
- if (qt_material_count < 0)
- qDebug("Material destroyed after qt_print_material_count() was called.");
+ if (qsg_leak_check) {
+ --qt_material_count;
+ if (qt_material_count < 0)
+ qDebug("Material destroyed after qt_print_material_count() was called.");
+ }
#endif
}
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h
index 062311e2e3..5effdbfda6 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.h
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.h
@@ -45,8 +45,6 @@
#include <QtQuick/qtquickglobal.h>
#include <qopenglshaderprogram.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGMaterial;
@@ -143,6 +141,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QSGMaterialShader::RenderState::DirtyStates)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp
index 5995dc862d..6a22e0e7f9 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.cpp
+++ b/src/quick/scenegraph/coreapi/qsgnode.cpp
@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DEBUG
+static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty();
static int qt_node_count = 0;
static void qt_print_node_count()
@@ -271,11 +272,13 @@ QSGNode::QSGNode(NodeType type)
void QSGNode::init()
{
#ifndef QT_NO_DEBUG
- ++qt_node_count;
- static bool atexit_registered = false;
- if (!atexit_registered) {
- atexit(qt_print_node_count);
- atexit_registered = true;
+ if (qsg_leak_check) {
+ ++qt_node_count;
+ static bool atexit_registered = false;
+ if (!atexit_registered) {
+ atexit(qt_print_node_count);
+ atexit_registered = true;
+ }
}
#endif
}
@@ -289,9 +292,11 @@ void QSGNode::init()
QSGNode::~QSGNode()
{
#ifndef QT_NO_DEBUG
- --qt_node_count;
- if (qt_node_count < 0)
- qDebug("Node destroyed after qt_print_node_count() was called.");
+ if (qsg_leak_check) {
+ --qt_node_count;
+ if (qt_node_count < 0)
+ qDebug("Node destroyed after qt_print_node_count() was called.");
+ }
#endif
destroy();
}
diff --git a/src/quick/scenegraph/coreapi/qsgnode.h b/src/quick/scenegraph/coreapi/qsgnode.h
index 82bb66fa77..522546d8e8 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.h
+++ b/src/quick/scenegraph/coreapi/qsgnode.h
@@ -47,8 +47,6 @@
#include <float.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
//#define QML_RUNTIME_TESTING
@@ -335,6 +333,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QSGNode::Flags)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // NODE_H
diff --git a/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h b/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h
index 88eb814766..7e57bf5bbf 100644
--- a/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h
+++ b/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h
@@ -45,8 +45,6 @@
#include <private/qtquickglobal_p.h>
#include <QtGui/private/qdatabuffer_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGNode;
@@ -96,6 +94,4 @@ protected:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // NODEUPDATER_P_H
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index 6f9d380eb5..02eec70952 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -60,8 +60,7 @@ QT_BEGIN_NAMESPACE
-#define QSG_RENDERER_TIMING
-#ifdef QSG_RENDERER_TIMING
+#ifndef QSG_NO_RENDERER_TIMING
static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
static QTime frameTimer;
static int preprocessTime;
@@ -237,7 +236,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
m_is_rendering = true;
-#ifdef QSG_RENDERER_TIMING
+#ifndef QSG_NO_RENDERER_TIMING
if (qsg_render_timing)
frameTimer.start();
int bindTime = 0;
@@ -248,7 +247,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
preprocess();
bindable.bind();
-#ifdef QSG_RENDERER_TIMING
+#ifndef QSG_NO_RENDERER_TIMING
if (qsg_render_timing)
bindTime = frameTimer.elapsed();
#endif
@@ -269,7 +268,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
#endif
render();
-#ifdef QSG_RENDERER_TIMING
+#ifndef QSG_NO_RENDERER_TIMING
if (qsg_render_timing)
renderTime = frameTimer.elapsed();
#endif
@@ -289,9 +288,9 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
m_index_buffer_bound = false;
}
-#ifdef QSG_RENDERER_TIMING
+#ifndef QSG_NO_RENDERER_TIMING
if (qsg_render_timing) {
- printf(" - Breakdown of frametime: preprocess=%d, updates=%d, binding=%d, render=%d, total=%d\n",
+ printf(" - Breakdown of render time: preprocess=%d, updates=%d, binding=%d, render=%d, total=%d\n",
preprocessTime,
updatePassTime - preprocessTime,
bindTime - updatePassTime,
@@ -379,7 +378,7 @@ void QSGRenderer::preprocess()
}
}
-#ifdef QSG_RENDERER_TIMING
+#ifndef QSG_NO_RENDERER_TIMING
if (qsg_render_timing)
preprocessTime = frameTimer.elapsed();
#endif
@@ -387,7 +386,7 @@ void QSGRenderer::preprocess()
nodeUpdater()->setToplevelOpacity(context()->renderAlpha());
nodeUpdater()->updateStates(m_root_node);
-#ifdef QSG_RENDERER_TIMING
+#ifndef QSG_NO_RENDERER_TIMING
if (qsg_render_timing)
updatePassTime = frameTimer.elapsed();
#endif
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer_p.h b/src/quick/scenegraph/coreapi/qsgrenderer_p.h
index 92072e2e3e..5dd53547d1 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgrenderer_p.h
@@ -55,8 +55,6 @@
#include <QtQuick/private/qsgcontext_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGMaterialShader;
@@ -241,6 +239,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // RENDERER_H
diff --git a/src/quick/scenegraph/coreapi/qsgrendernode_p.h b/src/quick/scenegraph/coreapi/qsgrendernode_p.h
index 6c3e03b8b3..1f1bc23123 100644
--- a/src/quick/scenegraph/coreapi/qsgrendernode_p.h
+++ b/src/quick/scenegraph/coreapi/qsgrendernode_p.h
@@ -56,8 +56,6 @@
#include "qsgnode.h"
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_PRIVATE_EXPORT QSGRenderNode : public QSGNode
@@ -110,6 +108,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRenderNode::StateFlags)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index 87b13d86d3..4e8bafbe95 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -48,8 +48,14 @@
#include <QtGui/qguiapplication.h>
#include <qdir.h>
+#include <QElapsedTimer>
+
QT_BEGIN_NAMESPACE
+#ifndef QSG_NO_RENDERER_TIMING
+static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
+static QElapsedTimer qsg_render_timer;
+#endif
QSGDistanceFieldGlyphCache::Texture QSGDistanceFieldGlyphCache::s_emptyTexture;
@@ -155,6 +161,11 @@ void QSGDistanceFieldGlyphCache::update()
if (m_pendingGlyphs.isEmpty())
return;
+#ifndef QSG_NO_RENDERER_TIMING
+ if (qsg_render_timing)
+ qsg_render_timer.start();
+#endif
+
QHash<glyph_t, QImage> distanceFields;
for (int i = 0; i < m_pendingGlyphs.size(); ++i) {
@@ -164,9 +175,27 @@ void QSGDistanceFieldGlyphCache::update()
distanceFields.insert(glyphIndex, distanceField);
}
+#ifndef QSG_NO_RENDERER_TIMING
+ int renderTime = 0;
+ int count = m_pendingGlyphs.size();
+ if (qsg_render_timing)
+ renderTime = qsg_render_timer.elapsed();
+#endif
+
m_pendingGlyphs.reset();
storeGlyphs(distanceFields);
+
+#ifndef QSG_NO_RENDERER_TIMING
+ if (qsg_render_timing) {
+ printf(" - glyphs: count=%d, render=%d, store=%d, total=%d\n",
+ count,
+ renderTime,
+ (int) qsg_render_timer.elapsed() - renderTime,
+ (int) qsg_render_timer.elapsed());
+
+ }
+#endif
}
void QSGDistanceFieldGlyphCache::setGlyphsPosition(const QList<GlyphPosition> &glyphs)
diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h
index 8b37deb1c1..85c1d2e6ff 100644
--- a/src/quick/scenegraph/qsgadaptationlayer_p.h
+++ b/src/quick/scenegraph/qsgadaptationlayer_p.h
@@ -59,8 +59,6 @@
// ### remove
#include <QtQuick/private/qquicktext_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGNode;
@@ -292,6 +290,4 @@ inline bool QSGDistanceFieldGlyphCache::containsGlyph(glyph_t glyph)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index c9ac190e86..705b12c4d4 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -71,6 +71,12 @@ DEFINE_BOOL_CONFIG_OPTION(qmlFlashMode, QML_FLASH_MODE)
DEFINE_BOOL_CONFIG_OPTION(qmlTranslucentMode, QML_TRANSLUCENT_MODE)
DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
+
+#ifndef QSG_NO_RENDERER_TIMING
+static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
+static QElapsedTimer qsg_renderer_timer;
+#endif
+
/*
Comments about this class from Gunnar:
@@ -243,6 +249,14 @@ void QSGContext::initialize(QOpenGLContext *context)
{
Q_D(QSGContext);
+ // Sanity check the surface format, in case it was overridden by the application
+ QSurfaceFormat requested = defaultSurfaceFormat();
+ QSurfaceFormat actual = context->format();
+ if (requested.depthBufferSize() > 0 && actual.depthBufferSize() <= 0)
+ qWarning("QSGContext::initialize: depth buffer support missing, expect rendering errors");
+ if (requested.stencilBufferSize() > 0 && actual.stencilBufferSize() <= 0)
+ qWarning("QSGContext::initialize: stencil buffer support missing, expect rendering errors");
+
Q_ASSERT(!d->gl);
d->gl = context;
@@ -463,11 +477,21 @@ QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material)
if (shader)
return shader;
+#ifndef QSG_NO_RENDERER_TIMING
+ if (qsg_render_timing)
+ qsg_renderer_timer.start();
+#endif
+
shader = material->createShader();
shader->compile();
shader->initialize();
d->materials[type] = shader;
+#ifndef QSG_NO_RENDERER_TIMING
+ if (qsg_render_timing)
+ printf(" - compiling material: %dms\n", (int) qsg_renderer_timer.elapsed());
+#endif
+
return shader;
}
diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h
index 1ae3ada3d8..b069c53dd3 100644
--- a/src/quick/scenegraph/qsgcontext_p.h
+++ b/src/quick/scenegraph/qsgcontext_p.h
@@ -54,8 +54,6 @@
#include <QtQuick/qsgnode.h>
#include <QtQuick/private/qsgdepthstencilbuffer_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -69,7 +67,7 @@ class QQuickWindow;
class QSGTexture;
class QSGMaterial;
class QSGMaterialShader;
-class QQuickWindowManager;
+class QSGRenderLoop;
class QOpenGLContext;
class QOpenGLFramebufferObject;
@@ -127,7 +125,7 @@ public:
virtual QAnimationDriver *createAnimationDriver(QObject *parent);
static QQuickTextureFactory *createTextureFactoryFromImage(const QImage &image);
- static QQuickWindowManager *createWindowManager();
+ static QSGRenderLoop *createWindowManager();
public slots:
@@ -140,6 +138,4 @@ signals:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSGCONTEXT_H
diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp
index 76b4e63816..545762aa72 100644
--- a/src/quick/scenegraph/qsgcontextplugin.cpp
+++ b/src/quick/scenegraph/qsgcontextplugin.cpp
@@ -157,7 +157,7 @@ QQuickTextureFactory *QSGContext::createTextureFactoryFromImage(const QImage &im
specific window manager.
*/
-QQuickWindowManager *QSGContext::createWindowManager()
+QSGRenderLoop *QSGContext::createWindowManager()
{
QSGAdaptionPluginData *plugin = contextFactory();
if (plugin->factory)
diff --git a/src/quick/scenegraph/qsgcontextplugin_p.h b/src/quick/scenegraph/qsgcontextplugin_p.h
index 4e5be6edce..be3987d823 100644
--- a/src/quick/scenegraph/qsgcontextplugin_p.h
+++ b/src/quick/scenegraph/qsgcontextplugin_p.h
@@ -47,20 +47,18 @@
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGContext;
-class QQuickWindowManager;
+class QSGRenderLoop;
struct Q_QUICK_PRIVATE_EXPORT QSGContextFactoryInterface : public QFactoryInterface
{
virtual QSGContext *create(const QString &key) const = 0;
virtual QQuickTextureFactory *createTextureFactoryFromImage(const QImage &image) = 0;
- virtual QQuickWindowManager *createWindowManager() = 0;
+ virtual QSGRenderLoop *createWindowManager() = 0;
};
#define QSGContextFactoryInterface_iid \
@@ -79,11 +77,9 @@ public:
virtual QSGContext *create(const QString &key) const = 0;
virtual QQuickTextureFactory *createTextureFactoryFromImage(const QImage &) { return 0; }
- virtual QQuickWindowManager *createWindowManager() { return 0; }
+ virtual QSGRenderLoop *createWindowManager() { return 0; }
};
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSGCONTEXTPLUGIN_H
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.h b/src/quick/scenegraph/qsgdefaultglyphnode_p.h
index 8f764b2d91..a1cd381968 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.h
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.h
@@ -45,8 +45,6 @@
#include <private/qsgadaptationlayer_p.h>
#include <QtQuick/qsgnode.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QGlyphs;
@@ -80,6 +78,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // DEFAULT_GLYPHNODE_H
diff --git a/src/quick/scenegraph/qsgdefaultimagenode_p.h b/src/quick/scenegraph/qsgdefaultimagenode_p.h
index 07cfa2c925..d2b3baae79 100644
--- a/src/quick/scenegraph/qsgdefaultimagenode_p.h
+++ b/src/quick/scenegraph/qsgdefaultimagenode_p.h
@@ -46,8 +46,6 @@
#include <private/qsgadaptationlayer_p.h>
#include <QtQuick/qsgtexturematerial.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class SmoothTextureMaterial : public QSGTextureMaterial
@@ -103,6 +101,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
index ebfe4a74a0..f642ca8d16 100644
--- a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
+++ b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
@@ -338,6 +338,9 @@ void QSGDefaultRectangleNode::update()
updateGeometry();
m_dirty_geometry = false;
}
+ m_material.setFlag(QSGMaterial::Blending, (m_gradient_stops.size() > 0 && !m_gradient_is_opaque)
+ || m_color.alpha() < 255
+ || (m_pen_width > 0 && m_border_color.alpha() < 255));
}
void QSGDefaultRectangleNode::updateGeometry()
diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h
index f42a1fa14a..e4560784fd 100644
--- a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h
+++ b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h
@@ -47,8 +47,6 @@
#include <QtQuick/qsgvertexcolormaterial.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGContext;
@@ -104,6 +102,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h
index bb423820b4..b75a123d34 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h
@@ -47,8 +47,6 @@
#include <QtQuick/private/qquicktext_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGContext;
@@ -112,8 +110,6 @@ private:
uint m_dirtyMaterial: 1;
};
-QT_END_HEADER
-
QT_END_NAMESPACE
#endif // DISTANCEFIELD_GLYPHNODE_H
diff --git a/src/quick/scenegraph/qsgflashnode_p.h b/src/quick/scenegraph/qsgflashnode_p.h
index 84ea734a25..d8d2ef4a24 100644
--- a/src/quick/scenegraph/qsgflashnode_p.h
+++ b/src/quick/scenegraph/qsgflashnode_p.h
@@ -44,8 +44,6 @@
#include <QtQuick/QSGSimpleRectNode>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGFlashNode : public QSGSimpleRectNode
@@ -61,7 +59,5 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSGFLASHNODE_H
diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 69aa63c278..85ef549397 100644
--- a/src/quick/items/qquickwindowmanager.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qquickwindowmanager_p.h"
-#include "qquickthreadedwindowmanager_p.h"
+#include "qsgrenderloop_p.h"
+#include "qsgthreadedrenderloop_p.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QTime>
@@ -74,17 +74,17 @@ extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_
DEFINE_BOOL_CONFIG_OPTION(qmlNoThreadedRenderer, QML_BAD_GUI_RENDER_LOOP);
DEFINE_BOOL_CONFIG_OPTION(qmlForceThreadedRenderer, QML_FORCE_THREADED_RENDERER); // Might trigger graphics driver threading bugs, use at own risk
-QQuickWindowManager *QQuickWindowManager::s_instance = 0;
+QSGRenderLoop *QSGRenderLoop::s_instance = 0;
-QQuickWindowManager::~QQuickWindowManager()
+QSGRenderLoop::~QSGRenderLoop()
{
}
-class QQuickTrivialWindowManager : public QObject, public QQuickWindowManager
+class QSGGuiThreadRenderLoop : public QObject, public QSGRenderLoop
{
Q_OBJECT
public:
- QQuickTrivialWindowManager();
+ QSGGuiThreadRenderLoop();
void show(QQuickWindow *window);
void hide(QQuickWindow *window);
@@ -100,7 +100,7 @@ public:
void maybeUpdate(QQuickWindow *window);
void update(QQuickWindow *window) { maybeUpdate(window); } // identical for this implementation.
- void releaseResources() { }
+ void releaseResources(QQuickWindow *) { }
QAnimationDriver *animationDriver() const { return 0; }
@@ -124,7 +124,7 @@ public:
};
-QQuickWindowManager *QQuickWindowManager::instance()
+QSGRenderLoop *QSGRenderLoop::instance()
{
if (!s_instance) {
@@ -153,20 +153,20 @@ QQuickWindowManager *QQuickWindowManager::instance()
if (!s_instance) {
s_instance = fancy
- ? (QQuickWindowManager*) new QQuickRenderThreadSingleContextWindowManager
- : (QQuickWindowManager*) new QQuickTrivialWindowManager;
+ ? (QSGRenderLoop*) new QSGThreadedRenderLoop
+ : (QSGRenderLoop*) new QSGGuiThreadRenderLoop;
}
}
return s_instance;
}
-void QQuickWindowManager::setInstance(QQuickWindowManager *instance)
+void QSGRenderLoop::setInstance(QSGRenderLoop *instance)
{
Q_ASSERT(!s_instance);
s_instance = instance;
}
-QQuickTrivialWindowManager::QQuickTrivialWindowManager()
+QSGGuiThreadRenderLoop::QSGGuiThreadRenderLoop()
: gl(0)
, eventPending(false)
{
@@ -174,7 +174,7 @@ QQuickTrivialWindowManager::QQuickTrivialWindowManager()
}
-void QQuickTrivialWindowManager::show(QQuickWindow *window)
+void QSGGuiThreadRenderLoop::show(QQuickWindow *window)
{
WindowData data;
data.updatePending = false;
@@ -184,7 +184,7 @@ void QQuickTrivialWindowManager::show(QQuickWindow *window)
maybeUpdate(window);
}
-void QQuickTrivialWindowManager::hide(QQuickWindow *window)
+void QSGGuiThreadRenderLoop::hide(QQuickWindow *window)
{
if (!m_windows.contains(window))
return;
@@ -194,18 +194,27 @@ void QQuickTrivialWindowManager::hide(QQuickWindow *window)
cd->cleanupNodesOnShutdown();
if (m_windows.size() == 0) {
- sg->invalidate();
- delete gl;
- gl = 0;
+ if (!cd->persistentSceneGraph) {
+ sg->invalidate();
+ if (!cd->persistentGLContext) {
+ delete gl;
+ gl = 0;
+ }
+ }
}
}
-void QQuickTrivialWindowManager::windowDestroyed(QQuickWindow *window)
+void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window)
{
hide(window);
+ if (m_windows.size() == 0) {
+ sg->invalidate();
+ delete gl;
+ gl = 0;
+ }
}
-void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window)
+void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
{
bool renderWithoutShowing = QQuickWindowPrivate::get(window)->renderWithoutShowing;
if ((!window->isExposed() && !renderWithoutShowing) || !m_windows.contains(window))
@@ -294,13 +303,15 @@ void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window)
maybeUpdate(window);
}
-void QQuickTrivialWindowManager::exposureChanged(QQuickWindow *window)
+void QSGGuiThreadRenderLoop::exposureChanged(QQuickWindow *window)
{
- if (window->isExposed())
- maybeUpdate(window);
+ if (window->isExposed()) {
+ m_windows[window].updatePending = true;
+ renderWindow(window);
+ }
}
-QImage QQuickTrivialWindowManager::grab(QQuickWindow *window)
+QImage QSGGuiThreadRenderLoop::grab(QQuickWindow *window)
{
if (!m_windows.contains(window))
return QImage();
@@ -316,13 +327,13 @@ QImage QQuickTrivialWindowManager::grab(QQuickWindow *window)
-void QQuickTrivialWindowManager::resize(QQuickWindow *, const QSize &)
+void QSGGuiThreadRenderLoop::resize(QQuickWindow *, const QSize &)
{
}
-void QQuickTrivialWindowManager::maybeUpdate(QQuickWindow *window)
+void QSGGuiThreadRenderLoop::maybeUpdate(QQuickWindow *window)
{
if (!m_windows.contains(window))
return;
@@ -337,13 +348,13 @@ void QQuickTrivialWindowManager::maybeUpdate(QQuickWindow *window)
-QSGContext *QQuickTrivialWindowManager::sceneGraphContext() const
+QSGContext *QSGGuiThreadRenderLoop::sceneGraphContext() const
{
return sg;
}
-bool QQuickTrivialWindowManager::event(QEvent *e)
+bool QSGGuiThreadRenderLoop::event(QEvent *e)
{
if (e->type() == QEvent::User) {
eventPending = false;
@@ -358,6 +369,6 @@ bool QQuickTrivialWindowManager::event(QEvent *e)
return QObject::event(e);
}
-#include "qquickwindowmanager.moc"
+#include "qsgrenderloop.moc"
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickwindowmanager_p.h b/src/quick/scenegraph/qsgrenderloop_p.h
index 94142a9d90..2ec6de9411 100644
--- a/src/quick/items/qquickwindowmanager_p.h
+++ b/src/quick/scenegraph/qsgrenderloop_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QQUICKWINDOWMANAGER_P_H
-#define QQUICKWINDOWMANAGER_P_H
+#ifndef QSGRenderLoop_P_H
+#define QSGRenderLoop_P_H
#include <QtGui/QImage>
#include <private/qtquickglobal_p.h>
@@ -51,10 +51,10 @@ class QQuickWindow;
class QSGContext;
class QAnimationDriver;
-class Q_QUICK_PRIVATE_EXPORT QQuickWindowManager
+class Q_QUICK_PRIVATE_EXPORT QSGRenderLoop
{
public:
- virtual ~QQuickWindowManager();
+ virtual ~QSGRenderLoop();
virtual void show(QQuickWindow *window) = 0;
virtual void hide(QQuickWindow *window) = 0;
@@ -72,16 +72,16 @@ public:
virtual QSGContext *sceneGraphContext() const = 0;
- virtual void releaseResources() = 0;
+ virtual void releaseResources(QQuickWindow *window) = 0;
// ### make this less of a singleton
- static QQuickWindowManager *instance();
- static void setInstance(QQuickWindowManager *instance);
+ static QSGRenderLoop *instance();
+ static void setInstance(QSGRenderLoop *instance);
private:
- static QQuickWindowManager *s_instance;
+ static QSGRenderLoop *s_instance;
};
QT_END_NAMESPACE
-#endif // QQUICKWINDOWMANAGER_P_H
+#endif // QSGRenderLoop_P_H
diff --git a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
index 0286408116..ac613c16f4 100644
--- a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
+++ b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
@@ -46,8 +46,6 @@
#include <private/qsgadaptationlayer_p.h>
#include <private/qqmlguard_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QPlatformSharedGraphicsCache;
@@ -132,6 +130,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSGSHAREDDISTANCEFIELDGLYPHCACHE_H
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
new file mode 100644
index 0000000000..fb26f543c3
--- /dev/null
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -0,0 +1,1133 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtCore/QMutex>
+#include <QtCore/QWaitCondition>
+#include <QtCore/QAnimationDriver>
+#include <QtCore/QQueue>
+
+#include <QtGui/QGuiApplication>
+#include <QtGui/QScreen>
+
+#include <QtQuick/QQuickWindow>
+#include <private/qquickwindow_p.h>
+
+#include <QtQuick/private/qsgrenderer_p.h>
+
+#include "qsgthreadedrenderloop_p.h"
+
+/*
+ Overall design:
+
+ There are two classes here. QSGThreadedRenderLoop and
+ QSGRenderThread. All communication between the two is based on
+ event passing and we have a number of custom events.
+
+ In this implementation, the render thread is never blocked and the
+ GUI thread will initiate a polishAndSync which will block and wait
+ for the render thread to pick it up and release the block only
+ after the render thread is done syncing. The reason for this
+ is:
+
+ 1. Clear blocking paradigm. We only have one real "block" point
+ (polishAndSync()) and all blocking is initiated by GUI and picked
+ up by Render at specific times based on events. This makes the
+ execution deterministic.
+
+ 2. Render does not have to interact with GUI. This is done so that
+ the render thread can run its own animation system which stays
+ alive even when the GUI thread is blocked doing i/o, object
+ instantiation, QPainter-painting or any other non-trivial task.
+
+ ---
+
+ The render loop is active while any window is exposed. All visible
+ windows are tracked, but only exposed windows are actually added to
+ the render thread and rendered. That means that if all windows are
+ obscured, we might end up cleaning up the SG and GL context (if all
+ windows have disabled persistency). Especially for multiprocess,
+ low-end systems, this should be quite important.
+
+ */
+
+QT_BEGIN_NAMESPACE
+
+
+// #define QSG_RENDER_LOOP_DEBUG
+// #define QSG_RENDER_LOOP_DEBUG_FULL
+#ifdef QSG_RENDER_LOOP_DEBUG
+#define QSG_RENDER_LOOP_DEBUG_BASIC
+#endif
+
+#ifdef QSG_RENDER_LOOP_DEBUG_FULL
+#define QSG_RENDER_LOOP_DEBUG_BASIC
+#endif
+
+#if defined (QSG_RENDER_LOOP_DEBUG_FULL)
+QElapsedTimer qsgrl_timer;
+# define RLDEBUG1(x) qDebug("(%6d) %s : %4d - %s", (int) qsgrl_timer.elapsed(), __FILE__, __LINE__, x);
+# define RLDEBUG(x) qDebug("(%6d) %s : %4d - %s", (int) qsgrl_timer.elapsed(), __FILE__, __LINE__, x);
+#elif defined (QSG_RENDER_LOOP_DEBUG_BASIC)
+QElapsedTimer qsgrl_timer;
+# define RLDEBUG1(x) qDebug("(%6d) %s : %4d - %s", (int) qsgrl_timer.elapsed(), __FILE__, __LINE__, x);
+# define RLDEBUG(x)
+#else
+# define RLDEBUG1(x)
+# define RLDEBUG(x)
+#endif
+
+
+static int get_env_int(const char *name, int defaultValue)
+{
+ QByteArray content = qgetenv(name);
+
+ bool ok = false;
+ int value = content.toInt(&ok);
+ return ok ? value : defaultValue;
+}
+
+
+static inline int qsgrl_animation_interval() {
+ qreal refreshRate = QGuiApplication::primaryScreen()->refreshRate();
+ // To work around that some platforms wrongfully return 0 or something
+ // bogus for refreshrate
+ if (refreshRate < 1)
+ return 16;
+ return int(1000 / refreshRate);
+}
+
+
+#ifndef QSG_NO_WINDOW_TIMING
+static bool qquick_window_timing = !qgetenv("QML_WINDOW_TIMING").isEmpty();
+static QTime threadTimer;
+static int syncTime;
+static int renderTime;
+static int sinceLastTime;
+#endif
+
+extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
+
+// RL: Render Loop
+// RT: Render Thread
+
+// Passed from the RL to the RT when a window is rendeirng on screen
+// and should be added to the render loop.
+const QEvent::Type WM_Expose = QEvent::Type(QEvent::User + 1);
+
+// Passed from the RL to the RT when a window is removed obscured and
+// should be removed from the render loop.
+const QEvent::Type WM_Obscure = QEvent::Type(QEvent::User + 2);
+
+// Passed from the RL to itself to initiate a polishAndSync() call.
+const QEvent::Type WM_LockAndSync = QEvent::Type(QEvent::User + 3);
+
+// Passed from the RL to RT when GUI has been locked, waiting for sync
+// (updatePaintNode())
+const QEvent::Type WM_RequestSync = QEvent::Type(QEvent::User + 4);
+
+// Passed by the RT to itself to trigger another render pass. This is
+// typically a result of QQuickWindow::update().
+const QEvent::Type WM_RequestRepaint = QEvent::Type(QEvent::User + 5);
+
+// Passed by the RL to the RT when a window has changed size.
+const QEvent::Type WM_Resize = QEvent::Type(QEvent::User + 6);
+
+// Passed by the RL to the RT to free up maybe release SG and GL contexts
+// if no windows are rendering.
+const QEvent::Type WM_TryRelease = QEvent::Type(QEvent::User + 7);
+
+// Passed by the RL to the RL when maybeUpdate is called on the RT to
+// just replay the maybeUpdate later. This typically happens when
+// updatePaintNode() results in a call to QQuickItem::update().
+const QEvent::Type WM_UpdateLater = QEvent::Type(QEvent::User + 8);
+
+// Passed by the RL to the RT when a QQuickWindow::grabWindow() is
+// called.
+const QEvent::Type WM_Grab = QEvent::Type(QEvent::User + 9);
+
+template <typename T> T *windowFor(const QList<T> list, QQuickWindow *window)
+{
+ for (int i=0; i<list.size(); ++i) {
+ const T &t = list.at(i);
+ if (t.window == window)
+ return const_cast<T *>(&t);
+ }
+ return 0;
+}
+
+
+class WMWindowEvent : public QEvent
+{
+public:
+ WMWindowEvent(QQuickWindow *c, QEvent::Type type) : QEvent(type), window(c) { }
+ QQuickWindow *window;
+};
+
+class WMTryReleaseEvent : public WMWindowEvent
+{
+public:
+ WMTryReleaseEvent(QQuickWindow *win, bool destroy)
+ : WMWindowEvent(win, WM_TryRelease)
+ , inDestructor(destroy)
+ {}
+
+ bool inDestructor;
+};
+
+class WMResizeEvent : public WMWindowEvent
+{
+public:
+ WMResizeEvent(QQuickWindow *c, const QSize &s) : WMWindowEvent(c, WM_Resize), size(s) { }
+ QSize size;
+};
+
+
+class WMExposeEvent : public WMWindowEvent
+{
+public:
+ WMExposeEvent(QQuickWindow *c) : WMWindowEvent(c, WM_Expose), size(c->size()) { }
+ QSize size;
+};
+
+
+class WMGrabEvent : public WMWindowEvent
+{
+public:
+ WMGrabEvent(QQuickWindow *c, QImage *result) : WMWindowEvent(c, WM_Grab), image(result) {}
+ QImage *image;
+};
+
+
+class QSGRenderThreadEventQueue : public QQueue<QEvent *>
+{
+public:
+ QSGRenderThreadEventQueue()
+ : waiting(false)
+ {
+ }
+
+ void addEvent(QEvent *e) {
+ mutex.lock();
+ enqueue(e);
+ if (waiting)
+ condition.wakeOne();
+ mutex.unlock();
+ }
+
+ QEvent *takeEvent(bool wait) {
+ mutex.lock();
+ if (size() == 0 && wait) {
+ waiting = true;
+ condition.wait(&mutex);
+ waiting = false;
+ }
+ QEvent *e = dequeue();
+ mutex.unlock();
+ return e;
+ }
+
+ bool hasMoreEvents() {
+ mutex.lock();
+ bool has = !isEmpty();
+ mutex.unlock();
+ return has;
+ }
+
+private:
+ QMutex mutex;
+ QWaitCondition condition;
+ bool waiting;
+};
+
+
+class QSGRenderThread : public QThread
+{
+ Q_OBJECT
+public:
+
+ QSGRenderThread(QSGThreadedRenderLoop *w)
+ : wm(w)
+ , gl(0)
+ , sg(QSGContext::createDefaultContext())
+ , pendingUpdate(0)
+ , sleeping(false)
+ , syncResultedInChanges(false)
+ , guiIsLocked(false)
+ , shouldExit(false)
+ , stopEventProcessing(false)
+ {
+ sg->moveToThread(this);
+ vsyncDelta = QGuiApplication::primaryScreen()->refreshRate();
+ }
+
+
+ void invalidateOpenGL(QQuickWindow *window, bool inDestructor);
+ void initializeOpenGL();
+
+ bool event(QEvent *);
+ void run();
+
+ void syncAndRender();
+ void sync();
+
+ void requestRepaint()
+ {
+ if (sleeping)
+ stopEventProcessing = true;
+ if (m_windows.size() > 0)
+ pendingUpdate |= RepaintRequest;
+ }
+
+ void processEventsAndWaitForMore();
+ void processEvents();
+ void postEvent(QEvent *e);
+
+public slots:
+ void sceneGraphChanged() {
+ RLDEBUG(" Render: sceneGraphChanged()");
+ syncResultedInChanges = true;
+ }
+
+public:
+ enum UpdateRequest {
+ SyncRequest = 0x01,
+ RepaintRequest = 0x02
+ };
+
+ QSGThreadedRenderLoop *wm;
+ QOpenGLContext *gl;
+ QSGContext *sg;
+
+ QEventLoop eventLoop;
+
+ uint pendingUpdate : 2;
+ uint sleeping : 1;
+ uint syncResultedInChanges : 1;
+
+ volatile bool guiIsLocked;
+ volatile bool shouldExit;
+
+ float vsyncDelta;
+
+ QMutex mutex;
+ QWaitCondition waitCondition;
+
+ QElapsedTimer m_timer;
+
+ struct Window {
+ QQuickWindow *window;
+ QSize size;
+ };
+ QList<Window> m_windows;
+
+ // Local event queue stuff...
+ bool stopEventProcessing;
+ QSGRenderThreadEventQueue eventQueue;
+};
+
+bool QSGRenderThread::event(QEvent *e)
+{
+ switch ((int) e->type()) {
+
+ case WM_Expose: {
+ RLDEBUG1(" Render: WM_Expose");
+ WMExposeEvent *se = static_cast<WMExposeEvent *>(e);
+
+ pendingUpdate |= RepaintRequest;
+
+ if (windowFor(m_windows, se->window)) {
+ RLDEBUG1(" Render: - window already added...");
+ return true;
+ }
+
+ Window window;
+ window.window = se->window;
+ window.size = se->size;
+ m_windows << window;
+ return true; }
+
+ case WM_Obscure: {
+ RLDEBUG1(" Render: WM_Obscure");
+ WMWindowEvent *ce = static_cast<WMWindowEvent *>(e);
+ for (int i=0; i<m_windows.size(); ++i) {
+ if (m_windows.at(i).window == ce->window) {
+ RLDEBUG1(" Render: - removed one...");
+ m_windows.removeAt(i);
+ break;
+ }
+ }
+
+ if (sleeping && m_windows.size())
+ stopEventProcessing = true;
+
+ return true; }
+
+ case WM_RequestSync:
+ RLDEBUG(" Render: WM_RequestSync");
+ if (sleeping)
+ stopEventProcessing = true;
+ if (m_windows.size() > 0)
+ pendingUpdate |= SyncRequest;
+ return true;
+
+ case WM_Resize: {
+ RLDEBUG(" Render: WM_Resize");
+ WMResizeEvent *re = static_cast<WMResizeEvent *>(e);
+ Window *w = windowFor(m_windows, re->window);
+ w->size = re->size;
+ // No need to wake up here as we will get a sync shortly.. (see QSGThreadedRenderLoop::resize());
+ return true; }
+
+ case WM_TryRelease:
+ RLDEBUG1(" Render: WM_TryRelease");
+ mutex.lock();
+ if (m_windows.size() == 0) {
+ WMTryReleaseEvent *wme = static_cast<WMTryReleaseEvent *>(e);
+ RLDEBUG1(" Render: - setting exit flag and invalidating GL");
+ invalidateOpenGL(wme->window, wme->inDestructor);
+ shouldExit = !gl;
+ if (sleeping)
+ stopEventProcessing = true;
+ } else {
+ RLDEBUG1(" Render: - not releasing anything because we have active windows...");
+ }
+ waitCondition.wakeOne();
+ mutex.unlock();
+ return true;
+
+ case WM_Grab: {
+ RLDEBUG1(" Render: WM_Grab");
+ WMGrabEvent *ce = static_cast<WMGrabEvent *>(e);
+ Window *w = windowFor(m_windows, ce->window);
+ mutex.lock();
+ if (w) {
+ gl->makeCurrent(ce->window);
+
+ RLDEBUG1(" Render: - syncing scene graph");
+ QQuickWindowPrivate *d = QQuickWindowPrivate::get(w->window);
+ d->syncSceneGraph();
+
+ RLDEBUG1(" Render: - rendering scene graph");
+ QQuickWindowPrivate::get(ce->window)->renderSceneGraph(w->size);
+
+ RLDEBUG1(" Render: - grabbing result...");
+ *ce->image = qt_gl_read_framebuffer(w->size, false, false);
+ }
+ RLDEBUG1(" Render: - waking gui to handle grab result");
+ waitCondition.wakeOne();
+ mutex.unlock();
+ return true;
+ }
+
+ case WM_RequestRepaint:
+ // When GUI posts this event, it is followed by a polishAndSync, so we mustn't
+ // exit the event loop yet.
+ pendingUpdate |= RepaintRequest;
+ break;
+
+ default:
+ break;
+ }
+ return QThread::event(e);
+}
+
+void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor)
+{
+ RLDEBUG1(" Render: invalidateOpenGL()");
+
+ if (!gl)
+ return;
+
+ if (!window) {
+ qWarning("QSGThreadedRenderLoop:QSGRenderThread: no window to make current...");
+ return;
+ }
+
+
+ bool persistentGL = false;
+ bool persistentSG = false;
+
+ // GUI is locked so accessing the wm and window here is safe
+ for (int i=0; i<wm->m_windows.size(); ++i) {
+ const QSGThreadedRenderLoop::Window &w = wm->m_windows.at(i);
+ if (!inDestructor || w.window != window) {
+ persistentSG |= w.window->isPersistentSceneGraph();
+ persistentGL |= w.window->isPersistentOpenGLContext();
+ }
+ }
+
+ gl->makeCurrent(window);
+
+ // The canvas nodes must be cleanded up regardless if we are in the destructor..
+ if (!persistentSG || inDestructor) {
+ QQuickWindowPrivate *dd = QQuickWindowPrivate::get(window);
+ dd->cleanupNodesOnShutdown();
+ }
+
+ // We're not doing any cleanup in this case...
+ if (persistentSG) {
+ RLDEBUG1(" Render: - persistent SG, avoiding cleanup");
+ return;
+ }
+
+ sg->invalidate();
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ gl->doneCurrent();
+ RLDEBUG1(" Render: - invalidated scenegraph..");
+
+ if (!persistentGL) {
+ delete gl;
+ gl = 0;
+ RLDEBUG1(" Render: - invalidated OpenGL");
+ } else {
+ RLDEBUG1(" Render: - persistent GL, avoiding cleanup");
+ }
+}
+
+void QSGRenderThread::initializeOpenGL()
+{
+ RLDEBUG1(" Render: initializeOpenGL()");
+ QWindow *win = m_windows.at(0).window;
+ bool temp = false;
+
+ // Workaround for broken expose logic... We should not get an
+ // expose when the size of a window is invalid, but we sometimes do.
+ // On Mac this leads to harmless, yet annoying, console warnings
+ if (m_windows.at(0).size.isEmpty()) {
+ temp = true;
+ win = new QWindow();
+ win->setFormat(m_windows.at(0).window->requestedFormat());
+ win->setSurfaceType(QWindow::OpenGLSurface);
+ win->setGeometry(0, 0, 64, 64);
+ win->create();
+ }
+
+ gl = new QOpenGLContext();
+ // Pick up the surface format from one of them
+ gl->setFormat(win->requestedFormat());
+ gl->create();
+ if (!gl->makeCurrent(win))
+ qWarning("QQuickWindow: makeCurrent() failed...");
+ sg->initialize(gl);
+
+ if (temp) {
+ delete win;
+ }
+}
+
+/*!
+ Enters the mutex lock to make sure GUI is blocking and performs
+ sync, then wakes GUI.
+ */
+void QSGRenderThread::sync()
+{
+ RLDEBUG(" Render: sync()");
+ mutex.lock();
+
+ Q_ASSERT_X(guiIsLocked, "QSGRenderThread::sync()", "sync triggered on bad terms as gui is not already locked...");
+ pendingUpdate = 0;
+
+ for (int i=0; i<m_windows.size(); ++i) {
+ Window &w = const_cast<Window &>(m_windows.at(i));
+ if (w.size.width() == 0 || w.size.height() == 0) {
+ RLDEBUG(" Render: - window has bad size, waiting...");
+ continue;
+ }
+ gl->makeCurrent(w.window);
+ QQuickWindowPrivate *d = QQuickWindowPrivate::get(w.window);
+ bool hadRenderer = d->renderer != 0;
+ d->syncSceneGraph();
+ if (!hadRenderer && d->renderer) {
+ RLDEBUG(" Render: - renderer was created, hooking up changed signal");
+ syncResultedInChanges = true;
+ connect(d->renderer, SIGNAL(sceneGraphChanged()), this, SLOT(sceneGraphChanged()), Qt::DirectConnection);
+ }
+ }
+
+ RLDEBUG(" Render: - unlocking after sync");
+
+ waitCondition.wakeOne();
+ mutex.unlock();
+
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+}
+
+
+void QSGRenderThread::syncAndRender()
+{
+#ifndef QSG_NO_WINDOW_TIMING
+ if (qquick_window_timing)
+ sinceLastTime = threadTimer.restart();
+#endif
+ QElapsedTimer waitTimer;
+ waitTimer.start();
+
+ RLDEBUG(" Render: syncAndRender()");
+
+ syncResultedInChanges = false;
+
+ bool repaintRequested = pendingUpdate & RepaintRequest;
+
+ if (pendingUpdate & SyncRequest) {
+ RLDEBUG(" Render: - update pending, doing sync");
+ sync();
+ }
+
+ if (!syncResultedInChanges && !(repaintRequested)) {
+ RLDEBUG(" Render: - no changes, rendering aborted");
+ int waitTime = vsyncDelta - (int) waitTimer.elapsed();
+ if (waitTime > 0)
+ msleep(waitTime);
+ return;
+ }
+
+#ifndef QSG_NO_WINDOW_TIMING
+ if (qquick_window_timing)
+ syncTime = threadTimer.elapsed();
+#endif
+ RLDEBUG(" Render: - rendering starting");
+
+ for (int i=0; i<m_windows.size(); ++i) {
+ Window &w = const_cast<Window &>(m_windows.at(i));
+ QQuickWindowPrivate *d = QQuickWindowPrivate::get(w.window);
+ if (!d->renderer || w.size.width() == 0 || w.size.height() == 0) {
+ RLDEBUG(" Render: - Window not yet ready, skipping render...");
+ continue;
+ }
+ gl->makeCurrent(w.window);
+ d->renderSceneGraph(w.size);
+#ifndef QSG_NO_WINDOW_TIMING
+ if (qquick_window_timing && i == 0)
+ renderTime = threadTimer.elapsed();
+#endif
+ gl->swapBuffers(w.window);
+ d->fireFrameSwapped();
+ }
+ RLDEBUG(" Render: - rendering done");
+
+#ifndef QSG_NO_WINDOW_TIMING
+ if (qquick_window_timing)
+ qDebug("window Time: sinceLast=%d, sync=%d, first render=%d, after final swap=%d",
+ sinceLastTime,
+ syncTime,
+ renderTime - syncTime,
+ threadTimer.elapsed() - renderTime);
+#endif
+}
+
+
+
+void QSGRenderThread::postEvent(QEvent *e)
+{
+ eventQueue.addEvent(e);
+}
+
+
+
+void QSGRenderThread::processEvents()
+{
+ RLDEBUG(" Render: processEvents()");
+ while (eventQueue.hasMoreEvents()) {
+ QEvent *e = eventQueue.takeEvent(false);
+ event(e);
+ delete e;
+ }
+ RLDEBUG(" Render: - done with processEvents()");
+}
+
+void QSGRenderThread::processEventsAndWaitForMore()
+{
+ RLDEBUG(" Render: processEventsAndWaitForMore()");
+ stopEventProcessing = false;
+ while (!stopEventProcessing) {
+ QEvent *e = eventQueue.takeEvent(true);
+ event(e);
+ delete e;
+ }
+ RLDEBUG(" Render: - done with processEventsAndWaitForMore()");
+}
+
+void QSGRenderThread::run()
+{
+ RLDEBUG1(" Render: run()");
+ while (!shouldExit) {
+
+ if (m_windows.size() > 0) {
+ if (!gl)
+ initializeOpenGL();
+ if (!sg->isReady())
+ sg->initialize(gl);
+ syncAndRender();
+ }
+
+ processEvents();
+ QCoreApplication::processEvents();
+
+ if (!shouldExit
+ && (pendingUpdate == 0 || m_windows.size() == 0)) {
+ RLDEBUG(" Render: enter event loop (going to sleep)");
+ sleeping = true;
+ processEventsAndWaitForMore();
+ sleeping = false;
+ }
+
+ }
+
+ Q_ASSERT_X(!gl, "QSGRenderThread::run()", "The OpenGL context should be cleaned up before exiting the render thread...");
+
+ RLDEBUG1(" Render: run() completed...");
+}
+
+QSGThreadedRenderLoop::QSGThreadedRenderLoop()
+ : m_animation_timer(0)
+ , m_update_timer(0)
+ , m_sync_triggered_update(false)
+{
+#if defined(QSG_RENDER_LOOP_DEBUG_BASIC) || defined (QSG_RENDER_LOOP_DEBUG_FULL)
+ qsgrl_timer.start();
+#endif
+
+ m_thread = new QSGRenderThread(this);
+ m_thread->moveToThread(m_thread);
+
+ m_animation_driver = m_thread->sg->createAnimationDriver(this);
+
+ m_exhaust_delay = get_env_int("QML_EXHAUST_DELAY", 5);
+
+ connect(m_animation_driver, SIGNAL(started()), this, SLOT(animationStarted()));
+ connect(m_animation_driver, SIGNAL(stopped()), this, SLOT(animationStopped()));
+
+ m_animation_driver->install();
+ RLDEBUG1("GUI: QSGThreadedRenderLoop() created");
+}
+
+void QSGThreadedRenderLoop::maybePostPolishRequest()
+{
+ if (m_update_timer == 0) {
+ RLDEBUG("GUI: - posting update");
+ m_update_timer = startTimer(m_exhaust_delay, Qt::PreciseTimer);
+ }
+}
+
+QAnimationDriver *QSGThreadedRenderLoop::animationDriver() const
+{
+ return m_animation_driver;
+}
+
+QSGContext *QSGThreadedRenderLoop::sceneGraphContext() const
+{
+ return m_thread->sg;
+}
+
+bool QSGThreadedRenderLoop::anyoneShowing()
+{
+ for (int i=0; i<m_windows.size(); ++i) {
+ QQuickWindow *c = m_windows.at(i).window;
+ if (c->isVisible() && c->isExposed())
+ return true;
+ }
+ return false;
+}
+
+void QSGThreadedRenderLoop::animationStarted()
+{
+ RLDEBUG("GUI: animationStarted()");
+ if (!anyoneShowing() && m_animation_timer == 0)
+ m_animation_timer = startTimer(qsgrl_animation_interval());
+ maybePostPolishRequest();
+}
+
+void QSGThreadedRenderLoop::animationStopped()
+{
+ RLDEBUG("GUI: animationStopped()");
+ if (!anyoneShowing()) {
+ killTimer(m_animation_timer);
+ m_animation_timer = 0;
+ }
+}
+
+
+
+/*
+ Adds this window to the list of tracked windowes in this window
+ manager. show() does not trigger rendering to start, that happens
+ in expose.
+ */
+
+void QSGThreadedRenderLoop::show(QQuickWindow *window)
+{
+ RLDEBUG1("GUI: show()");
+
+ Window win;
+ win.window = window;
+ m_windows << win;
+}
+
+
+
+/*
+ Removes this window from the list of tracked windowes in this
+ window manager. hide() will trigger obscure, which in turn will
+ stop rendering.
+ */
+
+void QSGThreadedRenderLoop::hide(QQuickWindow *window)
+{
+ RLDEBUG1("GUI: hide()");
+
+ if (window->isExposed())
+ handleObscurity(window);
+
+ releaseResources(window);
+
+ for (int i=0; i<m_windows.size(); ++i) {
+ if (m_windows.at(i).window == window) {
+ m_windows.removeAt(i);
+ break;
+ }
+ }
+}
+
+
+/*!
+ If the window is first hide it, then perform a complete cleanup
+ with releaseResources which will take down the GL context and
+ exit the rendering thread.
+ */
+void QSGThreadedRenderLoop::windowDestroyed(QQuickWindow *window)
+{
+ RLDEBUG1("GUI: windowDestroyed()");
+
+ if (window->isVisible())
+ hide(window);
+ releaseResources(window, true);
+
+ RLDEBUG1("GUI: - done with windowDestroyed()");
+}
+
+
+void QSGThreadedRenderLoop::exposureChanged(QQuickWindow *window)
+{
+ RLDEBUG1("GUI: exposureChanged()");
+ if (windowFor(m_windows, window) == 0)
+ return;
+
+ if (window->isExposed()) {
+ handleExposure(window);
+ } else {
+ handleObscurity(window);
+ }
+}
+
+
+/*!
+ Will post an event to the render thread that this window should
+ start to render.
+ */
+void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window)
+{
+ RLDEBUG1("GUI: handleExposure");
+
+ // Because we are going to bind a GL context to it, make sure it
+ // is created.
+ if (!window->handle())
+ window->create();
+
+ m_thread->postEvent(new WMExposeEvent(window));
+
+ // Start render thread if it is not running
+ if (!m_thread->isRunning()) {
+ m_thread->shouldExit = false;
+
+ RLDEBUG1("GUI: - starting render thread...");
+ m_thread->start();
+
+ } else {
+ RLDEBUG1("GUI: - render thread already running");
+ }
+
+ polishAndSync();
+
+ // Kill non-visual animation timer if it is running
+ if (m_animation_timer) {
+ killTimer(m_animation_timer);
+ m_animation_timer = 0;
+ }
+
+}
+
+/*!
+ This function posts an event to the render thread to remove the window
+ from the list of windowses to render.
+
+ It also starts up the non-vsync animation tick if no more windows
+ are showing.
+ */
+void QSGThreadedRenderLoop::handleObscurity(QQuickWindow *window)
+{
+ RLDEBUG1("GUI: handleObscurity");
+ if (m_thread->isRunning())
+ m_thread->postEvent(new WMWindowEvent(window, WM_Obscure));
+
+ if (!anyoneShowing() && m_animation_driver->isRunning() && m_animation_timer == 0) {
+ m_animation_timer = startTimer(qsgrl_animation_interval());
+ }
+}
+
+
+/*!
+ Called whenever the QML scene has changed. Will post an event to
+ ourselves that a sync is needed.
+ */
+void QSGThreadedRenderLoop::maybeUpdate(QQuickWindow *window)
+{
+ Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread() || m_thread->guiIsLocked,
+ "QQuickItem::update()",
+ "Function can only be called from GUI thread or during QQuickItem::updatePaintNode()");
+
+ RLDEBUG("GUI: maybeUpdate...");
+ Window *w = windowFor(m_windows, window);
+ if (!w || !m_thread->isRunning()) {
+ return;
+ }
+
+ // Call this function from the Gui thread later as startTimer cannot be
+ // called from the render thread.
+ if (QThread::currentThread() == m_thread) {
+ RLDEBUG("GUI: - on render thread, will update later..");
+ m_sync_triggered_update = true;
+ return;
+ }
+
+ maybePostPolishRequest();
+}
+
+/*!
+ Called when the QQuickWindow should be explicitly repainted. This function
+ can also be called on the render thread when the GUI thread is blocked to
+ keep render thread animations alive.
+ */
+void QSGThreadedRenderLoop::update(QQuickWindow *window)
+{
+ if (QThread::currentThread() == m_thread) {
+ RLDEBUG("Gui: update called on render thread");
+ m_thread->requestRepaint();
+ return;
+ }
+
+ RLDEBUG("Gui: update called");
+ m_thread->postEvent(new QEvent(WM_RequestRepaint));
+ maybeUpdate(window);
+}
+
+
+
+/*!
+ * Release resources will post an event to the render thread to
+ * free up the SG and GL resources and exists the render thread.
+ */
+void QSGThreadedRenderLoop::releaseResources(QQuickWindow *window, bool inDestructor)
+{
+ RLDEBUG1("GUI: releaseResources requested...");
+
+ m_thread->mutex.lock();
+ if (m_thread->isRunning() && !m_thread->shouldExit) {
+ RLDEBUG1("GUI: - posting release request to render thread");
+ m_thread->postEvent(new WMTryReleaseEvent(window, inDestructor));
+ m_thread->waitCondition.wait(&m_thread->mutex);
+ }
+ m_thread->mutex.unlock();
+}
+
+
+
+void QSGThreadedRenderLoop::polishAndSync()
+{
+ if (!anyoneShowing())
+ return;
+
+ RLDEBUG("GUI: polishAndSync()");
+
+#ifndef QSG_NO_WINDOW_TIMING
+ QElapsedTimer timer;
+ int polishTime = 0;
+ int waitTime = 0;
+ if (qquick_window_timing)
+ timer.start();
+#endif
+
+ // Polish as the last thing we do before we allow the sync to take place
+ for (int i=0; i<m_windows.size(); ++i) {
+ const Window &w = m_windows.at(i);
+ QQuickWindowPrivate *d = QQuickWindowPrivate::get(w.window);
+ d->polishItems();
+ }
+#ifndef QSG_NO_WINDOW_TIMING
+ if (qquick_window_timing)
+ polishTime = timer.elapsed();
+#endif
+
+ m_sync_triggered_update = false;
+
+ RLDEBUG("GUI: - lock for sync...");
+ m_thread->mutex.lock();
+ m_thread->guiIsLocked = true;
+ m_thread->postEvent(new QEvent(WM_RequestSync));
+
+ RLDEBUG("GUI: - wait for sync...");
+#ifndef QSG_NO_WINDOW_TIMING
+ if (qquick_window_timing)
+ waitTime = timer.elapsed();
+#endif
+ m_thread->waitCondition.wait(&m_thread->mutex);
+ m_thread->guiIsLocked = false;
+ m_thread->mutex.unlock();
+ RLDEBUG("GUI: - unlocked after sync...");
+
+#ifndef QSG_NO_WINDOW_TIMING
+ int syncTime = timer.elapsed();
+#endif
+
+ killTimer(m_update_timer);
+ m_update_timer = 0;
+
+ if (m_animation_driver->isRunning()) {
+ RLDEBUG("GUI: - animations advancing");
+ m_animation_driver->advance();
+ RLDEBUG("GUI: - animations done");
+
+ // We need to trigger another sync to keep animations running...
+ maybePostPolishRequest();
+ } else if (m_sync_triggered_update) {
+ maybePostPolishRequest();
+ }
+
+#ifndef QSG_NO_WINDOW_TIMING
+ if (qquick_window_timing)
+ qDebug(" - polish=%d, wait=%d, sync=%d -- animations=%d", polishTime, waitTime - polishTime, syncTime - waitTime, int(timer.elapsed() - syncTime));
+#endif
+}
+
+bool QSGThreadedRenderLoop::event(QEvent *e)
+{
+ switch ((int) e->type()) {
+
+ case QEvent::Timer:
+ if (static_cast<QTimerEvent *>(e)->timerId() == m_animation_timer) {
+ RLDEBUG("GUI: QEvent::Timer -> non-visual animation");
+ m_animation_driver->advance();
+ } else if (static_cast<QTimerEvent *>(e)->timerId() == m_update_timer) {
+ RLDEBUG("GUI: QEvent::Timer -> Polish & Sync");
+ polishAndSync();
+ }
+ return true;
+
+ default:
+ break;
+ }
+
+ return QObject::event(e);
+}
+
+
+
+/*
+ Locks down GUI and performs a grab the scene graph, then returns the result.
+
+ Since the QML scene could have changed since the last time it was rendered,
+ we need to polish and sync the scene graph. This might seem superfluous, but
+ - QML changes could have triggered deleteLater() which could have removed
+ textures or other objects from the scene graph, causing render to crash.
+ - Autotests rely on grab(), setProperty(), grab(), compare behavior.
+ */
+
+QImage QSGThreadedRenderLoop::grab(QQuickWindow *window)
+{
+ RLDEBUG("GUI: grab");
+ if (!m_thread->isRunning())
+ return QImage();
+
+ if (!window->handle())
+ window->create();
+
+ RLDEBUG1("GUI: - polishing items...");
+ QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);
+ d->polishItems();
+
+ QImage result;
+ m_thread->mutex.lock();
+ RLDEBUG1("GUI: - locking, posting grab event");
+ m_thread->postEvent(new WMGrabEvent(window, &result));
+ m_thread->waitCondition.wait(&m_thread->mutex);
+ RLDEBUG1("GUI: - locking, grab done, unlocking");
+ m_thread->mutex.unlock();
+
+ RLDEBUG1("Gui: - grab complete");
+
+ return result;
+}
+
+/*
+ Notify the render thread that the window is now a new size. Then
+ locks GUI until render has adapted.
+ */
+
+void QSGThreadedRenderLoop::resize(QQuickWindow *w, const QSize &size)
+{
+ RLDEBUG1("GUI: resize");
+
+ if (!m_thread->isRunning() || !m_windows.size() || !w->isExposed() || windowFor(m_windows, w) == 0) {
+ return;
+ }
+
+ if (size.width() == 0 || size.height() == 0)
+ return;
+
+ RLDEBUG("GUI: - posting resize event...");
+ m_thread->postEvent(new WMResizeEvent(w, size));
+
+ polishAndSync();
+}
+
+#include "qsgthreadedrenderloop.moc"
+
+QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
new file mode 100644
index 0000000000..63b2b442e6
--- /dev/null
+++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSGTHREADEDRENDERLOOP_P_H
+#define QSGTHREADEDRENDERLOOP_P_H
+
+#include <QtCore/QThread>
+#include <QtGui/QOpenGLContext>
+#include <private/qsgcontext_p.h>
+
+#include "qsgrenderloop_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QSGRenderThread;
+
+class QSGThreadedRenderLoop : public QObject, public QSGRenderLoop
+{
+ Q_OBJECT
+public:
+ QSGThreadedRenderLoop();
+
+ void show(QQuickWindow *window);
+ void hide(QQuickWindow *window);
+
+ void windowDestroyed(QQuickWindow *window);
+ void exposureChanged(QQuickWindow *window);
+
+ void handleExposure(QQuickWindow *window);
+ void handleObscurity(QQuickWindow *window);
+
+ QImage grab(QQuickWindow *);
+
+ void resize(QQuickWindow *, const QSize &);
+
+ void update(QQuickWindow *window);
+ void maybeUpdate(QQuickWindow *window);
+ QSGContext *sceneGraphContext() const;
+
+ QAnimationDriver *animationDriver() const;
+
+ void releaseResources(QQuickWindow *window) { releaseResources(window, false); }
+
+ bool event(QEvent *);
+
+ void wakeup();
+
+public slots:
+ void animationStarted();
+ void animationStopped();
+
+private:
+ friend class QSGRenderThread;
+
+ void releaseResources(QQuickWindow *window, bool inDestructor);
+ bool checkAndResetForceUpdate(QQuickWindow *window);
+
+ bool anyoneShowing();
+ void initialize();
+
+ void maybePostPolishRequest();
+
+ void waitForReleaseComplete();
+
+ void polishAndSync();
+
+ struct Window {
+ QQuickWindow *window;
+ };
+
+ QSGRenderThread *m_thread;
+ QAnimationDriver *m_animation_driver;
+ QList<Window> m_windows;
+
+ int m_animation_timer;
+ int m_update_timer;
+ int m_exhaust_delay;
+
+ bool m_sync_triggered_update;
+};
+
+
+
+QT_END_NAMESPACE
+
+#endif // QSGTHREADEDRENDERLOOP_P_H
diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri
index a58e9b46ad..8c87e23ac9 100644
--- a/src/quick/scenegraph/scenegraph.pri
+++ b/src/quick/scenegraph/scenegraph.pri
@@ -65,7 +65,10 @@ HEADERS += \
$$PWD/qsgdefaultimagenode_p.h \
$$PWD/qsgdefaultrectanglenode_p.h \
$$PWD/qsgflashnode_p.h \
- $$PWD/qsgshareddistancefieldglyphcache_p.h
+ $$PWD/qsgshareddistancefieldglyphcache_p.h \
+ $$PWD/qsgrenderloop_p.h \
+ $$PWD/qsgthreadedrenderloop_p.h
+
SOURCES += \
$$PWD/qsgadaptationlayer.cpp \
@@ -79,7 +82,10 @@ SOURCES += \
$$PWD/qsgdefaultimagenode.cpp \
$$PWD/qsgdefaultrectanglenode.cpp \
$$PWD/qsgflashnode.cpp \
- $$PWD/qsgshareddistancefieldglyphcache.cpp
+ $$PWD/qsgshareddistancefieldglyphcache.cpp \
+ $$PWD/qsgrenderloop.cpp \
+ $$PWD/qsgthreadedrenderloop.cpp
+
diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h b/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h
index 479c8e2d1f..f3fb92cbc5 100644
--- a/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h
+++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h
@@ -48,8 +48,6 @@
#include <QtCore/qsharedpointer.h>
#include <QtCore/qhash.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGDepthStencilBufferManager;
@@ -137,6 +135,4 @@ extern uint qHash(const QSGDepthStencilBuffer::Format &format);
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.h b/src/quick/scenegraph/util/qsgflatcolormaterial.h
index 97b8c14a9b..27cf256603 100644
--- a/src/quick/scenegraph/util/qsgflatcolormaterial.h
+++ b/src/quick/scenegraph/util/qsgflatcolormaterial.h
@@ -45,8 +45,6 @@
#include <QtQuick/qsgmaterial.h>
#include <qcolor.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_EXPORT QSGFlatColorMaterial : public QSGMaterial
@@ -67,6 +65,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // FLATCOLORMATERIAL_H
diff --git a/src/quick/scenegraph/util/qsgpainternode.cpp b/src/quick/scenegraph/util/qsgpainternode.cpp
index df226455e9..e5cf6b8295 100644
--- a/src/quick/scenegraph/util/qsgpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgpainternode.cpp
@@ -70,7 +70,7 @@ static inline int qt_next_power_of_two(int v)
QSGPainterTexture::QSGPainterTexture()
: QSGPlainTexture()
{
-
+ m_retain_image = true;
}
#ifdef QT_OPENGL_ES
diff --git a/src/quick/scenegraph/util/qsgpainternode_p.h b/src/quick/scenegraph/util/qsgpainternode_p.h
index 8c799810e4..387ca9bf88 100644
--- a/src/quick/scenegraph/util/qsgpainternode_p.h
+++ b/src/quick/scenegraph/util/qsgpainternode_p.h
@@ -50,8 +50,6 @@
#include <QtGui/qcolor.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QOpenGLFramebufferObject;
@@ -151,8 +149,6 @@ private:
bool m_dirtyTexture;
};
-QT_END_HEADER
-
QT_END_NAMESPACE
#endif // QSGPAINTERNODE_P_H
diff --git a/src/quick/scenegraph/util/qsgsimplematerial.h b/src/quick/scenegraph/util/qsgsimplematerial.h
index 877ea1c4b5..a1e5aa23be 100644
--- a/src/quick/scenegraph/util/qsgsimplematerial.h
+++ b/src/quick/scenegraph/util/qsgsimplematerial.h
@@ -44,8 +44,6 @@
#include <QtQuick/qsgmaterial.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
template <typename State>
@@ -215,7 +213,5 @@ Q_INLINE_TEMPLATE void QSGSimpleMaterialShader<State>::updateState(const RenderS
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/util/qsgsimplerectnode.h b/src/quick/scenegraph/util/qsgsimplerectnode.h
index 2808354089..856e6793bc 100644
--- a/src/quick/scenegraph/util/qsgsimplerectnode.h
+++ b/src/quick/scenegraph/util/qsgsimplerectnode.h
@@ -45,8 +45,6 @@
#include <QtQuick/qsgnode.h>
#include <QtQuick/qsgflatcolormaterial.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_EXPORT QSGSimpleRectNode : public QSGGeometryNode
@@ -70,6 +68,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // SOLIDRECTNODE_H
diff --git a/src/quick/scenegraph/util/qsgsimpletexturenode.h b/src/quick/scenegraph/util/qsgsimpletexturenode.h
index a2ce80802a..ffd10210ae 100644
--- a/src/quick/scenegraph/util/qsgsimpletexturenode.h
+++ b/src/quick/scenegraph/util/qsgsimpletexturenode.h
@@ -46,8 +46,6 @@
#include <QtQuick/qsggeometry.h>
#include <QtQuick/qsgtexturematerial.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_EXPORT QSGSimpleTextureNode : public QSGGeometryNode
@@ -75,6 +73,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSGSIMPLETEXTURENODE_H
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 16cc46113d..48927ce5e1 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -65,6 +65,20 @@
#include <QHash>
#endif
+#ifndef QT_NO_DEBUG
+static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty();
+#endif
+
+#ifndef QSG_NO_RENDERER_TIMING
+static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
+static QElapsedTimer qsg_renderer_timer;
+#endif
+
+#ifndef GL_BGRA
+#define GL_BGRA 0x80E1
+#endif
+
+
QT_BEGIN_NAMESPACE
inline static bool isPowerOfTwo(int x)
@@ -172,7 +186,7 @@ static void qt_debug_remove_texture(QSGTexture* texture)
--qt_debug_texture_count;
if (qt_debug_texture_count < 0)
- qDebug("Material destroyed after qt_debug_print_texture_count() was called.");
+ qDebug("Texture destroyed after qt_debug_print_texture_count() was called.");
}
#endif // QT_NO_DEBUG
@@ -259,7 +273,8 @@ QSGTexture::QSGTexture()
: QObject(*(new QSGTexturePrivate))
{
#ifndef QT_NO_DEBUG
- qt_debug_add_texture(this);
+ if (qsg_leak_check)
+ qt_debug_add_texture(this);
#endif
}
@@ -269,7 +284,8 @@ QSGTexture::QSGTexture()
QSGTexture::~QSGTexture()
{
#ifndef QT_NO_DEBUG
- qt_debug_remove_texture(this);
+ if (qsg_leak_check)
+ qt_debug_remove_texture(this);
#endif
}
@@ -513,6 +529,7 @@ QSGPlainTexture::QSGPlainTexture()
, m_dirty_bind_options(false)
, m_owns_texture(true)
, m_mipmaps_generated(false)
+ , m_retain_image(false)
{
}
@@ -523,7 +540,6 @@ QSGPlainTexture::~QSGPlainTexture()
glDeleteTextures(1, &m_texture_id);
}
-#ifdef QT_OPENGL_ES
void qsg_swizzleBGRAToRGBA(QImage *image)
{
const int width = image->width();
@@ -534,7 +550,6 @@ void qsg_swizzleBGRAToRGBA(QImage *image)
p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
}
}
-#endif
void QSGPlainTexture::setImage(const QImage &image)
{
@@ -596,14 +611,30 @@ void QSGPlainTexture::bind()
m_dirty_texture = false;
+#ifndef QSG_NO_RENDERER_TIMING
+ if (qsg_render_timing)
+ qsg_renderer_timer.start();
+#endif
if (m_image.isNull()) {
- if (m_texture_id && m_owns_texture)
+ if (m_texture_id && m_owns_texture) {
glDeleteTextures(1, &m_texture_id);
+#ifndef QSG_NO_RENDERER_TIMING
+ if (qsg_render_timing) {
+ printf(" - texture deleted in %dms (size: %dx%d)\n",
+ (int) qsg_renderer_timer.elapsed(),
+ m_texture_size.width(),
+ m_texture_size.height());
+ }
+#endif
+ }
m_texture_id = 0;
m_texture_size = QSize();
m_has_mipmaps = false;
m_has_alpha = false;
+
+
+
return;
}
@@ -611,6 +642,12 @@ void QSGPlainTexture::bind()
glGenTextures(1, &m_texture_id);
glBindTexture(GL_TEXTURE_2D, m_texture_id);
+#ifndef QSG_NO_RENDERER_TIMING
+ int bindTime = 0;
+ if (qsg_render_timing)
+ bindTime = qsg_renderer_timer.elapsed();
+#endif
+
// ### TODO: check for out-of-memory situations...
int w = m_image.width();
int h = m_image.height();
@@ -619,14 +656,46 @@ void QSGPlainTexture::bind()
? m_image
: m_image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+#ifndef QSG_NO_RENDERER_TIMING
+ int convertTime = 0;
+ if (qsg_render_timing)
+ convertTime = qsg_renderer_timer.elapsed();
+#endif
+
updateBindOptions(m_dirty_bind_options);
+ GLenum externalFormat = GL_RGBA;
+ GLenum internalFormat = GL_RGBA;
+
+ const char *extensions = (const char *) glGetString(GL_EXTENSIONS);
+ if (strstr(extensions, "GL_EXT_bgra")) {
+ externalFormat = GL_BGRA;
#ifdef QT_OPENGL_ES
+ internalFormat = GL_BGRA;
+#endif
+ } else if (strstr(extensions, "GL_APPLE_texture_format_BGRA8888")) {
+ externalFormat = GL_BGRA;
+ } else if (strstr(extensions, "GL_EXT_texture_format_BGRA8888")
+ || strstr(extensions, "GL_IMG_texture_format_BGRA8888")) {
+ externalFormat = GL_BGRA;
+ internalFormat = GL_BGRA;
+ } else {
qsg_swizzleBGRAToRGBA(&tmp);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tmp.constBits());
-#else
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, tmp.constBits());
+ }
+
+#ifndef QSG_NO_RENDERER_TIMING
+ int swizzleTime = 0;
+ if (qsg_render_timing)
+ swizzleTime = qsg_renderer_timer.elapsed();
#endif
+ glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, w, h, 0, externalFormat, GL_UNSIGNED_BYTE, tmp.constBits());
+
+#ifndef QSG_NO_RENDERER_TIMING
+ int uploadTime = 0;
+ if (qsg_render_timing)
+ uploadTime = qsg_renderer_timer.elapsed();
+#endif
+
if (m_has_mipmaps) {
QOpenGLContext *ctx = QOpenGLContext::currentContext();
@@ -634,10 +703,33 @@ void QSGPlainTexture::bind()
m_mipmaps_generated = true;
}
+#ifndef QSG_NO_RENDERER_TIMING
+ int mipmapTime = 0;
+ if (qsg_render_timing) {
+ mipmapTime = qsg_renderer_timer.elapsed();
+
+ printf(" - plaintexture(%dx%d) bind=%d, convert=%d, swizzle=%d (%s->%s), upload=%d, mipmap=%d, total=%d\n",
+ m_texture_size.width(), m_texture_size.height(),
+ bindTime,
+ convertTime - bindTime,
+ swizzleTime - convertTime,
+ externalFormat == GL_BGRA ? "BGRA" : "RGBA",
+ internalFormat == GL_BGRA ? "BGRA" : "RGBA",
+ uploadTime - swizzleTime,
+ mipmapTime - uploadTime,
+ (int) qsg_renderer_timer.elapsed());
+
+ }
+
+#endif
+
+
m_texture_size = QSize(w, h);
m_texture_rect = QRectF(0, 0, 1, 1);
m_dirty_bind_options = false;
+ if (!m_retain_image)
+ m_image = QImage();
}
diff --git a/src/quick/scenegraph/util/qsgtexture.h b/src/quick/scenegraph/util/qsgtexture.h
index 9d91d4e81c..ace29cd9a0 100644
--- a/src/quick/scenegraph/util/qsgtexture.h
+++ b/src/quick/scenegraph/util/qsgtexture.h
@@ -46,8 +46,6 @@
#include <QObject>
#include <QImage>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QSGTexturePrivate;
@@ -127,6 +125,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/util/qsgtexture_p.h b/src/quick/scenegraph/util/qsgtexture_p.h
index ed1d782c35..6430a93ed8 100644
--- a/src/quick/scenegraph/util/qsgtexture_p.h
+++ b/src/quick/scenegraph/util/qsgtexture_p.h
@@ -112,6 +112,7 @@ protected:
uint m_dirty_bind_options : 1;
uint m_owns_texture : 1;
uint m_mipmaps_generated : 1;
+ uint m_retain_image: 1;
};
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/util/qsgtexturematerial.h b/src/quick/scenegraph/util/qsgtexturematerial.h
index 822084b463..83d941b084 100644
--- a/src/quick/scenegraph/util/qsgtexturematerial.h
+++ b/src/quick/scenegraph/util/qsgtexturematerial.h
@@ -45,8 +45,6 @@
#include <QtQuick/qsgmaterial.h>
#include <QtQuick/qsgtexture.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_EXPORT QSGOpaqueTextureMaterial : public QSGMaterial
@@ -94,6 +92,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // TEXTUREMATERIAL_H
diff --git a/src/quick/scenegraph/util/qsgtexturematerial_p.h b/src/quick/scenegraph/util/qsgtexturematerial_p.h
index 346004be35..a07cb7925e 100644
--- a/src/quick/scenegraph/util/qsgtexturematerial_p.h
+++ b/src/quick/scenegraph/util/qsgtexturematerial_p.h
@@ -45,8 +45,6 @@
#include "qsgtexturematerial.h"
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_PRIVATE_EXPORT QSGOpaqueTextureMaterialShader : public QSGMaterialShader
@@ -81,6 +79,4 @@ protected:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QSGTEXTUREMATERIAL_P_H
diff --git a/src/quick/scenegraph/util/qsgtextureprovider.h b/src/quick/scenegraph/util/qsgtextureprovider.h
index f4925612f9..608b3c6e0f 100644
--- a/src/quick/scenegraph/util/qsgtextureprovider.h
+++ b/src/quick/scenegraph/util/qsgtextureprovider.h
@@ -45,8 +45,6 @@
#include <QtQuick/qsgtexture.h>
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_EXPORT QSGTextureProvider : public QObject
@@ -61,6 +59,4 @@ Q_SIGNALS:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif
diff --git a/src/quick/scenegraph/util/qsgvertexcolormaterial.h b/src/quick/scenegraph/util/qsgvertexcolormaterial.h
index 7e1eb43193..a3ffa48c31 100644
--- a/src/quick/scenegraph/util/qsgvertexcolormaterial.h
+++ b/src/quick/scenegraph/util/qsgvertexcolormaterial.h
@@ -44,8 +44,6 @@
#include <QtQuick/qsgmaterial.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class Q_QUICK_EXPORT QSGVertexColorMaterial : public QSGMaterial
@@ -62,6 +60,4 @@ protected:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // VERTEXCOLORMATERIAL_H
diff --git a/src/quick/util/qquickanimation_p.h b/src/quick/util/qquickanimation_p.h
index cb0da6112a..82d1ba269e 100644
--- a/src/quick/util/qquickanimation_p.h
+++ b/src/quick/util/qquickanimation_p.h
@@ -54,8 +54,6 @@
#include "private/qabstractanimationjob_p.h"
#include <QtGui/qcolor.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickAbstractAnimationPrivate;
@@ -460,6 +458,4 @@ QML_DECLARE_TYPE(QQuickParallelAnimation)
QML_DECLARE_TYPE(QQuickVector3dAnimation)
QML_DECLARE_TYPE(QQuickRotationAnimation)
-QT_END_HEADER
-
#endif // QQUICKANIMATION_H
diff --git a/src/quick/util/qquickanimationcontroller_p.h b/src/quick/util/qquickanimationcontroller_p.h
index 0fe3888afb..5286e77534 100644
--- a/src/quick/util/qquickanimationcontroller_p.h
+++ b/src/quick/util/qquickanimationcontroller_p.h
@@ -45,8 +45,6 @@
#include <qqml.h>
#include "qquickanimation_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickAnimationControllerPrivate;
@@ -89,6 +87,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickAnimationController)
-QT_END_HEADER
-
#endif // QQUICKANIMATIONCONTROLLER_H
diff --git a/src/quick/util/qquickapplication_p.h b/src/quick/util/qquickapplication_p.h
index aa46a6a7e9..2eef59b608 100644
--- a/src/quick/util/qquickapplication_p.h
+++ b/src/quick/util/qquickapplication_p.h
@@ -46,8 +46,6 @@
#include <qqml.h>
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -81,6 +79,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickApplication)
-QT_END_HEADER
-
#endif // QQUICKAPPLICATION_P_H
diff --git a/src/quick/util/qquickbehavior_p.h b/src/quick/util/qquickbehavior_p.h
index a93b597a6b..0a49891cc0 100644
--- a/src/quick/util/qquickbehavior_p.h
+++ b/src/quick/util/qquickbehavior_p.h
@@ -47,8 +47,6 @@
#include <private/qqmlpropertyvalueinterceptor_p.h>
#include <qqml.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickAbstractAnimation;
@@ -88,6 +86,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickBehavior)
-QT_END_HEADER
-
#endif // QQUICKBEHAVIOR_H
diff --git a/src/quick/util/qquickfontloader_p.h b/src/quick/util/qquickfontloader_p.h
index 9337f5c2d7..1488ffe734 100644
--- a/src/quick/util/qquickfontloader_p.h
+++ b/src/quick/util/qquickfontloader_p.h
@@ -47,8 +47,6 @@
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickFontLoaderPrivate;
@@ -89,7 +87,5 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickFontLoader)
-QT_END_HEADER
-
#endif // QQUICKFONTLOADER_H
diff --git a/src/quick/util/qquickimageprovider.h b/src/quick/util/qquickimageprovider.h
index 75c2e80a34..2735c9ac78 100644
--- a/src/quick/util/qquickimageprovider.h
+++ b/src/quick/util/qquickimageprovider.h
@@ -47,8 +47,6 @@
#include <QtGui/qpixmap.h>
#include <QtQml/qqmlengine.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
@@ -87,6 +85,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKIMAGEPROVIDER_H
diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h
index 545e98556b..71545851e4 100644
--- a/src/quick/util/qquickpath_p.h
+++ b/src/quick/util/qquickpath_p.h
@@ -50,8 +50,6 @@
#include <QtCore/QObject>
#include <QtGui/QPainterPath>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickCurve;
@@ -446,6 +444,4 @@ QML_DECLARE_TYPE(QQuickPathSvg)
QML_DECLARE_TYPE(QQuickPathPercent)
QML_DECLARE_TYPE(QQuickPath)
-QT_END_HEADER
-
#endif // QQUICKPATH_H
diff --git a/src/quick/util/qquickpathinterpolator_p.h b/src/quick/util/qquickpathinterpolator_p.h
index f5414e028a..b66af408db 100644
--- a/src/quick/util/qquickpathinterpolator_p.h
+++ b/src/quick/util/qquickpathinterpolator_p.h
@@ -45,8 +45,6 @@
#include <qqml.h>
#include <QObject>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickPath;
@@ -93,6 +91,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickPathInterpolator)
-QT_END_HEADER
-
#endif // QQUICKPATHINTERPOLATOR_P_H
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index dda2fbe2b0..7a9bea3aa0 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -91,6 +91,17 @@ static inline QString imageId(const QUrl &url)
return url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1);
}
+QQuickDefaultTextureFactory::QQuickDefaultTextureFactory(const QImage &image)
+{
+ if (image.format() == QImage::Format_ARGB32_Premultiplied
+ || image.format() == QImage::Format_RGB32) {
+ im = image;
+ } else {
+ im = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ }
+}
+
+
QSGTexture *QQuickDefaultTextureFactory::createTexture(QQuickWindow *) const
{
QSGPlainTexture *t = new QSGPlainTexture();
diff --git a/src/quick/util/qquickpixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h
index a6c2a7c1f3..08dba8044f 100644
--- a/src/quick/util/qquickpixmapcache_p.h
+++ b/src/quick/util/qquickpixmapcache_p.h
@@ -51,8 +51,6 @@
#include <private/qintrusivelist_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlEngine;
@@ -63,11 +61,7 @@ class QQuickDefaultTextureFactory : public QQuickTextureFactory
{
Q_OBJECT
public:
- QQuickDefaultTextureFactory(const QImage &i)
- : im(i)
- {
- }
-
+ QQuickDefaultTextureFactory(const QImage &i);
QSGTexture *createTexture(QQuickWindow *window) const;
QSize textureSize() const { return im.size(); }
int textureByteCount() const { return im.byteCount(); }
@@ -139,6 +133,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPixmap::Options)
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKPIXMAPCACHE_H
diff --git a/src/quick/util/qquickpropertychanges_p.h b/src/quick/util/qquickpropertychanges_p.h
index 95320afd6d..674dfa7c4c 100644
--- a/src/quick/util/qquickpropertychanges_p.h
+++ b/src/quick/util/qquickpropertychanges_p.h
@@ -45,8 +45,6 @@
#include "qquickstatechangescript_p.h"
#include <private/qqmlcustomparser_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickPropertyChangesPrivate;
@@ -105,6 +103,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickPropertyChanges)
-QT_END_HEADER
-
#endif // QQUICKPROPERTYCHANGES_H
diff --git a/src/quick/util/qquicksmoothedanimation_p.h b/src/quick/util/qquicksmoothedanimation_p.h
index 644ebf2a7b..7bf8b6c063 100644
--- a/src/quick/util/qquicksmoothedanimation_p.h
+++ b/src/quick/util/qquicksmoothedanimation_p.h
@@ -47,8 +47,6 @@
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQmlProperty;
@@ -95,6 +93,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickSmoothedAnimation)
-QT_END_HEADER
-
#endif // QQUICKSMOOTHEDANIMATION_H
diff --git a/src/quick/util/qquickspringanimation_p.h b/src/quick/util/qquickspringanimation_p.h
index f43d6a4002..14968b770c 100644
--- a/src/quick/util/qquickspringanimation_p.h
+++ b/src/quick/util/qquickspringanimation_p.h
@@ -47,8 +47,6 @@
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickSpringAnimationPrivate;
@@ -102,6 +100,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickSpringAnimation)
-QT_END_HEADER
-
#endif // QQUICKSPRINGANIMATION_H
diff --git a/src/quick/util/qquickstate_p.h b/src/quick/util/qquickstate_p.h
index e9324f4390..6a7b1b345f 100644
--- a/src/quick/util/qquickstate_p.h
+++ b/src/quick/util/qquickstate_p.h
@@ -48,8 +48,6 @@
#include <QtCore/qsharedpointer.h>
#include <private/qtquickglobal_p.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickActionEvent;
@@ -205,6 +203,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickStateOperation)
QML_DECLARE_TYPE(QQuickState)
-QT_END_HEADER
-
#endif // QQUICKSTATE_H
diff --git a/src/quick/util/qquickstatechangescript_p.h b/src/quick/util/qquickstatechangescript_p.h
index 8d3e3804f9..3d8e139fe7 100644
--- a/src/quick/util/qquickstatechangescript_p.h
+++ b/src/quick/util/qquickstatechangescript_p.h
@@ -45,8 +45,6 @@
#include "qquickstate_p.h"
#include <qqmlscriptstring.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickStateChangeScriptPrivate;
@@ -80,6 +78,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickStateChangeScript)
-QT_END_HEADER
-
#endif // QQUICKSTATEOPERATIONS_H
diff --git a/src/quick/util/qquickstategroup_p.h b/src/quick/util/qquickstategroup_p.h
index ccd928aacf..b8e34237b7 100644
--- a/src/quick/util/qquickstategroup_p.h
+++ b/src/quick/util/qquickstategroup_p.h
@@ -44,8 +44,6 @@
#include "qquickstate_p.h"
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickStateGroupPrivate;
@@ -90,6 +88,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickStateGroup)
-QT_END_HEADER
-
#endif // QQUICKSTATEGROUP_H
diff --git a/src/quick/util/qquicksystempalette_p.h b/src/quick/util/qquicksystempalette_p.h
index c8267b677a..6ff31829e3 100644
--- a/src/quick/util/qquicksystempalette_p.h
+++ b/src/quick/util/qquicksystempalette_p.h
@@ -47,8 +47,6 @@
#include <QtCore/qobject.h>
#include <QPalette>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickSystemPalettePrivate;
@@ -115,6 +113,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickSystemPalette)
-QT_END_HEADER
-
#endif // QQUICKSYSTEMPALETTE_H
diff --git a/src/quick/util/qquicktransition_p.h b/src/quick/util/qquicktransition_p.h
index 6ed2ad63cf..831aec025f 100644
--- a/src/quick/util/qquicktransition_p.h
+++ b/src/quick/util/qquicktransition_p.h
@@ -48,8 +48,6 @@
#include <QtCore/qobject.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickAbstractAnimation;
@@ -127,6 +125,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickTransition)
-QT_END_HEADER
-
#endif // QQUICKTRANSITION_H
diff --git a/src/quick/util/qquickutilmodule.cpp b/src/quick/util/qquickutilmodule.cpp
index 5591f04a57..a45ec4ef15 100644
--- a/src/quick/util/qquickutilmodule.cpp
+++ b/src/quick/util/qquickutilmodule.cpp
@@ -45,7 +45,6 @@
#include "qquickbehavior_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"
@@ -73,7 +72,6 @@ void QQuickUtilModule::defineModule()
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");
diff --git a/src/quick/util/qquickutilmodule_p.h b/src/quick/util/qquickutilmodule_p.h
index 5a7406b8e7..360480a34a 100644
--- a/src/quick/util/qquickutilmodule_p.h
+++ b/src/quick/util/qquickutilmodule_p.h
@@ -44,8 +44,6 @@
#include <qqml.h>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
class QQuickUtilModule
@@ -56,6 +54,4 @@ public:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKUTILMODULE_H
diff --git a/src/quick/util/qquickvaluetypes_p.h b/src/quick/util/qquickvaluetypes_p.h
index 557cbd4642..2f8756fb01 100644
--- a/src/quick/util/qquickvaluetypes_p.h
+++ b/src/quick/util/qquickvaluetypes_p.h
@@ -54,8 +54,6 @@
#include <QtGui/QMatrix4x4>
#include <QtGui/QFont>
-QT_BEGIN_HEADER
-
QT_BEGIN_NAMESPACE
namespace QQuickValueTypes {
@@ -365,6 +363,4 @@ private:
QT_END_NAMESPACE
-QT_END_HEADER
-
#endif // QQUICKVALUETYPES_P_H
diff --git a/src/quick/util/util.pri b/src/quick/util/util.pri
index 7a56a95314..7f77f7f702 100644
--- a/src/quick/util/util.pri
+++ b/src/quick/util/util.pri
@@ -1,7 +1,6 @@
SOURCES += \
$$PWD/qquickapplication.cpp\
$$PWD/qquickutilmodule.cpp\
- $$PWD/qquickpackage.cpp \
$$PWD/qquickanimation.cpp \
$$PWD/qquicksystempalette.cpp \
$$PWD/qquickspringanimation.cpp \
@@ -13,15 +12,12 @@ SOURCES += \
$$PWD/qquickpropertychanges.cpp \
$$PWD/qquickstategroup.cpp \
$$PWD/qquicktransition.cpp \
- $$PWD/qquicklistaccessor.cpp \
$$PWD/qquicktimeline.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/qquickimageprovider.cpp \
$$PWD/qquicksvgparser.cpp \
@@ -31,7 +27,6 @@ SOURCES += \
HEADERS += \
$$PWD/qquickapplication_p.h\
$$PWD/qquickutilmodule_p.h\
- $$PWD/qquickpackage_p.h \
$$PWD/qquickanimation_p.h \
$$PWD/qquickanimation_p_p.h \
$$PWD/qquicksystempalette_p.h \
@@ -46,7 +41,6 @@ HEADERS += \
$$PWD/qquicktransitionmanager_p_p.h \
$$PWD/qquickstategroup_p.h \
$$PWD/qquicktransition_p.h \
- $$PWD/qquicklistaccessor_p.h \
$$PWD/qquicktimeline_p_p.h \
$$PWD/qquickpixmapcache_p.h \
$$PWD/qquickbehavior_p.h \
@@ -54,8 +48,6 @@ HEADERS += \
$$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/qquickimageprovider.h \
$$PWD/qquicksvgparser_p.h \
diff --git a/sync.profile b/sync.profile
index bddfd0f7f3..61d25bafa5 100644
--- a/sync.profile
+++ b/sync.profile
@@ -17,7 +17,7 @@
# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
#
%dependencies = (
- "qtbase" => "refs/heads/stable",
- "qtxmlpatterns" => "refs/heads/stable",
- "qtjsbackend" => "refs/heads/stable",
+ "qtbase" => "refs/heads/dev",
+ "qtxmlpatterns" => "refs/heads/dev",
+ "qtjsbackend" => "refs/heads/dev",
);
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
index a4bf1c7de6..87cba8cd2f 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
@@ -252,44 +252,6 @@ for ( HEX_STRING = "-0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_ST
HEX_VALUE -= Math.pow(16,POWER)*15;
}
-// let us do some octal tests. numbers that start with 0 and do not provid a radix should
-// default to using "0" as a radix.
-
-var OCT_STRING = "0";
-var OCT_VALUE = 0;
-
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+")", OCT_VALUE, parseInt(OCT_STRING) );
- OCT_VALUE += Math.pow(8,POWER)*7;
-}
-
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+")", OCT_VALUE, parseInt(OCT_STRING) );
- OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
-// should get the same results as above if we provid the radix of 8 (or 010)
-
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+",8)", OCT_VALUE, parseInt(OCT_STRING,8) );
- OCT_VALUE += Math.pow(8,POWER)*7;
-}
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+",010)", OCT_VALUE, parseInt(OCT_STRING,010) );
- OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
-// we shall stop parsing digits when we get one that isn't a numeric literal of the type we think
-// it should be.
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+"8,8)", OCT_VALUE, parseInt(OCT_STRING+"8",8) );
- OCT_VALUE += Math.pow(8,POWER)*7;
-}
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+"8,010)", OCT_VALUE, parseInt(OCT_STRING+"8",010) );
- OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
new TestCase( SECTION,
"parseInt( '0x' )",
NaN,
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
index 56bf83adcc..a89154e597 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
@@ -384,43 +384,12 @@ new TestCase( SECTION, "parseFloat(0XE)", 14, parseFloat(0XE));
new TestCase( SECTION, "parseFloat(0XF)", 15, parseFloat(0XF));
-// A StringNumericLiteral may not use octal notation
-
-new TestCase( SECTION, "parseFloat('00')", 0, parseFloat("00"));
-new TestCase( SECTION, "parseFloat('01')", 1, parseFloat("01"));
-new TestCase( SECTION, "parseFloat('02')", 2, parseFloat("02"));
-new TestCase( SECTION, "parseFloat('03')", 3, parseFloat("03"));
-new TestCase( SECTION, "parseFloat('04')", 4, parseFloat("04"));
-new TestCase( SECTION, "parseFloat('05')", 5, parseFloat("05"));
-new TestCase( SECTION, "parseFloat('06')", 6, parseFloat("06"));
-new TestCase( SECTION, "parseFloat('07')", 7, parseFloat("07"));
-new TestCase( SECTION, "parseFloat('010')", 10, parseFloat("010"));
-new TestCase( SECTION, "parseFloat('011')", 11, parseFloat("011"));
-
// A StringNumericLIteral may have any number of leading 0 digits
new TestCase( SECTION, "parseFloat('001')", 1, parseFloat("001"));
new TestCase( SECTION, "parseFloat('0001')", 1, parseFloat("0001"));
new TestCase( SECTION, "parseFloat(' 0001 ')", 1, parseFloat(" 0001 "));
-// an octal numeric literal should be treated as an octal
-
-new TestCase( SECTION, "parseFloat(00)", 0, parseFloat(00));
-new TestCase( SECTION, "parseFloat(01)", 1, parseFloat(01));
-new TestCase( SECTION, "parseFloat(02)", 2, parseFloat(02));
-new TestCase( SECTION, "parseFloat(03)", 3, parseFloat(03));
-new TestCase( SECTION, "parseFloat(04)", 4, parseFloat(04));
-new TestCase( SECTION, "parseFloat(05)", 5, parseFloat(05));
-new TestCase( SECTION, "parseFloat(06)", 6, parseFloat(06));
-new TestCase( SECTION, "parseFloat(07)", 7, parseFloat(07));
-new TestCase( SECTION, "parseFloat(010)", 8, parseFloat(010));
-new TestCase( SECTION, "parseFloat(011)", 9, parseFloat(011));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION, "parseFloat(001)", 1, parseFloat(001));
-new TestCase( SECTION, "parseFloat(0001)", 1, parseFloat(0001));
-
// make sure it's reflexive
new TestCase( SECTION, "parseFloat(Math.PI)", Math.PI, parseFloat(Math.PI));
new TestCase( SECTION, "parseFloat(Math.LN2)", Math.LN2, parseFloat(Math.LN2));
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
index 557b93f637..1167b73ee1 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
@@ -256,28 +256,6 @@ new TestCase( SECTION, "parseFloat(' 0XD')", 0, parseFl
new TestCase( SECTION, "parseFloat(' 0XE')", 0, parseFloat(" 0XE"));
new TestCase( SECTION, "parseFloat(' 0XF')", 0, parseFloat(" 0XF"));
-// A StringNumericLiteral may not use octal notation
-
-new TestCase( SECTION, "parseFloat(' 00')", 0, parseFloat(" 00"));
-new TestCase( SECTION, "parseFloat(' 01')", 1, parseFloat(" 01"));
-new TestCase( SECTION, "parseFloat(' 02')", 2, parseFloat(" 02"));
-new TestCase( SECTION, "parseFloat(' 03')", 3, parseFloat(" 03"));
-new TestCase( SECTION, "parseFloat(' 04')", 4, parseFloat(" 04"));
-new TestCase( SECTION, "parseFloat(' 05')", 5, parseFloat(" 05"));
-new TestCase( SECTION, "parseFloat(' 06')", 6, parseFloat(" 06"));
-new TestCase( SECTION, "parseFloat(' 07')", 7, parseFloat(" 07"));
-new TestCase( SECTION, "parseFloat(' 010')", 10, parseFloat(" 010"));
-new TestCase( SECTION, "parseFloat(' 011')", 11, parseFloat(" 011"));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION, "parseFloat(' 001')", 1, parseFloat(" 001"));
-new TestCase( SECTION, "parseFloat(' 0001')", 1, parseFloat(" 0001"));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION, "parseFloat(001)", 1, parseFloat(001));
-new TestCase( SECTION, "parseFloat(0001)", 1, parseFloat(0001));
// make sure it' s reflexive
new TestCase( SECTION, "parseFloat( ' ' +Math.PI+' ')", Math.PI, parseFloat( ' ' +Math.PI+' '));
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
index faeeb9e0b0..18f1986d7e 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
@@ -106,9 +106,6 @@ new TestCase( SECTION, "isNaN( '0xaa' )", false, isNaN( "0xaa" )
new TestCase( SECTION, "isNaN( '0x0A' )", false, isNaN( "0x0A" ) );
new TestCase( SECTION, "isNaN( '0xAA' )", false, isNaN( "0xAA" ) );
-new TestCase( SECTION, "isNaN( 077 )", false, isNaN( 077 ) );
-new TestCase( SECTION, "isNaN( '077' )", false, isNaN( "077" ) );
-
new TestCase( SECTION, "isNaN( Number.NaN )", true, isNaN(Number.NaN) );
new TestCase( SECTION, "isNaN( Number.POSITIVE_INFINITY )", false, isNaN(Number.POSITIVE_INFINITY) );
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
index e3db5e7931..9eb52a8ff1 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
@@ -107,9 +107,6 @@ new TestCase( SECTION, "isFinite( '0xaa' )", true, isFinite( "0
new TestCase( SECTION, "isFinite( '0x0A' )", true, isFinite( "0x0A" ) );
new TestCase( SECTION, "isFinite( '0xAA' )", true, isFinite( "0xAA" ) );
-new TestCase( SECTION, "isFinite( 077 )", true, isFinite( 077 ) );
-new TestCase( SECTION, "isFinite( '077' )", true, isFinite( "077" ) );
-
new TestCase( SECTION, "isFinite( new String('Infinity') )", false, isFinite(new String("Infinity")) );
new TestCase( SECTION, "isFinite( new String('-Infinity') )", false, isFinite(new String("-Infinity")) );
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
index fb13b24e07..3eacb2990f 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
@@ -85,16 +85,6 @@ new TestCase( SECTION,
0x100000000 );
new TestCase( SECTION,
- "077777777777777777",
- 2251799813685247,
- 077777777777777777 );
-
-new TestCase( SECTION,
- "077777777777777776",
- 2251799813685246,
- 077777777777777776 );
-
-new TestCase( SECTION,
"0x1fffffffffffff",
9007199254740991,
0x1fffffffffffff );
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
index 8fbe16cb8f..6121cd54fd 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
@@ -74,20 +74,4 @@ new TestCase( SECTION,
9,
9 );
-new TestCase( SECTION,
- "09",
- 9,
- 09 );
-
-new TestCase( SECTION,
- "099",
- 99,
- 099 );
-
-
-new TestCase( SECTION,
- "077",
- 63,
- 077 );
-
test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
index 9ccb912752..29635596e1 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
@@ -215,24 +215,6 @@ new TestCase( SECTION, "0XE", 14, 0XE );
new TestCase( SECTION, "0XF", 15, 0XF );
-new TestCase( SECTION, "00", 0, 00 );
-new TestCase( SECTION, "01", 1, 01 );
-new TestCase( SECTION, "02", 2, 02 );
-new TestCase( SECTION, "03", 3, 03 );
-new TestCase( SECTION, "04", 4, 04 );
-new TestCase( SECTION, "05", 5, 05 );
-new TestCase( SECTION, "06", 6, 06 );
-new TestCase( SECTION, "07", 7, 07 );
-
-new TestCase( SECTION, "000", 0, 000 );
-new TestCase( SECTION, "011", 9, 011 );
-new TestCase( SECTION, "022", 18, 022 );
-new TestCase( SECTION, "033", 27, 033 );
-new TestCase( SECTION, "044", 36, 044 );
-new TestCase( SECTION, "055", 45, 055 );
-new TestCase( SECTION, "066", 54, 066 );
-new TestCase( SECTION, "077", 63, 077 );
-
new TestCase( SECTION, "0.00000000001", 0.00000000001, 0.00000000001 );
new TestCase( SECTION, "0.00000000001e-2", 0.0000000000001, 0.00000000001e-2 );
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
index 015a385220..4a3173db6c 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
@@ -76,53 +76,6 @@ new TestCase( SECTION, "\\v", String.fromCharCode(0x000B), "\v" );
// DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::OctalEscapeSequence
-new TestCase( SECTION, "\\00", String.fromCharCode(0x0000), "\00" );
-new TestCase( SECTION, "\\01", String.fromCharCode(0x0001), "\01" );
-new TestCase( SECTION, "\\02", String.fromCharCode(0x0002), "\02" );
-new TestCase( SECTION, "\\03", String.fromCharCode(0x0003), "\03" );
-new TestCase( SECTION, "\\04", String.fromCharCode(0x0004), "\04" );
-new TestCase( SECTION, "\\05", String.fromCharCode(0x0005), "\05" );
-new TestCase( SECTION, "\\06", String.fromCharCode(0x0006), "\06" );
-new TestCase( SECTION, "\\07", String.fromCharCode(0x0007), "\07" );
-
-new TestCase( SECTION, "\\010", String.fromCharCode(0x0008), "\010" );
-new TestCase( SECTION, "\\011", String.fromCharCode(0x0009), "\011" );
-new TestCase( SECTION, "\\012", String.fromCharCode(0x000A), "\012" );
-new TestCase( SECTION, "\\013", String.fromCharCode(0x000B), "\013" );
-new TestCase( SECTION, "\\014", String.fromCharCode(0x000C), "\014" );
-new TestCase( SECTION, "\\015", String.fromCharCode(0x000D), "\015" );
-new TestCase( SECTION, "\\016", String.fromCharCode(0x000E), "\016" );
-new TestCase( SECTION, "\\017", String.fromCharCode(0x000F), "\017" );
-new TestCase( SECTION, "\\020", String.fromCharCode(0x0010), "\020" );
-new TestCase( SECTION, "\\042", String.fromCharCode(0x0022), "\042" );
-
-new TestCase( SECTION, "\\0", String.fromCharCode(0x0000), "\0" );
-new TestCase( SECTION, "\\1", String.fromCharCode(0x0001), "\1" );
-new TestCase( SECTION, "\\2", String.fromCharCode(0x0002), "\2" );
-new TestCase( SECTION, "\\3", String.fromCharCode(0x0003), "\3" );
-new TestCase( SECTION, "\\4", String.fromCharCode(0x0004), "\4" );
-new TestCase( SECTION, "\\5", String.fromCharCode(0x0005), "\5" );
-new TestCase( SECTION, "\\6", String.fromCharCode(0x0006), "\6" );
-new TestCase( SECTION, "\\7", String.fromCharCode(0x0007), "\7" );
-
-new TestCase( SECTION, "\\10", String.fromCharCode(0x0008), "\10" );
-new TestCase( SECTION, "\\11", String.fromCharCode(0x0009), "\11" );
-new TestCase( SECTION, "\\12", String.fromCharCode(0x000A), "\12" );
-new TestCase( SECTION, "\\13", String.fromCharCode(0x000B), "\13" );
-new TestCase( SECTION, "\\14", String.fromCharCode(0x000C), "\14" );
-new TestCase( SECTION, "\\15", String.fromCharCode(0x000D), "\15" );
-new TestCase( SECTION, "\\16", String.fromCharCode(0x000E), "\16" );
-new TestCase( SECTION, "\\17", String.fromCharCode(0x000F), "\17" );
-new TestCase( SECTION, "\\20", String.fromCharCode(0x0010), "\20" );
-new TestCase( SECTION, "\\42", String.fromCharCode(0x0022), "\42" );
-
-new TestCase( SECTION, "\\000", String.fromCharCode(0), "\000" );
-new TestCase( SECTION, "\\111", String.fromCharCode(73), "\111" );
-new TestCase( SECTION, "\\222", String.fromCharCode(146), "\222" );
-new TestCase( SECTION, "\\333", String.fromCharCode(219), "\333" );
-
-// following line commented out as it causes a compile time error
-// new TestCase( SECTION, "\\444", "444", "\444" );
// DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::HexEscapeSequence
/*
@@ -202,13 +155,10 @@ new TestCase( SECTION, "\\o", "o", "\o" );
new TestCase( SECTION, "\\p", "p", "\p" );
new TestCase( SECTION, "\\q", "q", "\q" );
new TestCase( SECTION, "\\s", "s", "\s" );
-new TestCase( SECTION, "\\u", "u", "\u" );
new TestCase( SECTION, "\\w", "w", "\w" );
-new TestCase( SECTION, "\\x", "x", "\x" );
new TestCase( SECTION, "\\y", "y", "\y" );
new TestCase( SECTION, "\\z", "z", "\z" );
-new TestCase( SECTION, "\\9", "9", "\9" );
new TestCase( SECTION, "\\A", "A", "\A" );
new TestCase( SECTION, "\\B", "B", "\B" );
diff --git a/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
index 0412742767..abe1095d40 100644
--- a/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
@@ -194,11 +194,6 @@ new TestCase( SECTION,
Math.abs( -0xfff ) );
new TestCase( SECTION,
- "Math.abs( -0777 )",
- 511,
- Math.abs(-0777 ) );
-
-new TestCase( SECTION,
"Math.abs('-1e-1')",
0.1,
Math.abs('-1e-1') );
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
index dc56427395..3141906d5d 100644
--- a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
@@ -296,16 +296,6 @@ new TestCase( SECTION,
0x100000000 );
new TestCase( SECTION,
- "077777777777777777",
- 2251799813685247,
- 077777777777777777 );
-
-new TestCase( SECTION,
- "077777777777777776",
- 2251799813685246,
- 077777777777777776 );
-
-new TestCase( SECTION,
"0x1fffffffffffff",
9007199254740991,
0x1fffffffffffff );
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
index 401ad43c11..053720d7e9 100644
--- a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
@@ -125,70 +125,6 @@ expectedmatch = Array(string);
addThis();
-/*
- * This one should produce a match. The two-character string
- * 'a' + '\011' is duplicated in the pattern and test string:
- */
-status = inSection(4);
-pattern = /.\011/;
-string = 'a\011';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now, for the second character of the string,
- * use the Unicode escape '\u0009' instead of the octal escape '\011'
- */
-status = inSection(5);
-pattern = /.\011/;
-string = 'a\u0009';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now for the second character of the string,
- * use the hex escape '\x09' instead of the octal escape '\011'
- */
-status = inSection(6);
-pattern = /.\011/;
-string = 'a\x09';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now for the second character of the string,
- * use the escape '\t' instead of the octal escape '\011'
- */
-status = inSection(7);
-pattern = /.\011/;
-string = 'a\t';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Return to the string from Section 1.
- *
- * Unlike Section 1, use the RegExp() function to create the
- * regexp pattern: null character followed by the string '11'.
- *
- * Since this is exactly what the string is, we should get a match -
- */
-status = inSection(8);
-string = 'a' + String.fromCharCode(0) + '11';
-pattern = RegExp(string);
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
//-------------------------------------------------------------------------------------------------
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
index bca1a15e19..7b811abc31 100644
--- a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
@@ -111,11 +111,11 @@ testRegExp([status], [re], [str], [result], [expect]);
//# Some things for avoiding backslashitis later on.
$esc = '\\\\';
$Period = '\.';
-$space = '\040'; $tab = '\t';
+$space = '\x20'; $tab = '\t';
$OpenBR = '\\['; $CloseBR = '\\]';
$OpenParen = '\\('; $CloseParen = '\\)';
-$NonASCII = '\x80-\xff'; $ctrl = '\000-\037';
-$CRlist = '\n\015'; //# note: this should really be only \015.
+$NonASCII = '\x80-\xff'; $ctrl = '\0-\x1f';
+$CRlist = '\n\x0d'; //# note: this should really be only \015.
// Items 19, 20, 21
$qtext = '[^' + $esc + $NonASCII + $CRlist + '\"]'; // # for within "..."
$dtext = '[^' + $esc + $NonASCII + $CRlist + $OpenBR + $CloseBR + ']'; // # for within [...]
@@ -226,7 +226,7 @@ $route_addr =
'>'; // # >
//# Item 3: phrase........
-$phrase_ctrl = '\000-\010\012-\037'; // # like ctrl, but without tab
+$phrase_ctrl = '\0-\x08\x0a-\x1f'; // # like ctrl, but without tab
//# Like atom-char, but without listing space, and uses phrase_ctrl.
//# Since the class is negated, this matches the same as atom-char plus space and tab
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
index 1be199743d..27ddfab51d 100755
--- a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
@@ -37,7 +37,7 @@
var gTestfile = 'regress-441477-01.js';
//-----------------------------------------------------------------------------
-var BUGNUMBER = 441477-01;
+var BUGNUMBER = 441477.01;
var summary = '';
var actual = 'No Exception';
var expect = 'No Exception';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
index 368fde1278..59564b272e 100755
--- a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
@@ -55,7 +55,7 @@ function test()
expect = ["", undefined, ""] + '';
actual = "y".split(/(x)?\1y/) + '';
- reportCompare(expect, actual, summary + ': "y".split(/(x)?\1y/)');
+ reportCompare(expect, actual, summary + ': "y".split(/(x)?\\1y/)');
expect = ["", undefined, ""] + '';
actual = "y".split(/(x)?y/) + '';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js
deleted file mode 100755
index 0e3c4b0189..0000000000
--- a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is JavaScript Engine testing utilities.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Martin Honnen
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-var gTestfile = 'regress-352044-02-n.js';
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 352044;
-var summary = 'issues with Unicode escape sequences in JavaScript source code';
-var actual = 'No Error';
-var expect = 'SyntaxError';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
- enterFunc ('test');
- printBugNumber(BUGNUMBER);
- printStatus (summary);
-
- print('This test case is expected to throw an uncaught SyntaxError');
-
- try
- {
- var i = 1;
- i \u002b= 1;
- print(i);
- }
- catch(ex)
- {
- actual = ex + '';
- }
-
- reportCompare(expect, actual, summary);
-
- exitFunc ('test');
-}
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 55c3fc800a..70b718c4d8 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -2226,15 +2226,10 @@ void tst_QJSEngine::jsContinueInSwitch()
void tst_QJSEngine::jsShadowReadOnlyPrototypeProperty()
{
- // SpiderMonkey has different behavior than JSC and V8; it disallows
- // creating a property on the instance if there's a property with the
- // same name in the prototype, and that property is read-only. We
- // adopted that behavior in the old (4.5) QtScript back-end, but it
- // just seems weird -- and non-compliant. Adopt the JSC behavior instead.
QJSEngine eng;
QVERIFY(eng.evaluate("o = {}; o.__proto__ = parseInt; o.length").isNumber());
- QCOMPARE(eng.evaluate("o.length = 123; o.length").toInt(), 123);
- QVERIFY(eng.evaluate("o.hasOwnProperty('length')").toBool());
+ QVERIFY(eng.evaluate("o.length = 123; o.length").toInt() != 123);
+ QVERIFY(!eng.evaluate("o.hasOwnProperty('length')").toBool());
}
void tst_QJSEngine::jsReservedWords_data()
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index b77effe3e5..da705cefdb 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -42,11 +42,11 @@ PRIVATETESTS += \
qqmlvaluetypes \
qqmlvaluetypeproviders \
qqmlbinding \
- qquickchangeset \
+ qqmlchangeset \
qqmlconnections \
- qquicklistcompositor \
- qquicklistmodel \
- qquicklistmodelworkerscript \
+ qqmllistcompositor \
+ qqmllistmodel \
+ qqmllistmodelworkerscript \
qquickworkerscript \
qqmlbundle \
qrcqml \
diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
index a2ac6949ee..2957a70d04 100644
--- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp
+++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
@@ -112,6 +112,7 @@ void tst_qmlmin::initTestCase()
invalidFiles << "tests/auto/qml/qqmlecmascript/data/qtbug_22843.library.js";
invalidFiles << "tests/auto/qml/qquickworkerscript/data/script_error_onLoad.js";
invalidFiles << "tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedFileQualifier.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedImport.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedModule.js";
@@ -120,6 +121,13 @@ void tst_qmlmin::initTestCase()
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingFileQualifier.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleQualifier.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleVersion.js";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml";
}
QStringList tst_qmlmin::findFiles(const QDir &d)
diff --git a/tests/auto/qml/qqmlchangeset/qqmlchangeset.pro b/tests/auto/qml/qqmlchangeset/qqmlchangeset.pro
new file mode 100644
index 0000000000..b65e58c0b3
--- /dev/null
+++ b/tests/auto/qml/qqmlchangeset/qqmlchangeset.pro
@@ -0,0 +1,10 @@
+CONFIG += testcase
+TARGET = tst_qqmlhangeset
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qqmlchangeset.cpp
+
+CONFIG += parallel_test
+
+QT += core-private gui-private qml-private testlib
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qquickchangeset/tst_qquickchangeset.cpp b/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp
index 77286b04b4..0f09de26d3 100644
--- a/tests/auto/qml/qquickchangeset/tst_qquickchangeset.cpp
+++ b/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
#include <qtest.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmlchangeset_p.h>
-class tst_qquickchangeset : public QObject
+class tst_qqmlchangeset : public QObject
{
Q_OBJECT
private slots:
@@ -140,7 +140,7 @@ public:
bool applyChanges(QVector<int> &list, const QVector<Signal> &changes)
{
- QHash<QQuickChangeSet::MoveKey, int> removedValues;
+ QHash<QQmlChangeSet::MoveKey, int> removedValues;
foreach (const Signal &signal, changes) {
if (signal.isInsert()) {
if (signal.index < 0 || signal.index > list.count()) {
@@ -148,7 +148,7 @@ public:
return false;
}
if (signal.moveId != -1) {
- QQuickChangeSet::Insert insert(signal.index, signal.count, signal.moveId, signal.offset);
+ QQmlChangeSet::Insert insert(signal.index, signal.count, signal.moveId, signal.offset);
for (int i = insert.start(); i < insert.end(); ++i)
list.insert(i, removedValues.take(insert.moveKey(i)));
} else {
@@ -160,7 +160,7 @@ public:
return false;
}
if (signal.moveId != -1) {
- QQuickChangeSet::Remove remove(signal.index, signal.count, signal.moveId, signal.offset);
+ QQmlChangeSet::Remove remove(signal.index, signal.count, signal.moveId, signal.offset);
for (int i = remove.start(); i < remove.end(); ++i)
removedValues.insert(remove.moveKey(i), list.at(i));
}
@@ -184,7 +184,7 @@ public:
};
-bool operator ==(const tst_qquickchangeset::Signal &left, const tst_qquickchangeset::Signal &right)
+bool operator ==(const tst_qqmlchangeset::Signal &left, const tst_qqmlchangeset::Signal &right)
{
return left.index == right.index
&& left.count == right.count
@@ -194,13 +194,13 @@ bool operator ==(const tst_qquickchangeset::Signal &left, const tst_qquickchange
}
QT_BEGIN_NAMESPACE
-bool operator ==(const QQuickChangeSet::Change &left, const QQuickChangeSet::Change &right)
+bool operator ==(const QQmlChangeSet::Change &left, const QQmlChangeSet::Change &right)
{
return left.index == right.index && left.count == right.count && left.moveId == right.moveId;
}
QT_END_NAMESPACE
-QDebug operator <<(QDebug debug, const tst_qquickchangeset::Signal &signal)
+QDebug operator <<(QDebug debug, const tst_qqmlchangeset::Signal &signal)
{
if (signal.isInsert() && signal.moveId == -1)
debug.nospace() << "Insert(" << signal.index << "," << signal.count << ")";
@@ -217,8 +217,8 @@ QDebug operator <<(QDebug debug, const tst_qquickchangeset::Signal &signal)
return debug;
}
-Q_DECLARE_METATYPE(tst_qquickchangeset::SignalList)
-Q_DECLARE_METATYPE(tst_qquickchangeset::SignalListList)
+Q_DECLARE_METATYPE(tst_qqmlchangeset::SignalList)
+Q_DECLARE_METATYPE(tst_qqmlchangeset::SignalListList)
#if 0
# define VERIFY_EXPECTED_OUTPUT \
@@ -256,7 +256,7 @@ Q_DECLARE_METATYPE(tst_qquickchangeset::SignalListList)
}
#endif
-void tst_qquickchangeset::sequence_data()
+void tst_qqmlchangeset::sequence_data()
{
QTest::addColumn<SignalList>("input");
QTest::addColumn<SignalList>("output");
@@ -1163,12 +1163,12 @@ void tst_qquickchangeset::sequence_data()
<< Insert(24,1,5,9) << Insert(25,2) << Insert(27,2));
}
-void tst_qquickchangeset::sequence()
+void tst_qqmlchangeset::sequence()
{
QFETCH(SignalList, input);
QFETCH(SignalList, output);
- QQuickChangeSet set;
+ QQmlChangeSet set;
foreach (const Signal &signal, input) {
if (signal.isRemove())
@@ -1182,18 +1182,18 @@ void tst_qquickchangeset::sequence()
}
SignalList changes;
- foreach (const QQuickChangeSet::Remove &remove, set.removes())
+ foreach (const QQmlChangeSet::Remove &remove, set.removes())
changes << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, set.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, set.inserts())
changes << Insert(insert.index, insert.count, insert.moveId, insert.offset);
- foreach (const QQuickChangeSet::Change &change, set.changes())
+ foreach (const QQmlChangeSet::Change &change, set.changes())
changes << Change(change.index, change.count);
VERIFY_EXPECTED_OUTPUT
QCOMPARE(changes, output);
}
-void tst_qquickchangeset::apply_data()
+void tst_qqmlchangeset::apply_data()
{
QTest::addColumn<SignalListList>("input");
@@ -1297,15 +1297,15 @@ void tst_qquickchangeset::apply_data()
<< (SignalList() << Move(38,23,1,3) << Move(38,31,0,4) << Remove(26,11) << Move(5,7,18,5) << Move(19,0,8,6)));
}
-void tst_qquickchangeset::apply()
+void tst_qqmlchangeset::apply()
{
QFETCH(SignalListList, input);
- QQuickChangeSet set;
- QQuickChangeSet linearSet;
+ QQmlChangeSet set;
+ QQmlChangeSet linearSet;
foreach (const SignalList &list, input) {
- QQuickChangeSet intermediateSet;
+ QQmlChangeSet intermediateSet;
foreach (const Signal &signal, list) {
if (signal.isRemove()) {
intermediateSet.remove(signal.index, signal.count);
@@ -1322,15 +1322,15 @@ void tst_qquickchangeset::apply()
}
SignalList changes;
- foreach (const QQuickChangeSet::Remove &remove, set.removes())
+ foreach (const QQmlChangeSet::Remove &remove, set.removes())
changes << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, set.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, set.inserts())
changes << Insert(insert.index, insert.count, insert.moveId, insert.offset);
SignalList linearChanges;
- foreach (const QQuickChangeSet::Remove &remove, linearSet.removes())
+ foreach (const QQmlChangeSet::Remove &remove, linearSet.removes())
linearChanges << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, linearSet.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, linearSet.inserts())
linearChanges << Insert(insert.index, insert.count, insert.moveId, insert.offset);
// The output in the failing tests isn't incorrect, merely sub-optimal.
@@ -1343,7 +1343,7 @@ void tst_qquickchangeset::apply()
QCOMPARE(changes, linearChanges);
}
-void tst_qquickchangeset::removeConsecutive_data()
+void tst_qqmlchangeset::removeConsecutive_data()
{
QTest::addColumn<SignalList>("input");
QTest::addColumn<SignalList>("output");
@@ -1359,22 +1359,22 @@ void tst_qquickchangeset::removeConsecutive_data()
<< (SignalList() << Remove(0,2) << Remove(0,1,0,0) << Remove(0,5));
}
-void tst_qquickchangeset::removeConsecutive()
+void tst_qqmlchangeset::removeConsecutive()
{
QFETCH(SignalList, input);
QFETCH(SignalList, output);
- QVector<QQuickChangeSet::Remove> removes;
+ QVector<QQmlChangeSet::Remove> removes;
foreach (const Signal &signal, input) {
QVERIFY(signal.isRemove());
- removes.append(QQuickChangeSet::Remove(signal.index, signal.count, signal.moveId, signal.offset));
+ removes.append(QQmlChangeSet::Remove(signal.index, signal.count, signal.moveId, signal.offset));
}
- QQuickChangeSet set;
+ QQmlChangeSet set;
set.remove(removes);
SignalList changes;
- foreach (const QQuickChangeSet::Remove &remove, set.removes())
+ foreach (const QQmlChangeSet::Remove &remove, set.removes())
changes << Remove(remove.index, remove.count, remove.moveId, remove.offset);
QVERIFY(set.inserts().isEmpty());
QVERIFY(set.changes().isEmpty());
@@ -1383,7 +1383,7 @@ void tst_qquickchangeset::removeConsecutive()
QCOMPARE(changes, output);
}
-void tst_qquickchangeset::insertConsecutive_data()
+void tst_qqmlchangeset::insertConsecutive_data()
{
QTest::addColumn<SignalList>("input");
QTest::addColumn<SignalList>("output");
@@ -1399,22 +1399,22 @@ void tst_qquickchangeset::insertConsecutive_data()
<< (SignalList() << Insert(0,2) << Insert(2,1,0,0) << Insert(3,5));
}
-void tst_qquickchangeset::insertConsecutive()
+void tst_qqmlchangeset::insertConsecutive()
{
QFETCH(SignalList, input);
QFETCH(SignalList, output);
- QVector<QQuickChangeSet::Insert> inserts;
+ QVector<QQmlChangeSet::Insert> inserts;
foreach (const Signal &signal, input) {
QVERIFY(signal.isInsert());
- inserts.append(QQuickChangeSet::Insert(signal.index, signal.count, signal.moveId, signal.offset));
+ inserts.append(QQmlChangeSet::Insert(signal.index, signal.count, signal.moveId, signal.offset));
}
- QQuickChangeSet set;
+ QQmlChangeSet set;
set.insert(inserts);
SignalList changes;
- foreach (const QQuickChangeSet::Insert &insert, set.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, set.inserts())
changes << Insert(insert.index, insert.count, insert.moveId, insert.offset);
QVERIFY(set.removes().isEmpty());
QVERIFY(set.changes().isEmpty());
@@ -1423,9 +1423,9 @@ void tst_qquickchangeset::insertConsecutive()
QCOMPARE(changes, output);
}
-void tst_qquickchangeset::copy()
+void tst_qqmlchangeset::copy()
{
- QQuickChangeSet changeSet;
+ QQmlChangeSet changeSet;
changeSet.remove(0, 12);
changeSet.remove(5, 4);
changeSet.insert(3, 9);
@@ -1433,9 +1433,9 @@ void tst_qquickchangeset::copy()
changeSet.change(24, 8);
changeSet.move(3, 5, 9, 0);
- QQuickChangeSet copy(changeSet);
+ QQmlChangeSet copy(changeSet);
- QQuickChangeSet assign;
+ QQmlChangeSet assign;
assign = changeSet;
copy.move(4, 2, 5, 1);
@@ -1453,27 +1453,27 @@ void tst_qquickchangeset::copy()
QCOMPARE(assign.difference(), changeSet.difference());
}
-void tst_qquickchangeset::debug()
+void tst_qqmlchangeset::debug()
{
- QQuickChangeSet changeSet;
+ QQmlChangeSet changeSet;
changeSet.remove(0, 12);
changeSet.remove(5, 4);
changeSet.insert(3, 9);
changeSet.insert(15, 2);
changeSet.change(24, 8);
- QTest::ignoreMessage(QtDebugMsg, "QQuickChangeSet(Remove(0,12) Remove(5,4) Insert(3,9) Insert(15,2) Change(24,8) )");
+ QTest::ignoreMessage(QtDebugMsg, "QQmlChangeSet(Remove(0,12) Remove(5,4) Insert(3,9) Insert(15,2) Change(24,8) )");
qDebug() << changeSet;
changeSet.clear();
- QTest::ignoreMessage(QtDebugMsg, "QQuickChangeSet(Remove(12,4,0,0) Insert(5,4,0,0) )");
+ QTest::ignoreMessage(QtDebugMsg, "QQmlChangeSet(Remove(12,4,0,0) Insert(5,4,0,0) )");
changeSet.move(12, 5, 4, 0);
qDebug() << changeSet;
}
-void tst_qquickchangeset::random_data()
+void tst_qqmlchangeset::random_data()
{
QTest::addColumn<int>("seed");
QTest::addColumn<int>("combinations");
@@ -1484,7 +1484,7 @@ void tst_qquickchangeset::random_data()
QTest::newRow("3*5") << 32 << 3 << 5;
}
-void tst_qquickchangeset::random()
+void tst_qqmlchangeset::random()
{
QFETCH(int, seed);
QFETCH(int, combinations);
@@ -1494,14 +1494,14 @@ void tst_qquickchangeset::random()
int failures = 0;
for (int i = 0; i < 20000; ++i) {
- QQuickChangeSet accumulatedSet;
+ QQmlChangeSet accumulatedSet;
SignalList input;
int modelCount = 40;
int moveCount = 0;
for (int j = 0; j < combinations; ++j) {
- QQuickChangeSet set;
+ QQmlChangeSet set;
for (int k = 0; k < depth; ++k) {
switch (-(qrand() % 3)) {
case InsertOp: {
@@ -1537,9 +1537,9 @@ void tst_qquickchangeset::random()
}
SignalList output;
- foreach (const QQuickChangeSet::Remove &remove, accumulatedSet.removes())
+ foreach (const QQmlChangeSet::Remove &remove, accumulatedSet.removes())
output << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, accumulatedSet.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, accumulatedSet.inserts())
output << Insert(insert.index, insert.count, insert.moveId, insert.offset);
QVector<int> inputList;
@@ -1569,6 +1569,6 @@ void tst_qquickchangeset::random()
QCOMPARE(failures, 0);
}
-QTEST_MAIN(tst_qquickchangeset)
+QTEST_MAIN(tst_qqmlchangeset)
-#include "tst_qquickchangeset.moc"
+#include "tst_qqmlchangeset.moc"
diff --git a/tests/auto/qml/qqmlecmascript/data/getSet.qml b/tests/auto/qml/qqmlecmascript/data/getSet.qml
new file mode 100644
index 0000000000..2987986b38
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/getSet.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+
+QtObject {
+ function get(x) { return 1; }
+ function set(x) { return 1; }
+ function code() {
+ var get = 0;
+ var set = 1;
+ var o = {
+ get foo() { return 2; },
+ set foo(x) { 1; }
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml
new file mode 100644
index 0000000000..b9a30ef8b5
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml
@@ -0,0 +1,47 @@
+import QtQuick 2.0
+
+QtObject {
+
+ // PLEASE NOTE: the function below is whitespace and newline sensitive,
+ // because that is what the test is all about.
+ //
+ // So: DO NOT REFORMAT THE CODE BELOW!
+
+ function code() {
+var x=0, y=0;
+var z=
+x
++
+++
+y
+
+//////////////////////////////////////////////////////////////////////////////
+if (false) {
+ ;
+}
+//////////////////////////////////////////////////////////////////////////////
+
+z=
+x
++ ++
+y
+
+//////////////////////////////////////////////////////////////////////////////
+if (false) {
+ ;
+}
+//////////////////////////////////////////////////////////////////////////////
+
+z=
+x
++ ++
+y
+
+//////////////////////////////////////////////////////////////////////////////
+if (false) {
+ ;
+}
+
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml
new file mode 100644
index 0000000000..717cdb5715
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+QtObject {
+
+ // PLEASE NOTE: the function below is whitespace and newline sensitive,
+ // because that is what the test is all about.
+ //
+ // So: DO NOT REFORMAT THE CODE BELOW!
+
+ function code() {
+var a, b, c;
+a=b
+++c
+
+if (a === b) {
+}
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml
new file mode 100644
index 0000000000..710729cbfe
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+QtObject {
+
+ // PLEASE NOTE: the function below is whitespace and newline sensitive,
+ // because that is what the test is all about.
+ //
+ // So: DO NOT REFORMAT THE CODE BELOW!
+
+ function code() {
+var x=0, y=0;
+var z=
+x
+++
+++
+y
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml
new file mode 100644
index 0000000000..1b83a1be0b
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml
new file mode 100644
index 0000000000..77f13178c3
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 1.01;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml
new file mode 100644
index 0000000000..f20baf305a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 1e-10;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml
new file mode 100644
index 0000000000..e115dbbbb1
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = -1.2;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml
new file mode 100644
index 0000000000..c3db17602a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = .4e-5;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml
new file mode 100644
index 0000000000..471db8708a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0x1;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml
new file mode 100644
index 0000000000..f8f8e1aae8
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0Xa;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml
new file mode 100644
index 0000000000..61233cbd5b
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0x;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml
new file mode 100644
index 0000000000..45195452ca
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0X;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml
new file mode 100644
index 0000000000..71b82b956d
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\01";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml
new file mode 100644
index 0000000000..787f1d86c7
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\1a";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml
new file mode 100644
index 0000000000..9954617b6b
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\012";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml
new file mode 100644
index 0000000000..5bf41f0c1a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\00a";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml
new file mode 100644
index 0000000000..563e01a995
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\u000G";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index fee66695fc..93f3b66504 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -266,6 +266,9 @@ private slots:
void deleteLaterObjectMethodCall();
void automaticSemicolon();
void compatibilitySemicolon();
+ void incrDecrSemicolon1();
+ void incrDecrSemicolon2();
+ void incrDecrSemicolon_error1();
void unaryExpression();
void switchStatement();
void withStatement();
@@ -285,6 +288,8 @@ private slots:
void propertyOverride();
void concatenatedStringPropertyAccess();
void jsOwnedObjectsDeletedOnEngineDestroy();
+ void numberParsing();
+ void stringParsing();
private:
static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -1792,10 +1797,7 @@ void tst_qqmlecmascript::functionErrors()
object = componentTwo.create();
QVERIFY(object != 0);
- QString srpname = object->property("srp_name").toString();
-
- warning = url + QLatin1String(":16: TypeError: Property 'scarceResource' of object ") + srpname
- + QLatin1String(" is not a function");
+ warning = url + QLatin1String(":16: TypeError: Property 'scarceResource' of object [object Object] is not a function");
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
delete object;
@@ -4111,8 +4113,7 @@ void tst_qqmlecmascript::scarceResources_other()
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
- srp_name = object->property("srp_name").toString();
- expectedWarning = varComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object ") + srp_name + QLatin1String(" is not a function");
+ expectedWarning = varComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object [object Object] is not a function");
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
@@ -4184,8 +4185,7 @@ void tst_qqmlecmascript::scarceResources_other()
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
- srp_name = object->property("srp_name").toString();
- expectedWarning = variantComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object ") + srp_name + QLatin1String(" is not a function");
+ expectedWarning = variantComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object [object Object] is not a function");
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
@@ -6625,6 +6625,27 @@ void tst_qqmlecmascript::compatibilitySemicolon()
QVERIFY(object != 0);
}
+void tst_qqmlecmascript::incrDecrSemicolon1()
+{
+ QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_qqmlecmascript::incrDecrSemicolon2()
+{
+ QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_qqmlecmascript::incrDecrSemicolon_error1()
+{
+ QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon_error1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object == 0);
+}
+
void tst_qqmlecmascript::unaryExpression()
{
QQmlComponent component(&engine, testFileUrl("unaryExpression.qml"));
@@ -7343,6 +7364,34 @@ void tst_qqmlecmascript::jsOwnedObjectsDeletedOnEngineDestroy()
delete object;
}
+void tst_qqmlecmascript::numberParsing()
+{
+ for (int i = 1; i < 8; ++i) {
+ QString file("numberParsing.%1.qml");
+ file = file.arg(i);
+ QQmlComponent component(&engine, testFileUrl(file));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ }
+ for (int i = 1; i < 3; ++i) {
+ QString file("numberParsing_error.%1.qml");
+ file = file.arg(i);
+ QQmlComponent component(&engine, testFileUrl(file));
+ QVERIFY(!component.errors().isEmpty());
+ }
+}
+
+void tst_qqmlecmascript::stringParsing()
+{
+ for (int i = 1; i < 6; ++i) {
+ QString file("stringParsing_error.%1.qml");
+ file = file.arg(i);
+ QQmlComponent component(&engine, testFileUrl(file));
+ QObject *object = component.create();
+ QVERIFY(object == 0);
+ }
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"
diff --git a/tests/auto/qml/qqmllanguage/data/CompositeType5.qml b/tests/auto/qml/qqmllanguage/data/CompositeType5.qml
new file mode 100644
index 0000000000..564468ce90
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/CompositeType5.qml
@@ -0,0 +1,2 @@
+CompositeType {
+}
diff --git a/tests/auto/qml/qqmllanguage/data/CompositeType6.qml b/tests/auto/qml/qqmllanguage/data/CompositeType6.qml
new file mode 100644
index 0000000000..a8a2af9318
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/CompositeType6.qml
@@ -0,0 +1,2 @@
+CompositeType2 {
+}
diff --git a/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml b/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml
index 717cd84536..4034849df8 100644
--- a/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml
+++ b/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml
@@ -8,6 +8,10 @@ QtObject {
property QtObject myProperty4
property MyQmlObject myProperty5
property MyQmlObject myProperty6
+ property CompositeType myProperty7
+ property CompositeType myProperty8
+ property CompositeType2 myProperty9
+ property CompositeType2 myPropertyA
myProperty: CompositeType {}
myProperty2: CompositeType2 {}
@@ -15,4 +19,8 @@ QtObject {
myProperty4: CompositeType4 {}
myProperty5: CompositeType2 {}
myProperty6: CompositeType4 {}
+ myProperty7: CompositeType {}
+ myProperty8: CompositeType5 {}
+ myProperty9: CompositeType2 {}
+ myPropertyA: CompositeType6 {}
}
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt
new file mode 100644
index 0000000000..7a75447a62
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt
@@ -0,0 +1,2 @@
+3:1:Type RegisteredCompositeType2 unavailable
+-1:-1:File not found
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml
new file mode 100644
index 0000000000..915a6138d9
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml
@@ -0,0 +1,3 @@
+import Test 1.0
+
+RegisteredCompositeType2 {}
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt
new file mode 100644
index 0000000000..0272619404
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt
@@ -0,0 +1,2 @@
+3:1:Type RegisteredCompositeType3 unavailable
+1:1:Expected a qualified name id
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml
new file mode 100644
index 0000000000..43d7f3ee95
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml
@@ -0,0 +1,3 @@
+import Test 1.0
+
+RegisteredCompositeType3 {}
diff --git a/tests/auto/qml/qqmllanguage/data/literals.qml b/tests/auto/qml/qqmllanguage/data/literals.qml
index ffef050438..564b389760 100644
--- a/tests/auto/qml/qqmllanguage/data/literals.qml
+++ b/tests/auto/qml/qqmllanguage/data/literals.qml
@@ -2,12 +2,14 @@ import QtQuick 2.0
QtObject {
property variant n1: 0xFe32 // hex
- property variant n2: 015 // octal
+ property variant n2: 015
property variant n3: -4.2E11 // floating-point literals
property variant n4: .1e9
property variant n5: 3e-12
property variant n6: 3e+12
property variant n7: 0.1e9
+ property variant n8: 1152921504606846976
+ property variant n9: 100000000000000000000
property variant c1: "\b" // special characters
property variant c2: "\f"
diff --git a/tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml b/tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml
new file mode 100644
index 0000000000..f633a14fa7
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml
@@ -0,0 +1,3 @@
+import Test 1.0
+
+RegisteredCompositeType {}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 0f9e328bd9..3121d10265 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -139,6 +139,7 @@ private slots:
void registrationOrder();
void readonly();
void receivers();
+ void registeredCompositeType();
void basicRemote_data();
void basicRemote();
@@ -467,6 +468,9 @@ void tst_qqmllanguage::errors_data()
QTest::newRow("invalidTypeName.4") << "invalidTypeName.4.qml" << "invalidTypeName.4.errors.txt" << false;
QTest::newRow("Major version isolation") << "majorVersionIsolation.qml" << "majorVersionIsolation.errors.txt" << false;
+
+ QTest::newRow("badCompositeRegistration.1") << "badCompositeRegistration.1.qml" << "badCompositeRegistration.1.errors.txt" << false;
+ QTest::newRow("badCompositeRegistration.2") << "badCompositeRegistration.2.qml" << "badCompositeRegistration.2.errors.txt" << false;
}
@@ -2771,6 +2775,10 @@ void tst_qqmllanguage::initTestCase()
QQmlMetaType::registerCustomStringConverter(qMetaTypeId<MyCustomVariantType>(), myCustomVariantTypeConverter);
registerTypes();
+ // Registered here because it uses testFileUrl
+ qmlRegisterType(testFileUrl("CompositeType.qml"), "Test", 1, 0, "RegisteredCompositeType");
+ qmlRegisterType(testFileUrl("CompositeType.DoesNotExist.qml"), "Test", 1, 0, "RegisteredCompositeType2");
+ qmlRegisterType(testFileUrl("invalidRoot.1.qml"), "Test", 1, 0, "RegisteredCompositeType3");
// Registering the TestType class in other modules should have no adverse effects
qmlRegisterType<TestType>("org.qtproject.TestPre", 1, 0, "Test");
@@ -2915,6 +2923,17 @@ void tst_qqmllanguage::receivers()
delete o;
}
+void tst_qqmllanguage::registeredCompositeType()
+{
+ QQmlComponent component(&engine, testFileUrl("registeredCompositeType.qml"));
+
+ VERIFY_ERRORS(0);
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ delete o;
+}
+
// QTBUG-18268
void tst_qqmllanguage::remoteLoadCrash()
{
@@ -3053,6 +3072,8 @@ void tst_qqmllanguage::literals_data()
QTest::newRow("fp3") << "n5" << QVariant(3e-12);
QTest::newRow("fp4") << "n6" << QVariant(3e+12);
QTest::newRow("fp5") << "n7" << QVariant(0.1e9);
+ QTest::newRow("large-int1") << "n8" << QVariant((double) 1152921504606846976);
+ QTest::newRow("large-int2") << "n9" << QVariant(100000000000000000000.);
QTest::newRow("special1") << "c1" << QVariant(QString("\b"));
QTest::newRow("special2") << "c2" << QVariant(QString("\f"));
@@ -3064,8 +3085,8 @@ void tst_qqmllanguage::literals_data()
QTest::newRow("special8") << "c8" << QVariant(QString("\""));
QTest::newRow("special9") << "c9" << QVariant(QString("\\"));
// We don't handle octal escape sequences
- QTest::newRow("special11") << "c10" << QVariant(QString(1, QChar(0xa9)));
- QTest::newRow("special12") << "c11" << QVariant(QString(1, QChar(0x00A9)));
+ QTest::newRow("special10") << "c10" << QVariant(QString(1, QChar(0xa9)));
+ QTest::newRow("special11") << "c11" << QVariant(QString(1, QChar(0x00A9)));
}
void tst_qqmllanguage::literals()
diff --git a/tests/auto/qml/qquickchangeset/qquickchangeset.pro b/tests/auto/qml/qqmllistcompositor/qqmllistcompositor.pro
index fd8c87baa4..e6c9dc3a29 100644
--- a/tests/auto/qml/qquickchangeset/qquickchangeset.pro
+++ b/tests/auto/qml/qqmllistcompositor/qqmllistcompositor.pro
@@ -1,8 +1,8 @@
CONFIG += testcase
-TARGET = tst_qquickchangeset
+TARGET = tst_qqmllistcompositor
macx:CONFIG -= app_bundle
-SOURCES += tst_qquickchangeset.cpp
+SOURCES += tst_qqmllistcompositor.cpp
CONFIG += parallel_test
diff --git a/tests/auto/qml/qquicklistcompositor/tst_qquicklistcompositor.cpp b/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp
index 5be501c94e..d5e85f478d 100644
--- a/tests/auto/qml/qquicklistcompositor/tst_qquicklistcompositor.cpp
+++ b/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp
@@ -39,11 +39,11 @@
**
****************************************************************************/
#include <qtest.h>
-#include <private/qquicklistcompositor_p.h>
+#include <private/qqmllistcompositor_p.h>
template<typename T, int N> int lengthOf(const T (&)[N]) { return N; }
-typedef QQuickListCompositor C;
+typedef QQmlListCompositor C;
struct Range
{
@@ -70,9 +70,9 @@ template <typename T> struct Array
typedef Array<int> IndexArray;
typedef Array<const void *> ListArray;
-typedef QVector<QQuickListCompositor::Remove> RemoveList;
-typedef QVector<QQuickListCompositor::Insert> InsertList;
-typedef QVector<QQuickListCompositor::Change> ChangeList;
+typedef QVector<QQmlListCompositor::Remove> RemoveList;
+typedef QVector<QQmlListCompositor::Insert> InsertList;
+typedef QVector<QQmlListCompositor::Change> ChangeList;
typedef QVector<Range> RangeList;
@@ -102,7 +102,7 @@ QT_END_NAMESPACE
static const C::Group Visible = C::Group(2);
static const C::Group Selection = C::Group(3);
-class tst_qquicklistcompositor : public QObject
+class tst_qqmllistcompositor : public QObject
{
Q_OBJECT
@@ -174,7 +174,7 @@ private slots:
void groupDebug();
};
-void tst_qquicklistcompositor::find_data()
+void tst_qqmllistcompositor::find_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("startGroup");
@@ -201,7 +201,7 @@ void tst_qquicklistcompositor::find_data()
<< uint(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag) << 0;
}
-void tst_qquicklistcompositor::find()
+void tst_qqmllistcompositor::find()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, startGroup);
@@ -215,7 +215,7 @@ void tst_qquicklistcompositor::find()
QFETCH(uint, rangeFlags);
QFETCH(int, rangeIndex);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -224,7 +224,7 @@ void tst_qquicklistcompositor::find()
compositor.find(startGroup, startIndex);
- QQuickListCompositor::iterator it = compositor.find(group, index);
+ QQmlListCompositor::iterator it = compositor.find(group, index);
QCOMPARE(it.index[C::Cache], cacheIndex);
QCOMPARE(it.index[C::Default], defaultIndex);
QCOMPARE(it.index[Visible], visibleIndex);
@@ -233,7 +233,7 @@ void tst_qquicklistcompositor::find()
QCOMPARE(it->index, rangeIndex);
}
-void tst_qquicklistcompositor::findInsertPosition_data()
+void tst_qqmllistcompositor::findInsertPosition_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("group");
@@ -265,7 +265,7 @@ void tst_qquicklistcompositor::findInsertPosition_data()
<< uint(0) << 0;
}
-void tst_qquicklistcompositor::findInsertPosition()
+void tst_qqmllistcompositor::findInsertPosition()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, group);
@@ -277,14 +277,14 @@ void tst_qquicklistcompositor::findInsertPosition()
QFETCH(uint, rangeFlags);
QFETCH(int, rangeIndex);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
foreach (const Range &range, ranges)
compositor.append(range.list, range.index, range.count, range.flags);
- QQuickListCompositor::insert_iterator it = compositor.findInsertPosition(group, index);
+ QQmlListCompositor::insert_iterator it = compositor.findInsertPosition(group, index);
QCOMPARE(it.index[C::Cache], cacheIndex);
QCOMPARE(it.index[C::Default], defaultIndex);
@@ -294,9 +294,9 @@ void tst_qquicklistcompositor::findInsertPosition()
QCOMPARE(it->index, rangeIndex);
}
-void tst_qquicklistcompositor::insert()
+void tst_qqmllistcompositor::insert()
{
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -383,7 +383,7 @@ void tst_qquicklistcompositor::insert()
}
}
-void tst_qquicklistcompositor::clearFlags_data()
+void tst_qqmllistcompositor::clearFlags_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("group");
@@ -518,7 +518,7 @@ void tst_qquicklistcompositor::clearFlags_data()
}
}
-void tst_qquicklistcompositor::clearFlags()
+void tst_qqmllistcompositor::clearFlags()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, group);
@@ -535,7 +535,7 @@ void tst_qquicklistcompositor::clearFlags()
QFETCH(IndexArray, selectionIndexes);
QFETCH(ListArray, selectionLists);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -577,7 +577,7 @@ void tst_qquicklistcompositor::clearFlags()
}
}
-void tst_qquicklistcompositor::setFlags_data()
+void tst_qqmllistcompositor::setFlags_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("group");
@@ -700,7 +700,7 @@ void tst_qquicklistcompositor::setFlags_data()
}
}
-void tst_qquicklistcompositor::setFlags()
+void tst_qqmllistcompositor::setFlags()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, group);
@@ -717,7 +717,7 @@ void tst_qquicklistcompositor::setFlags()
QFETCH(IndexArray, selectionIndexes);
QFETCH(ListArray, selectionLists);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -759,7 +759,7 @@ void tst_qquicklistcompositor::setFlags()
}
}
-void tst_qquicklistcompositor::move_data()
+void tst_qqmllistcompositor::move_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("fromGroup");
@@ -985,7 +985,7 @@ void tst_qquicklistcompositor::move_data()
}
}
-void tst_qquicklistcompositor::move()
+void tst_qqmllistcompositor::move()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, fromGroup);
@@ -1004,7 +1004,7 @@ void tst_qquicklistcompositor::move()
QFETCH(IndexArray, selectionIndexes);
QFETCH(ListArray, selectionLists);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1048,11 +1048,11 @@ void tst_qquicklistcompositor::move()
}
}
-void tst_qquicklistcompositor::moveFromEnd()
+void tst_qqmllistcompositor::moveFromEnd()
{
int listA; void *a = &listA;
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.append(a, 0, 1, C::AppendFlag | C::PrependFlag | C::DefaultFlag);
// Moving an item anchors it to that position.
@@ -1074,9 +1074,9 @@ void tst_qquicklistcompositor::moveFromEnd()
QCOMPARE(it.modelIndex(), 0);
}
-void tst_qquicklistcompositor::clear()
+void tst_qqmllistcompositor::clear()
{
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1097,7 +1097,7 @@ void tst_qquicklistcompositor::clear()
QCOMPARE(compositor.count(C::Cache), 0);
}
-void tst_qquicklistcompositor::listItemsInserted_data()
+void tst_qqmllistcompositor::listItemsInserted_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1226,7 +1226,7 @@ void tst_qquicklistcompositor::listItemsInserted_data()
}
}
-void tst_qquicklistcompositor::listItemsInserted()
+void tst_qqmllistcompositor::listItemsInserted()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1238,7 +1238,7 @@ void tst_qquicklistcompositor::listItemsInserted()
QFETCH(IndexArray, visibleIndexes);
QFETCH(IndexArray, selectionIndexes);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1276,7 +1276,7 @@ void tst_qquicklistcompositor::listItemsInserted()
}
}
-void tst_qquicklistcompositor::listItemsRemoved_data()
+void tst_qqmllistcompositor::listItemsRemoved_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1362,7 +1362,7 @@ void tst_qquicklistcompositor::listItemsRemoved_data()
}
}
-void tst_qquicklistcompositor::listItemsRemoved()
+void tst_qqmllistcompositor::listItemsRemoved()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1374,7 +1374,7 @@ void tst_qquicklistcompositor::listItemsRemoved()
QFETCH(IndexArray, visibleIndexes);
QFETCH(IndexArray, selectionIndexes);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1412,7 +1412,7 @@ void tst_qquicklistcompositor::listItemsRemoved()
}
}
-void tst_qquicklistcompositor::listItemsMoved_data()
+void tst_qqmllistcompositor::listItemsMoved_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1554,7 +1554,7 @@ void tst_qquicklistcompositor::listItemsMoved_data()
}
}
-void tst_qquicklistcompositor::listItemsMoved()
+void tst_qqmllistcompositor::listItemsMoved()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1568,7 +1568,7 @@ void tst_qquicklistcompositor::listItemsMoved()
QFETCH(IndexArray, visibleIndexes);
QFETCH(IndexArray, selectionIndexes);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1608,7 +1608,7 @@ void tst_qquicklistcompositor::listItemsMoved()
}
}
-void tst_qquicklistcompositor::listItemsChanged_data()
+void tst_qqmllistcompositor::listItemsChanged_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1640,7 +1640,7 @@ void tst_qquicklistcompositor::listItemsChanged_data()
<< Change(0, 0, 3, 6, 2, C::DefaultFlag | C::CacheFlag));
}
-void tst_qquicklistcompositor::listItemsChanged()
+void tst_qqmllistcompositor::listItemsChanged()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1648,7 +1648,7 @@ void tst_qquicklistcompositor::listItemsChanged()
QFETCH(int, count);
QFETCH(ChangeList, expectedChanges);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1661,12 +1661,12 @@ void tst_qquicklistcompositor::listItemsChanged()
QCOMPARE(changes, expectedChanges);
}
-void tst_qquicklistcompositor::compositorDebug()
+void tst_qqmllistcompositor::compositorDebug()
{
void *a = (void *)0xa0;
void *b = (void *)0xb0;
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
compositor.append(a, 0, 2, C::PrependFlag | C::DefaultFlag);
@@ -1676,7 +1676,7 @@ void tst_qquicklistcompositor::compositorDebug()
compositor.append(a, 2, 3, C::DefaultFlag);
QTest::ignoreMessage(QtDebugMsg,
- "QQuickListCompositor(00110\n"
+ "QQmlListCompositor(00110\n"
" 0 0 0 0 Range(0xa0 0 2 00P000000000D0\n"
" 0 0 2 0 Range(0xa0 2 3 00P00000000000\n"
" 0 0 2 0 Range(0xa0 5 2 0AP000000000D0\n"
@@ -1687,7 +1687,7 @@ void tst_qquicklistcompositor::compositorDebug()
compositor.setFlags(C::Default, 5, 2, SelectionFlag);
QTest::ignoreMessage(QtDebugMsg,
- "QQuickListCompositor(20110\n"
+ "QQmlListCompositor(20110\n"
" 0 0 0 0 Range(0xa0 0 2 00P000000000D0\n"
" 0 0 2 0 Range(0xa0 2 3 00P00000000000\n"
" 0 0 2 0 Range(0xa0 5 2 0AP000000000D0\n"
@@ -1698,12 +1698,12 @@ void tst_qquicklistcompositor::compositorDebug()
qDebug() << compositor;
}
-void tst_qquicklistcompositor::changeDebug()
+void tst_qqmllistcompositor::changeDebug()
{
void *a = (void *)0xa0;
void *b = (void *)0xb0;
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
compositor.append(a, 0, 2, C::PrependFlag | C::DefaultFlag);
@@ -1716,14 +1716,14 @@ void tst_qquicklistcompositor::changeDebug()
QTest::ignoreMessage(QtDebugMsg, "Change(-1 2 000000010D0 2 0 7 0)");
- qDebug() << QQuickListCompositor::Change(compositor.find(C::Default, 7), 2, SelectionFlag | C::DefaultFlag);
+ qDebug() << QQmlListCompositor::Change(compositor.find(C::Default, 7), 2, SelectionFlag | C::DefaultFlag);
QTest::ignoreMessage(QtDebugMsg, "Remove(9 4 000000000D0 10 0)");
- qDebug() << QQuickListCompositor::Remove(compositor.find(C::Default, 10), 4, C::DefaultFlag, 9);
+ qDebug() << QQmlListCompositor::Remove(compositor.find(C::Default, 10), 4, C::DefaultFlag, 9);
QTest::ignoreMessage(QtDebugMsg, "Insert(9 4 000000000D0 3 0)");
- qDebug() << QQuickListCompositor::Insert(compositor.find(C::Default, 3), 4, C::DefaultFlag, 9);
+ qDebug() << QQmlListCompositor::Insert(compositor.find(C::Default, 3), 4, C::DefaultFlag, 9);
}
-void tst_qquicklistcompositor::groupDebug()
+void tst_qqmllistcompositor::groupDebug()
{
QTest::ignoreMessage(QtDebugMsg, "Default ");
qDebug() << C::Default;
@@ -1733,8 +1733,8 @@ void tst_qquicklistcompositor::groupDebug()
qDebug() << Selection;
}
-QTEST_MAIN(tst_qquicklistcompositor)
+QTEST_MAIN(tst_qqmllistcompositor)
-#include "tst_qquicklistcompositor.moc"
+#include "tst_qqmllistcompositor.moc"
diff --git a/tests/auto/qml/qquicklistmodel/data/enumerate.qml b/tests/auto/qml/qqmllistmodel/data/enumerate.qml
index f73d66b318..f73d66b318 100644
--- a/tests/auto/qml/qquicklistmodel/data/enumerate.qml
+++ b/tests/auto/qml/qqmllistmodel/data/enumerate.qml
diff --git a/tests/auto/qml/qquicklistmodel/data/multipleroles.qml b/tests/auto/qml/qqmllistmodel/data/multipleroles.qml
index 4a331e2b3e..4a331e2b3e 100644
--- a/tests/auto/qml/qquicklistmodel/data/multipleroles.qml
+++ b/tests/auto/qml/qqmllistmodel/data/multipleroles.qml
diff --git a/tests/auto/qml/qquicklistmodel/data/setmodelcachelist.qml b/tests/auto/qml/qqmllistmodel/data/setmodelcachelist.qml
index 58bf1ccd04..58bf1ccd04 100644
--- a/tests/auto/qml/qquicklistmodel/data/setmodelcachelist.qml
+++ b/tests/auto/qml/qqmllistmodel/data/setmodelcachelist.qml
diff --git a/tests/auto/qml/qquicklistmodel/data/signalhandlers.qml b/tests/auto/qml/qqmllistmodel/data/signalhandlers.qml
index 750d99c5a3..750d99c5a3 100644
--- a/tests/auto/qml/qquicklistmodel/data/signalhandlers.qml
+++ b/tests/auto/qml/qqmllistmodel/data/signalhandlers.qml
diff --git a/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro b/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro
index e2b88ccec6..ef044f1663 100644
--- a/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro
+++ b/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro
@@ -1,8 +1,8 @@
CONFIG += testcase
-TARGET = tst_qquicklistmodel
+TARGET = tst_qqmllistmodel
macx:CONFIG -= app_bundle
-SOURCES += tst_qquicklistmodel.cpp
+SOURCES += tst_qqmllistmodel.cpp
include (../../shared/util.pri)
diff --git a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 8deaae9902..22229febf3 100644
--- a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -43,7 +43,7 @@
#include <QtQuick/private/qquicktext_p.h>
#include <QtQuick/private/qquickanimation_p.h>
#include <QtQml/private/qqmlengine_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include <QtQml/private/qqmlexpression_p.h>
#include <QQmlComponent>
@@ -82,17 +82,17 @@ static bool isValidErrorMessage(const QString &msg, bool dynamicRoleTest)
return valid;
}
-class tst_qquicklistmodel : public QQmlDataTest
+class tst_qqmllistmodel : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquicklistmodel()
+ tst_qqmllistmodel()
{
qRegisterMetaType<QVector<int> >();
}
private:
- int roleFromName(const QQuickListModel *model, const QString &roleName);
+ int roleFromName(const QQmlListModel *model, const QString &roleName);
static bool compareVariantList(const QVariantList &testList, QVariant object);
@@ -132,11 +132,11 @@ private slots:
void datetime_data();
};
-bool tst_qquicklistmodel::compareVariantList(const QVariantList &testList, QVariant object)
+bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVariant object)
{
bool allOk = true;
- QQuickListModel *model = qobject_cast<QQuickListModel *>(object.value<QObject *>());
+ QQmlListModel *model = qobject_cast<QQmlListModel *>(object.value<QObject *>());
if (model == 0)
return false;
@@ -178,12 +178,12 @@ bool tst_qquicklistmodel::compareVariantList(const QVariantList &testList, QVari
return allOk;
}
-int tst_qquicklistmodel::roleFromName(const QQuickListModel *model, const QString &roleName)
+int tst_qqmllistmodel::roleFromName(const QQmlListModel *model, const QString &roleName)
{
return model->roleNames().key(roleName.toUtf8(), -1);
}
-void tst_qquicklistmodel::static_types_data()
+void tst_qqmllistmodel::static_types_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QVariant>("value");
@@ -240,7 +240,7 @@ void tst_qquicklistmodel::static_types_data()
<< QString("<Unknown File>: Can't assign to existing role 'foo' of different type [List -> Number]");
}
-void tst_qquicklistmodel::static_types()
+void tst_qqmllistmodel::static_types()
{
QFETCH(QString, qml);
QFETCH(QVariant, value);
@@ -272,7 +272,7 @@ void tst_qquicklistmodel::static_types()
delete obj;
}
-void tst_qquicklistmodel::static_i18n_data()
+void tst_qqmllistmodel::static_i18n_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QVariant>("value");
@@ -309,7 +309,7 @@ void tst_qquicklistmodel::static_i18n_data()
<< QString("ListElement: improperly specified QT_TRID_NOOP");
}
-void tst_qquicklistmodel::static_i18n()
+void tst_qqmllistmodel::static_i18n()
{
QFETCH(QString, qml);
QFETCH(QVariant, value);
@@ -341,7 +341,7 @@ void tst_qquicklistmodel::static_i18n()
delete obj;
}
-void tst_qquicklistmodel::static_nestedElements()
+void tst_qqmllistmodel::static_nestedElements()
{
QFETCH(int, elementCount);
@@ -379,7 +379,7 @@ void tst_qquicklistmodel::static_nestedElements()
delete obj;
}
-void tst_qquicklistmodel::static_nestedElements_data()
+void tst_qqmllistmodel::static_nestedElements_data()
{
QTest::addColumn<int>("elementCount");
@@ -389,7 +389,7 @@ void tst_qquicklistmodel::static_nestedElements_data()
QTest::newRow("many items") << 5;
}
-void tst_qquicklistmodel::dynamic_data()
+void tst_qqmllistmodel::dynamic_data()
{
QTest::addColumn<QString>("script");
QTest::addColumn<int>("result");
@@ -530,7 +530,7 @@ void tst_qquicklistmodel::dynamic_data()
}
}
-void tst_qquicklistmodel::dynamic()
+void tst_qqmllistmodel::dynamic()
{
QFETCH(QString, script);
QFETCH(int, result);
@@ -539,7 +539,7 @@ void tst_qquicklistmodel::dynamic()
QQuickItem dummyItem0, dummyItem1;
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextObject(&model);
@@ -561,7 +561,7 @@ void tst_qquicklistmodel::dynamic()
QVERIFY(spyCount.count() > 0);
}
-void tst_qquicklistmodel::enumerate()
+void tst_qqmllistmodel::enumerate()
{
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("enumerate.qml"));
@@ -602,7 +602,7 @@ void tst_qquicklistmodel::enumerate()
delete item;
}
-void tst_qquicklistmodel::error_data()
+void tst_qqmllistmodel::error_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QString>("error");
@@ -652,7 +652,7 @@ void tst_qquicklistmodel::error_data()
<< "Foo.ListElement - Foo is not a namespace";
}
-void tst_qquicklistmodel::error()
+void tst_qqmllistmodel::error()
{
QFETCH(QString, qml);
QFETCH(QString, error);
@@ -671,7 +671,7 @@ void tst_qquicklistmodel::error()
}
}
-void tst_qquicklistmodel::syncError()
+void tst_qqmllistmodel::syncError()
{
QString qml = "import QtQuick 2.0\nListModel { id: lm; Component.onCompleted: lm.sync() }";
QString error = "file:dummy.qml:2:1: QML ListModel: List sync() can only be called from a WorkerScript";
@@ -689,7 +689,7 @@ void tst_qquicklistmodel::syncError()
/*
Test model changes from set() are available to the view
*/
-void tst_qquicklistmodel::set_data()
+void tst_qqmllistmodel::set_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -697,12 +697,12 @@ void tst_qquicklistmodel::set_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodel::set()
+void tst_qqmllistmodel::set()
{
QFETCH(bool, dynamicRoles);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextProperty("model", &model);
@@ -727,7 +727,7 @@ void tst_qquicklistmodel::set()
/*
Test model changes on values returned by get() are available to the view
*/
-void tst_qquicklistmodel::get()
+void tst_qqmllistmodel::get()
{
QFETCH(QString, expression);
QFETCH(int, index);
@@ -740,7 +740,7 @@ void tst_qquicklistmodel::get()
component.setData(
"import QtQuick 2.0\n"
"ListModel {}\n", QUrl());
- QQuickListModel *model = qobject_cast<QQuickListModel*>(component.create());
+ QQmlListModel *model = qobject_cast<QQmlListModel*>(component.create());
model->setDynamicRoles(dynamicRoles);
engine.rootContext()->setContextProperty("model", model);
@@ -775,7 +775,7 @@ void tst_qquicklistmodel::get()
delete model;
}
-void tst_qquicklistmodel::get_data()
+void tst_qqmllistmodel::get_data()
{
QTest::addColumn<QString>("expression");
QTest::addColumn<int>("index");
@@ -802,7 +802,7 @@ void tst_qquicklistmodel::get_data()
/*
Test that the tests run in get() also work for nested list data
*/
-void tst_qquicklistmodel::get_nested()
+void tst_qqmllistmodel::get_nested()
{
QFETCH(QString, expression);
QFETCH(int, index);
@@ -818,10 +818,10 @@ void tst_qquicklistmodel::get_nested()
component.setData(
"import QtQuick 2.0\n"
"ListModel {}", QUrl());
- QQuickListModel *model = qobject_cast<QQuickListModel*>(component.create());
+ QQmlListModel *model = qobject_cast<QQmlListModel*>(component.create());
model->setDynamicRoles(dynamicRoles);
QVERIFY(component.errorString().isEmpty());
- QQuickListModel *childModel;
+ QQmlListModel *childModel;
engine.rootContext()->setContextProperty("model", model);
RUNEXPR("model.append({ listRoleA: [\n"
@@ -872,7 +872,7 @@ void tst_qquicklistmodel::get_nested()
int outerListRole = roleFromName(model, outerListRoleName);
QVERIFY(outerListRole >= 0);
- childModel = qobject_cast<QQuickListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
+ childModel = qobject_cast<QQmlListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
QVERIFY(childModel);
QString extendedExpression = QString("get(%1).%2.%3").arg(outerListIndex).arg(outerListRoleName).arg(expression);
@@ -900,20 +900,20 @@ void tst_qquicklistmodel::get_nested()
delete model;
}
-void tst_qquicklistmodel::get_nested_data()
+void tst_qqmllistmodel::get_nested_data()
{
get_data();
}
//QTBUG-13754
-void tst_qquicklistmodel::crash_model_with_multiple_roles()
+void tst_qqmllistmodel::crash_model_with_multiple_roles()
{
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("multipleroles.qml"));
QObject *rootItem = component.create();
QVERIFY(component.errorString().isEmpty());
QVERIFY(rootItem != 0);
- QQuickListModel *model = rootItem->findChild<QQuickListModel*>("listModel");
+ QQmlListModel *model = rootItem->findChild<QQmlListModel*>("listModel");
QVERIFY(model != 0);
// used to cause a crash
@@ -923,7 +923,7 @@ void tst_qquicklistmodel::crash_model_with_multiple_roles()
}
//QTBUG-15190
-void tst_qquicklistmodel::set_model_cache()
+void tst_qqmllistmodel::set_model_cache()
{
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("setmodelcachelist.qml"));
@@ -935,7 +935,7 @@ void tst_qquicklistmodel::set_model_cache()
delete model;
}
-void tst_qquicklistmodel::property_changes()
+void tst_qqmllistmodel::property_changes()
{
QFETCH(QString, script_setup);
QFETCH(QString, script_change);
@@ -946,7 +946,7 @@ void tst_qquicklistmodel::property_changes()
QFETCH(bool, dynamicRoles);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model, engine.rootContext());
engine.rootContext()->setContextObject(&model);
@@ -993,7 +993,7 @@ void tst_qquicklistmodel::property_changes()
delete connectionsObject;
}
-void tst_qquicklistmodel::property_changes_data()
+void tst_qqmllistmodel::property_changes_data()
{
QTest::addColumn<QString>("script_setup");
QTest::addColumn<QString>("script_change");
@@ -1066,7 +1066,7 @@ void tst_qquicklistmodel::property_changes_data()
}
}
-void tst_qquicklistmodel::clear_data()
+void tst_qqmllistmodel::clear_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -1074,12 +1074,12 @@ void tst_qquicklistmodel::clear_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodel::clear()
+void tst_qqmllistmodel::clear()
{
QFETCH(bool, dynamicRoles);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model, engine.rootContext());
engine.rootContext()->setContextProperty("model", &model);
@@ -1111,7 +1111,7 @@ void tst_qquicklistmodel::clear()
QCOMPARE(roleNames[2], QByteArray("propertyC"));
}
-void tst_qquicklistmodel::signal_handlers_data()
+void tst_qqmllistmodel::signal_handlers_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -1119,14 +1119,14 @@ void tst_qquicklistmodel::signal_handlers_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodel::signal_handlers()
+void tst_qqmllistmodel::signal_handlers()
{
QFETCH(bool, dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("signalhandlers.qml"));
QObject *model = component.create();
- QQuickListModel *lm = qobject_cast<QQuickListModel *>(model);
+ QQmlListModel *lm = qobject_cast<QQmlListModel *>(model);
QVERIFY(lm != 0);
lm->setDynamicRoles(dynamicRoles);
QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
@@ -1136,7 +1136,7 @@ void tst_qquicklistmodel::signal_handlers()
delete model;
}
-void tst_qquicklistmodel::role_mode_data()
+void tst_qqmllistmodel::role_mode_data()
{
QTest::addColumn<QString>("script");
QTest::addColumn<int>("result");
@@ -1150,14 +1150,14 @@ void tst_qquicklistmodel::role_mode_data()
QTest::newRow("enableDynamic2") << "{dynamicRoles=true;append({'a':1});dynamicRoles=false;dynamicRoles}" << 1 << "<Unknown File>: QML ListModel: unable to enable static roles as this model is not empty!";
}
-void tst_qquicklistmodel::role_mode()
+void tst_qqmllistmodel::role_mode()
{
QFETCH(QString, script);
QFETCH(int, result);
QFETCH(QString, warning);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextObject(&model);
QQmlExpression e(engine.rootContext(), &model, script);
@@ -1171,10 +1171,10 @@ void tst_qquicklistmodel::role_mode()
QCOMPARE(actual,result);
}
-void tst_qquicklistmodel::string_to_list_crash()
+void tst_qqmllistmodel::string_to_list_crash()
{
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextObject(&model);
QString script = QLatin1String("{append({'a':'data'});get(0).a = [{'x':123}]}");
@@ -1184,7 +1184,7 @@ void tst_qquicklistmodel::string_to_list_crash()
e.evaluate();
}
-void tst_qquicklistmodel::empty_element_warning_data()
+void tst_qqmllistmodel::empty_element_warning_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<bool>("warning");
@@ -1198,7 +1198,7 @@ void tst_qquicklistmodel::empty_element_warning_data()
QTest::newRow("role3") << "import QtQuick 2.0\nListModel { ListElement {} ListElement {a:1} ListElement {b:2} }" << false;
}
-void tst_qquicklistmodel::empty_element_warning()
+void tst_qqmllistmodel::empty_element_warning()
{
QFETCH(QString, qml);
QFETCH(bool, warning);
@@ -1219,7 +1219,7 @@ void tst_qquicklistmodel::empty_element_warning()
delete obj;
}
-void tst_qquicklistmodel::datetime_data()
+void tst_qqmllistmodel::datetime_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QDateTime>("expected");
@@ -1234,13 +1234,13 @@ void tst_qquicklistmodel::datetime_data()
QTest::newRow("dt3") << "{append({'date':dt0});get(0).date=undefined;get(0).date}" << dt;
}
-void tst_qquicklistmodel::datetime()
+void tst_qqmllistmodel::datetime()
{
QFETCH(QString, qml);
QFETCH(QDateTime, expected);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
QQmlEngine::setContextForObject(&model,engine.rootContext());
QDateTime dt0(QDate(1900, 1, 2), QTime( 8, 14));
QDateTime dt1(QDate(2000, 11, 22), QTime(10, 45));
@@ -1253,6 +1253,6 @@ void tst_qquicklistmodel::datetime()
QVERIFY(expected == dtResult);
}
-QTEST_MAIN(tst_qquicklistmodel)
+QTEST_MAIN(tst_qqmllistmodel)
-#include "tst_qquicklistmodel.moc"
+#include "tst_qqmllistmodel.moc"
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/model.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/model.qml
index 5973ea8adf..5973ea8adf 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/model.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/model.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/script.js b/tests/auto/qml/qqmllistmodelworkerscript/data/script.js
index 66a4acb8a8..66a4acb8a8 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/script.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/script.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.js b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.js
index cb9dfa66aa..cb9dfa66aa 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.qml
index e2361acf6b..e2361acf6b 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.js b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.js
index f63dd68839..f63dd68839 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.qml
index bdb5e024d8..bdb5e024d8 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.js b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.js
index 9b8d8fa7f3..9b8d8fa7f3 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml
index c21cd43e7e..c21cd43e7e 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/qquicklistmodelworkerscript.pro b/tests/auto/qml/qqmllistmodelworkerscript/qqmllistmodelworkerscript.pro
index 07875722f1..14f0604a9b 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/qquicklistmodelworkerscript.pro
+++ b/tests/auto/qml/qqmllistmodelworkerscript/qqmllistmodelworkerscript.pro
@@ -1,8 +1,8 @@
CONFIG += testcase
-TARGET = tst_qquicklistmodelworkerscript
+TARGET = tst_qqmllistmodelworkerscript
macx:CONFIG -= app_bundle
-SOURCES += tst_qquicklistmodelworkerscript.cpp
+SOURCES += tst_qqmllistmodelworkerscript.cpp
include (../../shared/util.pri)
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/tst_qquicklistmodelworkerscript.cpp b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
index 8d5f34c010..a0edfb6891 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/tst_qquicklistmodelworkerscript.cpp
+++ b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
@@ -42,7 +42,7 @@
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquicktext_p.h>
#include <QtQml/private/qqmlengine_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include <QtQml/private/qqmlexpression_p.h>
#include <QQmlComponent>
@@ -81,18 +81,18 @@ static bool isValidErrorMessage(const QString &msg, bool dynamicRoleTest)
return valid;
}
-class tst_qquicklistmodelworkerscript : public QQmlDataTest
+class tst_qqmllistmodelworkerscript : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquicklistmodelworkerscript()
+ tst_qqmllistmodelworkerscript()
{
qRegisterMetaType<QVector<int> >();
}
private:
- int roleFromName(const QQuickListModel *model, const QString &roleName);
- QQuickItem *createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQuickListModel *model);
+ int roleFromName(const QQmlListModel *model, const QString &roleName);
+ QQuickItem *createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQmlListModel *model);
void waitForWorker(QQuickItem *item);
static bool compareVariantList(const QVariantList &testList, QVariant object);
@@ -119,11 +119,11 @@ private slots:
void dynamic_role();
};
-bool tst_qquicklistmodelworkerscript::compareVariantList(const QVariantList &testList, QVariant object)
+bool tst_qqmllistmodelworkerscript::compareVariantList(const QVariantList &testList, QVariant object)
{
bool allOk = true;
- QQuickListModel *model = qobject_cast<QQuickListModel *>(object.value<QObject *>());
+ QQmlListModel *model = qobject_cast<QQmlListModel *>(object.value<QObject *>());
if (model == 0)
return false;
@@ -165,12 +165,12 @@ bool tst_qquicklistmodelworkerscript::compareVariantList(const QVariantList &tes
return allOk;
}
-int tst_qquicklistmodelworkerscript::roleFromName(const QQuickListModel *model, const QString &roleName)
+int tst_qqmllistmodelworkerscript::roleFromName(const QQmlListModel *model, const QString &roleName)
{
return model->roleNames().key(roleName.toUtf8(), -1);
}
-QQuickItem *tst_qquicklistmodelworkerscript::createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQuickListModel *model)
+QQuickItem *tst_qqmllistmodelworkerscript::createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQmlListModel *model)
{
QQuickItem *item = qobject_cast<QQuickItem*>(component->create());
QQmlEngine::setContextForObject(model, eng->rootContext());
@@ -179,7 +179,7 @@ QQuickItem *tst_qquicklistmodelworkerscript::createWorkerTest(QQmlEngine *eng, Q
return item;
}
-void tst_qquicklistmodelworkerscript::waitForWorker(QQuickItem *item)
+void tst_qqmllistmodelworkerscript::waitForWorker(QQuickItem *item)
{
QQmlProperty prop(item, "done");
QVERIFY(prop.isValid());
@@ -198,7 +198,7 @@ void tst_qquicklistmodelworkerscript::waitForWorker(QQuickItem *item)
QVERIFY(prop.read().toBool());
}
-void tst_qquicklistmodelworkerscript::dynamic_data()
+void tst_qqmllistmodelworkerscript::dynamic_data()
{
QTest::addColumn<QString>("script");
QTest::addColumn<int>("result");
@@ -339,12 +339,12 @@ void tst_qquicklistmodelworkerscript::dynamic_data()
}
}
-void tst_qquicklistmodelworkerscript::dynamic_worker_data()
+void tst_qqmllistmodelworkerscript::dynamic_worker_data()
{
dynamic_data();
}
-void tst_qquicklistmodelworkerscript::dynamic_worker()
+void tst_qqmllistmodelworkerscript::dynamic_worker()
{
QFETCH(QString, script);
QFETCH(int, result);
@@ -357,7 +357,7 @@ void tst_qquicklistmodelworkerscript::dynamic_worker()
// This is same as dynamic() except it applies the test to a ListModel called
// from a WorkerScript.
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("model.qml"));
@@ -389,12 +389,12 @@ void tst_qquicklistmodelworkerscript::dynamic_worker()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::dynamic_worker_sync_data()
+void tst_qqmllistmodelworkerscript::dynamic_worker_sync_data()
{
dynamic_data();
}
-void tst_qquicklistmodelworkerscript::dynamic_worker_sync()
+void tst_qqmllistmodelworkerscript::dynamic_worker_sync()
{
QFETCH(QString, script);
QFETCH(int, result);
@@ -408,7 +408,7 @@ void tst_qquicklistmodelworkerscript::dynamic_worker_sync()
// from the worker script, calls sync(), and tests the changes are reflected in the
// list in the main thread
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("model.qml"));
@@ -439,7 +439,7 @@ void tst_qquicklistmodelworkerscript::dynamic_worker_sync()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::get_data()
+void tst_qqmllistmodelworkerscript::get_data()
{
QTest::addColumn<QString>("expression");
QTest::addColumn<int>("index");
@@ -463,7 +463,7 @@ void tst_qquicklistmodelworkerscript::get_data()
}
}
-void tst_qquicklistmodelworkerscript::get_worker()
+void tst_qqmllistmodelworkerscript::get_worker()
{
QFETCH(QString, expression);
QFETCH(int, index);
@@ -471,7 +471,7 @@ void tst_qquicklistmodelworkerscript::get_worker()
QFETCH(QVariant, roleValue);
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("model.qml"));
@@ -513,12 +513,12 @@ void tst_qquicklistmodelworkerscript::get_worker()
delete item;
}
-void tst_qquicklistmodelworkerscript::get_worker_data()
+void tst_qqmllistmodelworkerscript::get_worker_data()
{
get_data();
}
-void tst_qquicklistmodelworkerscript::property_changes_data()
+void tst_qqmllistmodelworkerscript::property_changes_data()
{
QTest::addColumn<QString>("script_setup");
QTest::addColumn<QString>("script_change");
@@ -591,7 +591,7 @@ void tst_qquicklistmodelworkerscript::property_changes_data()
}
}
-void tst_qquicklistmodelworkerscript::property_changes_worker()
+void tst_qqmllistmodelworkerscript::property_changes_worker()
{
QFETCH(QString, script_setup);
QFETCH(QString, script_change);
@@ -600,7 +600,7 @@ void tst_qquicklistmodelworkerscript::property_changes_worker()
QFETCH(bool, itemsChanged);
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("model.qml"));
@@ -631,12 +631,12 @@ void tst_qquicklistmodelworkerscript::property_changes_worker()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::property_changes_worker_data()
+void tst_qqmllistmodelworkerscript::property_changes_worker_data()
{
property_changes_data();
}
-void tst_qquicklistmodelworkerscript::worker_sync_data()
+void tst_qqmllistmodelworkerscript::worker_sync_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -644,11 +644,11 @@ void tst_qquicklistmodelworkerscript::worker_sync_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodelworkerscript::worker_sync()
+void tst_qqmllistmodelworkerscript::worker_sync()
{
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workersync.qml"));
@@ -661,7 +661,7 @@ void tst_qquicklistmodelworkerscript::worker_sync()
QVERIFY(model.count() == 2);
QVariant childData = model.data(0, 0);
- QQuickListModel *childModel = qobject_cast<QQuickListModel *>(childData.value<QObject *>());
+ QQmlListModel *childModel = qobject_cast<QQmlListModel *>(childData.value<QObject *>());
QVERIFY(childModel);
QVERIFY(childModel->count() == 1);
@@ -704,16 +704,16 @@ void tst_qquicklistmodelworkerscript::worker_sync()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::worker_remove_element_data()
+void tst_qqmllistmodelworkerscript::worker_remove_element_data()
{
worker_sync_data();
}
-void tst_qquicklistmodelworkerscript::worker_remove_element()
+void tst_qqmllistmodelworkerscript::worker_remove_element()
{
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workerremoveelement.qml"));
@@ -746,7 +746,7 @@ void tst_qquicklistmodelworkerscript::worker_remove_element()
{
//don't crash if model was deleted earlier
- QQuickListModel* model = new QQuickListModel;
+ QQmlListModel* model = new QQmlListModel;
model->setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workerremoveelement.qml"));
@@ -767,16 +767,16 @@ void tst_qquicklistmodelworkerscript::worker_remove_element()
}
}
-void tst_qquicklistmodelworkerscript::worker_remove_list_data()
+void tst_qqmllistmodelworkerscript::worker_remove_list_data()
{
worker_sync_data();
}
-void tst_qquicklistmodelworkerscript::worker_remove_list()
+void tst_qqmllistmodelworkerscript::worker_remove_list()
{
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workerremovelist.qml"));
@@ -808,7 +808,7 @@ void tst_qquicklistmodelworkerscript::worker_remove_list()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::dynamic_role_data()
+void tst_qqmllistmodelworkerscript::dynamic_role_data()
{
QTest::addColumn<QString>("preamble");
QTest::addColumn<QString>("script");
@@ -817,13 +817,13 @@ void tst_qquicklistmodelworkerscript::dynamic_role_data()
QTest::newRow("sync1") << "{append({'a':[{'b':1},{'b':2}]})}" << "{get(0).a = 'string';count}" << 1;
}
-void tst_qquicklistmodelworkerscript::dynamic_role()
+void tst_qqmllistmodelworkerscript::dynamic_role()
{
QFETCH(QString, preamble);
QFETCH(QString, script);
QFETCH(int, result);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(true);
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("model.qml"));
@@ -854,6 +854,6 @@ void tst_qquicklistmodelworkerscript::dynamic_role()
qApp->processEvents();
}
-QTEST_MAIN(tst_qquicklistmodelworkerscript)
+QTEST_MAIN(tst_qqmllistmodelworkerscript)
-#include "tst_qquicklistmodelworkerscript.moc"
+#include "tst_qqmllistmodelworkerscript.moc"
diff --git a/tests/auto/qml/qqmlmetatype/data/CompositeType.qml b/tests/auto/qml/qqmlmetatype/data/CompositeType.qml
new file mode 100644
index 0000000000..bc2abca42b
--- /dev/null
+++ b/tests/auto/qml/qqmlmetatype/data/CompositeType.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property int foo
+}
diff --git a/tests/auto/qml/qqmlmetatype/data/ImplicitType.qml b/tests/auto/qml/qqmlmetatype/data/ImplicitType.qml
new file mode 100644
index 0000000000..ca2bcef5bf
--- /dev/null
+++ b/tests/auto/qml/qqmlmetatype/data/ImplicitType.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property int bar
+}
diff --git a/tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml b/tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml
new file mode 100644
index 0000000000..f838c6995f
--- /dev/null
+++ b/tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml
@@ -0,0 +1,3 @@
+import "."
+
+ImplicitType{}
diff --git a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
index b24f006bad..a9a6a32a2b 100644
--- a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
+++ b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
@@ -3,6 +3,9 @@ TARGET = tst_qqmlmetatype
SOURCES += tst_qqmlmetatype.cpp
macx:CONFIG -= app_bundle
+TESTDATA = data/*
+include (../../shared/util.pri)
+
CONFIG += parallel_test
QT += core-private gui-private qml-private testlib v8-private
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index d5dd364e25..90023222d3 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -41,12 +41,16 @@
#include <qtest.h>
#include <qqml.h>
+#include <qqmlprivate.h>
+#include <qqmlengine.h>
+#include <qqmlcomponent.h>
#include <private/qqmlmetatype_p.h>
#include <private/qqmlpropertyvalueinterceptor_p.h>
#include <private/qhashedstring_p.h>
+#include "../../shared/util.h"
-class tst_qqmlmetatype : public QObject
+class tst_qqmlmetatype : public QQmlDataTest
{
Q_OBJECT
public:
@@ -60,6 +64,8 @@ private slots:
void qmlPropertyValueInterceptorCast();
void qmlType();
void invalidQmlTypeName();
+ void registrationType();
+ void compositeType();
void isList();
@@ -77,6 +83,13 @@ public:
};
QML_DECLARE_TYPE(TestType);
+QObject *testTypeProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(scriptEngine);
+ return new TestType();
+}
+
class ParserStatusTestType : public QObject, public QQmlParserStatus
{
Q_OBJECT
@@ -108,10 +121,15 @@ QML_DECLARE_TYPE(ValueInterceptorTestType);
void tst_qqmlmetatype::initTestCase()
{
+ QQmlDataTest::initTestCase();
qmlRegisterType<TestType>("Test", 1, 0, "TestType");
+ qmlRegisterSingletonType<TestType>("Test", 1, 0, "TestTypeSingleton", testTypeProvider);
qmlRegisterType<ParserStatusTestType>("Test", 1, 0, "ParserStatusTestType");
qmlRegisterType<ValueSourceTestType>("Test", 1, 0, "ValueSourceTestType");
qmlRegisterType<ValueInterceptorTestType>("Test", 1, 0, "ValueInterceptorTestType");
+
+ QUrl testTypeUrl(testFileUrl("CompositeType.qml"));
+ qmlRegisterType(testTypeUrl, "Test", 1, 0, "TestTypeComposite");
}
void tst_qqmlmetatype::qmlParserStatusCast()
@@ -228,6 +246,44 @@ void tst_qqmlmetatype::defaultObject()
QCOMPARE(QString(QQmlMetaType::defaultProperty(&t).name()), QString("foo"));
}
+void tst_qqmlmetatype::registrationType()
+{
+ QQmlType *type = QQmlMetaType::qmlType(QString("TestType"), QString("Test"), 1, 0);
+ QVERIFY(type);
+ QVERIFY(!type->isInterface());
+ QVERIFY(!type->isSingleton());
+ QVERIFY(!type->isComposite());
+
+ type = QQmlMetaType::qmlType(QString("TestTypeSingleton"), QString("Test"), 1, 0);
+ QVERIFY(type);
+ QVERIFY(!type->isInterface());
+ QVERIFY(type->isSingleton());
+ QVERIFY(!type->isComposite());
+
+ type = QQmlMetaType::qmlType(QString("TestTypeComposite"), QString("Test"), 1, 0);
+ QVERIFY(type);
+ QVERIFY(!type->isInterface());
+ QVERIFY(!type->isSingleton());
+ QVERIFY(type->isComposite());
+}
+
+void tst_qqmlmetatype::compositeType()
+{
+ QQmlEngine engine;
+
+ //Loading the test file also loads all composite types it imports
+ QQmlComponent c(&engine, testFileUrl("testImplicitComposite.qml"));
+ QObject* obj = c.create();
+ QVERIFY(obj);
+
+ QQmlType *type = QQmlMetaType::qmlType(QString("ImplicitType"), QString(""), 1, 0);
+ QVERIFY(type);
+ QVERIFY(type->module() == QLatin1String(""));
+ QVERIFY(type->elementName() == QLatin1String("ImplicitType"));
+ QCOMPARE(type->qmlTypeName(), QLatin1String("ImplicitType"));
+ QCOMPARE(type->sourceUrl(), testFileUrl("ImplicitType.qml"));
+}
+
QTEST_MAIN(tst_qqmlmetatype)
#include "tst_qqmlmetatype.moc"
diff --git a/tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir b/tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
deleted file mode 100644
index 0a8b5d46eb..0000000000
--- a/tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin plugin
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index 46e0c9e436..a2bf06c2ba 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -145,7 +145,7 @@ void tst_QQuickWorkerScript::messaging_data()
void tst_QQuickWorkerScript::messaging_sendQObjectList()
{
- // Not allowed to send QObjects other than QQuickListModelWorkerAgent
+ // Not allowed to send QObjects other than QQmlListModelWorkerAgent
// instances. If objects are sent in a list, they will be sent as 'undefined'
// js values.
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp
index 7055fb6e03..9c5fb88af2 100644
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -82,11 +82,9 @@ private:
QStringList findQmlFiles(const QDir &);
QQmlEngine engine;
-
- QQuickWindow *window;
};
-tst_examples::tst_examples() : window(0)
+tst_examples::tst_examples()
{
// Add files to exclude here
excludedFiles << "examples/quick/canvas/tiger/tiger.qml"; // QTBUG-26528
@@ -94,7 +92,7 @@ tst_examples::tst_examples() : window(0)
// Add directories you want excluded here (don't add examples/, because they install to examples/qtdeclarative/)
excludedDirs << "shared"; //Not an example
- excludedDirs << "qtquick/text/fonts"; // QTBUG-21415
+ excludedDirs << "quick/text/fonts"; // QTBUG-29004
excludedDirs << "snippets/qml/path"; //No root QQuickItem
excludedDirs << "tutorials/gettingStartedQml"; //C++ example, but no cpp files in root dir
@@ -120,7 +118,6 @@ tst_examples::tst_examples() : window(0)
tst_examples::~tst_examples()
{
- delete window;
}
void tst_examples::init()
@@ -260,6 +257,9 @@ void tst_examples::sgexamples_data()
void tst_examples::sgexamples()
{
QFETCH(QString, file);
+ QQuickWindow window;
+ window.setPersistentOpenGLContext(true);
+ window.setPersistentSceneGraph(true);
QQmlComponent component(&engine, QUrl::fromLocalFile(file));
if (component.status() == QQmlComponent::Error)
@@ -272,13 +272,11 @@ void tst_examples::sgexamples()
component.completeCreate();
QVERIFY(root);
- if (!window) {
- window = new QQuickWindow();
- window->resize(240, 320);
- window->show();
- QVERIFY(QTest::qWaitForWindowExposed(window));
- }
- root->setParentItem(window->contentItem());
+ window.resize(240, 320);
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ root->setParentItem(window.contentItem());
component.completeCreate();
qApp->processEvents();
@@ -303,6 +301,8 @@ void tst_examples::sgsnippets_data()
void tst_examples::sgsnippets()
{
+ QQuickWindow window;
+
QFETCH(QString, file);
QQmlComponent component(&engine, QUrl::fromLocalFile(file));
@@ -316,13 +316,11 @@ void tst_examples::sgsnippets()
component.completeCreate();
QVERIFY(root);
- if (!window) {
- window = new QQuickWindow();
- window->resize(240, 320);
- window->show();
- QVERIFY(QTest::qWaitForWindowExposed(window));
- }
- root->setParentItem(window->contentItem());
+ window.resize(240, 320);
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ root->setParentItem(window.contentItem());
component.completeCreate();
qApp->processEvents();
diff --git a/tests/auto/quick/qquickanimations/qquickanimations.pro b/tests/auto/quick/qquickanimations/qquickanimations.pro
index f3cf4832e5..747a2afdff 100644
--- a/tests/auto/quick/qquickanimations/qquickanimations.pro
+++ b/tests/auto/quick/qquickanimations/qquickanimations.pro
@@ -1,4 +1,5 @@
CONFIG += testcase
+mac:CONFIG+=insignificant_test # QTBUG-29062
TARGET = tst_qquickanimations
SOURCES += tst_qquickanimations.cpp
diff --git a/tests/auto/quick/qquickflickable/qquickflickable.pro b/tests/auto/quick/qquickflickable/qquickflickable.pro
index 95c703befe..67d5fc12f0 100644
--- a/tests/auto/quick/qquickflickable/qquickflickable.pro
+++ b/tests/auto/quick/qquickflickable/qquickflickable.pro
@@ -11,3 +11,4 @@ TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+CONFIG+=insignificant_test
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 57c4c12264..875ade45b8 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -210,10 +210,12 @@ void tst_qquickflickable::boundsBehavior()
void tst_qquickflickable::rebound()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("rebound.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -229,7 +231,7 @@ void tst_qquickflickable::rebound()
QSignalSpy hMoveSpy(flickable, SIGNAL(movingHorizontallyChanged()));
// flick and test the transition is run
- flick(window, QPoint(20,20), QPoint(120,120), 200);
+ flick(window.data(), QPoint(20,20), QPoint(120,120), 200);
QTRY_COMPARE(window->rootObject()->property("transitionsStarted").toInt(), 2);
QCOMPARE(hMoveSpy.count(), 1);
@@ -259,14 +261,13 @@ void tst_qquickflickable::rebound()
#ifdef Q_OS_MAC
QSKIP("QTBUG-26696 - sometimes fails on Mac");
- delete window;
return;
#endif
// flick and trigger the transition multiple times
// (moving signals are emitted as soon as the first transition starts)
- flick(window, QPoint(20,20), QPoint(120,120), 200); // both x and y will bounce back
- flick(window, QPoint(20,120), QPoint(120,20), 200); // only x will bounce back
+ flick(window.data(), QPoint(20,20), QPoint(120,120), 200); // both x and y will bounce back
+ flick(window.data(), QPoint(20,120), QPoint(120,20), 200); // only x will bounce back
QVERIFY(flickable->isMoving());
QVERIFY(window->rootObject()->property("transitionsStarted").toInt() >= 1);
@@ -295,7 +296,7 @@ void tst_qquickflickable::rebound()
// (i.e. moving but transition->running = false)
window->rootObject()->setProperty("transitionEnabled", false);
- flick(window, QPoint(20,20), QPoint(120,120), 200);
+ flick(window.data(), QPoint(20,20), QPoint(120,120), 200);
QCOMPARE(window->rootObject()->property("transitionsStarted").toInt(), 0);
QCOMPARE(hMoveSpy.count(), 1);
QCOMPARE(vMoveSpy.count(), 1);
@@ -308,8 +309,6 @@ void tst_qquickflickable::rebound()
QCOMPARE(movementStartedSpy.count(), 1);
QCOMPARE(movementEndedSpy.count(), 1);
QCOMPARE(window->rootObject()->property("transitionsStarted").toInt(), 0);
-
- delete window;
}
void tst_qquickflickable::maximumFlickVelocity()
@@ -355,7 +354,9 @@ void tst_qquickflickable::pressDelay()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("pressDelay.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -394,7 +395,9 @@ void tst_qquickflickable::nestedPressDelay()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("nestedPressDelay.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *outer = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -503,7 +506,8 @@ void tst_qquickflickable::returnToBounds()
{
QFETCH(bool, setRebound);
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
+
window->rootContext()->setContextProperty("setRebound", setRebound);
window->setSource(testFileUrl("resize.qml"));
QVERIFY(window->rootObject() != 0);
@@ -534,8 +538,6 @@ void tst_qquickflickable::returnToBounds()
QVERIFY(!rebound->running());
QCOMPARE(reboundSpy.count(), setRebound ? 2 : 0);
-
- delete window;
}
void tst_qquickflickable::returnToBounds_data()
@@ -548,10 +550,12 @@ void tst_qquickflickable::returnToBounds_data()
void tst_qquickflickable::wheel()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("wheel.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flick = window->rootObject()->findChild<QQuickFlickable*>("flick");
@@ -561,7 +565,7 @@ void tst_qquickflickable::wheel()
QPoint pos(200, 200);
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(0,-120), -120, Qt::Vertical, Qt::NoButton, Qt::NoModifier);
event.setAccepted(false);
- QGuiApplication::sendEvent(window, &event);
+ QGuiApplication::sendEvent(window.data(), &event);
}
QTRY_VERIFY(flick->contentY() > 0);
@@ -575,13 +579,11 @@ void tst_qquickflickable::wheel()
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(-120,0), -120, Qt::Horizontal, Qt::NoButton, Qt::NoModifier);
event.setAccepted(false);
- QGuiApplication::sendEvent(window, &event);
+ QGuiApplication::sendEvent(window.data(), &event);
}
QTRY_VERIFY(flick->contentX() > 0);
QVERIFY(flick->contentY() == 0);
-
- delete window;
}
void tst_qquickflickable::movingAndFlicking_data()
@@ -616,11 +618,12 @@ void tst_qquickflickable::movingAndFlicking()
const QPoint flickFrom(50, 200); // centre
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -639,7 +642,7 @@ void tst_qquickflickable::movingAndFlicking()
QSignalSpy flickEndSpy(flickable, SIGNAL(flickEnded()));
// do a flick that keeps the view within the bounds
- flick(window, flickFrom, flickToWithoutSnapBack, 200);
+ flick(window.data(), flickFrom, flickToWithoutSnapBack, 200);
QTRY_VERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -695,7 +698,7 @@ void tst_qquickflickable::movingAndFlicking()
flickable->setContentX(0);
flickable->setContentY(0);
QTRY_VERIFY(!flickable->isMoving());
- flick(window, flickFrom, flickToWithSnapBack, 200);
+ flick(window.data(), flickFrom, flickToWithSnapBack, 10);
QTRY_VERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -739,8 +742,6 @@ void tst_qquickflickable::movingAndFlicking()
QCOMPARE(flickable->contentX(), 0.0);
QCOMPARE(flickable->contentY(), 0.0);
-
- delete window;
}
@@ -776,11 +777,12 @@ void tst_qquickflickable::movingAndDragging()
const QPoint moveFrom(50, 200); // centre
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -799,10 +801,10 @@ void tst_qquickflickable::movingAndDragging()
QSignalSpy moveEndSpy(flickable, SIGNAL(movementEnded()));
// start the drag
- QTest::mousePress(window, Qt::LeftButton, 0, moveFrom);
- QTest::mouseMove(window, moveFrom + moveByWithoutSnapBack);
- QTest::mouseMove(window, moveFrom + moveByWithoutSnapBack*2);
- QTest::mouseMove(window, moveFrom + moveByWithoutSnapBack*3);
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, moveFrom);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithoutSnapBack);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithoutSnapBack*2);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithoutSnapBack*3);
QTRY_VERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -821,7 +823,7 @@ void tst_qquickflickable::movingAndDragging()
QCOMPARE(moveStartSpy.count(), 1);
QCOMPARE(dragStartSpy.count(), 1);
- QTest::mouseRelease(window, Qt::LeftButton, 0, moveFrom + moveByWithoutSnapBack*3);
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, moveFrom + moveByWithoutSnapBack*3);
QVERIFY(!flickable->isDragging());
QVERIFY(!flickable->isDraggingHorizontally());
@@ -870,10 +872,10 @@ void tst_qquickflickable::movingAndDragging()
flickable->setContentX(0);
flickable->setContentY(0);
QTRY_VERIFY(!flickable->isMoving());
- QTest::mousePress(window, Qt::LeftButton, 0, moveFrom);
- QTest::mouseMove(window, moveFrom + moveByWithSnapBack);
- QTest::mouseMove(window, moveFrom + moveByWithSnapBack*2);
- QTest::mouseMove(window, moveFrom + moveByWithSnapBack*3);
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, moveFrom);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithSnapBack);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithSnapBack*2);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithSnapBack*3);
QVERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -894,7 +896,7 @@ void tst_qquickflickable::movingAndDragging()
QCOMPARE(dragStartSpy.count(), 1);
QCOMPARE(dragEndSpy.count(), 0);
- QTest::mouseRelease(window, Qt::LeftButton, 0, moveFrom + moveByWithSnapBack*3);
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, moveFrom + moveByWithSnapBack*3);
// should now start snapping back to bounds (moving but not dragging)
QVERIFY(flickable->isMoving());
@@ -937,17 +939,16 @@ void tst_qquickflickable::movingAndDragging()
QCOMPARE(flickable->contentX(), 0.0);
QCOMPARE(flickable->contentY(), 0.0);
-
- delete window;
}
void tst_qquickflickable::flickOnRelease()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -960,9 +961,9 @@ void tst_qquickflickable::flickOnRelease()
// underlying drivers will hopefully provide a pre-calculated velocity
// (based on more data than what the UI gets), thus making this use case
// working even with small movements.
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50, 300));
- QTest::mouseMove(window, QPoint(50, 10), 10);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 10), 10);
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(50, 300));
+ QTest::mouseMove(window.data(), QPoint(50, 10), 10);
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10), 10);
QCOMPARE(vFlickSpy.count(), 1);
@@ -974,17 +975,16 @@ void tst_qquickflickable::flickOnRelease()
#endif
// Stop on a full pixel after user interaction
QCOMPARE(flickable->contentY(), (qreal)qRound(flickable->contentY()));
-
- delete window;
}
void tst_qquickflickable::pressWhileFlicking()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -999,7 +999,7 @@ void tst_qquickflickable::pressWhileFlicking()
// flick then press while it is still moving
// flicking == false, moving == true;
- flick(window, QPoint(20,190), QPoint(20, 50), 200);
+ flick(window.data(), QPoint(20,190), QPoint(20, 50), 200);
QVERIFY(flickable->verticalVelocity() > 0.0);
QTRY_VERIFY(flickable->isFlicking());
QVERIFY(flickable->isFlickingVertically());
@@ -1014,77 +1014,76 @@ void tst_qquickflickable::pressWhileFlicking()
QCOMPARE(hFlickSpy.count(), 0);
QCOMPARE(flickSpy.count(), 1);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(20, 50));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(20, 50));
QTRY_VERIFY(!flickable->isFlicking());
QVERIFY(!flickable->isFlickingVertically());
QVERIFY(flickable->isMoving());
QVERIFY(flickable->isMovingVertically());
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(20,50));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(20,50));
QVERIFY(!flickable->isFlicking());
QVERIFY(!flickable->isFlickingVertically());
QTRY_VERIFY(!flickable->isMoving());
QVERIFY(!flickable->isMovingVertically());
// Stop on a full pixel after user interaction
QCOMPARE(flickable->contentX(), (qreal)qRound(flickable->contentX()));
-
- delete window;
}
void tst_qquickflickable::disabled()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("disabled.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flick = window->rootObject()->findChild<QQuickFlickable*>("flickable");
QVERIFY(flick != 0);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50, 90));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(50, 90));
- QTest::mouseMove(window, QPoint(50, 80));
- QTest::mouseMove(window, QPoint(50, 70));
- QTest::mouseMove(window, QPoint(50, 60));
+ QTest::mouseMove(window.data(), QPoint(50, 80));
+ QTest::mouseMove(window.data(), QPoint(50, 70));
+ QTest::mouseMove(window.data(), QPoint(50, 60));
QVERIFY(flick->isMoving() == false);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 60));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 60));
// verify that mouse clicks on other elements still work (QTBUG-20584)
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50, 10));
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 10));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
QTRY_VERIFY(window->rootObject()->property("clicked").toBool() == true);
-
- delete window;
}
void tst_qquickflickable::flickVelocity()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QVERIFY(flickable != 0);
// flick up
- flick(window, QPoint(20,190), QPoint(20, 50), 200);
+ flick(window.data(), QPoint(20,190), QPoint(20, 50), 200);
QVERIFY(flickable->verticalVelocity() > 0.0);
QTRY_VERIFY(flickable->verticalVelocity() == 0.0);
// flick down
- flick(window, QPoint(20,10), QPoint(20, 140), 200);
- QVERIFY(flickable->verticalVelocity() < 0.0);
+ flick(window.data(), QPoint(20,10), QPoint(20, 140), 200);
+ QTRY_VERIFY(flickable->verticalVelocity() < 0.0);
QTRY_VERIFY(flickable->verticalVelocity() == 0.0);
#ifdef Q_OS_MAC
QSKIP("boost doesn't work on OS X");
- delete window;
return;
#endif
@@ -1092,17 +1091,15 @@ void tst_qquickflickable::flickVelocity()
QQuickFlickablePrivate *fp = QQuickFlickablePrivate::get(flickable);
bool boosted = false;
for (int i = 0; i < 6; ++i) {
- flick(window, QPoint(20,390), QPoint(20, 50), 100);
+ flick(window.data(), QPoint(20,390), QPoint(20, 50), 100);
boosted |= fp->flickBoost > 1.0;
}
QVERIFY(boosted);
// Flick in opposite direction -> boost cancelled.
- flick(window, QPoint(20,10), QPoint(20, 340), 200);
+ flick(window.data(), QPoint(20,10), QPoint(20, 340), 200);
QTRY_VERIFY(flickable->verticalVelocity() < 0.0);
QVERIFY(fp->flickBoost == 1.0);
-
- delete window;
}
void tst_qquickflickable::margins()
@@ -1166,20 +1163,22 @@ void tst_qquickflickable::margins()
void tst_qquickflickable::cancelOnMouseGrab()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("cancel.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QVERIFY(flickable != 0);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(10, 10));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(10, 10));
// drag out of bounds
- QTest::mouseMove(window, QPoint(50, 50));
- QTest::mouseMove(window, QPoint(100, 100));
- QTest::mouseMove(window, QPoint(150, 150));
+ QTest::mouseMove(window.data(), QPoint(50, 50));
+ QTest::mouseMove(window.data(), QPoint(100, 100));
+ QTest::mouseMove(window.data(), QPoint(150, 150));
QVERIFY(flickable->contentX() != 0);
QVERIFY(flickable->contentY() != 0);
@@ -1195,56 +1194,54 @@ void tst_qquickflickable::cancelOnMouseGrab()
QTRY_VERIFY(!flickable->isMoving());
QTRY_VERIFY(!flickable->isDragging());
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 10));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
- delete window;
}
void tst_qquickflickable::clickAndDragWhenTransformed()
{
- QQuickView *view = new QQuickView;
+ QScopedPointer<QQuickView> view(new QQuickView);
view->setSource(testFileUrl("transformedFlickable.qml"));
view->show();
+ QVERIFY(QTest::qWaitForWindowExposed(view.data()));
view->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(view));
+ QVERIFY(QTest::qWaitForWindowActive(view.data()));
QVERIFY(view->rootObject() != 0);
QQuickFlickable *flickable = view->rootObject()->findChild<QQuickFlickable*>("flickable");
QVERIFY(flickable != 0);
// click outside child rect
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(190, 190));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(190, 190));
QTest::qWait(10);
QCOMPARE(flickable->property("itemPressed").toBool(), false);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(190, 190));
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(190, 190));
// click inside child rect
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(200, 200));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(200, 200));
QTest::qWait(10);
QCOMPARE(flickable->property("itemPressed").toBool(), true);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(200, 200));
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(200, 200));
const int threshold = qApp->styleHints()->startDragDistance();
// drag outside bounds
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(160, 160));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(160, 160));
QTest::qWait(10);
- QTest::mouseMove(view, QPoint(160 + threshold * 2, 160));
- QTest::mouseMove(view, QPoint(160 + threshold * 3, 160));
+ QTest::mouseMove(view.data(), QPoint(160 + threshold * 2, 160));
+ QTest::mouseMove(view.data(), QPoint(160 + threshold * 3, 160));
QCOMPARE(flickable->isDragging(), false);
QCOMPARE(flickable->property("itemPressed").toBool(), false);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(180, 160));
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(180, 160));
// drag inside bounds
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(200, 140));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(200, 140));
QTest::qWait(10);
- QTest::mouseMove(view, QPoint(200 + threshold * 2, 140));
- QTest::mouseMove(view, QPoint(200 + threshold * 3, 140));
+ QTest::mouseMove(view.data(), QPoint(200 + threshold * 2, 140));
+ QTest::mouseMove(view.data(), QPoint(200 + threshold * 3, 140));
QCOMPARE(flickable->isDragging(), true);
QCOMPARE(flickable->property("itemPressed").toBool(), false);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(220, 140));
-
- delete view;
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(220, 140));
}
void tst_qquickflickable::flickTwiceUsingTouches()
diff --git a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
index 19059c55df..b350abe953 100644
--- a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
+++ b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
@@ -525,7 +525,6 @@ void tst_qquickfocusscope::canvasFocus()
QSignalSpy scope2ActiveFocusSpy(scope2, SIGNAL(activeFocusChanged(bool)));
QSignalSpy item2ActiveFocusSpy(item2, SIGNAL(activeFocusChanged(bool)));
- QEXPECT_FAIL("", "QTBUG-22415", Abort);
QCOMPARE(rootItem->hasFocus(), false);
QCOMPARE(rootItem->hasActiveFocus(), false);
QCOMPARE(scope1->hasFocus(), true);
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 3c30f9e887..0c9788ab8e 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -51,8 +51,7 @@
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquickgridview_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include <QtQuick/private/qquickvisualitemmodel_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include "../../shared/util.h"
#include "../shared/viewtestutil.h"
#include "../shared/visualtestutil.h"
@@ -2435,7 +2434,7 @@ void tst_QQuickGridView::modelChanges()
QQuickGridView *gridView = window->rootObject()->findChild<QQuickGridView*>("gridView");
QTRY_VERIFY(gridView);
- QQuickListModel *alternateModel = window->rootObject()->findChild<QQuickListModel*>("alternateModel");
+ QQmlListModel *alternateModel = window->rootObject()->findChild<QQmlListModel*>("alternateModel");
QTRY_VERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue<QObject *>(alternateModel);
QSignalSpy modelSpy(gridView, SIGNAL(modelChanged()));
@@ -2871,7 +2870,8 @@ void tst_QQuickGridView::enforceRange_rightToLeft()
ctxt->setContextProperty("testTopToBottom", QVariant(true));
window->setSource(testFileUrl("gridview-enforcerange.qml"));
- qApp->processEvents();
+ window->show();
+ QTRY_VERIFY(window->isExposed());
QVERIFY(window->rootObject() != 0);
QQuickGridView *gridview = findItem<QQuickGridView>(window->rootObject(), "grid");
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index e237174eb1..a7343f686f 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -175,6 +175,8 @@ private:
};
void ensureFocus(QWindow *w) {
+ if (w->width() <=0 || w->height() <= 0)
+ w->setGeometry(100, 100, 400, 300);
w->show();
w->requestActivate();
QTest::qWaitForWindowActive(w);
@@ -270,10 +272,6 @@ void tst_qquickitem::simpleFocus()
QQuickWindow window;
ensureFocus(&window);
-#ifdef Q_OS_MAC
- QSKIP("QTBUG-24094: fails on Mac OS X 10.7");
-#endif
-
QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
QQuickItem *l1c1 = new TestItem(window.contentItem());
@@ -732,7 +730,7 @@ void tst_qquickitem::focusSubItemInNonFocusScope()
QQuickView *view = new QQuickView;
view->setSource(testFileUrl("focusSubItemInNonFocusScope.qml"));
view->show();
- qApp->processEvents();
+ QTest::qWaitForWindowActive(view);
QQuickItem *dummyItem = view->rootObject()->findChild<QQuickItem *>("dummyItem");
QVERIFY(dummyItem);
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index c034fe83c8..65892ddd9b 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -48,8 +48,8 @@
#include <QtQml/qqmlincubator.h>
#include <QtQuick/private/qquicklistview_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include <QtQuick/private/qquickvisualitemmodel_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmlobjectmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include "../../shared/util.h"
#include "../shared/viewtestutil.h"
#include "../shared/visualtestutil.h"
@@ -2768,7 +2768,7 @@ void tst_QQuickListView::itemList()
QQuickItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QQuickVisualItemModel *model = window->rootObject()->findChild<QQuickVisualItemModel*>("itemModel");
+ QQmlObjectModel *model = window->rootObject()->findChild<QQmlObjectModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
@@ -2809,7 +2809,7 @@ void tst_QQuickListView::itemListFlicker()
QQuickItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QQuickVisualItemModel *model = window->rootObject()->findChild<QQuickVisualItemModel*>("itemModel");
+ QQmlObjectModel *model = window->rootObject()->findChild<QQmlObjectModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
@@ -3258,7 +3258,7 @@ void tst_QQuickListView::modelChanges()
QQuickListView *listView = window->rootObject()->findChild<QQuickListView*>("listView");
QTRY_VERIFY(listView);
- QQuickListModel *alternateModel = window->rootObject()->findChild<QQuickListModel*>("alternateModel");
+ QQmlListModel *alternateModel = window->rootObject()->findChild<QQmlListModel*>("alternateModel");
QTRY_VERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue<QObject *>(alternateModel);
QSignalSpy modelSpy(listView, SIGNAL(modelChanged()));
@@ -4606,7 +4606,7 @@ void tst_QQuickListView::rightToLeft()
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
- QQuickVisualItemModel *model = window->rootObject()->findChild<QQuickVisualItemModel*>("itemModel");
+ QQmlObjectModel *model = window->rootObject()->findChild<QQmlObjectModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index 8821203902..f52939e628 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -50,7 +50,7 @@
#include <QtQuick/private/qquickpath_p.h>
#include <QtQuick/private/qquicktext_p.h>
#include <QtQuick/private/qquickrectangle_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include <QtQml/private/qqmlvaluetype_p.h>
#include <QtGui/qstandarditemmodel.h>
#include <QStringListModel>
@@ -199,7 +199,7 @@ void tst_QQuickPathView::initValues()
void tst_QQuickPathView::items()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QaimModel model;
model.addItem("Fred", "12345");
@@ -238,8 +238,6 @@ void tst_QQuickPathView::items()
offset.setX(pathview->highlightItem()->width()/2);
offset.setY(pathview->highlightItem()->height()/2);
QCOMPARE(pathview->highlightItem()->position() + offset, start);
-
- delete window;
}
void tst_QQuickPathView::pathview2()
@@ -350,7 +348,7 @@ void tst_QQuickPathView::insertModel()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -388,8 +386,6 @@ void tst_QQuickPathView::insertModel()
QTRY_COMPARE(pathview->offset(), offset);
QCOMPARE(pathview->currentIndex(), currentIndex);
-
- delete window;
}
void tst_QQuickPathView::removeModel_data()
@@ -444,7 +440,8 @@ void tst_QQuickPathView::removeModel()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
+
window->show();
QaimModel model;
@@ -478,8 +475,6 @@ void tst_QQuickPathView::removeModel()
QTRY_COMPARE(pathview->offset(), offset);
QCOMPARE(pathview->currentIndex(), currentIndex);
-
- delete window;
}
@@ -539,7 +534,7 @@ void tst_QQuickPathView::moveModel()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -573,8 +568,6 @@ void tst_QQuickPathView::moveModel()
QTRY_COMPARE(pathview->offset(), offset);
QCOMPARE(pathview->currentIndex(), currentIndex);
-
- delete window;
}
void tst_QQuickPathView::consecutiveModelChanges_data()
@@ -640,7 +633,7 @@ void tst_QQuickPathView::consecutiveModelChanges()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -704,7 +697,6 @@ void tst_QQuickPathView::consecutiveModelChanges()
QCOMPARE(pathview->currentIndex(), currentIndex);
- delete window;
}
void tst_QQuickPathView::path()
@@ -756,7 +748,7 @@ void tst_QQuickPathView::path()
void tst_QQuickPathView::dataModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QQmlContext *ctxt = window->rootContext();
@@ -865,13 +857,12 @@ void tst_QQuickPathView::dataModel()
model.removeItem(model.count()-1);
QCOMPARE(pathview->currentIndex(), model.count()-1);
- delete window;
delete testObject;
}
void tst_QQuickPathView::pathMoved()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -926,7 +917,6 @@ void tst_QQuickPathView::pathMoved()
window->rootObject()->setProperty("delegateScale", 1.2);
QTRY_COMPARE(firstItem->position() + offset, start);
- delete window;
}
void tst_QQuickPathView::offset_data()
@@ -960,7 +950,7 @@ void tst_QQuickPathView::offset()
void tst_QQuickPathView::setCurrentIndex()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -1103,12 +1093,11 @@ void tst_QQuickPathView::setCurrentIndex()
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
- delete window;
}
void tst_QQuickPathView::resetModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QStringList strings;
strings << "one" << "two" << "three";
@@ -1143,12 +1132,11 @@ void tst_QQuickPathView::resetModel()
QCOMPARE(display->text(), strings.at(i));
}
- delete window;
}
void tst_QQuickPathView::propertyChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1185,12 +1173,11 @@ void tst_QQuickPathView::propertyChanges()
pathView->setMaximumFlickVelocity(1000);
QCOMPARE(maximumFlickVelocitySpy.count(), 1);
- delete window;
}
void tst_QQuickPathView::pathChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1247,12 +1234,11 @@ void tst_QQuickPathView::pathChanges()
pathAttribute->setName("scale");
QCOMPARE(nameSpy.count(),1);
- delete window;
}
void tst_QQuickPathView::componentChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1270,12 +1256,11 @@ void tst_QQuickPathView::componentChanges()
pathView->setDelegate(&delegateComponent);
QCOMPARE(delegateSpy.count(),1);
- delete window;
}
void tst_QQuickPathView::modelChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1284,7 +1269,7 @@ void tst_QQuickPathView::modelChanges()
pathView->setCurrentIndex(3);
QTRY_COMPARE(pathView->offset(), 6.0);
- QQuickListModel *alternateModel = window->rootObject()->findChild<QQuickListModel*>("alternateModel");
+ QQmlListModel *alternateModel = window->rootObject()->findChild<QQmlListModel*>("alternateModel");
QVERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue<QObject *>(alternateModel);
QSignalSpy modelSpy(pathView, SIGNAL(modelChanged()));
@@ -1305,12 +1290,11 @@ void tst_QQuickPathView::modelChanges()
QCOMPARE(pathView->currentIndex(), 0);
QCOMPARE(currentIndexSpy.count(), 1);
- delete window;
}
void tst_QQuickPathView::pathUpdateOnStartChanged()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("pathUpdateOnStartChanged.qml"));
@@ -1327,17 +1311,16 @@ void tst_QQuickPathView::pathUpdateOnStartChanged()
QCOMPARE(item->x(), path->startX() - item->width() / 2.0);
QCOMPARE(item->y(), path->startY() - item->height() / 2.0);
- delete window;
}
void tst_QQuickPathView::package()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("pathview_package.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QQuickPathView *pathView = window->rootObject()->findChild<QQuickPathView*>("photoPathView");
QVERIFY(pathView);
@@ -1350,13 +1333,12 @@ void tst_QQuickPathView::package()
QVERIFY(item);
QVERIFY(item->scale() != 1.0);
- delete window;
}
//QTBUG-13017
void tst_QQuickPathView::emptyModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QStringListModel model;
@@ -1371,7 +1353,6 @@ void tst_QQuickPathView::emptyModel()
QCOMPARE(pathview->offset(), qreal(0.0));
- delete window;
}
void tst_QQuickPathView::emptyPath()
@@ -1411,7 +1392,7 @@ void tst_QQuickPathView::closed()
// QTBUG-14239
void tst_QQuickPathView::pathUpdate()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("pathUpdate.qml"));
@@ -1422,7 +1403,6 @@ void tst_QQuickPathView::pathUpdate()
QVERIFY(item);
QCOMPARE(item->x(), 150.0);
- delete window;
}
void tst_QQuickPathView::visualDataModel()
@@ -1463,12 +1443,12 @@ void tst_QQuickPathView::undefinedPath()
void tst_QQuickPathView::mouseDrag()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1482,12 +1462,12 @@ void tst_QQuickPathView::mouseDrag()
int current = pathview->currentIndex();
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(10,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(10,100));
QTest::qWait(100);
{
QMouseEvent mv(QEvent::MouseMove, QPoint(30,100), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QGuiApplication::sendEvent(window, &mv);
+ QGuiApplication::sendEvent(window.data(), &mv);
}
// first move beyond threshold does not trigger drag
QVERIFY(!pathview->isMoving());
@@ -1501,7 +1481,7 @@ void tst_QQuickPathView::mouseDrag()
{
QMouseEvent mv(QEvent::MouseMove, QPoint(90,100), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QGuiApplication::sendEvent(window, &mv);
+ QGuiApplication::sendEvent(window.data(), &mv);
}
// next move beyond threshold does trigger drag
QVERIFY(pathview->isMoving());
@@ -1515,7 +1495,7 @@ void tst_QQuickPathView::mouseDrag()
QVERIFY(pathview->currentIndex() != current);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(40,100));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(40,100));
QVERIFY(!pathview->isDragging());
QCOMPARE(draggingSpy.count(), 2);
QCOMPARE(dragStartedSpy.count(), 1);
@@ -1524,12 +1504,11 @@ void tst_QQuickPathView::mouseDrag()
QTRY_COMPARE(moveEndedSpy.count(), 1);
QCOMPARE(moveStartedSpy.count(), 1);
- delete window;
}
void tst_QQuickPathView::treeModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QStandardItemModel model;
@@ -1552,18 +1531,17 @@ void tst_QQuickPathView::treeModel()
QTRY_VERIFY(item = findItem<QQuickText>(pathview, "wrapper", 0));
QTRY_COMPARE(item->text(), QLatin1String("Row 2 Child Item"));
- delete window;
}
void tst_QQuickPathView::changePreferredHighlight()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setGeometry(0,0,400,200);
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1587,7 +1565,6 @@ void tst_QQuickPathView::changePreferredHighlight()
QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentIndex(), 0);
- delete window;
}
void tst_QQuickPathView::creationContext()
@@ -1608,7 +1585,7 @@ void tst_QQuickPathView::creationContext()
// QTBUG-21320
void tst_QQuickPathView::currentOffsetOnInsertion()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -1681,12 +1658,11 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
// verify that current item (item 1) is still at offset 0.5
QCOMPARE(item->position() + offset, start);
- delete window;
}
void tst_QQuickPathView::asynchronous()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QQmlIncubationController controller;
window->engine()->setIncubationController(&controller);
@@ -1737,7 +1713,6 @@ void tst_QQuickPathView::asynchronous()
QCOMPARE(curItem->position() + offset, itemPos);
}
- delete window;
}
void tst_QQuickPathView::missingPercent()
@@ -1752,12 +1727,12 @@ void tst_QQuickPathView::missingPercent()
void tst_QQuickPathView::cancelDrag()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1767,10 +1742,10 @@ void tst_QQuickPathView::cancelDrag()
QSignalSpy dragEndedSpy(pathview, SIGNAL(dragEnded()));
// drag between snap points
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(10,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(10,100));
QTest::qWait(100);
- QTest::mouseMove(window, QPoint(30, 100));
- QTest::mouseMove(window, QPoint(85, 100));
+ QTest::mouseMove(window.data(), QPoint(30, 100));
+ QTest::mouseMove(window.data(), QPoint(85, 100));
QTRY_VERIFY(pathview->offset() != qFloor(pathview->offset()));
QTRY_VERIFY(pathview->isMoving());
@@ -1791,25 +1766,24 @@ void tst_QQuickPathView::cancelDrag()
QCOMPARE(dragStartedSpy.count(), 1);
QCOMPARE(dragEndedSpy.count(), 1);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(40,100));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(40,100));
- delete window;
}
void tst_QQuickPathView::maximumFlickVelocity()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
pathview->setMaximumFlickVelocity(700);
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QVERIFY(pathview->isFlicking());
QTRY_VERIFY_WITH_TIMEOUT(!pathview->isMoving(), 50000);
@@ -1818,7 +1792,7 @@ void tst_QQuickPathView::maximumFlickVelocity()
pathview->setOffset(0.);
pathview->setMaximumFlickVelocity(300);
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QVERIFY(pathview->isFlicking());
QTRY_VERIFY_WITH_TIMEOUT(!pathview->isMoving(), 50000);
@@ -1827,7 +1801,7 @@ void tst_QQuickPathView::maximumFlickVelocity()
pathview->setOffset(0.);
pathview->setMaximumFlickVelocity(500);
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QVERIFY(pathview->isFlicking());
QTRY_VERIFY_WITH_TIMEOUT(!pathview->isMoving(), 50000);
@@ -1838,14 +1812,13 @@ void tst_QQuickPathView::maximumFlickVelocity()
QVERIFY(dist3 > dist2);
QVERIFY(dist2 < dist1);
- delete window;
}
void tst_QQuickPathView::snapToItem()
{
QFETCH(bool, enforceRange);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("panels.qml"));
QQuickPathView *pathview = window->rootObject()->findChild<QQuickPathView*>("view");
QVERIFY(pathview != 0);
@@ -1857,7 +1830,7 @@ void tst_QQuickPathView::snapToItem()
QSignalSpy snapModeSpy(pathview, SIGNAL(snapModeChanged()));
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QTRY_VERIFY(!pathview->isMoving());
@@ -1869,7 +1842,6 @@ void tst_QQuickPathView::snapToItem()
else
QVERIFY(pathview->currentIndex() == currentIndex);
- delete window;
}
void tst_QQuickPathView::snapToItem_data()
@@ -1884,12 +1856,12 @@ void tst_QQuickPathView::snapOneItem()
{
QFETCH(bool, enforceRange);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("panels.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = window->rootObject()->findChild<QQuickPathView*>("view");
QVERIFY(pathview != 0);
@@ -1905,7 +1877,7 @@ void tst_QQuickPathView::snapOneItem()
int currentIndex = pathview->currentIndex();
double startOffset = pathview->offset();
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QTRY_VERIFY(!pathview->isMoving());
@@ -1918,7 +1890,6 @@ void tst_QQuickPathView::snapOneItem()
else
QVERIFY(pathview->currentIndex() == currentIndex);
- delete window;
}
void tst_QQuickPathView::snapOneItem_data()
@@ -1938,12 +1909,12 @@ void tst_QQuickPathView::positionViewAtIndex()
QFETCH(QQuickPathView::PositionMode, mode);
QFETCH(qreal, offset);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("pathview3.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1959,7 +1930,6 @@ void tst_QQuickPathView::positionViewAtIndex()
QCOMPARE(pathview->offset(), offset);
- delete window;
}
void tst_QQuickPathView::positionViewAtIndex_data()
@@ -2002,12 +1972,12 @@ void tst_QQuickPathView::indexAt_itemAt()
QFETCH(qreal, y);
QFETCH(int, index);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("pathview3.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -2020,7 +1990,6 @@ void tst_QQuickPathView::indexAt_itemAt()
QCOMPARE(pathview->indexAt(x,y), index);
QVERIFY(pathview->itemAt(x,y) == item);
- delete window;
}
void tst_QQuickPathView::indexAt_itemAt_data()
@@ -2038,7 +2007,7 @@ void tst_QQuickPathView::indexAt_itemAt_data()
void tst_QQuickPathView::cacheItemCount()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("pathview3.qml"));
window->show();
@@ -2112,7 +2081,6 @@ void tst_QQuickPathView::cacheItemCount()
controller.incubateWhile(&b);
}
- delete window;
}
QTEST_MAIN(tst_QQuickPathView)
diff --git a/tests/auto/quick/qquickpositioners/data/gridtest.qml b/tests/auto/quick/qquickpositioners/data/gridtest.qml
index 50bec1377b..fbe0b22b15 100644
--- a/tests/auto/quick/qquickpositioners/data/gridtest.qml
+++ b/tests/auto/quick/qquickpositioners/data/gridtest.qml
@@ -1,11 +1,15 @@
-import QtQuick 2.0
+import QtQuick 2.1
Item {
width: 640
height: 480
property bool testRightToLeft: false
+ property int testHAlignment: Grid.AlignLeft;
+ property int testVAlignment: Grid.AlignTop;
Grid {
layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ horizontalItemAlignment: testHAlignment
+ verticalItemAlignment: testVAlignment
objectName: "grid"
columns: 3
Rectangle {
diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
index 98999e540a..1f472a3f46 100644
--- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
@@ -78,6 +78,8 @@ private slots:
void test_grid_animated();
void test_grid_animated_rightToLeft();
void test_grid_zero_columns();
+ void test_grid_H_alignment();
+ void test_grid_V_alignment();
void test_propertychanges();
void test_repeater();
void test_flow();
@@ -288,7 +290,7 @@ tst_qquickpositioners::tst_qquickpositioners()
void tst_qquickpositioners::test_horizontal()
{
- QQuickView *window = createView(testFile("horizontal.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -311,13 +313,11 @@ void tst_qquickpositioners::test_horizontal()
QQuickItem *row = window->rootObject()->findChild<QQuickItem*>("row");
QCOMPARE(row->width(), 110.0);
QCOMPARE(row->height(), 50.0);
-
- delete window;
}
void tst_qquickpositioners::test_horizontal_rtl()
{
- QQuickView *window = createView(testFile("horizontal.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -350,12 +350,11 @@ void tst_qquickpositioners::test_horizontal_rtl()
QCOMPARE(three->x(), 90.0);
QCOMPARE(three->y(), 0.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_spacing()
{
- QQuickView *window = createView(testFile("horizontal-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-spacing.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -379,12 +378,11 @@ void tst_qquickpositioners::test_horizontal_spacing()
QCOMPARE(row->width(), 130.0);
QCOMPARE(row->height(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_spacing_rightToLeft()
{
- QQuickView *window = createView(testFile("horizontal-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-spacing.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -408,12 +406,11 @@ void tst_qquickpositioners::test_horizontal_spacing_rightToLeft()
QCOMPARE(row->width(), 130.0);
QCOMPARE(row->height(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_animated()
{
- QQuickView *window = createView(testFile("horizontal-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -431,7 +428,7 @@ void tst_qquickpositioners::test_horizontal_animated()
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *row = window->rootObject()->findChild<QQuickItem*>("row");
QVERIFY(row);
@@ -462,12 +459,11 @@ void tst_qquickpositioners::test_horizontal_animated()
QTRY_COMPARE(two->x(), 50.0);
QTRY_COMPARE(three->x(), 100.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_animated_rightToLeft()
{
- QQuickView *window = createView(testFile("horizontal-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -485,7 +481,7 @@ void tst_qquickpositioners::test_horizontal_animated_rightToLeft()
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *row = window->rootObject()->findChild<QQuickItem*>("row");
QVERIFY(row);
@@ -518,12 +514,11 @@ void tst_qquickpositioners::test_horizontal_animated_rightToLeft()
QTRY_COMPARE(one->x(), 100.0);
QTRY_COMPARE(two->x(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_animated_disabled()
{
- QQuickView *window = createView(testFile("horizontal-animated-disabled.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-animated-disabled.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -556,7 +551,6 @@ void tst_qquickpositioners::test_horizontal_animated_disabled()
QTRY_COMPARE(two->x(), 50.0);
QTRY_COMPARE(three->x(), 100.0);
- delete window;
}
void tst_qquickpositioners::populateTransitions(const QString &positionerObjectName)
@@ -576,7 +570,8 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QQuickView *window = QQuickViewTestUtil::createView();
+ QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
+
QQmlContext *ctxt = window->rootContext();
ctxt->setContextProperty("usePopulateTransition", usePopulateTransition);
ctxt->setContextProperty("enableAddTransition", true);
@@ -592,6 +587,7 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN
QQuickItem *positioner = window->rootObject()->findChild<QQuickItem*>(positionerObjectName);
QVERIFY(positioner);
window->show();
+ QTest::qWaitForWindowExposed(window.data());
qApp->processEvents();
if (!dynamicallyPopulate && usePopulateTransition) {
@@ -627,8 +623,6 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN
model.insertItem(0, "new item", "");
QTRY_COMPARE(window->rootObject()->property("addTransitionsDone").toInt(), 1);
QTRY_COMPARE(window->rootObject()->property("populateTransitionsDone").toInt(), 0);
-
- delete window;
}
void tst_qquickpositioners::populateTransitions_data()
@@ -657,7 +651,7 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName)
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QQuickView *window = QQuickViewTestUtil::createView();
+ QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
QQmlContext *ctxt = window->rootContext();
ctxt->setContextProperty("usePopulateTransition", QVariant(false));
ctxt->setContextProperty("enableAddTransition", QVariant(true));
@@ -667,6 +661,7 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName)
ctxt->setContextProperty("displacedItems_transitionVia", displacedItems_transitionVia);
window->setSource(testFileUrl("transitions.qml"));
window->show();
+ QTest::qWaitForWindowExposed(window.data());
qApp->processEvents();
QQuickItem *positioner = window->rootObject()->findChild<QQuickItem*>(positionerObjectName);
@@ -733,8 +728,6 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName)
}
checkItemPositions(positioner, &model, window->rootObject()->property("incrementalSize").toInt());
-
- delete window;
}
void tst_qquickpositioners::addTransitions_data()
@@ -770,7 +763,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QQuickView *window = QQuickViewTestUtil::createView();
+ QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
QQmlContext *ctxt = window->rootContext();
ctxt->setContextProperty("usePopulateTransition", QVariant(false));
ctxt->setContextProperty("enableAddTransition", QVariant(false));
@@ -780,6 +773,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
ctxt->setContextProperty("displacedItems_transitionVia", displacedItems_transitionVia);
window->setSource(testFileUrl("transitions.qml"));
window->show();
+ QTest::qWaitForWindowExposed(window.data());
qApp->processEvents();
QList<QPair<QString,QString> > expectedDisplacedValues = expectedDisplacedIndexes.getModelDataValues(model);
@@ -842,8 +836,6 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
}
checkItemPositions(positioner, &model, window->rootObject()->property("incrementalSize").toInt());
-
- delete window;
}
void tst_qquickpositioners::moveTransitions_data()
@@ -929,7 +921,7 @@ void tst_qquickpositioners::checkItemPositions(QQuickItem *positioner, QaimModel
void tst_qquickpositioners::test_vertical()
{
- QQuickView *window = createView(testFile("vertical.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("vertical.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -952,12 +944,11 @@ void tst_qquickpositioners::test_vertical()
QCOMPARE(column->height(), 80.0);
QCOMPARE(column->width(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_vertical_spacing()
{
- QQuickView *window = createView(testFile("vertical-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("vertical-spacing.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -979,12 +970,11 @@ void tst_qquickpositioners::test_vertical_spacing()
QCOMPARE(column->height(), 100.0);
QCOMPARE(column->width(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_vertical_animated()
{
- QQuickView *window = createView(testFile("vertical-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("vertical-animated.qml"), false));
//Note that they animate in
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
@@ -999,7 +989,7 @@ void tst_qquickpositioners::test_vertical_animated()
QVERIFY(three != 0);
QCOMPARE(three->y(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *column = window->rootObject()->findChild<QQuickItem*>("column");
QVERIFY(column);
@@ -1029,12 +1019,11 @@ void tst_qquickpositioners::test_vertical_animated()
QTRY_COMPARE(two->y(), 50.0);
QTRY_COMPARE(three->y(), 100.0);
- delete window;
}
void tst_qquickpositioners::test_grid()
{
- QQuickView *window = createView(testFile("gridtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1063,12 +1052,11 @@ void tst_qquickpositioners::test_grid()
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
- delete window;
}
void tst_qquickpositioners::test_grid_topToBottom()
{
- QQuickView *window = createView(testFile("grid-toptobottom.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("grid-toptobottom.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1097,12 +1085,11 @@ void tst_qquickpositioners::test_grid_topToBottom()
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 120.0);
- delete window;
}
void tst_qquickpositioners::test_grid_rightToLeft()
{
- QQuickView *window = createView(testFile("gridtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -1146,12 +1133,11 @@ void tst_qquickpositioners::test_grid_rightToLeft()
QCOMPARE(five->x(), 140.0);
QCOMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_grid_spacing()
{
- QQuickView *window = createView(testFile("grid-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("grid-spacing.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1179,12 +1165,11 @@ void tst_qquickpositioners::test_grid_spacing()
QCOMPARE(grid->width(), 128.0);
QCOMPARE(grid->height(), 104.0);
- delete window;
}
void tst_qquickpositioners::test_grid_row_column_spacing()
{
- QQuickView *window = createView(testFile("grid-row-column-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("grid-row-column-spacing.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1212,12 +1197,11 @@ void tst_qquickpositioners::test_grid_row_column_spacing()
QCOMPARE(grid->width(), 142.0);
QCOMPARE(grid->height(), 107.0);
- delete window;
}
void tst_qquickpositioners::test_grid_animated()
{
- QQuickView *window = createView(testFile("grid-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("grid-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -1247,7 +1231,7 @@ void tst_qquickpositioners::test_grid_animated()
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *grid = window->rootObject()->findChild<QQuickItem*>("grid");
QVERIFY(grid);
@@ -1297,12 +1281,11 @@ void tst_qquickpositioners::test_grid_animated()
QTRY_COMPARE(five->x(), 50.0);
QTRY_COMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_grid_animated_rightToLeft()
{
- QQuickView *window = createView(testFile("grid-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("grid-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -1332,7 +1315,7 @@ void tst_qquickpositioners::test_grid_animated_rightToLeft()
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *grid = window->rootObject()->findChild<QQuickItem*>("grid");
QVERIFY(grid);
@@ -1382,12 +1365,11 @@ void tst_qquickpositioners::test_grid_animated_rightToLeft()
QTRY_COMPARE(five->x(), 50.0);
QTRY_COMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_grid_zero_columns()
{
- QQuickView *window = createView(testFile("gridzerocolumns.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("gridzerocolumns.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1415,12 +1397,133 @@ void tst_qquickpositioners::test_grid_zero_columns()
QCOMPARE(grid->width(), 170.0);
QCOMPARE(grid->height(), 60.0);
- delete window;
+}
+
+void tst_qquickpositioners::test_grid_H_alignment()
+{
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
+
+ window->rootObject()->setProperty("testHAlignment", QQuickGrid::AlignHCenter);
+
+ QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
+ QVERIFY(one != 0);
+ QQuickRectangle *two = window->rootObject()->findChild<QQuickRectangle*>("two");
+ QVERIFY(two != 0);
+ QQuickRectangle *three = window->rootObject()->findChild<QQuickRectangle*>("three");
+ QVERIFY(three != 0);
+ QQuickRectangle *four = window->rootObject()->findChild<QQuickRectangle*>("four");
+ QVERIFY(four != 0);
+ QQuickRectangle *five = window->rootObject()->findChild<QQuickRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 55.0);
+ QCOMPARE(five->y(), 50.0);
+
+ QQuickItem *grid = window->rootObject()->findChild<QQuickItem*>("grid");
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ window->rootObject()->setProperty("testHAlignment", QQuickGrid::AlignRight);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 60.0);
+ QCOMPARE(five->y(), 50.0);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ window->rootObject()->setProperty("testRightToLeft", true);
+
+ QCOMPARE(one->x(), 50.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 30.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 50.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 30.0);
+ QCOMPARE(five->y(), 50.0);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ window->rootObject()->setProperty("testHAlignment", QQuickGrid::AlignHCenter);
+
+ QCOMPARE(one->x(), 50.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 30.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 50.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 35.0);
+ QCOMPARE(five->y(), 50.0);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+}
+
+void tst_qquickpositioners::test_grid_V_alignment()
+{
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
+
+ window->rootObject()->setProperty("testVAlignment", QQuickGrid::AlignVCenter);
+
+ QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
+ QVERIFY(one != 0);
+ QQuickRectangle *two = window->rootObject()->findChild<QQuickRectangle*>("two");
+ QVERIFY(two != 0);
+ QQuickRectangle *three = window->rootObject()->findChild<QQuickRectangle*>("three");
+ QVERIFY(three != 0);
+ QQuickRectangle *four = window->rootObject()->findChild<QQuickRectangle*>("four");
+ QVERIFY(four != 0);
+ QQuickRectangle *five = window->rootObject()->findChild<QQuickRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 15.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 70.0);
+
+ window->rootObject()->setProperty("testVAlignment", QQuickGrid::AlignBottom);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 30.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 90.0);
+
}
void tst_qquickpositioners::test_propertychanges()
{
- QQuickView *window = createView(testFile("propertychangestest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("propertychangestest.qml")));
QQuickGrid *grid = qobject_cast<QQuickGrid*>(window->rootObject());
QVERIFY(grid != 0);
@@ -1474,12 +1577,11 @@ void tst_qquickpositioners::test_propertychanges()
QCOMPARE(columnsSpy.count(),2);
QCOMPARE(rowsSpy.count(),2);
- delete window;
}
void tst_qquickpositioners::test_repeater()
{
- QQuickView *window = createView(testFile("repeatertest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("repeatertest.qml")));
QQuickRectangle *one = findItem<QQuickRectangle>(window->contentItem(), "one");
QVERIFY(one != 0);
@@ -1497,12 +1599,11 @@ void tst_qquickpositioners::test_repeater()
QCOMPARE(three->x(), 100.0);
QCOMPARE(three->y(), 0.0);
- delete window;
}
void tst_qquickpositioners::test_flow()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -1533,12 +1634,11 @@ void tst_qquickpositioners::test_flow()
QCOMPARE(flow->width(), 90.0);
QCOMPARE(flow->height(), 120.0);
- delete window;
}
void tst_qquickpositioners::test_flow_rightToLeft()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -1569,12 +1669,11 @@ void tst_qquickpositioners::test_flow_rightToLeft()
QCOMPARE(flow->width(), 90.0);
QCOMPARE(flow->height(), 120.0);
- delete window;
}
void tst_qquickpositioners::test_flow_topToBottom()
{
- QQuickView *window = createView(testFile("flowtest-toptobottom.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest-toptobottom.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -1622,12 +1721,11 @@ void tst_qquickpositioners::test_flow_topToBottom()
QCOMPARE(five->x(), 40.0);
QCOMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_flow_resize()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject());
QVERIFY(root);
@@ -1656,12 +1754,11 @@ void tst_qquickpositioners::test_flow_resize()
QTRY_COMPARE(five->x(), 50.0);
QTRY_COMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_flow_resize_rightToLeft()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject());
QVERIFY(root);
@@ -1690,12 +1787,11 @@ void tst_qquickpositioners::test_flow_resize_rightToLeft()
QCOMPARE(five->x(), 65.0);
QCOMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_flow_implicit_resize()
{
- QQuickView *window = createView(testFile("flow-testimplicitsize.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flow-testimplicitsize.qml")));
QVERIFY(window->rootObject() != 0);
QQuickFlow *flow = window->rootObject()->findChild<QQuickFlow*>("flow");
@@ -1719,7 +1815,6 @@ void tst_qquickpositioners::test_flow_implicit_resize()
QCOMPARE(flow->width(), 220.0);
QCOMPARE(flow->height(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_conflictinganchors()
@@ -1836,10 +1931,10 @@ void tst_qquickpositioners::test_mirroring()
objectNames << "one" << "two" << "three" << "four" << "five";
foreach (const QString qmlFile, qmlFiles) {
- QQuickView *windowA = createView(testFile(qmlFile));
+ QScopedPointer<QQuickView> windowA(createView(testFile(qmlFile)));
QQuickItem *rootA = qobject_cast<QQuickItem*>(windowA->rootObject());
- QQuickView *windowB = createView(testFile(qmlFile));
+ QScopedPointer<QQuickView> windowB(createView(testFile(qmlFile)));
QQuickItem *rootB = qobject_cast<QQuickItem*>(windowB->rootObject());
rootA->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
@@ -1881,15 +1976,13 @@ void tst_qquickpositioners::test_mirroring()
QQuickItem *itemB = rootB->findChild<QQuickItem*>(objectName);
QTRY_COMPARE(itemA->x(), itemB->x());
}
- delete windowA;
- delete windowB;
}
}
void tst_qquickpositioners::test_allInvisible()
{
//QTBUG-19361
- QQuickView *window = createView(testFile("allInvisible.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("allInvisible.qml")));
QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject());
QVERIFY(root);
@@ -1908,7 +2001,7 @@ void tst_qquickpositioners::test_attachedproperties()
{
QFETCH(QString, filename);
- QQuickView *window = createView(filename);
+ QScopedPointer<QQuickView> window(createView(filename));
QVERIFY(window->rootObject() != 0);
QQuickRectangle *greenRect = window->rootObject()->findChild<QQuickRectangle *>("greenRect");
@@ -1940,7 +2033,6 @@ void tst_qquickpositioners::test_attachedproperties()
isLast = yellowRect->property("isLastItem").toBool();
QVERIFY(isLast == true);
- delete window;
}
void tst_qquickpositioners::test_attachedproperties_data()
@@ -1955,7 +2047,7 @@ void tst_qquickpositioners::test_attachedproperties_data()
void tst_qquickpositioners::test_attachedproperties_dynamic()
{
- QQuickView *window = createView(testFile("attachedproperties-dynamic.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("attachedproperties-dynamic.qml")));
QVERIFY(window->rootObject() != 0);
QQuickRow *row = window->rootObject()->findChild<QQuickRow *>("pos");
@@ -2006,7 +2098,6 @@ void tst_qquickpositioners::test_attachedproperties_dynamic()
QTRY_VERIFY(rect1->property("firstItem").toBool() == false);
QTRY_VERIFY(rect1->property("lastItem").toBool() == true);
- delete window;
}
QQuickView *tst_qquickpositioners::createView(const QString &filename, bool wait)
diff --git a/tests/auto/quick/qquicktextdocument/data/text.qml b/tests/auto/quick/qquicktextdocument/data/text.qml
new file mode 100644
index 0000000000..43a8c6bb82
--- /dev/null
+++ b/tests/auto/quick/qquicktextdocument/data/text.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.1
+
+TextEdit {
+ text: ""
+}
+
diff --git a/tests/auto/qml/qquicklistcompositor/qquicklistcompositor.pro b/tests/auto/quick/qquicktextdocument/qquicktextdocument.pro
index 9d1d2bd237..e6bfdbd099 100644
--- a/tests/auto/qml/qquicklistcompositor/qquicklistcompositor.pro
+++ b/tests/auto/quick/qquicktextdocument/qquicktextdocument.pro
@@ -1,10 +1,15 @@
CONFIG += testcase
-TARGET = tst_qquicklistcompositor
+TARGET = tst_qquicktextdocument
macx:CONFIG -= app_bundle
-SOURCES += tst_qquicklistcompositor.cpp
+SOURCES += tst_qquicktextdocument.cpp
+
+include (../../shared/util.pri)
+
+TESTDATA = data/*
CONFIG += parallel_test
QT += core-private gui-private qml-private quick-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
diff --git a/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp b/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp
new file mode 100644
index 0000000000..717496cf0e
--- /dev/null
+++ b/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <QtQuick/QQuickTextDocument>
+#include <QtQuick/QQuickItem>
+#include <QtQuick/private/qquicktextedit_p.h>
+#include <QtGui/QTextDocument>
+#include <QtGui/QTextDocumentWriter>
+#include <QtQml/QQmlEngine>
+#include <QtQml/QQmlComponent>
+#include "../../shared/util.h"
+
+class tst_qquicktextdocument : public QQmlDataTest
+{
+ Q_OBJECT
+private slots:
+ void textDocumentWriter();
+};
+
+QString text = QStringLiteral("foo bar");
+
+void tst_qquicktextdocument::textDocumentWriter()
+{
+ QQmlEngine e;
+ QQmlComponent c(&e, testFileUrl("text.qml"));
+ QObject* o = c.create();
+ QVERIFY(o);
+ QQuickTextEdit *edit = qobject_cast<QQuickTextEdit*>(o);
+ QVERIFY(edit);
+
+ QQuickTextDocument* quickDocument = qobject_cast<QQuickTextDocument*>(edit->property("textDocument").value<QObject*>());
+ QVERIFY(quickDocument->textDocument() != 0);
+
+ QBuffer output;
+ output.open(QBuffer::ReadWrite);
+ QVERIFY(output.buffer().isEmpty());
+
+ edit->setProperty("text", QVariant(text));
+ QTextDocumentWriter writer(&output, "plaintext");
+ QVERIFY(writer.write(quickDocument->textDocument()));
+ QCOMPARE(output.buffer(), text.toLatin1());
+ delete o;
+}
+
+QTEST_MAIN(tst_qquicktextdocument)
+
+#include "tst_qquicktextdocument.moc"
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index bf7539e449..c29c6c05d6 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -2225,6 +2225,7 @@ void tst_qquicktextedit::cursorDelegate()
QQuickView view(source);
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject");
QVERIFY(textEditObject != 0);
// Delegate creation is deferred until focus in or cursor visibility is forced.
@@ -2340,6 +2341,7 @@ void tst_qquicktextedit::remoteCursorDelegate()
view.setSource(testFileUrl("cursorTestRemote.qml"));
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject");
QVERIFY(textEditObject != 0);
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 86a05c3d3b..8e63b6207f 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -2665,6 +2665,7 @@ void tst_qquicktextinput::cursorDelegate()
QQuickView view(source);
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextInput *textInputObject = view.rootObject()->findChild<QQuickTextInput*>("textInputObject");
QVERIFY(textInputObject != 0);
// Delegate is created on demand, and so won't be available immediately. Focus in or
@@ -2774,7 +2775,7 @@ void tst_qquicktextinput::cursorDelegate()
void tst_qquicktextinput::remoteCursorDelegate()
{
TestHTTPServer server(SERVER_PORT);
- server.serveDirectory(dataDirectory());
+ server.serveDirectory(dataDirectory(), TestHTTPServer::Delay);
QQuickView view;
@@ -2784,6 +2785,7 @@ void tst_qquicktextinput::remoteCursorDelegate()
view.setSource(testFileUrl("cursorTestRemote.qml"));
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextInput *textInputObject = view.rootObject()->findChild<QQuickTextInput*>("textInputObject");
QVERIFY(textInputObject != 0);
diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
index 74c557871f..f97b0f35a6 100644
--- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
+++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
@@ -52,9 +52,9 @@
#include <QtQuick/qquickview.h>
#include <private/qquicklistview_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include <QtQuick/private/qquickvisualdatamodel_p.h>
+#include <QtQml/private/qqmldelegatemodel_p.h>
#include <private/qqmlvaluetype_p.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmlchangeset_p.h>
#include <private/qqmlengine_p.h>
#include <math.h>
#include <QtGui/qstandarditemmodel.h>
@@ -360,21 +360,21 @@ public:
int indexCreated;
public Q_SLOTS:
- void initItem(int index, QQuickItem *item)
+ void initItem(int index, QObject *item)
{
- itemInitialized = item;
+ itemInitialized = qobject_cast<QQuickItem*>(item);
indexInitialized = index;
}
- void createdItem(int index, QQuickItem *item)
+ void createdItem(int index, QObject *item)
{
- itemCreated = item;
+ itemCreated = qobject_cast<QQuickItem*>(item);
indexCreated = index;
}
- void destroyingItem(QQuickItem *item)
+ void destroyingItem(QObject *item)
{
- itemDestroyed = item;
+ itemDestroyed = qobject_cast<QQuickItem*>(item);
}
};
@@ -452,9 +452,9 @@ private:
template <int N> void get_verify(
const SingleRoleModel &model,
- QQuickVisualDataModel *visualModel,
- QQuickVisualDataGroup *visibleItems,
- QQuickVisualDataGroup *selectedItems,
+ QQmlDelegateModel *visualModel,
+ QQmlDataGroup *visibleItems,
+ QQmlDataGroup *selectedItems,
const int (&mIndex)[N],
const int (&iIndex)[N],
const int (&vIndex)[N],
@@ -467,7 +467,7 @@ private:
QQmlEngine engine;
};
-Q_DECLARE_METATYPE(QQuickChangeSet)
+Q_DECLARE_METATYPE(QQmlChangeSet)
template <typename T> static T evaluate(QObject *scope, const QString &expression)
{
@@ -489,7 +489,7 @@ template <> void evaluate<void>(QObject *scope, const QString &expression)
void tst_qquickvisualdatamodel::initTestCase()
{
QQmlDataTest::initTestCase();
- qRegisterMetaType<QQuickChangeSet>();
+ qRegisterMetaType<QQmlChangeSet>();
qmlRegisterType<SingleRoleModel>("tst_qquickvisualdatamodel", 1, 0, "SingleRoleModel");
qmlRegisterType<DataObject>("tst_qquickvisualdatamodel", 1, 0, "DataObject");
@@ -517,7 +517,7 @@ void tst_qquickvisualdatamodel::rootIndex()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *obj = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *obj = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(obj != 0);
QMetaObject::invokeMethod(obj, "setRoot");
@@ -611,7 +611,7 @@ void tst_qquickvisualdatamodel::childChanged()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *vdm = listview->findChild<QQuickVisualDataModel*>("visualModel");
+ QQmlDelegateModel *vdm = listview->findChild<QQmlDelegateModel*>("visualModel");
vdm->setRootIndex(QVariant::fromValue(model.indexFromItem(model.item(1,0))));
QCOMPARE(listview->count(), 1);
@@ -922,7 +922,7 @@ void tst_qquickvisualdatamodel::noDelegate()
QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject());
QVERIFY(listview != 0);
- QQuickVisualDataModel *vdm = listview->findChild<QQuickVisualDataModel*>("visualModel");
+ QQmlDelegateModel *vdm = listview->findChild<QQmlDelegateModel*>("visualModel");
QVERIFY(vdm != 0);
QCOMPARE(vdm->count(), 3);
@@ -1052,15 +1052,15 @@ void tst_qquickvisualdatamodel::qaimRowsMoved()
SingleRoleModel model(list);
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *obj = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *obj = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(obj != 0);
- QSignalSpy spy(obj, SIGNAL(modelUpdated(QQuickChangeSet,bool)));
+ QSignalSpy spy(obj, SIGNAL(modelUpdated(QQmlChangeSet,bool)));
model.emitMove(sourceFirst, sourceLast, destinationChild);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy[0].count(), 2);
- QQuickChangeSet changeSet = spy[0][0].value<QQuickChangeSet>();
+ QQmlChangeSet changeSet = spy[0][0].value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, expectFrom);
QCOMPARE(changeSet.removes().at(0).count, expectCount);
@@ -1115,11 +1115,11 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
- QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQuickChangeSet,bool)));
- QQuickChangeSet changeSet;
+ QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQmlChangeSet,bool)));
+ QQmlChangeSet changeSet;
QCOMPARE(vdm->count(), 4);
@@ -1127,7 +1127,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
model.move(QModelIndex(), 1, model.index(0, 0), 3, 2);
QCOMPARE(vdm->count(), 2);
QCOMPARE(spy.count(), 1);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, 1);
QCOMPARE(changeSet.removes().at(0).count, 2);
@@ -1137,7 +1137,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
model.move(model.index(0, 0), 4, QModelIndex(), 2, 1);
QCOMPARE(vdm->count(), 3);
QCOMPARE(spy.count(), 2);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 0);
QCOMPARE(changeSet.inserts().count(), 1);
QCOMPARE(changeSet.inserts().at(0).index, 2);
@@ -1147,11 +1147,11 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QCOMPARE(vdm->rootIndex().value<QModelIndex>(), model.index(2, 0));
QCOMPARE(vdm->count(), 3);
QCOMPARE(spy.count(), 4);
- changeSet = spy.at(2).at(0).value<QQuickChangeSet>();
+ changeSet = spy.at(2).at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, 0);
QCOMPARE(changeSet.removes().at(0).count, 3);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.inserts().count(), 1);
QCOMPARE(changeSet.inserts().at(0).index, 0);
QCOMPARE(changeSet.inserts().at(0).count, 3);
@@ -1182,7 +1182,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QCOMPARE(vdm->rootIndex().value<QModelIndex>(), QModelIndex());
QCOMPARE(vdm->count(), 0);
QCOMPARE(spy.count(), 5);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, 0);
QCOMPARE(changeSet.removes().at(0).count, 3);
@@ -1192,7 +1192,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QCOMPARE(vdm->rootIndex().value<QModelIndex>(), QModelIndex());
QCOMPARE(vdm->count(), 2);
QCOMPARE(spy.count(), 6);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 0);
QCOMPARE(changeSet.inserts().count(), 1);
QCOMPARE(changeSet.inserts().at(0).index, 0);
@@ -1211,17 +1211,17 @@ void tst_qquickvisualdatamodel::watchedRoles()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
// VisualDataModel doesn't initialize model data until the first item is requested.
- QQuickItem *item = vdm->item(0);
+ QQuickItem *item = qobject_cast<QQuickItem*>(vdm->object(0));
QVERIFY(item);
vdm->release(item);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // Ensure released items are deleted before test exits.
- QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQuickChangeSet,bool)));
- QQuickChangeSet changeSet;
+ QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQmlChangeSet,bool)));
+ QQmlChangeSet changeSet;
QCOMPARE(vdm->count(), 30);
@@ -1238,13 +1238,13 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(0), model.index(4));
QCOMPARE(spy.count(), 1);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 0);
QCOMPARE(changeSet.changes().at(0).count, 5);
emit model.dataChanged(model.index(1), model.index(6), QVector<int>() << QaimModel::Name);
QCOMPARE(spy.count(), 2);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 1);
QCOMPARE(changeSet.changes().at(0).count, 6);
@@ -1255,7 +1255,7 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(0), model.index(4));
QCOMPARE(spy.count(), 3);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 0);
QCOMPARE(changeSet.changes().at(0).count, 5);
@@ -1264,7 +1264,7 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(8), model.index(8), QVector<int>() << QaimModel::Number);
QCOMPARE(spy.count(), 4);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 8);
QCOMPARE(changeSet.changes().at(0).count, 1);
@@ -1272,19 +1272,19 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(0), model.index(4));
QCOMPARE(spy.count(), 5);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 0);
QCOMPARE(changeSet.changes().at(0).count, 5);
emit model.dataChanged(model.index(1), model.index(6), QVector<int>() << QaimModel::Name);
QCOMPARE(spy.count(), 6);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 1);
QCOMPARE(changeSet.changes().at(0).count, 6);
emit model.dataChanged(model.index(8), model.index(8), QVector<int>() << QaimModel::Number);
QCOMPARE(spy.count(), 7);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 8);
QCOMPARE(changeSet.changes().at(0).count, 1);
}
@@ -1301,29 +1301,29 @@ void tst_qquickvisualdatamodel::hasModelChildren()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
QCOMPARE(vdm->count(), 4);
QQuickItem *item = 0;
- item = vdm->item(0);
+ item = qobject_cast<QQuickItem*>(vdm->object(0));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), true);
vdm->release(item);
- item = vdm->item(1);
+ item = qobject_cast<QQuickItem*>(vdm->object(1));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), false);
vdm->release(item);
- item = vdm->item(2);
+ item = qobject_cast<QQuickItem*>(vdm->object(2));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), true);
vdm->release(item);
- item = vdm->item(3);
+ item = qobject_cast<QQuickItem*>(vdm->object(3));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), false);
vdm->release(item);
@@ -1351,14 +1351,14 @@ void tst_qquickvisualdatamodel::setValue()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
QCOMPARE(vdm->count(), 3);
QQuickItem *item = 0;
- item = vdm->item(0);
+ item = qobject_cast<QQuickItem*>(vdm->object(0));
QVERIFY(item);
QCOMPARE(evaluate<QString>(item, "display"), QString("Row 1 Item"));
evaluate<void>(item, "display = 'Changed Item 1'");
@@ -1412,7 +1412,7 @@ void tst_qquickvisualdatamodel::remove()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
{
@@ -1521,7 +1521,7 @@ void tst_qquickvisualdatamodel::move()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
{
@@ -1710,13 +1710,13 @@ void tst_qquickvisualdatamodel::groups()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = listview->findChild<QQuickVisualDataModel *>("visualModel");
+ QQmlDelegateModel *visualModel = listview->findChild<QQmlDelegateModel *>("visualModel");
QVERIFY(visualModel);
- QQuickVisualDataGroup *visibleItems = listview->findChild<QQuickVisualDataGroup *>("visibleItems");
+ QQmlDataGroup *visibleItems = listview->findChild<QQmlDataGroup *>("visibleItems");
QVERIFY(visibleItems);
- QQuickVisualDataGroup *selectedItems = listview->findChild<QQuickVisualDataGroup *>("selectedItems");
+ QQmlDataGroup *selectedItems = listview->findChild<QQmlDataGroup *>("selectedItems");
QVERIFY(selectedItems);
const bool f = false;
@@ -1939,9 +1939,9 @@ void tst_qquickvisualdatamodel::groups()
template <int N> void tst_qquickvisualdatamodel::get_verify(
const SingleRoleModel &model,
- QQuickVisualDataModel *visualModel,
- QQuickVisualDataGroup *visibleItems,
- QQuickVisualDataGroup *selectedItems,
+ QQmlDelegateModel *visualModel,
+ QQmlDataGroup *visibleItems,
+ QQmlDataGroup *selectedItems,
const int (&mIndex)[N],
const int (&iIndex)[N],
const int (&vIndex)[N],
@@ -2030,13 +2030,13 @@ void tst_qquickvisualdatamodel::get()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
- QQuickVisualDataGroup *visibleItems = visualModel->findChild<QQuickVisualDataGroup *>("visibleItems");
+ QQmlDataGroup *visibleItems = visualModel->findChild<QQmlDataGroup *>("visibleItems");
QVERIFY(visibleItems);
- QQuickVisualDataGroup *selectedItems = visualModel->findChild<QQuickVisualDataGroup *>("selectedItems");
+ QQmlDataGroup *selectedItems = visualModel->findChild<QQmlDataGroup *>("selectedItems");
QVERIFY(selectedItems);
QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(ctxt->engine());
@@ -2154,7 +2154,7 @@ void tst_qquickvisualdatamodel::get()
void tst_qquickvisualdatamodel::invalidGroups()
{
QUrl source = testFileUrl("groups-invalid.qml");
- QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":12:9: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("Group names must start with a lower case letter")).toUtf8());
+ QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":12:9: QML VisualDataGroup: " + QQmlDataGroup::tr("Group names must start with a lower case letter")).toUtf8());
QQmlComponent component(&engine, source);
QScopedPointer<QObject> object(component.create());
@@ -2326,7 +2326,7 @@ void tst_qquickvisualdatamodel::create()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
QCOMPARE(listview->count(), 20);
@@ -2440,7 +2440,7 @@ void tst_qquickvisualdatamodel::incompleteModel()
QScopedPointer<QObject> object(component.beginCreate(engine.rootContext()));
- QQuickVisualDataModel *model = qobject_cast<QQuickVisualDataModel *>(object.data());
+ QQmlDelegateModel *model = qobject_cast<QQmlDelegateModel *>(object.data());
QVERIFY(model);
QSignalSpy itemsSpy(model->items(), SIGNAL(countChanged()));
@@ -3665,67 +3665,67 @@ void tst_qquickvisualdatamodel::warnings_data()
QTest::newRow("insert < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.insert(-2, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("insert: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("insert: index out of range"))
<< 4;
QTest::newRow("insert > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.insert(8, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("insert: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("insert: index out of range"))
<< 4;
QTest::newRow("create < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.create(-2, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("create: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("create: index out of range"))
<< 4;
QTest::newRow("create > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.create(8, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("create: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("create: index out of range"))
<< 4;
QTest::newRow("resolve from < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(-2, 3)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index out of range"))
<< 4;
QTest::newRow("resolve from > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(8, 3)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index out of range"))
<< 4;
QTest::newRow("resolve to < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, -2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index out of range"))
<< 4;
QTest::newRow("resolve to > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, 8)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index out of range"))
<< 4;
QTest::newRow("resolve from invalid index")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(\"two\", 3)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from index invalid"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index invalid"))
<< 4;
QTest::newRow("resolve to invalid index")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, \"two\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to index invalid"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index invalid"))
<< 4;
QTest::newRow("resolve already resolved item")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, 2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from is not an unresolved item"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from is not an unresolved item"))
<< 4;
QTest::newRow("resolve already resolved item")
@@ -3733,193 +3733,193 @@ void tst_qquickvisualdatamodel::warnings_data()
<< QString("{ items.insert(0, {\"number\": \"eight\"});"
"items.insert(1, {\"number\": \"seven\"});"
"items.resolve(0, 1)}")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to is not a model item"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to is not a model item"))
<< 6;
QTest::newRow("remove index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(-2, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
<< 4;
QTest::newRow("remove index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(4, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
<< 4;
QTest::newRow("remove index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(9, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
<< 4;
QTest::newRow("remove invalid index")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(\"nine\", 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: invalid index"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid index"))
<< 4;
QTest::newRow("remove count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(1, -2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid count"))
<< 4;
QTest::newRow("remove index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid count"))
<< 4;
QTest::newRow("addGroups index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(-2, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
<< 4;
QTest::newRow("addGroups index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(4, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
<< 4;
QTest::newRow("addGroups index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(9, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
<< 4;
QTest::newRow("addGroups count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(1, -2, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: invalid count"))
<< 4;
QTest::newRow("addGroups index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: invalid count"))
<< 4;
QTest::newRow("removeGroups index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(-2, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
<< 4;
QTest::newRow("removeGroups index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(4, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
<< 4;
QTest::newRow("removeGroups index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(9, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
<< 4;
QTest::newRow("removeGroups count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(1, -2, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: invalid count"))
<< 4;
QTest::newRow("removeGroups index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: invalid count"))
<< 4;
QTest::newRow("setGroups index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(-2, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
<< 4;
QTest::newRow("setGroups index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(4, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
<< 4;
QTest::newRow("setGroups index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(9, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
<< 4;
QTest::newRow("setGroups count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(1, -2, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: invalid count"))
<< 4;
QTest::newRow("setGroups index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: invalid count"))
<< 4;
QTest::newRow("move from < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(-2, 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
QTest::newRow("move from == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(4, 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
QTest::newRow("move from > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(9, 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
QTest::newRow("move invalid from")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(\"nine\", 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: invalid from index"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid from index"))
<< 4;
QTest::newRow("move to < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, -2, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
<< 4;
QTest::newRow("move to == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, 4, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
<< 4;
QTest::newRow("move to > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, 9, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
<< 4;
QTest::newRow("move invalid to")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, \"nine\", 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: invalid to index"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid to index"))
<< 4;
QTest::newRow("move count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, 1, -2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid count"))
<< 4;
QTest::newRow("move from + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(2, 1, 4)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
}
@@ -3961,19 +3961,19 @@ void tst_qquickvisualdatamodel::invalidAttachment()
QCOMPARE(component.errors().count(), 0);
QVariant property = object->property("invalidVdm");
- QCOMPARE(property.userType(), qMetaTypeId<QQuickVisualDataModel *>());
- QVERIFY(!property.value<QQuickVisualDataModel *>());
+ QCOMPARE(property.userType(), qMetaTypeId<QQmlDelegateModel *>());
+ QVERIFY(!property.value<QQmlDelegateModel *>());
QQuickItem *item = findItem<QQuickItem>(static_cast<QQuickItem *>(object.data()), "delegate");
QVERIFY(item);
property = item->property("validVdm");
- QCOMPARE(property.userType(), qMetaTypeId<QQuickVisualDataModel *>());
- QVERIFY(property.value<QQuickVisualDataModel *>());
+ QCOMPARE(property.userType(), qMetaTypeId<QQmlDelegateModel *>());
+ QVERIFY(property.value<QQmlDelegateModel *>());
property = item->property("invalidVdm");
- QCOMPARE(property.userType(), qMetaTypeId<QQuickVisualDataModel *>());
- QVERIFY(!property.value<QQuickVisualDataModel *>());
+ QCOMPARE(property.userType(), qMetaTypeId<QQmlDelegateModel *>());
+ QVERIFY(!property.value<QQmlDelegateModel *>());
}
void tst_qquickvisualdatamodel::asynchronousInsert_data()
@@ -4005,15 +4005,15 @@ void tst_qquickvisualdatamodel::asynchronousInsert()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
ItemRequester requester;
- connect(visualModel, SIGNAL(initItem(int,QQuickItem*)), &requester, SLOT(initItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(createdItem(int,QQuickItem*)), &requester, SLOT(createdItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(destroyingItem(QQuickItem*)), &requester, SLOT(destroyingItem(QQuickItem*)));
+ connect(visualModel, SIGNAL(initItem(int,QObject*)), &requester, SLOT(initItem(int,QObject*)));
+ connect(visualModel, SIGNAL(createdItem(int,QObject*)), &requester, SLOT(createdItem(int,QObject*)));
+ connect(visualModel, SIGNAL(destroyingItem(QObject*)), &requester, SLOT(destroyingItem(QObject*)));
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QVERIFY(!requester.itemInitialized);
@@ -4025,7 +4025,7 @@ void tst_qquickvisualdatamodel::asynchronousInsert()
newItems.append(qMakePair(QLatin1String("New item") + QString::number(i), QString(QLatin1String(""))));
model.insertItems(insertIndex, newItems);
- item = visualModel->item(completeIndex, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(completeIndex, false));
QVERIFY(item);
QCOMPARE(requester.itemInitialized, item);
@@ -4070,15 +4070,15 @@ void tst_qquickvisualdatamodel::asynchronousRemove()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
ItemRequester requester;
- connect(visualModel, SIGNAL(initItem(int,QQuickItem*)), &requester, SLOT(initItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(createdItem(int,QQuickItem*)), &requester, SLOT(createdItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(destroyingItem(QQuickItem*)), &requester, SLOT(destroyingItem(QQuickItem*)));
+ connect(visualModel, SIGNAL(initItem(int,QObject*)), &requester, SLOT(initItem(int,QObject*)));
+ connect(visualModel, SIGNAL(createdItem(int,QObject*)), &requester, SLOT(createdItem(int,QObject*)));
+ connect(visualModel, SIGNAL(destroyingItem(QObject*)), &requester, SLOT(destroyingItem(QObject*)));
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QVERIFY(!requester.itemInitialized);
@@ -4098,7 +4098,7 @@ void tst_qquickvisualdatamodel::asynchronousRemove()
QCOMPARE(requester.itemCreated, requester.itemInitialized);
QCOMPARE(requester.itemDestroyed, requester.itemInitialized);
} else {
- item = visualModel->item(completeIndex, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(completeIndex, false));
QVERIFY(item);
QCOMPARE(requester.itemInitialized, item);
@@ -4148,15 +4148,15 @@ void tst_qquickvisualdatamodel::asynchronousMove()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
ItemRequester requester;
- connect(visualModel, SIGNAL(initItem(int,QQuickItem*)), &requester, SLOT(initItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(createdItem(int,QQuickItem*)), &requester, SLOT(createdItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(destroyingItem(QQuickItem*)), &requester, SLOT(destroyingItem(QQuickItem*)));
+ connect(visualModel, SIGNAL(initItem(int,QObject*)), &requester, SLOT(initItem(int,QObject*)));
+ connect(visualModel, SIGNAL(createdItem(int,QObject*)), &requester, SLOT(createdItem(int,QObject*)));
+ connect(visualModel, SIGNAL(destroyingItem(QObject*)), &requester, SLOT(destroyingItem(QObject*)));
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QVERIFY(!requester.itemInitialized);
@@ -4165,7 +4165,7 @@ void tst_qquickvisualdatamodel::asynchronousMove()
model.moveItems(from, to, count);
- item = visualModel->item(completeIndex, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(completeIndex, false));
QVERIFY(item);
@@ -4196,10 +4196,10 @@ void tst_qquickvisualdatamodel::asynchronousCancel()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QCOMPARE(controller.incubatingObjectCount(), 1);
@@ -4221,10 +4221,10 @@ void tst_qquickvisualdatamodel::invalidContext()
QQmlComponent c(&engine, testFileUrl("visualdatamodel.qml"));
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create(context.data()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create(context.data()));
QVERIFY(visualModel);
- QQuickItem *item = visualModel->item(4, false);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(4, false));
QVERIFY(item);
visualModel->release(item);
@@ -4232,7 +4232,7 @@ void tst_qquickvisualdatamodel::invalidContext()
model.insertItem(4, "new item", "");
- item = visualModel->item(4, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(4, false));
QVERIFY(!item);
}
diff --git a/tests/auto/quick/qquickwindow/data/focus.qml b/tests/auto/quick/qquickwindow/data/focus.qml
index 901f2fcf2e..899b999cdc 100644
--- a/tests/auto/quick/qquickwindow/data/focus.qml
+++ b/tests/auto/quick/qquickwindow/data/focus.qml
@@ -2,6 +2,10 @@ import QtQuick 2.0
import QtQuick.Window 2.0 as Window
Window.Window {
+
+ width: 400
+ height: 300
+
Item {
objectName: "item1"
}
diff --git a/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml b/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml
index 955304e317..03400ba673 100644
--- a/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml
+++ b/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml
@@ -10,6 +10,6 @@ Window.Window {
RootItemAccessor {
id:accessor
objectName:"accessor"
- Component.onCompleted:accessor.rootItem();
+ Component.onCompleted:accessor.contentItem();
}
}
diff --git a/tests/auto/quick/qquickwindow/data/showHideAnimate.qml b/tests/auto/quick/qquickwindow/data/showHideAnimate.qml
new file mode 100644
index 0000000000..e83910c5a5
--- /dev/null
+++ b/tests/auto/quick/qquickwindow/data/showHideAnimate.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+
+Item {
+ NumberAnimation on opacity { from: 0; to: 1; duration: 100; loops: Animation.Infinite }
+}
diff --git a/tests/auto/quick/qquickwindow/qquickwindow.pro b/tests/auto/quick/qquickwindow/qquickwindow.pro
index 9ae63a9ef1..59d96429db 100644
--- a/tests/auto/quick/qquickwindow/qquickwindow.pro
+++ b/tests/auto/quick/qquickwindow/qquickwindow.pro
@@ -13,6 +13,7 @@ TESTDATA = data/*
OTHER_FILES += \
data/AnimationsWhileHidden.qml \
- data/Headless.qml
+ data/Headless.qml \
+ data/showHideAnimate.qml
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 3e3a35f8d1..b2e07e4c13 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -284,8 +284,11 @@ private slots:
void constantUpdates();
+ void constantUpdatesOnWindow_data();
+ void constantUpdatesOnWindow();
void mouseFiltering();
void headless();
+ void noUpdateWhenNothingChanges();
void touchEvent_basic();
void touchEvent_propagation();
@@ -312,6 +315,13 @@ private slots:
void ownershipRootItem();
+ void hideThenDelete_data();
+ void hideThenDelete();
+
+ void showHideAnimate();
+
+ void testExpose();
+
#ifndef QT_NO_CURSOR
void cursor();
#endif
@@ -331,6 +341,55 @@ void tst_qquickwindow::constantUpdates()
QTRY_VERIFY(item.iterations > 60);
}
+void tst_qquickwindow::constantUpdatesOnWindow_data()
+{
+ QTest::addColumn<bool>("blockedGui");
+ QTest::addColumn<QByteArray>("signal");
+
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
+ bool threaded = window.openglContext()->thread() != QGuiApplication::instance()->thread();
+
+ if (threaded) {
+ QTest::newRow("blocked, beforeSync") << true << QByteArray(SIGNAL(beforeSynchronizing()));
+ QTest::newRow("blocked, beforeRender") << true << QByteArray(SIGNAL(beforeRendering()));
+ QTest::newRow("blocked, afterRender") << true << QByteArray(SIGNAL(afterRendering()));
+ QTest::newRow("blocked, swapped") << true << QByteArray(SIGNAL(frameSwapped()));
+ }
+ QTest::newRow("unblocked, beforeSync") << false << QByteArray(SIGNAL(beforeSynchronizing()));
+ QTest::newRow("unblocked, beforeRender") << false << QByteArray(SIGNAL(beforeRendering()));
+ QTest::newRow("unblocked, afterRender") << false << QByteArray(SIGNAL(afterRendering()));
+ QTest::newRow("unblocked, swapped") << false << QByteArray(SIGNAL(frameSwapped()));
+}
+
+void tst_qquickwindow::constantUpdatesOnWindow()
+{
+ QFETCH(bool, blockedGui);
+ QFETCH(QByteArray, signal);
+
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+
+ connect(&window, signal.constData(), &window, SLOT(update()), Qt::DirectConnection);
+ window.show();
+ QTRY_VERIFY(window.isExposed());
+
+ QSignalSpy catcher(&window, SIGNAL(frameSwapped()));
+ if (blockedGui)
+ QTest::qSleep(1000);
+ else {
+ window.update();
+ QTest::qWait(1000);
+ }
+ window.hide();
+
+ // We should expect 60, but under loaded conditions we could be skipping
+ // frames, so don't expect too much.
+ QVERIFY(catcher.size() > 10);
+}
+
void tst_qquickwindow::touchEvent_basic()
{
TestTouchItem::clearMousePressCounter();
@@ -945,6 +1004,8 @@ void tst_qquickwindow::headless()
QScopedPointer<QObject> cleanup(created);
QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
+ window->setPersistentOpenGLContext(false);
+ window->setPersistentSceneGraph(false);
QVERIFY(window);
window->show();
@@ -984,6 +1045,28 @@ void tst_qquickwindow::headless()
QCOMPARE(originalContent, newContent);
}
+void tst_qquickwindow::noUpdateWhenNothingChanges()
+{
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+
+ QQuickRectangle rect(window.contentItem());
+
+ window.show();
+ QTRY_VERIFY(window.isExposed());
+
+ if (window.openglContext()->thread() == QGuiApplication::instance()->thread()) {
+ QSKIP("Only threaded renderloop implements this feature");
+ return;
+ }
+
+ QSignalSpy spy(&window, SIGNAL(frameSwapped()));
+ rect.update();
+ QTest::qWait(500);
+
+ QCOMPARE(spy.size(), 0);
+}
+
void tst_qquickwindow::focusObject()
{
QQmlEngine engine;
@@ -997,6 +1080,11 @@ void tst_qquickwindow::focusObject()
QQuickWindow *window = qobject_cast<QQuickWindow*>(created);
QVERIFY(window);
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+
QQuickItem *item1 = window->findChild<QQuickItem*>("item1");
QVERIFY(item1);
item1->setFocus(true);
@@ -1207,6 +1295,110 @@ void tst_qquickwindow::cursor()
}
#endif
+void tst_qquickwindow::hideThenDelete_data()
+{
+ QTest::addColumn<bool>("persistentSG");
+ QTest::addColumn<bool>("persistentGL");
+
+ QTest::newRow("persistent:SG=false,GL=false") << false << false;
+ QTest::newRow("persistent:SG=true,GL=false") << true << false;
+ QTest::newRow("persistent:SG=false,GL=true") << false << true;
+ QTest::newRow("persistent:SG=true,GL=true") << true << true;
+}
+
+void tst_qquickwindow::hideThenDelete()
+{
+ if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
+ QSKIP("For some obscure reason this test fails in CI only");
+ return;
+ }
+
+ QFETCH(bool, persistentSG);
+ QFETCH(bool, persistentGL);
+
+ QSignalSpy *openglDestroyed = 0;
+ QSignalSpy *sgInvalidated = 0;
+
+ {
+ QQuickWindow window;
+ window.setColor(Qt::red);
+
+ window.setPersistentSceneGraph(persistentSG);
+ window.setPersistentOpenGLContext(persistentGL);
+
+ window.resize(400, 300);
+ window.show();
+
+ QTest::qWaitForWindowExposed(&window);
+
+ openglDestroyed = new QSignalSpy(window.openglContext(), SIGNAL(aboutToBeDestroyed()));
+ sgInvalidated = new QSignalSpy(&window, SIGNAL(sceneGraphInvalidated()));
+
+ window.hide();
+
+ QTRY_VERIFY(!window.isExposed());
+
+ if (!persistentSG) {
+ QVERIFY(sgInvalidated->size() > 0);
+ if (!persistentGL)
+ QVERIFY(openglDestroyed->size() > 0);
+ else
+ QVERIFY(openglDestroyed->size() == 0);
+ } else {
+ QVERIFY(sgInvalidated->size() == 0);
+ QVERIFY(openglDestroyed->size() == 0);
+ }
+ }
+
+ QVERIFY(sgInvalidated->size() > 0);
+ QVERIFY(openglDestroyed->size() > 0);
+}
+
+void tst_qquickwindow::showHideAnimate()
+{
+ // This test tries to mimick a bug triggered in the qquickanimatedimage test
+ // A window is shown, then removed again before it is exposed. This left
+ // traces in the render loop which prevent other animations from running
+ // later on.
+ {
+ QQuickWindow window;
+ window.resize(400, 300);
+ window.show();
+ }
+
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("showHideAnimate.qml"));
+ QQuickItem* created = qobject_cast<QQuickItem *>(component.create());
+
+ QVERIFY(created);
+
+ QTRY_VERIFY(created->opacity() > 0.5);
+ QTRY_VERIFY(created->opacity() < 0.5);
+}
+
+void tst_qquickwindow::testExpose()
+{
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+
+ window.show();
+ QTRY_VERIFY(window.isExposed());
+
+ QSignalSpy swapSpy(&window, SIGNAL(frameSwapped()));
+
+ // exhaust pending exposes, as some platforms send us plenty
+ // while showing the first time
+ QTest::qWait(1000);
+ while (swapSpy.size() != 0) {
+ swapSpy.clear();
+ QTest::qWait(100);
+ }
+
+ QWindowSystemInterface::handleExposeEvent(&window, QRegion(10, 10, 20, 20));
+ QTRY_COMPARE(swapSpy.size(), 1);
+}
+
QTEST_MAIN(tst_qquickwindow)
#include "tst_qquickwindow.moc"
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
index c4a4173e0f..aa1e1ec701 100644
--- a/tests/auto/quick/quick.pro
+++ b/tests/auto/quick/quick.pro
@@ -61,6 +61,7 @@ QUICKTESTS = \
qquickshadereffect \
qquickspritesequence \
qquicktext \
+ qquicktextdocument \
qquicktextedit \
qquicktextinput \
qquickvisualdatamodel \
diff --git a/tools/qmlmin/main.cpp b/tools/qmlmin/main.cpp
index a8ebf12333..e3e81985a1 100644
--- a/tools/qmlmin/main.cpp
+++ b/tools/qmlmin/main.cpp
@@ -352,13 +352,7 @@ bool Minify::parse(int startToken)
if (isIdentChar(lastChar))
assembled += QLatin1Char(' ');
- foreach (const QChar &ch, identifier) {
- if (isIdentChar(ch))
- assembled += ch;
- else {
- escape(ch, &assembled);
- }
- }
+ assembled += identifier;
} else if (yytoken == T_STRING_LITERAL || yytoken == T_MULTILINE_STRING_LITERAL) {
assembled += QLatin1Char('"');
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index b5ee08ddd3..e05c77cbfa 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -184,11 +184,13 @@ QSet<const QMetaObject *> collectReachableMetaObjects(QQmlEngine *engine, const
QHash<QByteArray, QSet<QByteArray> > extensions;
foreach (const QQmlType *ty, QQmlMetaType::qmlTypes()) {
- qmlTypesByCppName[ty->metaObject()->className()].insert(ty);
- if (ty->isExtendedType()) {
- extensions[ty->typeName()].insert(ty->metaObject()->className());
+ if (!ty->isComposite()) {
+ qmlTypesByCppName[ty->metaObject()->className()].insert(ty);
+ if (ty->isExtendedType())
+ extensions[ty->typeName()].insert(ty->metaObject()->className());
+ collectReachableMetaObjects(ty, &metas);
}
- collectReachableMetaObjects(ty, &metas);
+ // TODO actually handle composite types
}
// Adjust exports of the base object if there are extensions.
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index a9a907f648..1e7c6e13de 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -152,6 +152,7 @@ struct Options
, slowAnimations(false)
, quitImmediately(false)
, resizeViewToRootItem(false)
+ , multisample(false)
{
}
@@ -167,6 +168,7 @@ struct Options
bool slowAnimations;
bool quitImmediately;
bool resizeViewToRootItem;
+ bool multisample;
QString translationFile;
};
@@ -349,7 +351,7 @@ static void usage()
qWarning(" --maximized ............................... Run maximized");
qWarning(" --fullscreen .............................. Run fullscreen");
qWarning(" --transparent ............................. Make the window transparent");
- qWarning(" --no-multisample .......................... Disable multisampling (anti-aliasing)");
+ qWarning(" --multisample ............................. Enable multisampling (OpenGL anti-aliasing)");
qWarning(" --no-version-detection .................... Do not try to detect the version of the .qml file");
qWarning(" --slow-animations ......................... Run all animations in slow motion");
qWarning(" --resize-to-root .......................... Resize the window to the size of the root item");
@@ -391,6 +393,8 @@ int main(int argc, char ** argv)
options.translationFile = QLatin1String(argv[++i]);
else if (lowerArgument == QLatin1String("--resize-to-root"))
options.resizeViewToRootItem = true;
+ else if (lowerArgument == QLatin1String("--multisample"))
+ options.multisample = true;
else if (lowerArgument == QLatin1String("-i") && i + 1 < argc)
imports.append(QString::fromLatin1(argv[++i]));
else if (lowerArgument == QLatin1String("-b") && i + 2 < argc) {
@@ -497,14 +501,16 @@ int main(int argc, char ** argv)
}
if (window) {
+ QSurfaceFormat surfaceFormat = window->requestedFormat();
+ if (options.multisample)
+ surfaceFormat.setSamples(16);
if (options.transparent) {
- QSurfaceFormat surfaceFormat;
surfaceFormat.setAlphaBufferSize(8);
- window->setFormat(surfaceFormat);
window->setClearBeforeRendering(true);
window->setColor(QColor(Qt::transparent));
window->setFlags(Qt::FramelessWindowHint);
}
+ window->setFormat(surfaceFormat);
if (options.fullscreen)
window->showFullScreen();